# HG changeset patch # User Marcin Kuzminski # Date 2013-05-28 14:57:24 # Node ID fe053a42c4ce62717893a6194058012f858f6176 # Parent ddd05df2aced189d60eca08f259fad0c646d3358 added dashboard items config in visual settings diff --git a/development.ini b/development.ini --- a/development.ini +++ b/development.ini @@ -106,9 +106,6 @@ use_htsts = false ## number of commits stats will parse on each iteration commit_parse_limit = 25 -## number of items displayed in lightweight dashboard before paginating is shown -dashboard_items = 100 - ## use gravatar service to display avatars use_gravatar = true diff --git a/production.ini b/production.ini --- a/production.ini +++ b/production.ini @@ -106,9 +106,6 @@ use_htsts = false ## number of commits stats will parse on each iteration commit_parse_limit = 25 -## number of items displayed in lightweight dashboard before paginating is shown -dashboard_items = 100 - ## use gravatar service to display avatars use_gravatar = true diff --git a/rhodecode/config/deployment.ini_tmpl b/rhodecode/config/deployment.ini_tmpl --- a/rhodecode/config/deployment.ini_tmpl +++ b/rhodecode/config/deployment.ini_tmpl @@ -106,9 +106,6 @@ use_htsts = false ## number of commits stats will parse on each iteration commit_parse_limit = 25 -## number of items displayed in lightweight dashboard before paginating is shown -dashboard_items = 100 - ## use gravatar service to display avatars use_gravatar = true diff --git a/rhodecode/controllers/admin/settings.py b/rhodecode/controllers/admin/settings.py --- a/rhodecode/controllers/admin/settings.py +++ b/rhodecode/controllers/admin/settings.py @@ -183,6 +183,7 @@ class SettingsController(BaseController) ) try: + #TODO: rewrite this to something less ugly sett1 = RhodeCodeSetting.get_by_name_or_create('show_public_icon') sett1.app_settings_value = \ form_result['rhodecode_show_public_icon'] @@ -203,6 +204,11 @@ class SettingsController(BaseController) form_result['rhodecode_repository_fields'] Session().add(sett4) + sett5 = RhodeCodeSetting.get_by_name_or_create('dashboard_items') + sett5.app_settings_value = \ + form_result['rhodecode_dashboard_items'] + Session().add(sett5) + Session().commit() set_rhodecode_config(config) h.flash(_('Updated visualisation settings'), diff --git a/rhodecode/lib/base.py b/rhodecode/lib/base.py --- a/rhodecode/lib/base.py +++ b/rhodecode/lib/base.py @@ -267,18 +267,19 @@ class BaseController(WSGIController): # Visual options c.visual = AttributeDict({}) rc_config = RhodeCodeSetting.get_app_settings() - + ## DB stored c.visual.show_public_icon = str2bool(rc_config.get('rhodecode_show_public_icon')) c.visual.show_private_icon = str2bool(rc_config.get('rhodecode_show_private_icon')) c.visual.stylify_metatags = str2bool(rc_config.get('rhodecode_stylify_metatags')) - c.visual.dashboard_items = safe_int(config.get('dashboard_items', 100)) + c.visual.dashboard_items = safe_int(rc_config.get('rhodecode_dashboard_items', 100)) c.visual.repository_fields = str2bool(rc_config.get('rhodecode_repository_fields')) + ## INI stored + self.cut_off_limit = int(config.get('cut_off_limit')) + c.repo_name = get_repo_slug(request) # can be empty c.backends = BACKENDS.keys() c.unread_notifications = NotificationModel()\ .get_unread_cnt_for_user(c.rhodecode_user.user_id) - self.cut_off_limit = int(config.get('cut_off_limit')) - self.sa = meta.Session self.scm_model = ScmModel(self.sa) diff --git a/rhodecode/model/forms.py b/rhodecode/model/forms.py --- a/rhodecode/model/forms.py +++ b/rhodecode/model/forms.py @@ -285,6 +285,7 @@ def ApplicationVisualisationForm(): rhodecode_repository_fields = v.StringBoolean(if_missing=False) rhodecode_lightweight_journal = v.StringBoolean(if_missing=False) + rhodecode_dashboard_items = v.UnicodeString() return _ApplicationVisualisationForm diff --git a/rhodecode/templates/admin/settings/settings.html b/rhodecode/templates/admin/settings/settings.html --- a/rhodecode/templates/admin/settings/settings.html +++ b/rhodecode/templates/admin/settings/settings.html @@ -133,9 +133,18 @@ ${h.checkbox('rhodecode_repository_fields','True')} + ${_('Allows storing additional customized fields per repository.')} - +
+
+ +
+
+ ${h.text('rhodecode_dashboard_items',size=5)} + ${_('Number of items displayed in lightweight dashboard before pagination is shown.')} +
+
@@ -149,6 +158,7 @@ ${h.checkbox('rhodecode_show_private_icon','True')}
+ ${_('Show public/private icons next to repositories names')}