diff --git a/frontend/src/components/ContributionMessages/ContributionMessagesListItem.vue b/frontend/src/components/ContributionMessages/ContributionMessagesListItem.vue index 9c7a3a0f2..df0ddbc4c 100644 --- a/frontend/src/components/ContributionMessages/ContributionMessagesListItem.vue +++ b/frontend/src/components/ContributionMessages/ContributionMessagesListItem.vue @@ -4,14 +4,14 @@ {{ message.userFirstName }} {{ message.userLastName }} {{ $d(new Date(message.createdAt), 'short') }} - +
{{ message.userFirstName }} {{ message.userLastName }} {{ $d(new Date(message.createdAt), 'short') }} {{ $t('community.moderator') }} - +
diff --git a/frontend/src/components/ContributionMessages/LinkifyMessage.vue b/frontend/src/components/ContributionMessages/LinkifyMessage.vue index 09418858f..1f1e99417 100644 --- a/frontend/src/components/ContributionMessages/LinkifyMessage.vue +++ b/frontend/src/components/ContributionMessages/LinkifyMessage.vue @@ -2,6 +2,14 @@
{{ text }} + + {{ $d(new Date(text), 'short') }} +
+
+ +
+ {{ text | GDD }} +
{{ text }}
@@ -17,11 +25,22 @@ export default { type: String, required: true, }, + type: { + type: String, + reuired: true, + }, }, computed: { linkifiedMessage() { - const linkified = [] let string = this.message + const linkified = [] + let amount + if (this.type === 'HISTORY') { + const split = string.split(/\n\s*---\n\s*/) + string = split[1] + linkified.push({ type: 'date', text: split[0].trim() }) + amount = split[2].trim() + } let match while ((match = string.match(LINK_REGEX_PATTERN))) { if (match.index > 0) @@ -30,6 +49,7 @@ export default { string = string.substring(match.index + match[0].length) } if (string.length > 0) linkified.push({ type: 'text', text: string }) + if (amount) linkified.push({ type: 'amount', text: amount }) return linkified }, },