comparison 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
comparison
equal deleted inserted replaced
1786:02a26ed03537 1787:d4a7b6c82efe
1 ## -*- coding: utf-8 -*-
1 <%inherit file="/base/base.html"/> 2 <%inherit file="/base/base.html"/>
2 3
3 <%def name="title()"> 4 <%def name="title()">
4 ${c.repo_name} ${_('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)} - ${c.rhodecode_name} 5 ${c.repo_name} ${_('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)} - ${c.rhodecode_name}
5 </%def> 6 </%def>
22 <div class="title"> 23 <div class="title">
23 ${self.breadcrumbs()} 24 ${self.breadcrumbs()}
24 </div> 25 </div>
25 <div class="table"> 26 <div class="table">
26 <div id="body" class="diffblock"> 27 <div id="body" class="diffblock">
27 <div class="code-header"> 28 <div class="code-header cv">
28 <h3>${_('Compare View')}</h3> 29 <h3 class="code-header-title">${_('Compare View')}</h3>
29 <div> 30 <div>
30 ${_('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)} 31 ${_('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)}
31 </div> 32 </div>
32 </div> 33 </div>
33 </div> 34 </div>
55 %endfor 56 %endfor
56 </div> 57 </div>
57 </div> 58 </div>
58 59
59 </div> 60 </div>
60 %for cs in c.cs_ranges: 61 <%namespace name="comment" file="/changeset/changeset_file_comment.html"/>
61 %for change,filenode,diff,cs1,cs2,st in c.changes[cs.raw_id]: 62 <%namespace name="diff_block" file="/changeset/diff_block.html"/>
62 %if change !='removed': 63 %for cs in c.cs_ranges:
63 <div style="clear:both;height:10px"></div> 64 ##${comment.comment_inline_form(cs)}
64 <div class="diffblock margined"> 65 ## diff block
65 <div id="${h.FID(cs.raw_id,filenode.path)}" class="code-header"> 66 <h3 style="border:none;padding-top:8px;">${'r%s:%s' % (cs.revision,h.short_id(cs.raw_id))}</h3>
66 <div class="changeset_header"> 67 ${diff_block.diff_block(c.changes[cs.raw_id])}
67 <span class="changeset_file"> 68 ##${comment.comments(cs)}
68 ${h.link_to_if(change!='removed',h.safe_unicode(filenode.path),h.url('files_home',repo_name=c.repo_name, 69
69 revision=filenode.changeset.raw_id,f_path=h.safe_unicode(filenode.path)))} 70 %endfor
70 </span> 71 <script type="text/javascript">
71 %if 1: 72
72 &raquo; <span>${h.link_to(_('diff'), 73 YUE.onDOMReady(function(){
73 h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='diff'))}</span> 74
74 &raquo; <span>${h.link_to(_('raw diff'), 75 YUE.on(YUQ('.diff-menu-activate'),'click',function(e){
75 h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='raw'))}</span> 76 var act = e.currentTarget.nextElementSibling;
76 &raquo; <span>${h.link_to(_('download diff'), 77
77 h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='download'))}</span> 78 if(YUD.hasClass(act,'active')){
78 %endif 79 YUD.removeClass(act,'active');
79 </div> 80 YUD.setStyle(act,'display','none');
80 </div> 81 }else{
81 <div class="code-body"> 82 YUD.addClass(act,'active');
82 %if diff: 83 YUD.setStyle(act,'display','');
83 ${diff|n} 84 }
84 %else: 85 });
85 ${_('No changes in this file')} 86 })
86 %endif 87 </script>
87 </div>
88 </div>
89 %endif
90 %endfor
91 %endfor
92 </div> 88 </div>
93 </%def> 89 </%def>