Merge pull request #6417 from GeorgeSG/reverse-chat-option

Add option to reverse chat order
This commit is contained in:
Sabe Jones 2016-01-11 12:55:28 -06:00
commit dba620ee7a
4 changed files with 14 additions and 1 deletions

View file

@ -10,6 +10,8 @@
"newTaskEditPop": "With this option set, new tasks will immediately open for you to add details like notes and tags.",
"dailyDueDefaultView": "Set Dailies default to 'due' tab",
"dailyDueDefaultViewPop": "With this option set, the Dailies tasks will default to 'due' instead of 'all'",
"reverseChatOrder": "Show chat messages in reverse order",
"reverseChatOrderPop": "Show the messages in the Tarvern, Guild, and Party chats in reverse order, so that the oldest are on top.",
"startCollapsed": "Tag list in tasks starts collapsed",
"startCollapsedPop": "With this option set, the list of task tags will be hidden when you first open a task for editing.",
"startAdvCollapsed": "Advanced Options in tasks start collapsed",

View file

@ -360,6 +360,7 @@ var UserSchema = new Schema({
tagsCollapsed: {type: Boolean, 'default': false},
advancedCollapsed: {type: Boolean, 'default': false},
toolbarCollapsed: {type:Boolean, 'default':false},
reverseChatOrder: {type:Boolean, 'default':false},
background: String,
displayInviteToPartyWhenPartyIs1: { type:Boolean, 'default':true},
webhooks: {type: Schema.Types.Mixed, 'default': {}},

View file

@ -18,3 +18,10 @@ form.chat-form(ng-if='user.flags.communityGuidelinesAccepted' ng-submit='postCha
input.btn(type='submit', value=env.t('sendChat'), ng-disabled='_sending')
button.btn(type="button", ng-click='sync(group)', ng-disabled='_sending')=env.t('toolTipMsg')
include ../../shared/formatting-help
.chat-controls.clearfix
.chat-buttons
.checkbox
label
input(type='checkbox', ng-model='user.preferences.reverseChatOrder', ng-change='set({"preferences.reverseChatOrder": user.preferences.reverseChatOrder?true: false})')
span.hint(popover-trigger='mouseenter', popover-placement='top', popover=env.t('reverseChatOrderPop'))=env.t('reverseChatOrder')

View file

@ -1,6 +1,9 @@
mixin chatMessages(inbox)
ul.list-unstyled.tavern-chat
- var ngRepeat = inbox ? 'message in user.inbox.messages | toArray:true | orderBy:"sort":true' : 'message in group.chat track by message.id'
-
var ngRepeat = inbox ?
'message in user.inbox.messages | toArray:true | orderBy:"sort":true' :
'message in group.chat | orderBy:"timestamp":!user.preferences.reverseChatOrder track by message.id'
li.chat-message(ng-repeat=ngRepeat, ng-class=':: {highlight: isUserMentioned(user,message) || message.uuid=="system", "own-message": user._id == message.uuid}')
span.pull-right.text-danger(ng-if="user.contributor.admin && message.flagCount > 0")
| {{message.flagCount > 1 ? "Message Hidden" : "1 flag"}}