From 81fc727d418fc716a766e615a35c61c3a113c9b3 Mon Sep 17 00:00:00 2001 From: Matteo Pagliazzi Date: Thu, 21 Sep 2017 19:49:27 +0200 Subject: [PATCH] Client Fixes (#9056) * remove console.log calls used for debugging * open member modal when clicking on user name or avatar in chat * misc fixes to strings, payments, ... * simplify code * secure statsComputed --- .../client/components/chat/chatMessages.vue | 44 ++++++++++++++----- website/client/components/groups/tavern.vue | 3 +- .../components/payments/sendGemsModal.vue | 3 +- website/client/mixins/payments.js | 3 +- .../locales/en/communityGuidelines.json | 2 +- website/common/script/libs/statsComputed.js | 18 ++++---- 6 files changed, 50 insertions(+), 23 deletions(-) diff --git a/website/client/components/chat/chatMessages.vue b/website/client/components/chat/chatMessages.vue index 96a63346cf..4287f76ce1 100644 --- a/website/client/components/chat/chatMessages.vue +++ b/website/client/components/chat/chatMessages.vue @@ -11,13 +11,20 @@ .hr-middle(v-once) {{ msg.timestamp }} .row(v-if='user._id !== msg.uuid') .col-4 - avatar(v-if='cachedProfileData[msg.uuid]', - :member="cachedProfileData[msg.uuid]", :avatarOnly="true", - :hideClassBadge='true') + avatar( + v-if='cachedProfileData[msg.uuid]', + :member="cachedProfileData[msg.uuid]", + :avatarOnly="true", + :hideClassBadge='true', + @click.native="showMemberModal(msg.uuid)", + ) .card.col-8 .message-hidden(v-if='msg.flagCount > 0 && user.contributor.admin') Message Hidden .card-block - h3.leader(:class='userLevelStyle(cachedProfileData[msg.uuid])') + h3.leader( + :class='userLevelStyle(cachedProfileData[msg.uuid])' + @click="showMemberModal(msg.uuid)", + ) | {{msg.user}} .svg-icon(v-html="icons[`tier${cachedProfileData[msg.uuid].contributor.level}`]", v-if='cachedProfileData[msg.uuid] && cachedProfileData[msg.uuid].contributor && cachedProfileData[msg.uuid].contributor.level') p {{msg.timestamp | timeAgo}} @@ -39,11 +46,16 @@ span.action.float-right(v-if='likeCount(msg) > 0') .svg-icon(v-html="icons.liked") | + {{ likeCount(msg) }} + // @TODO can we avoid duplicating all this code? Cannot we just push everything + // to the right if the user is the author? .row(v-if='user._id === msg.uuid') .card.col-8 .message-hidden(v-if='msg.flagCount > 0 && user.contributor.admin') Message Hidden - {{ msg.flagCount }} Flags .card-block - h3.leader(:class='userLevelStyle(cachedProfileData[msg.uuid])') + h3.leader( + :class='userLevelStyle(cachedProfileData[msg.uuid])', + @click="showMemberModal(msg.uuid)", + ) | {{msg.user}} .svg-icon(v-html="icons[`tier${cachedProfileData[msg.uuid].contributor.level}`]", v-if='cachedProfileData[msg.uuid] && cachedProfileData[msg.uuid].contributor && cachedProfileData[msg.uuid].contributor.level') p {{msg.timestamp | timeAgo}} @@ -66,15 +78,19 @@ .svg-icon(v-html="icons.liked") | + {{ likeCount(msg) }} .col-4 - avatar(v-if='cachedProfileData[msg.uuid]', - :member="cachedProfileData[msg.uuid]", :avatarOnly="true", - :hideClassBadge='true') + avatar( + v-if='cachedProfileData[msg.uuid]', + :member="cachedProfileData[msg.uuid]", + :avatarOnly="true", + :hideClassBadge='true', + @click.native="showMemberModal(msg.uuid)", + )