Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NEW] Option to select unread count style #7589

Merged
merged 1 commit into from
Jul 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/rocketchat-i18n/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@
"Desktop_Notifications_Duration": "Desktop Notifications Duration",
"Desktop_Notifications_Duration_Description": "Seconds to display desktop notification. This may affect OS X Notification Center. Enter 0 to use default browser settings and not affect OS X Notification Center.",
"Desktop_Notifications_Enabled": "Desktop Notifications are Enabled",
"Different_Style_For_User_Mentions": "Different style for user mentions",
"Direct_message_someone": "Direct message someone",
"Direct_Messages": "Direct Messages",
"Disable_Notifications": "Disable Notifications",
Expand Down Expand Up @@ -1454,6 +1455,7 @@
"Rooms": "Rooms",
"Running_Instances": "Running Instances",
"S_new_messages_since_s": "%s new messages since %s",
"Same_Style_For_Mentions": "Same style for mentions",
"SAML": "SAML",
"SAML_Custom_Cert": "Custom Certificate",
"SAML_Custom_Entry_point": "Custom Entry Point",
Expand Down Expand Up @@ -1712,6 +1714,7 @@
"Type_your_new_password": "Type your new password",
"UI_DisplayRoles": "Display Roles",
"UI_Merge_Channels_Groups": "Merge private groups with channels",
"UI_Unread_Counter_Style": "Unread counter style",
"UI_Use_Name_Avatar": "Use full name initials to generate default avatar",
"UI_Use_Real_Name": "Use Real Name",
"Unarchive": "Unarchive",
Expand Down
13 changes: 13 additions & 0 deletions packages/rocketchat-lib/server/startup/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -1040,6 +1040,19 @@ RocketChat.settings.addGroup('Layout', function() {
type: 'boolean',
'public': true
});
this.add('UI_Unread_Counter_Style', 'Different_Style_For_User_Mentions', {
type: 'select',
values: [
{
key: 'Same_Style_For_Mentions',
i18nLabel: 'Same_Style_For_Mentions'
}, {
key: 'Different_Style_For_User_Mentions',
i18nLabel: 'Different_Style_For_User_Mentions'
}
],
'public': true
});
});
});

Expand Down
2 changes: 1 addition & 1 deletion packages/rocketchat-theme/client/imports/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -1351,7 +1351,7 @@ label.required::after {
right: 6px;
font-size: 11px;
top: 6px;
line-height: 16px;
line-height: 14px;
font-weight: 800;
}

Expand Down
1 change: 1 addition & 0 deletions packages/rocketchat-theme/server/colors.less
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,7 @@ a:hover {

.unread {
color: @success-color;
border: 1px solid @success-color;
}

.unread.unread-mention {
Expand Down
8 changes: 6 additions & 2 deletions packages/rocketchat-ui-sidenav/client/chatRoomItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@ Template.chatRoomItem.helpers({
},

unreadClass() {
if (RocketChat.settings.get('UI_Unread_Counter_Style') === 'Same_Style_For_Mentions') {
return 'unread unread-mention';
}

if (Match.test(this.userMentions, Number) && this.userMentions > 0) {
return 'unread unread-mention';
} else {
return 'unread';
}

return 'unread';
},

userStatus() {
Expand Down