Changeset - fe053a42c4ce
[Not reviewed]
beta
0 7 0
Marcin Kuzminski - 12 years ago 2013-05-28 16:57:24
marcin@python-works.com
added dashboard items config in visual settings
7 files changed with 23 insertions and 14 deletions:
0 comments (0 inline, 0 general)
development.ini
Show inline comments
 
@@ -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
 

	
production.ini
Show inline comments
 
@@ -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
 

	
rhodecode/config/deployment.ini_tmpl
Show inline comments
 
@@ -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
 

	
rhodecode/controllers/admin/settings.py
Show inline comments
 
@@ -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'),
rhodecode/lib/base.py
Show inline comments
 
@@ -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)
 

	
rhodecode/model/forms.py
Show inline comments
 
@@ -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
 

	
rhodecode/templates/admin/settings/settings.html
Show inline comments
 
@@ -133,9 +133,18 @@
 
                        ${h.checkbox('rhodecode_repository_fields','True')}
 
                        <label for="rhodecode_repository_fields">${_('Use repository extra fields')}</label>
 
                    </div>
 
                    <span class="help-block">${_('Allows storing additional customized fields per repository.')}</span>
 
                </div>
 
             </div>
 

	
 
            <div class="field">
 
                <div class="label">
 
                    <label for="rhodecode_realm">${_('Dashboard items')}:</label>
 
                </div>
 
                <div class="input">
 
                    ${h.text('rhodecode_dashboard_items',size=5)}
 
                    <span class="help-block">${_('Number of items displayed in lightweight dashboard before pagination is shown.')}</span>
 
                </div>
 
            </div>
 
             <div class="field">
 
                <div class="label label-checkbox">
 
                    <label>${_('Icons')}:</label>
 
@@ -149,6 +158,7 @@
 
                        ${h.checkbox('rhodecode_show_private_icon','True')}
 
                        <label for="rhodecode_show_private_icon">${_('Show private repo icon on repositories')}</label>
 
                    </div>
 
                    <span class="help-block">${_('Show public/private icons next to repositories names')}</span>
 
                 </div>
 
             </div>
 

	
0 comments (0 inline, 0 general)