##// END OF EJS Templates
Added compare buttons into branch views
marcink -
r2243:f6cdfc73 codereview
parent child Browse files
Show More
@@ -1,77 +1,91 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.html"/>
2 <%inherit file="/base/base.html"/>
3
3
4 <%def name="title()">
4 <%def name="title()">
5 ${c.repo_name} ${_('Branches')} - ${c.rhodecode_name}
5 ${c.repo_name} ${_('Branches')} - ${c.rhodecode_name}
6 </%def>
6 </%def>
7
7
8 <%def name="breadcrumbs_links()">
8 <%def name="breadcrumbs_links()">
9 <input class="q_filter_box" id="q_filter_branches" size="15" type="text" name="filter" value="${_('quick filter...')}"/>
9 <input class="q_filter_box" id="q_filter_branches" size="15" type="text" name="filter" value="${_('quick filter...')}"/>
10 ${h.link_to(u'Home',h.url('/'))}
10 ${h.link_to(u'Home',h.url('/'))}
11 &raquo;
11 &raquo;
12 ${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))}
12 ${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))}
13 &raquo;
13 &raquo;
14 ${_('branches')}
14 ${_('branches')}
15 </%def>
15 </%def>
16
16
17 <%def name="page_nav()">
17 <%def name="page_nav()">
18 ${self.menu('branches')}
18 ${self.menu('branches')}
19 </%def>
19 </%def>
20
20
21 <%def name="main()">
21 <%def name="main()">
22 <div class="box">
22 <div class="box">
23 <!-- box / title -->
23 <!-- box / title -->
24 <div class="title">
24 <div class="title">
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},
37 {key:"date",label:"${_('Date')}",sortable:true,
49 {key:"date",label:"${_('Date')}",sortable:true,
38 sortOptions: { sortFunction: dateSort }},
50 sortOptions: { sortFunction: dateSort }},
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"));
45
58
46 myDataSource.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE;
59 myDataSource.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE;
47
60
48 myDataSource.responseSchema = {
61 myDataSource.responseSchema = {
49 fields: [
62 fields: [
50 {key:"name"},
63 {key:"name"},
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
57 var myDataTable = new YAHOO.widget.DataTable("table_wrap", myColumnDefs, myDataSource,
71 var myDataTable = new YAHOO.widget.DataTable("table_wrap", myColumnDefs, myDataSource,
58 {
72 {
59 sortedBy:{key:"name",dir:"asc"},
73 sortedBy:{key:"name",dir:"asc"},
60 MSG_SORTASC:"${_('Click to sort ascending')}",
74 MSG_SORTASC:"${_('Click to sort ascending')}",
61 MSG_SORTDESC:"${_('Click to sort descending')}",
75 MSG_SORTDESC:"${_('Click to sort descending')}",
62 MSG_EMPTY:"${_('No records found.')}",
76 MSG_EMPTY:"${_('No records found.')}",
63 MSG_ERROR:"${_('Data error.')}",
77 MSG_ERROR:"${_('Data error.')}",
64 MSG_LOADING:"${_('Loading...')}",
78 MSG_LOADING:"${_('Loading...')}",
65 }
79 }
66 );
80 );
67 myDataTable.subscribe('postRenderEvent',function(oArgs) {
81 myDataTable.subscribe('postRenderEvent',function(oArgs) {
68 tooltip_activate();
82 tooltip_activate();
69 var func = function(node){
83 var func = function(node){
70 return node.parentNode.parentNode.parentNode.parentNode.parentNode;
84 return node.parentNode.parentNode.parentNode.parentNode.parentNode;
71 }
85 }
72 q_filter('q_filter_branches',YUQ('div.table tr td .logtags .branchtag a'),func);
86 q_filter('q_filter_branches',YUQ('div.table tr td .logtags .branchtag a'),func);
73 });
87 });
74
88
75 </script>
89 </script>
76
90
77 </%def>
91 </%def>
@@ -1,52 +1,58 b''
1 %if c.repo_branches:
1 %if c.repo_branches:
2 <div id="table_wrap" class="yui-skin-sam">
2 <div id="table_wrap" class="yui-skin-sam">
3 <table id="branches_data">
3 <table id="branches_data">
4 <thead>
4 <thead>
5 <tr>
5 <tr>
6 <th class="left">${_('name')}</th>
6 <th class="left">${_('name')}</th>
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()):
13 <tr class="parity${cnt%2}">
14 <tr class="parity${cnt%2}">
14 <td>
15 <td>
15 <span class="logtags">
16 <span class="logtags">
16 <span class="branchtag">${h.link_to(branch[0],
17 <span class="branchtag">${h.link_to(branch[0],
17 h.url('files_home',repo_name=c.repo_name,revision=branch[1].raw_id))}</span>
18 h.url('files_home',repo_name=c.repo_name,revision=branch[1].raw_id))}</span>
18 </span>
19 </span>
19 </td>
20 </td>
20 <td><span class="tooltip" title="${h.age(branch[1].date)}">${branch[1].date}</span></td>
21 <td><span class="tooltip" title="${h.age(branch[1].date)}">${branch[1].date}</span></td>
21 <td title="${branch[1].author}">${h.person(branch[1].author)}</td>
22 <td title="${branch[1].author}">${h.person(branch[1].author)}</td>
22 <td>
23 <td>
23 <div>
24 <div>
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:
30 %for cnt,branch in enumerate(c.repo_closed_branches.items()):
35 %for cnt,branch in enumerate(c.repo_closed_branches.items()):
31 <tr class="parity${cnt%2}">
36 <tr class="parity${cnt%2}">
32 <td>
37 <td>
33 <span class="logtags">
38 <span class="logtags">
34 <span class="branchtag">${h.link_to(branch[0]+' [closed]',
39 <span class="branchtag">${h.link_to(branch[0]+' [closed]',
35 h.url('changeset_home',repo_name=c.repo_name,revision=branch[1].raw_id))}</span>
40 h.url('changeset_home',repo_name=c.repo_name,revision=branch[1].raw_id))}</span>
36 </span>
41 </span>
37 </td>
42 </td>
38 <td><span class="tooltip" title="${h.age(branch[1].date)}">${branch[1].date}</span></td>
43 <td><span class="tooltip" title="${h.age(branch[1].date)}">${branch[1].date}</span></td>
39 <td title="${branch[1].author}">${h.person(branch[1].author)}</td>
44 <td title="${branch[1].author}">${h.person(branch[1].author)}</td>
40 <td>
45 <td>
41 <div>
46 <div>
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
48 </table>
54 </table>
49 </div>
55 </div>
50 %else:
56 %else:
51 ${_('There are no branches yet')}
57 ${_('There are no branches yet')}
52 %endif
58 %endif
General Comments 0
You need to be logged in to leave comments. Login now