From 15ff8fb73fcb34c9fc7b56e47d0bd7ae4dbfd4c9 Mon Sep 17 00:00:00 2001 From: Pragati Agrawal Date: Thu, 13 Jun 2019 18:51:20 +0530 Subject: [PATCH] settings: Fix sort order display settings. This fixes the mis-alphabetized `fluid_layout_width` at few places in the codebase, along with that it also fixes sorting order of `property_types` dictionary in models.py and few model fields of `UserProfile` model class. --- static/js/server_events_dispatch.js | 2 +- static/js/settings.js | 2 +- zerver/models.py | 20 ++++++++++---------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/static/js/server_events_dispatch.js b/static/js/server_events_dispatch.js index 6134cc45fe..88f74cc8f6 100644 --- a/static/js/server_events_dispatch.js +++ b/static/js/server_events_dispatch.js @@ -379,6 +379,7 @@ exports.dispatch_normal_event = function dispatch_normal_event(event) { 'demote_inactive_streams', 'dense_mode', 'emojiset', + 'fluid_layout_width', 'high_contrast_mode', 'night_mode', 'left_side_userlist', @@ -386,7 +387,6 @@ exports.dispatch_normal_event = function dispatch_normal_event(event) { 'twenty_four_hour_time', 'translate_emoticons', 'starred_message_counts', - 'fluid_layout_width', ]; if (_.contains(user_display_settings, event.setting_name)) { page_params[event.setting_name] = event.setting; diff --git a/static/js/settings.js b/static/js/settings.js index de6a33e070..ee60241131 100644 --- a/static/js/settings.js +++ b/static/js/settings.js @@ -108,11 +108,11 @@ function setup_settings_label() { // display settings dense_mode: i18n.t("Dense mode"), + fluid_layout_width: i18n.t("Use full width on wide screens"), high_contrast_mode: i18n.t("High contrast mode"), left_side_userlist: i18n.t("User list on left sidebar in narrow windows"), night_mode: i18n.t("Night mode"), starred_message_counts: i18n.t("Show counts for starred messages"), - fluid_layout_width: i18n.t("Use full width on wide screens"), twenty_four_hour_time: i18n.t("24-hour time (17:00 instead of 5:00 PM)"), translate_emoticons: i18n.t("Convert emoticons before sending (:) becomes 😃)"), }; diff --git a/zerver/models.py b/zerver/models.py index 0cc2d9a9c1..82a75213c1 100644 --- a/zerver/models.py +++ b/zerver/models.py @@ -880,14 +880,14 @@ class UserProfile(AbstractBaseUser, PermissionsMixin): left_side_userlist = models.BooleanField(default=False) # type: bool # display settings - twenty_four_hour_time = models.BooleanField(default=False) # type: bool default_language = models.CharField(default=u'en', max_length=MAX_LANGUAGE_ID_LENGTH) # type: str + dense_mode = models.BooleanField(default=True) # type: bool + fluid_layout_width = models.BooleanField(default=False) # type: bool high_contrast_mode = models.BooleanField(default=False) # type: bool night_mode = models.BooleanField(default=False) # type: bool translate_emoticons = models.BooleanField(default=False) # type: bool - dense_mode = models.BooleanField(default=True) # type: bool + twenty_four_hour_time = models.BooleanField(default=False) # type: bool starred_message_counts = models.BooleanField(default=False) # type: bool - fluid_layout_width = models.BooleanField(default=False) # type: bool # UI setting controlling Zulip's behavior of demoting in the sort # order and graying out streams with no recent traffic. The @@ -955,14 +955,14 @@ class UserProfile(AbstractBaseUser, PermissionsMixin): demote_inactive_streams=int, dense_mode=bool, emojiset=str, - left_side_userlist=bool, - timezone=str, - twenty_four_hour_time=bool, - high_contrast_mode=bool, - night_mode=bool, - translate_emoticons=bool, - starred_message_counts=bool, fluid_layout_width=bool, + high_contrast_mode=bool, + left_side_userlist=bool, + night_mode=bool, + starred_message_counts=bool, + timezone=str, + translate_emoticons=bool, + twenty_four_hour_time=bool, ) notification_setting_types = dict(