Mercurial > kallithea
diff rhodecode/templates/changeset/changeset_range.html @ 1787:d4a7b6c82efe beta
code garden for changeset ranges and comments
- disabled (for now) comments on changeset ranges
- code reuse by mako namespaces
- added flag for enabling comments in diffs
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sun, 18 Dec 2011 04:24:53 +0200 |
parents | 910e3a0d27c0 |
children | a6a30c919513 |
line wrap: on
line diff
--- a/rhodecode/templates/changeset/changeset_range.html Sun Dec 18 00:12:58 2011 +0200 +++ b/rhodecode/templates/changeset/changeset_range.html Sun Dec 18 04:24:53 2011 +0200 @@ -1,3 +1,4 @@ +## -*- coding: utf-8 -*- <%inherit file="/base/base.html"/> <%def name="title()"> @@ -24,8 +25,8 @@ </div> <div class="table"> <div id="body" class="diffblock"> - <div class="code-header"> - <h3>${_('Compare View')}</h3> + <div class="code-header cv"> + <h3 class="code-header-title">${_('Compare View')}</h3> <div> ${_('Changesets')} - r${c.cs_ranges[0].revision}:${h.short_id(c.cs_ranges[0].raw_id)} -> r${c.cs_ranges[-1].revision}:${h.short_id(c.cs_ranges[-1].raw_id)} </div> @@ -57,37 +58,32 @@ </div> </div> - %for cs in c.cs_ranges: - %for change,filenode,diff,cs1,cs2,st in c.changes[cs.raw_id]: - %if change !='removed': - <div style="clear:both;height:10px"></div> - <div class="diffblock margined"> - <div id="${h.FID(cs.raw_id,filenode.path)}" class="code-header"> - <div class="changeset_header"> - <span class="changeset_file"> - ${h.link_to_if(change!='removed',h.safe_unicode(filenode.path),h.url('files_home',repo_name=c.repo_name, - revision=filenode.changeset.raw_id,f_path=h.safe_unicode(filenode.path)))} - </span> - %if 1: - » <span>${h.link_to(_('diff'), - h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='diff'))}</span> - » <span>${h.link_to(_('raw diff'), - h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='raw'))}</span> - » <span>${h.link_to(_('download diff'), - h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='download'))}</span> - %endif - </div> - </div> - <div class="code-body"> - %if diff: - ${diff|n} - %else: - ${_('No changes in this file')} - %endif - </div> - </div> - %endif - %endfor - %endfor + <%namespace name="comment" file="/changeset/changeset_file_comment.html"/> + <%namespace name="diff_block" file="/changeset/diff_block.html"/> + %for cs in c.cs_ranges: + ##${comment.comment_inline_form(cs)} + ## diff block + <h3 style="border:none;padding-top:8px;">${'r%s:%s' % (cs.revision,h.short_id(cs.raw_id))}</h3> + ${diff_block.diff_block(c.changes[cs.raw_id])} + ##${comment.comments(cs)} + + %endfor + <script type="text/javascript"> + + YUE.onDOMReady(function(){ + + YUE.on(YUQ('.diff-menu-activate'),'click',function(e){ + var act = e.currentTarget.nextElementSibling; + + if(YUD.hasClass(act,'active')){ + YUD.removeClass(act,'active'); + YUD.setStyle(act,'display','none'); + }else{ + YUD.addClass(act,'active'); + YUD.setStyle(act,'display',''); + } + }); + }) + </script> </div> </%def> \ No newline at end of file