##// END OF EJS Templates
Use lightweight revisions in journal by default
marcink -
r2958:c0a6a2e6 beta
parent child Browse files
Show More
@@ -202,11 +202,6 b' class SettingsController(BaseController)'
202 form_result['rhodecode_lightweight_dashboard']
202 form_result['rhodecode_lightweight_dashboard']
203 Session().add(sett4)
203 Session().add(sett4)
204
204
205 sett5 = RhodeCodeSetting.get_by_name_or_create('lightweight_journal')
206 sett5.app_settings_value = \
207 form_result['rhodecode_lightweight_journal']
208 Session().add(sett5)
209
210 Session().commit()
205 Session().commit()
211 set_rhodecode_config(config)
206 set_rhodecode_config(config)
212 h.flash(_('Updated visualisation settings'),
207 h.flash(_('Updated visualisation settings'),
@@ -248,7 +248,6 b' class BaseController(WSGIController):'
248 c.visual.show_private_icon = str2bool(rc_config.get('rhodecode_show_private_icon'))
248 c.visual.show_private_icon = str2bool(rc_config.get('rhodecode_show_private_icon'))
249 c.visual.stylify_metatags = str2bool(rc_config.get('rhodecode_stylify_metatags'))
249 c.visual.stylify_metatags = str2bool(rc_config.get('rhodecode_stylify_metatags'))
250 c.visual.lightweight_dashboard = str2bool(rc_config.get('rhodecode_lightweight_dashboard'))
250 c.visual.lightweight_dashboard = str2bool(rc_config.get('rhodecode_lightweight_dashboard'))
251 c.visual.lightweight_journal = str2bool(rc_config.get('rhodecode_lightweight_dashboard'))
252
251
253 c.repo_name = get_repo_slug(request)
252 c.repo_name = get_repo_slug(request)
254 c.backends = BACKENDS.keys()
253 c.backends = BACKENDS.keys()
@@ -491,7 +491,7 b' def bool2icon(value):'
491 return value
491 return value
492
492
493
493
494 def action_parser(user_log, feed=False, parse_cs=True):
494 def action_parser(user_log, feed=False, parse_cs=False):
495 """
495 """
496 This helper will action_map the specified string action into translated
496 This helper will action_map the specified string action into translated
497 fancy names with icons and links
497 fancy names with icons and links
@@ -500,9 +500,7 b' def action_parser(user_log, feed=False, '
500 :param feed: use output for feeds (no html and fancy icons)
500 :param feed: use output for feeds (no html and fancy icons)
501 :param parse_cs: parse Changesets into VCS instances
501 :param parse_cs: parse Changesets into VCS instances
502 """
502 """
503 from pylons import tmpl_context as c
503
504 if c.visual.lightweight_journal:
505 parse_cs = False
506 action = user_log.action
504 action = user_log.action
507 action_params = ' '
505 action_params = ' '
508
506
@@ -522,42 +520,42 b' def action_parser(user_log, feed=False, '
522 repo_name = user_log.repository.repo_name
520 repo_name = user_log.repository.repo_name
523
521
524 def lnk(rev, repo_name):
522 def lnk(rev, repo_name):
525
526 if isinstance(rev, BaseChangeset) or isinstance(rev, AttributeDict):
523 if isinstance(rev, BaseChangeset) or isinstance(rev, AttributeDict):
527 if rev.revision:
524 lbl = '%s' % (rev.short_id[:8])
528 lbl = 'r%s:%s' % (rev.revision, rev.short_id)
529 else:
530 lbl = '%s' % (rev.short_id)
531 _url = url('changeset_home', repo_name=repo_name,
525 _url = url('changeset_home', repo_name=repo_name,
532 revision=rev.raw_id)
526 revision=rev.raw_id)
533 title = tooltip(rev.message) if parse_cs else ''
527 title = tooltip(rev.message)
534 else:
528 else:
529 ## changeset cannot be found/striped/removed etc.
535 lbl = ('%s' % rev)[:12]
530 lbl = ('%s' % rev)[:12]
536 _url = '#'
531 _url = '#'
537 title = _('Changeset not found')
532 title = _('Changeset not found')
538
533 if parse_cs:
539 return link_to(lbl, _url, title=title,
534 return link_to(lbl, _url, title=title, class_='tooltip')
540 class_='tooltip' if parse_cs else '',)
535 return link_to(lbl, _url, raw_id=rev.raw_id, class_='journal-cs')
541
536
542 revs = []
537 revs = []
543 if len(filter(lambda v: v != '', revs_ids)) > 0:
538 if len(filter(lambda v: v != '', revs_ids)) > 0:
544 if parse_cs:
539 repo = None
545 repo = user_log.repository.scm_instance
546 for rev in revs_ids[:revs_top_limit]:
540 for rev in revs_ids[:revs_top_limit]:
541 # we want parsed changesets, or new log store format is bad
547 if parse_cs:
542 if parse_cs:
548 try:
543 try:
549 rev = repo.get_changeset(rev)
544 if repo is None:
550 revs.append(rev)
545 repo = user_log.repository.scm_instance
546 _rev = repo.get_changeset(rev)
547 revs.append(_rev)
551 except ChangesetDoesNotExistError:
548 except ChangesetDoesNotExistError:
552 log.error('cannot find revision %s in this repo' % rev)
549 log.error('cannot find revision %s in this repo' % rev)
553 revs.append(rev)
550 revs.append(rev)
554 continue
551 continue
555 else:
552 else:
556 rev = AttributeDict({
553 _rev = AttributeDict({
557 'short_id': rev[:12],
554 'short_id': rev[:12],
558 'raw_id': rev,
555 'raw_id': rev,
556 'message': '',
559 })
557 })
560 revs.append(rev)
558 revs.append(_rev)
561 cs_links = []
559 cs_links = []
562 cs_links.append(" " + ', '.join(
560 cs_links.append(" " + ', '.join(
563 [lnk(rev, repo_name) for rev in revs[:revs_limit]]
561 [lnk(rev, repo_name) for rev in revs[:revs_limit]]
@@ -36,7 +36,7 b' from rhodecode.lib.utils import action_l'
36 from rhodecode.lib.vcs.backends.base import EmptyChangeset
36 from rhodecode.lib.vcs.backends.base import EmptyChangeset
37 from rhodecode.lib.compat import json
37 from rhodecode.lib.compat import json
38 from rhodecode.lib.exceptions import HTTPLockedRC
38 from rhodecode.lib.exceptions import HTTPLockedRC
39 from rhodecode.lib.utils2 import safe_str
39 from rhodecode.lib.utils2 import safe_str, datetime_to_time
40 from rhodecode.model.db import Repository, User
40 from rhodecode.model.db import Repository, User
41
41
42
42
@@ -131,10 +131,6 b''
131 ${h.checkbox('rhodecode_lightweight_dashboard','True')}
131 ${h.checkbox('rhodecode_lightweight_dashboard','True')}
132 <label for="rhodecode_lightweight_dashboard">${_('Use lightweight dashboard')}</label>
132 <label for="rhodecode_lightweight_dashboard">${_('Use lightweight dashboard')}</label>
133 </div>
133 </div>
134 <div class="checkbox">
135 ${h.checkbox('rhodecode_lightweight_journal','True')}
136 <label for="rhodecode_lightweight_journal">${_('Use lightweight journal')}</label>
137 </div>
138 </div>
134 </div>
139 </div>
135 </div>
140
136
@@ -70,6 +70,8 b''
70 <%include file="/compare/compare_cs.html" />
70 <%include file="/compare/compare_cs.html" />
71
71
72 ## FILES
72 ## FILES
73 <div id="affected_files">
74 % if c.files:
73 <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px">${_('Files affected')}</div>
75 <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px">${_('Files affected')}</div>
74 <div class="cs_files">
76 <div class="cs_files">
75 %for fid, change, f, stat in c.files:
77 %for fid, change, f, stat in c.files:
@@ -79,6 +81,10 b''
79 </div>
81 </div>
80 %endfor
82 %endfor
81 </div>
83 </div>
84 %else:
85 <div class="ui-btn" style="text-align: center;margin-top:5px">${_('Click to load diff details')}</div>
86 %endif
87 </div>
82 </div>
88 </div>
83 </div>
89 </div>
84 ## REVIEWERS
90 ## REVIEWERS
@@ -131,10 +137,12 b''
131 </script>
137 </script>
132
138
133 ## diff block
139 ## diff block
140 <div id="diff_block_container" style="clear:both;">
134 <%namespace name="diff_block" file="/changeset/diff_block.html"/>
141 <%namespace name="diff_block" file="/changeset/diff_block.html"/>
135 %for fid, change, f, stat in c.files:
142 %for fid, change, f, stat in c.files:
136 ${diff_block.diff_block_simple([c.changes[fid]])}
143 ${diff_block.diff_block_simple([c.changes[fid]])}
137 %endfor
144 %endfor
145 </div>
138
146
139 ## template for inline comment form
147 ## template for inline comment form
140 <%namespace name="comment" file="/changeset/changeset_file_comment.html"/>
148 <%namespace name="comment" file="/changeset/changeset_file_comment.html"/>
General Comments 0
You need to be logged in to leave comments. Login now