2019-02-14 22:31:03 +01:00
|
|
|
<template>
|
|
|
|
<x-column>
|
2019-02-18 03:13:56 +01:00
|
|
|
<template #header>
|
2019-02-14 22:31:03 +01:00
|
|
|
<fa :icon="faNewspaper"/>{{ $t('@.featured-notes') }}
|
2019-02-18 01:48:00 +01:00
|
|
|
</template>
|
2019-02-14 22:31:03 +01:00
|
|
|
|
|
|
|
<div>
|
2019-02-18 01:17:55 +01:00
|
|
|
<x-notes ref="timeline" :make-promise="makePromise" @inited="() => $emit('loaded')"/>
|
2019-02-14 22:31:03 +01:00
|
|
|
</div>
|
|
|
|
</x-column>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import Vue from 'vue';
|
|
|
|
import i18n from '../../../i18n';
|
|
|
|
import XColumn from './deck.column.vue';
|
|
|
|
import XNotes from './deck.notes.vue';
|
|
|
|
import { faNewspaper } from '@fortawesome/free-solid-svg-icons';
|
|
|
|
|
|
|
|
export default Vue.extend({
|
|
|
|
i18n: i18n(),
|
|
|
|
|
|
|
|
components: {
|
|
|
|
XColumn,
|
|
|
|
XNotes,
|
|
|
|
},
|
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
2019-02-18 01:17:55 +01:00
|
|
|
faNewspaper,
|
|
|
|
makePromise: cursor => this.$root.api('notes/featured', {
|
2019-02-26 06:42:24 +01:00
|
|
|
limit: 30,
|
2019-02-18 01:17:55 +01:00
|
|
|
}).then(notes => {
|
|
|
|
notes.sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime());
|
|
|
|
return notes;
|
|
|
|
})
|
2019-02-14 22:31:03 +01:00
|
|
|
};
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
focus() {
|
|
|
|
this.$refs.timeline.focus();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|