include attachments in draft
This commit is contained in:
parent
cc922029fb
commit
8657c820bd
2 changed files with 50 additions and 2 deletions
|
@ -2,13 +2,15 @@ import PostStatusForm from 'src/components/post_status_form/post_status_form.vue
|
||||||
import EditStatusForm from 'src/components/edit_status_form/edit_status_form.vue'
|
import EditStatusForm from 'src/components/edit_status_form/edit_status_form.vue'
|
||||||
import ConfirmModal from 'src/components/confirm_modal/confirm_modal.vue'
|
import ConfirmModal from 'src/components/confirm_modal/confirm_modal.vue'
|
||||||
import StatusContent from 'src/components/status_content/status_content.vue'
|
import StatusContent from 'src/components/status_content/status_content.vue'
|
||||||
|
import Gallery from 'src/components/gallery/gallery.vue'
|
||||||
|
|
||||||
const Draft = {
|
const Draft = {
|
||||||
components: {
|
components: {
|
||||||
PostStatusForm,
|
PostStatusForm,
|
||||||
EditStatusForm,
|
EditStatusForm,
|
||||||
ConfirmModal,
|
ConfirmModal,
|
||||||
StatusContent
|
StatusContent,
|
||||||
|
Gallery
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
draft: {
|
draft: {
|
||||||
|
@ -17,6 +19,7 @@ const Draft = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
|
console.log('DRAFT', this.draft)
|
||||||
return {
|
return {
|
||||||
editing: false,
|
editing: false,
|
||||||
showingConfirmDialog: false
|
showingConfirmDialog: false
|
||||||
|
@ -40,6 +43,19 @@ const Draft = {
|
||||||
},
|
},
|
||||||
refStatus () {
|
refStatus () {
|
||||||
return this.draft.refId ? this.$store.state.statuses.allStatusesObject[this.draft.refId] : undefined
|
return this.draft.refId ? this.$store.state.statuses.allStatusesObject[this.draft.refId] : undefined
|
||||||
|
},
|
||||||
|
localCollapseSubjectDefault () {
|
||||||
|
return this.$store.getters.mergedConfig.collapseMessageWithSubject
|
||||||
|
},
|
||||||
|
nsfwClickthrough () {
|
||||||
|
console.log(this.draft)
|
||||||
|
if (!this.draft.nsfw) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (this.draft.summary && this.localCollapseSubjectDefault) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
@ -26,7 +26,20 @@
|
||||||
:compact="true"
|
:compact="true"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<p>{{ draft.status }}</p>
|
<div class="status-preview">
|
||||||
|
<p>{{ draft.status }}</p>
|
||||||
|
<gallery
|
||||||
|
v-if="draft.files?.length !== 0"
|
||||||
|
class="attachments media-body"
|
||||||
|
:compact="true"
|
||||||
|
:nsfw="nsfwClickthrough"
|
||||||
|
:attachments="draft.files"
|
||||||
|
:limit="1"
|
||||||
|
size="small"
|
||||||
|
@play="$emit('mediaplay', attachment.id)"
|
||||||
|
@pause="$emit('mediapause', attachment.id)"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="editing">
|
<div v-if="editing">
|
||||||
<PostStatusForm
|
<PostStatusForm
|
||||||
|
@ -73,11 +86,30 @@
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.Draft {
|
.Draft {
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: var(--link);
|
||||||
|
}
|
||||||
|
|
||||||
.status-content {
|
.status-content {
|
||||||
padding: 0.5em;
|
padding: 0.5em;
|
||||||
margin: 0.5em 0;
|
margin: 0.5em 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.status-preview {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr 10em;
|
||||||
|
grid-gap: 0.5em;
|
||||||
|
max-width: 100%;
|
||||||
|
|
||||||
|
p {
|
||||||
|
word-wrap: break-word;
|
||||||
|
white-space: normal;
|
||||||
|
overflow-x: hidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.actions {
|
.actions {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
|
Loading…
Add table
Reference in a new issue