10256 - The placeholder and the message row are fixed (#10307)

This commit is contained in:
pengfluf
2018-05-05 00:04:06 +03:00
committed by Sabe Jones
parent 570a8bf0d5
commit 4fa2ef045d
2 changed files with 20 additions and 4 deletions

View File

@@ -23,7 +23,7 @@
.empty-messages.text-center(v-if='filtersConversations.length === 0') .empty-messages.text-center(v-if='filtersConversations.length === 0')
.svg-icon.envelope(v-html="icons.messageIcon") .svg-icon.envelope(v-html="icons.messageIcon")
h4(v-once) {{$t('emptyMessagesLine1')}} h4(v-once) {{$t('emptyMessagesLine1')}}
p(v-once) {{$t('emptyMessagesLine2')}} p(v-if="!user.flags.chatRevoked") {{$t('emptyMessagesLine2')}}
.conversations(v-if='filtersConversations.length > 0') .conversations(v-if='filtersConversations.length > 0')
.conversation(v-for='conversation in filtersConversations', @click='selectConversation(conversation.key)', .conversation(v-for='conversation in filtersConversations', @click='selectConversation(conversation.key)',
:class="{active: selectedConversation.key === conversation.key}") :class="{active: selectedConversation.key === conversation.key}")
@@ -34,15 +34,15 @@
.col-8.messages .col-8.messages
.empty-messages.text-center(v-if='activeChat.length === 0 && !selectedConversation.key') .empty-messages.text-center(v-if='activeChat.length === 0 && !selectedConversation.key')
.svg-icon.envelope(v-html="icons.messageIcon") .svg-icon.envelope(v-html="icons.messageIcon")
h4(v-once) Nothing Here Yet h4 {{placeholderTexts.title}}
p(v-once) Select a conversation on the left p(v-html="placeholderTexts.description")
.empty-messages.text-center(v-if='activeChat.length === 0 && selectedConversation.key') .empty-messages.text-center(v-if='activeChat.length === 0 && selectedConversation.key')
p {{ $t('beginningOfConversation', {userName: selectedConversation.name})}} p {{ $t('beginningOfConversation', {userName: selectedConversation.name})}}
chat-message.message-scroll(:chat.sync='activeChat', :inbox='true', ref="chatscroll") chat-message.message-scroll(:chat.sync='activeChat', :inbox='true', ref="chatscroll")
// @TODO: Implement new message header here when we fix the above // @TODO: Implement new message header here when we fix the above
.new-message-row(v-if='selectedConversation.key') .new-message-row(v-if='selectedConversation.key && !user.flags.chatRevoked')
textarea(v-model='newMessage') textarea(v-model='newMessage')
button.btn.btn-secondary(@click='sendPrivateMessage()') Send button.btn.btn-secondary(@click='sendPrivateMessage()') Send
</template> </template>
@@ -275,6 +275,18 @@ export default {
return conversation.name.toLowerCase().indexOf(this.search.toLowerCase()) !== -1; return conversation.name.toLowerCase().indexOf(this.search.toLowerCase()) !== -1;
}); });
}, },
placeholderTexts () {
if (this.user.flags.chatRevoked) {
return {
title: this.$t('PMPlaceholderTitleRevoked'),
description: this.$t('PMPlaceholderDescriptionRevoked'),
};
}
return {
title: this.$t('PMPlaceholderTitle'),
description: this.$t('PMPlaceholderDescription'),
};
},
}, },
methods: { methods: {
toggleClick () { toggleClick () {

View File

@@ -133,6 +133,10 @@
"clearAll": "Delete All Messages", "clearAll": "Delete All Messages",
"confirmDeleteAllMessages": "Are you sure you want to delete all messages in your inbox? Other users will still see messages you have sent to them.", "confirmDeleteAllMessages": "Are you sure you want to delete all messages in your inbox? Other users will still see messages you have sent to them.",
"optOutPopover": "Don't like private messages? Click to completely opt out", "optOutPopover": "Don't like private messages? Click to completely opt out",
"PMPlaceholderTitle": "Nothing Here Yet",
"PMPlaceholderDescription": "Select a conversation on the left",
"PMPlaceholderTitleRevoked": "Your chat privileges have been revoked",
"PMPlaceholderDescriptionRevoked": "You are not able to send private messages because your chat privileges have been revoked. If you have questions or concerns about this, please email <a href=\"mailto:admin@habitica.com\">admin@habitica.com</a> to discuss it with the staff.",
"block": "Block", "block": "Block",
"unblock": "Un-block", "unblock": "Un-block",
"pm-reply": "Send a reply", "pm-reply": "Send a reply",