Add option to reverse order of chat messages

This commit is contained in:
Georgi Gardev
2015-12-30 23:47:03 +02:00
parent 33714b4947
commit beaf0b83bb
3 changed files with 7 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

@@ -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"}}