##// END OF EJS Templates
Added compare buttons into branch views
marcink -
r2243:f6cdfc73 codereview
parent child Browse files
Show More
@@ -25,12 +25,24 b''
25 ${self.breadcrumbs()}
25 ${self.breadcrumbs()}
26 </div>
26 </div>
27 <!-- end box / title -->
27 <!-- end box / title -->
28 <div class="info_box" id="compare_branches" style="clear: both;padding: 10px 19px;vertical-align: right;text-align: right;"><a href="#" class="ui-btn small">${_('Compare branches')}</a></div>
28 <div class="table">
29 <div class="table">
29 <%include file='branches_data.html'/>
30 <%include file='branches_data.html'/>
30 </div>
31 </div>
31 </div>
32 </div>
32 <script type="text/javascript">
33 <script type="text/javascript">
33
34 YUE.on('compare_branches','click',function(e){
35 YUE.preventDefault(e);
36 var org = YUQ('input[name=compare_org]:checked')[0];
37 var other = YUQ('input[name=compare_other]:checked')[0];
38 var compare_url = "${h.url('compare_home',repo_name=c.repo_name,ref='__ORG__...__OTHER__')}";
39 if(org && other){
40 var u = compare_url.replace('__ORG__','branch:'+org.value)
41 .replace('__OTHER__','branch:'+other.value);
42 window.location=u;
43 }
44
45 })
34 // main table sorting
46 // main table sorting
35 var myColumnDefs = [
47 var myColumnDefs = [
36 {key:"name",label:"${_('Name')}",sortable:true},
48 {key:"name",label:"${_('Name')}",sortable:true},
@@ -39,6 +51,7 b' var myColumnDefs = ['
39 {key:"author",label:"${_('Author')}",sortable:true},
51 {key:"author",label:"${_('Author')}",sortable:true},
40 {key:"revision",label:"${_('Revision')}",sortable:true,
52 {key:"revision",label:"${_('Revision')}",sortable:true,
41 sortOptions: { sortFunction: revisionSort }},
53 sortOptions: { sortFunction: revisionSort }},
54 {key:"compare",label:"${_('Compare')}",sortable:false,},
42 ];
55 ];
43
56
44 var myDataSource = new YAHOO.util.DataSource(YUD.get("branches_data"));
57 var myDataSource = new YAHOO.util.DataSource(YUD.get("branches_data"));
@@ -51,6 +64,7 b' myDataSource.responseSchema = {'
51 {key:"date"},
64 {key:"date"},
52 {key:"author"},
65 {key:"author"},
53 {key:"revision"},
66 {key:"revision"},
67 {key:"compare"},
54 ]
68 ]
55 };
69 };
56
70
@@ -7,6 +7,7 b''
7 <th class="left">${_('date')}</th>
7 <th class="left">${_('date')}</th>
8 <th class="left">${_('author')}</th>
8 <th class="left">${_('author')}</th>
9 <th class="left">${_('revision')}</th>
9 <th class="left">${_('revision')}</th>
10 <th class="left">${_('compare')}</th>
10 </tr>
11 </tr>
11 </thead>
12 </thead>
12 %for cnt,branch in enumerate(c.repo_branches.items()):
13 %for cnt,branch in enumerate(c.repo_branches.items()):
@@ -24,6 +25,10 b''
24 <pre><a href="${h.url('files_home',repo_name=c.repo_name,revision=branch[1].raw_id)}">r${branch[1].revision}:${h.short_id(branch[1].raw_id)}</a></pre>
25 <pre><a href="${h.url('files_home',repo_name=c.repo_name,revision=branch[1].raw_id)}">r${branch[1].revision}:${h.short_id(branch[1].raw_id)}</a></pre>
25 </div>
26 </div>
26 </td>
27 </td>
28 <td>
29 <input class="branch-compare" type="radio" name="compare_org" value="${branch[0]}"/>
30 <input class="branch-compare" type="radio" name="compare_other" value="${branch[0]}"/>
31 </td>
27 </tr>
32 </tr>
28 %endfor
33 %endfor
29 % if hasattr(c,'repo_closed_branches') and c.repo_closed_branches:
34 % if hasattr(c,'repo_closed_branches') and c.repo_closed_branches:
@@ -42,6 +47,7 b''
42 <pre><a href="${h.url('files_home',repo_name=c.repo_name,revision=branch[1].raw_id)}">r${branch[1].revision}:${h.short_id(branch[1].raw_id)}</a></pre>
47 <pre><a href="${h.url('files_home',repo_name=c.repo_name,revision=branch[1].raw_id)}">r${branch[1].revision}:${h.short_id(branch[1].raw_id)}</a></pre>
43 </div>
48 </div>
44 </td>
49 </td>
50 <td></td>
45 </tr>
51 </tr>
46 %endfor
52 %endfor
47 %endif
53 %endif
General Comments 0
You need to be logged in to leave comments. Login now