Changeset - 029a40c58df7
[Not reviewed]
beta
0 5 0
Marcin Kuzminski - 13 years ago 2012-10-23 11:09:27
marcin@python-works.com
Added lightweight journal option for visual
5 files changed with 14 insertions and 2 deletions:
0 comments (0 inline, 0 general)
rhodecode/controllers/admin/settings.py
Show inline comments
 
@@ -199,12 +199,17 @@ class SettingsController(BaseController)
 

	
 
                sett4 = RhodeCodeSetting.get_by_name_or_create('lightweight_dashboard')
 
                sett4.app_settings_value = \
 
                    form_result['rhodecode_lightweight_dashboard']
 
                Session().add(sett4)
 

	
 
                sett5 = RhodeCodeSetting.get_by_name_or_create('lightweight_journal')
 
                sett5.app_settings_value = \
 
                    form_result['rhodecode_lightweight_journal']
 
                Session().add(sett5)
 

	
 
                Session().commit()
 
                set_rhodecode_config(config)
 
                h.flash(_('Updated visualisation settings'),
 
                        category='success')
 

	
 
            except Exception:
rhodecode/lib/base.py
Show inline comments
 
@@ -243,12 +243,13 @@ class BaseController(WSGIController):
 
        # Visual options
 
        c.visual = AttributeDict({})
 
        c.visual.show_public_icon = str2bool(config.get('rhodecode_show_public_icon'))
 
        c.visual.show_private_icon = str2bool(config.get('rhodecode_show_private_icon'))
 
        c.visual.stylify_metatags = str2bool(config.get('rhodecode_stylify_metatags'))
 
        c.visual.lightweight_dashboard = str2bool(config.get('rhodecode_lightweight_dashboard'))
 
        c.visual.lightweight_journal = str2bool(config.get('rhodecode_lightweight_dashboard'))
 

	
 
        c.repo_name = get_repo_slug(request)
 
        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'))
rhodecode/lib/helpers.py
Show inline comments
 
@@ -497,13 +497,14 @@ def action_parser(user_log, feed=False, 
 
    fancy names with icons and links
 

	
 
    :param user_log: user log instance
 
    :param feed: use output for feeds (no html and fancy icons)
 
    :param parse_cs: parse Changesets into VCS instances
 
    """
 
    if request.GET.get('lightweight'):
 
    from pylons import tmpl_context as c
 
    if c.visual.lightweight_journal:
 
        parse_cs = False
 
    action = user_log.action
 
    action_params = ' '
 

	
 
    x = action.split(':')
 

	
 
@@ -528,13 +529,13 @@ def action_parser(user_log, feed=False, 
 
                else:
 
                    lbl = '%s' % (rev.short_id)
 
                _url = url('changeset_home', repo_name=repo_name,
 
                           revision=rev.raw_id)
 
                title = tooltip(rev.message) if parse_cs else ''
 
            else:
 
                lbl = '%s' % rev
 
                lbl = ('%s' % rev)[:12]
 
                _url = '#'
 
                title = _('Changeset not found')
 

	
 
            return link_to(lbl, _url, title=title, 
 
                           class_='tooltip' if parse_cs else '',)
 

	
rhodecode/model/forms.py
Show inline comments
 
@@ -252,12 +252,13 @@ def ApplicationVisualisationForm():
 
        filter_extra_fields = False
 
        rhodecode_show_public_icon = v.StringBoolean(if_missing=False)
 
        rhodecode_show_private_icon = v.StringBoolean(if_missing=False)
 
        rhodecode_stylify_metatags = v.StringBoolean(if_missing=False)
 

	
 
        rhodecode_lightweight_dashboard = v.StringBoolean(if_missing=False)
 
        rhodecode_lightweight_journal = v.StringBoolean(if_missing=False)
 

	
 
    return _ApplicationVisualisationForm
 

	
 

	
 
def ApplicationUiSettingsForm():
 
    class _ApplicationUiSettingsForm(formencode.Schema):
rhodecode/templates/admin/settings/settings.html
Show inline comments
 
@@ -128,12 +128,16 @@
 
                </div>
 
                <div class="checkboxes">
 
                    <div class="checkbox">
 
                        ${h.checkbox('rhodecode_lightweight_dashboard','True')}
 
                        <label for="rhodecode_lightweight_dashboard">${_('Use lightweight dashboard')}</label>
 
                    </div>
 
                    <div class="checkbox">
 
                        ${h.checkbox('rhodecode_lightweight_journal','True')}
 
                        <label for="rhodecode_lightweight_journal">${_('Use lightweight journal')}</label>
 
                    </div>                    
 
                 </div>
 
             </div>
 

	
 
             <div class="field">
 
                <div class="label label-checkbox">
 
                    <label>${_('Icons')}:</label>
0 comments (0 inline, 0 general)