Show that a Post/Comment has been edited

This commit is contained in:
mattwr18 2019-10-03 12:01:04 +02:00
parent f4e0fc8e01
commit a5e3c52e1d
7 changed files with 85 additions and 33 deletions

View File

@ -12,20 +12,33 @@
<div v-else :class="{ comment: true, 'disabled-content': comment.deleted || comment.disabled }">
<ds-card :id="anchor">
<ds-space margin-bottom="small" margin-top="small">
<hc-user :user="author" :date-time="comment.createdAt" />
<ds-flex>
<ds-flex-item width="40%">
<hc-user :user="author" :date-time="comment.createdAt" />
</ds-flex-item>
<ds-flex-item>
<ds-text v-if="comment.createdAt !== comment.updatedAt" color="softer" class="italics">
{{ this.$t('comment.edited') }}
</ds-text>
</ds-flex-item>
<ds-flex-item>
<ds-space margin-top="base">
<client-only>
<content-menu
v-show="!openEditCommentMenu"
placement="bottom-end"
resource-type="comment"
:resource="comment"
:modalsData="menuModalsData"
class="float-right"
:is-owner="isAuthor(author.id)"
@showEditCommentMenu="editCommentMenu"
/>
</client-only>
</ds-space>
</ds-flex-item>
</ds-flex>
<!-- Content Menu (can open Modals) -->
<client-only>
<content-menu
v-show="!openEditCommentMenu"
placement="bottom-end"
resource-type="comment"
:resource="comment"
:modalsData="menuModalsData"
class="float-right"
:is-owner="isAuthor(author.id)"
@showEditCommentMenu="editCommentMenu"
/>
</client-only>
</ds-space>
<div v-if="openEditCommentMenu">
<hc-comment-form
@ -199,4 +212,8 @@ span.show-more-or-less {
margin: 0px 20px;
cursor: pointer;
}
.ds-text.italics {
font-style: italic;
}
</style>

View File

@ -10,6 +10,7 @@ export default i18n => {
contentExcerpt
content
createdAt
updatedAt
disabled
deleted
author {
@ -39,6 +40,7 @@ export default i18n => {
contentExcerpt
content
createdAt
updatedAt
disabled
deleted
author {

View File

@ -40,6 +40,7 @@ export const postFragment = lang => gql`
content
contentExcerpt
createdAt
updatedAt
disabled
deleted
slug
@ -64,6 +65,7 @@ export const commentFragment = lang => gql`
fragment comment on Comment {
id
createdAt
updatedAt
disabled
deleted
content

View File

@ -2,7 +2,7 @@
"maintenance": {
"title": "Human Connection befindet sich in der Wartung",
"explanation": "Zurzeit führen wir einige geplante Wartungsarbeiten durch, bitte versuch es später erneut.",
"questions": "Bei Fragen oder Problemen erreichst du uns per E-Mail an"
"questions": "Bei Fragen oder Problemen erreichst du uns per E-Mail an"
},
"index": {
"no-results": "Keine Beiträge gefunden.",
@ -335,7 +335,8 @@
"submit": "Kommentiere",
"submitted": "Kommentar Gesendet",
"updated": "Änderungen gespeichert"
}
},
"edited": "bearbeitet"
},
"comment": {
"content": {
@ -348,10 +349,11 @@
"show": {
"more": "mehr anzeigen",
"less": "weniger anzeigen"
}
},
"edited": "bearbeitet"
},
"quotes": {
"african": {
"african": {
"quote": "Viele kleine Leute an vielen kleinen Orten, die viele kleine Dinge tun, werden das Antlitz dieser Welt verändern.",
"author": "Afrikanisches Sprichwort"
}

View File

@ -336,7 +336,8 @@
"submit": "Comment",
"submitted": "Comment Submitted",
"updated": "Changes Saved"
}
},
"edited": "edited"
},
"comment": {
"content": {
@ -349,7 +350,8 @@
"show": {
"more": "show more",
"less": "show less"
}
},
"edited": "edited"
},
"quotes": {
"african": {

View File

@ -118,7 +118,11 @@
},
"takeAction": {
"name": "Tomar uma ação"
}
},
"comment": {
"submit": "Commentar"
},
"edited": "editado"
},
"quotes": {
"african": {
@ -202,8 +206,18 @@
"delete": "Apagar Contribuição"
},
"comment": {
"edit": "Editar Comentário",
"delete": "Apagar Comentário"
"content": {
"unavailable-placeholder": "… este commenttário não está disponível"
},
"menu": {
"edit": "Editar Comentário",
"delete": "Apagar Comentário"
},
"show": {
"more": "mostrar mais",
"less": "mostrar menos"
},
"edited": "editado"
},
"followButton": {
"follow": "Seguir",
@ -212,4 +226,4 @@
"shoutButton": {
"shouted": "Aclamou"
}
}
}

View File

@ -6,17 +6,30 @@
:class="{ 'post-card': true, 'disabled-content': post.disabled }"
>
<ds-space margin-bottom="small" />
<hc-user :user="post.author" :date-time="post.createdAt" />
<ds-flex>
<ds-flex-item width="40%">
<hc-user :user="post.author" :date-time="post.createdAt" />
</ds-flex-item>
<ds-flex-item>
<ds-text v-if="post.createdAt !== post.updatedAt" color="softer" class="italics">
{{ this.$t('post.edited') }}
</ds-text>
</ds-flex-item>
<ds-flex-item>
<ds-space margin-top="base">
<client-only>
<content-menu
placement="bottom-end"
resource-type="contribution"
:resource="post"
:modalsData="menuModalsData"
:is-owner="isAuthor(post.author ? post.author.id : null)"
/>
</client-only>
</ds-space>
</ds-flex-item>
</ds-flex>
<!-- Content Menu (can open Modals) -->
<client-only>
<content-menu
placement="bottom-end"
resource-type="contribution"
:resource="post"
:modalsData="menuModalsData"
:is-owner="isAuthor(post.author ? post.author.id : null)"
/>
</client-only>
<ds-space margin-bottom="small" />
<ds-heading tag="h3" no-margin class="hyphenate-text">{{ post.title }}</ds-heading>
<ds-space margin-bottom="small" />