2021-04-30 06:32:20 +00:00
|
|
|
<template>
|
2021-05-20 18:11:15 +00:00
|
|
|
<div class="card note-wrap">
|
|
|
|
<p class="note__content">
|
2021-04-30 06:32:20 +00:00
|
|
|
{{ note }}
|
2021-05-20 18:11:15 +00:00
|
|
|
</p>
|
2021-04-30 06:32:20 +00:00
|
|
|
<div class="footer">
|
|
|
|
<div class="meta">
|
|
|
|
<div :title="userName">
|
2021-06-09 12:55:05 +00:00
|
|
|
<thumbnail :src="thumbnail" :username="userName" size="16px" />
|
2021-04-30 06:32:20 +00:00
|
|
|
</div>
|
|
|
|
<div class="date-wrap">
|
|
|
|
<span>{{ readableTime }}</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="actions">
|
|
|
|
<woot-button
|
2021-06-09 08:31:43 +00:00
|
|
|
variant="smooth"
|
2021-06-09 12:55:05 +00:00
|
|
|
size="tiny"
|
2021-04-30 06:32:20 +00:00
|
|
|
icon="ion-compose"
|
|
|
|
color-scheme="secondary"
|
|
|
|
@click="onEdit"
|
|
|
|
/>
|
|
|
|
<woot-button
|
2021-06-09 08:31:43 +00:00
|
|
|
variant="smooth"
|
2021-06-09 12:55:05 +00:00
|
|
|
size="tiny"
|
2021-04-30 06:32:20 +00:00
|
|
|
icon="ion-trash-b"
|
|
|
|
color-scheme="secondary"
|
|
|
|
@click="onDelete"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2021-06-09 12:55:05 +00:00
|
|
|
import Thumbnail from 'dashboard/components/widgets/Thumbnail';
|
2021-04-30 06:32:20 +00:00
|
|
|
import timeMixin from 'dashboard/mixins/time';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
Thumbnail,
|
|
|
|
},
|
|
|
|
|
|
|
|
mixins: [timeMixin],
|
|
|
|
|
|
|
|
props: {
|
2021-05-05 08:06:45 +00:00
|
|
|
id: {
|
|
|
|
type: Number,
|
|
|
|
default: 0,
|
|
|
|
},
|
2021-04-30 06:32:20 +00:00
|
|
|
note: {
|
|
|
|
type: String,
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
userName: {
|
|
|
|
type: String,
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
timeStamp: {
|
|
|
|
type: Number,
|
|
|
|
default: 0,
|
|
|
|
},
|
|
|
|
thumbnail: {
|
|
|
|
type: String,
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
computed: {
|
|
|
|
readableTime() {
|
|
|
|
return this.dynamicTime(this.timeStamp);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
onEdit() {
|
2021-05-05 08:06:45 +00:00
|
|
|
this.$emit('edit', this.id);
|
2021-04-30 06:32:20 +00:00
|
|
|
},
|
|
|
|
onDelete() {
|
2021-05-05 08:06:45 +00:00
|
|
|
this.$emit('delete', this.id);
|
2021-04-30 06:32:20 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
2021-05-20 18:11:15 +00:00
|
|
|
.note__content {
|
|
|
|
font-size: var(--font-size-mini);
|
2021-06-09 12:55:05 +00:00
|
|
|
margin-bottom: var(--space-smaller);
|
2021-04-30 06:32:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.footer {
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
2021-06-09 12:55:05 +00:00
|
|
|
align-items: flex-end;
|
2021-04-30 06:32:20 +00:00
|
|
|
|
|
|
|
.meta {
|
|
|
|
display: flex;
|
|
|
|
padding: var(--space-smaller) 0;
|
|
|
|
|
|
|
|
.date-wrap {
|
|
|
|
margin-left: var(--space-smaller);
|
|
|
|
padding: var(--space-micro);
|
|
|
|
color: var(--color-body);
|
|
|
|
font-size: var(--font-size-micro);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.actions {
|
2021-05-20 18:11:15 +00:00
|
|
|
display: flex;
|
|
|
|
visibility: hidden;
|
|
|
|
|
2021-06-09 08:31:43 +00:00
|
|
|
.button {
|
|
|
|
margin-left: var(--space-small);
|
|
|
|
}
|
2021-04-30 06:32:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.note-wrap:hover {
|
|
|
|
.actions {
|
2021-05-20 18:11:15 +00:00
|
|
|
visibility: visible;
|
2021-04-30 06:32:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|