Sharkey/src/client/app/common/views/deck/deck.note-column.vue

74 lines
1.3 KiB
Vue
Raw Normal View History

<template>
<x-column>
2019-02-18 02:13:56 +00:00
<template #header>
<fa :icon="['far', 'comment-alt']"/><mk-user-name :user="note.user" v-if="note"/>
2019-02-18 00:48:00 +00:00
</template>
<div class="rvtscbadixhhbsczoorqoaygovdeecsx" v-if="note">
2018-10-20 15:18:01 +00:00
<div class="is-remote" v-if="note.user.host != null">
<details>
<summary><fa icon="exclamation-triangle"/> {{ $t('@.is-remote-post') }}</summary>
<a :href="note.url || note.uri" target="_blank">{{ $t('@.view-on-remote') }}</a>
2018-10-20 15:18:01 +00:00
</details>
</div>
<mk-note :note="note" :detail="true" :key="note.id"/>
</div>
</x-column>
</template>
<script lang="ts">
import Vue from 'vue';
import i18n from '../../../i18n';
import XColumn from './deck.column.vue';
export default Vue.extend({
i18n: i18n(),
components: {
XColumn,
},
data() {
return {
note: null,
fetching: true
};
},
watch: {
$route: 'fetch'
},
created() {
this.fetch();
},
methods: {
fetch() {
this.fetching = true;
this.$root.api('notes/show', {
noteId: this.$route.params.note
}).then(note => {
this.note = note;
this.fetching = false;
});
}
}
});
</script>
<style lang="stylus" scoped>
.rvtscbadixhhbsczoorqoaygovdeecsx
> .is-remote
padding 8px 16px
font-size 12px
&.is-remote
color var(--remoteInfoFg)
background var(--remoteInfoBg)
> a
font-weight bold
</style>