* Drag and drop files to comment editor to add a file attachment * Using Vue to render comments Since comments now has attachments we need to update the schemas ./manage.py maintenance replace_pillar_node_type_schemas
33 lines
777 B
JavaScript
33 lines
777 B
JavaScript
import { prettyDate } from '../../utils/init'
|
|
const TEMPLATE =
|
|
`<div class="pretty-created" :title="'Posted ' + created">
|
|
{{ prettyCreated }}
|
|
<span
|
|
v-if="isEdited"
|
|
:title="'Updated ' + prettyUpdated"
|
|
>*</span>
|
|
</div>
|
|
`;
|
|
|
|
Vue.component('pretty-created', {
|
|
template: TEMPLATE,
|
|
props: {
|
|
created: String,
|
|
updated: String,
|
|
detailed: {
|
|
type: Boolean,
|
|
default: true
|
|
}
|
|
},
|
|
computed: {
|
|
prettyCreated() {
|
|
return prettyDate(this.created, this.detailed);
|
|
},
|
|
prettyUpdated() {
|
|
return prettyDate(this.updated, this.detailed);
|
|
},
|
|
isEdited() {
|
|
return this.updated && (this.created !== this.updated)
|
|
}
|
|
}
|
|
}); |