##// END OF EJS Templates
pull requests: add a 'Changeset status' comment on changeset status
Mads Kiilerich -
r4056:458fd829 default
parent child Browse files
Show More
@@ -1,296 +1,298 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2
2
3 <%inherit file="/base/base.html"/>
3 <%inherit file="/base/base.html"/>
4
4
5 <%def name="title()">
5 <%def name="title()">
6 ${_('%s Changelog') % c.repo_name} &middot;
6 ${_('%s Changelog') % c.repo_name} &middot;
7 %if c.changelog_for_path:
7 %if c.changelog_for_path:
8 /${c.changelog_for_path} &middot;
8 /${c.changelog_for_path} &middot;
9 %endif
9 %endif
10 ${c.rhodecode_name}
10 ${c.rhodecode_name}
11 </%def>
11 </%def>
12
12
13 <%def name="breadcrumbs_links()">
13 <%def name="breadcrumbs_links()">
14 <% size = c.size if c.size <= c.total_cs else c.total_cs %>
14 <% size = c.size if c.size <= c.total_cs else c.total_cs %>
15 ${_('Changelog')}
15 ${_('Changelog')}
16 %if c.changelog_for_path:
16 %if c.changelog_for_path:
17 - /${c.changelog_for_path}
17 - /${c.changelog_for_path}
18 %endif
18 %endif
19 - ${ungettext('showing %d out of %d revision', 'showing %d out of %d revisions', size) % (size, c.total_cs)}
19 - ${ungettext('showing %d out of %d revision', 'showing %d out of %d revisions', size) % (size, c.total_cs)}
20 </%def>
20 </%def>
21
21
22 <%def name="page_nav()">
22 <%def name="page_nav()">
23 ${self.menu('repositories')}
23 ${self.menu('repositories')}
24 </%def>
24 </%def>
25
25
26 <%def name="main()">
26 <%def name="main()">
27 ${self.repo_context_bar('changelog')}
27 ${self.repo_context_bar('changelog')}
28 <div class="box">
28 <div class="box">
29 <!-- box / title -->
29 <!-- box / title -->
30 <div class="title">
30 <div class="title">
31 ${self.breadcrumbs()}
31 ${self.breadcrumbs()}
32 </div>
32 </div>
33 <div class="table">
33 <div class="table">
34 % if c.pagination:
34 % if c.pagination:
35 <div id="graph">
35 <div id="graph">
36 <div style="display:${'none' if c.changelog_for_path else ''}">
36 <div style="display:${'none' if c.changelog_for_path else ''}">
37 <div class="info_box" style="clear: both;padding: 10px 6px;min-height: 12px;text-align: right;">
37 <div class="info_box" style="clear: both;padding: 10px 6px;min-height: 12px;text-align: right;">
38 <a href="#" class="ui-btn small" id="rev_range_container" style="display:none"></a>
38 <a href="#" class="ui-btn small" id="rev_range_container" style="display:none"></a>
39 <a href="#" class="ui-btn small" id="rev_range_clear" style="display:none">${_('Clear selection')}</a>
39 <a href="#" class="ui-btn small" id="rev_range_clear" style="display:none">${_('Clear selection')}</a>
40
40
41 %if c.rhodecode_db_repo.fork:
41 %if c.rhodecode_db_repo.fork:
42 <a id="compare_fork" title="${_('Compare fork with %s' % c.rhodecode_db_repo.fork.repo_name)}" href="${h.url('compare_url',repo_name=c.rhodecode_db_repo.fork.repo_name,org_ref_type='branch',org_ref='default',other_repo=c.repo_name,other_ref_type='branch',other_ref=request.GET.get('branch') or 'default',merge=1)}" class="ui-btn small">${_('Compare fork with parent')}</a>
42 <a id="compare_fork" title="${_('Compare fork with %s' % c.rhodecode_db_repo.fork.repo_name)}" href="${h.url('compare_url',repo_name=c.rhodecode_db_repo.fork.repo_name,org_ref_type='branch',org_ref='default',other_repo=c.repo_name,other_ref_type='branch',other_ref=request.GET.get('branch') or 'default',merge=1)}" class="ui-btn small">${_('Compare fork with parent')}</a>
43 %endif
43 %endif
44 %if h.is_hg(c.rhodecode_repo):
44 %if h.is_hg(c.rhodecode_repo):
45 <a id="open_new_pr" href="${h.url('pullrequest_home',repo_name=c.repo_name)}" class="ui-btn small">${_('Open new pull request')}</a>
45 <a id="open_new_pr" href="${h.url('pullrequest_home',repo_name=c.repo_name)}" class="ui-btn small">${_('Open new pull request')}</a>
46 %endif
46 %endif
47 </div>
47 </div>
48 <div class="container_header">
48 <div class="container_header">
49 ${h.form(h.url.current(),method='get')}
49 ${h.form(h.url.current(),method='get')}
50 <div style="float:left">
50 <div style="float:left">
51 ${h.submit('set',_('Show'),class_="ui-btn")}
51 ${h.submit('set',_('Show'),class_="ui-btn")}
52 ${h.text('size',size=1,value=c.size)}
52 ${h.text('size',size=1,value=c.size)}
53 ${_('revisions')}
53 ${_('revisions')}
54 </div>
54 </div>
55 ${h.end_form()}
55 ${h.end_form()}
56 <div style="float:right">${h.select('branch_filter',c.branch_name,c.branch_filters)}</div>
56 <div style="float:right">${h.select('branch_filter',c.branch_name,c.branch_filters)}</div>
57 </div>
57 </div>
58 </div>
58 </div>
59 <div id="graph_nodes">
59 <div id="graph_nodes">
60 <canvas id="graph_canvas"></canvas>
60 <canvas id="graph_canvas"></canvas>
61 </div>
61 </div>
62 <div id="graph_content">
62 <div id="graph_content">
63
63
64 <table id="changesets">
64 <table id="changesets">
65 <tbody>
65 <tbody>
66 %for cnt,cs in enumerate(c.pagination):
66 %for cnt,cs in enumerate(c.pagination):
67 <tr id="chg_${cnt+1}" class="container ${'tablerow%s' % (cnt%2)}">
67 <tr id="chg_${cnt+1}" class="container ${'tablerow%s' % (cnt%2)}">
68 <td class="checkbox">
68 <td class="checkbox">
69 %if c.changelog_for_path:
69 %if c.changelog_for_path:
70 ${h.checkbox(cs.raw_id,class_="changeset_range", disabled="disabled")}
70 ${h.checkbox(cs.raw_id,class_="changeset_range", disabled="disabled")}
71 %else:
71 %else:
72 ${h.checkbox(cs.raw_id,class_="changeset_range")}
72 ${h.checkbox(cs.raw_id,class_="changeset_range")}
73 %endif
73 %endif
74 <td class="status">
74 <td class="status">
75 %if c.statuses.get(cs.raw_id):
75 %if c.statuses.get(cs.raw_id):
76 <div class="changeset-status-ico">
76 <div class="changeset-status-ico">
77 %if c.statuses.get(cs.raw_id)[2]:
77 %if c.statuses.get(cs.raw_id)[2]:
78 <a class="tooltip" title="${_('Click to open associated pull request #%s' % c.statuses.get(cs.raw_id)[2])}" href="${h.url('pullrequest_show',repo_name=c.statuses.get(cs.raw_id)[3],pull_request_id=c.statuses.get(cs.raw_id)[2])}">
78 <a class="tooltip" title="${_('Changeset status: %s\nClick to open associated pull request #%s') % (c.statuses.get(cs.raw_id)[0], c.statuses.get(cs.raw_id)[2])}" href="${h.url('pullrequest_show',repo_name=c.statuses.get(cs.raw_id)[3],pull_request_id=c.statuses.get(cs.raw_id)[2])}">
79 <img src="${h.url('/images/icons/flag_status_%s.png' % c.statuses.get(cs.raw_id)[0])}" />
79 <img src="${h.url('/images/icons/flag_status_%s.png' % c.statuses.get(cs.raw_id)[0])}" />
80 </a>
80 </a>
81 %else:
81 %else:
82 <img src="${h.url('/images/icons/flag_status_%s.png' % c.statuses.get(cs.raw_id)[0])}" />
82 <a class="tooltip" title="${_('Changeset status: %s') % c.statuses.get(cs.raw_id)[0]}" href="${h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id,anchor='comment-%s' % c.comments[cs.raw_id][0].comment_id)}">
83 <img src="${h.url('/images/icons/flag_status_%s.png' % c.statuses.get(cs.raw_id)[0])}" />
84 </a>
83 %endif
85 %endif
84 </div>
86 </div>
85 %endif
87 %endif
86 </td>
88 </td>
87 <td class="author">
89 <td class="author">
88 <img alt="gravatar" src="${h.gravatar_url(h.email_or_none(cs.author),16)}"/>
90 <img alt="gravatar" src="${h.gravatar_url(h.email_or_none(cs.author),16)}"/>
89 <span title="${cs.author}" class="user">${h.shorter(h.person(cs.author),22)}</span>
91 <span title="${cs.author}" class="user">${h.shorter(h.person(cs.author),22)}</span>
90 </td>
92 </td>
91 <td class="hash" style="width:${len(h.show_id(cs))*6.5}px">
93 <td class="hash" style="width:${len(h.show_id(cs))*6.5}px">
92 <a href="${h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id)}">
94 <a href="${h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id)}">
93 <span class="changeset_hash">${h.show_id(cs)}</span>
95 <span class="changeset_hash">${h.show_id(cs)}</span>
94 </a>
96 </a>
95 </td>
97 </td>
96 <td class="date">
98 <td class="date">
97 <div class="date">${h.age(cs.date,True)}</div>
99 <div class="date">${h.age(cs.date,True)}</div>
98 </td>
100 </td>
99 <td class="mid">
101 <td class="mid">
100 <div class="log-container">
102 <div class="log-container">
101 <div class="message">${h.urlify_commit(cs.message, c.repo_name,h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}</div>
103 <div class="message">${h.urlify_commit(cs.message, c.repo_name,h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}</div>
102 <div class="expand"><span class="expandtext">&darr; ${_('Show more')} &darr;</span></div>
104 <div class="expand"><span class="expandtext">&darr; ${_('Show more')} &darr;</span></div>
103 <div class="extra-container">
105 <div class="extra-container">
104 %if c.comments.get(cs.raw_id):
106 %if c.comments.get(cs.raw_id):
105 <div class="comments-container">
107 <div class="comments-container">
106 <div class="comments-cnt" title="${('comments')}">
108 <div class="comments-cnt" title="${_('Changeset has comments')}">
107 <a href="${h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id,anchor='comment-%s' % c.comments[cs.raw_id][0].comment_id)}">
109 <a href="${h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id,anchor='comment-%s' % c.comments[cs.raw_id][0].comment_id)}">
108 ${len(c.comments[cs.raw_id])}
110 ${len(c.comments[cs.raw_id])}
109 </a>
111 </a>
110 </div>
112 </div>
111 </div>
113 </div>
112 %endif
114 %endif
113 %if h.is_hg(c.rhodecode_repo):
115 %if h.is_hg(c.rhodecode_repo):
114 %for book in cs.bookmarks:
116 %for book in cs.bookmarks:
115 <div class="booktag" title="${_('Bookmark %s') % book}">
117 <div class="booktag" title="${_('Bookmark %s') % book}">
116 ${h.link_to(h.shorter(book),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))}
118 ${h.link_to(h.shorter(book),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))}
117 </div>
119 </div>
118 %endfor
120 %endfor
119 %endif
121 %endif
120 %for tag in cs.tags:
122 %for tag in cs.tags:
121 <div class="tagtag" title="${_('Tag %s') % tag}">
123 <div class="tagtag" title="${_('Tag %s') % tag}">
122 ${h.link_to(h.shorter(tag),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))}
124 ${h.link_to(h.shorter(tag),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))}
123 </div>
125 </div>
124 %endfor
126 %endfor
125 %if (not c.branch_name) and cs.branch:
127 %if (not c.branch_name) and cs.branch:
126 <div class="branchtag" title="${_('Branch %s' % cs.branch)}">
128 <div class="branchtag" title="${_('Branch %s' % cs.branch)}">
127 ${h.link_to(h.shorter(cs.branch),h.url('changelog_home',repo_name=c.repo_name,branch=cs.branch))}
129 ${h.link_to(h.shorter(cs.branch),h.url('changelog_home',repo_name=c.repo_name,branch=cs.branch))}
128 </div>
130 </div>
129 %endif
131 %endif
130 </div>
132 </div>
131 </div>
133 </div>
132 </td>
134 </td>
133 </tr>
135 </tr>
134 %endfor
136 %endfor
135 </tbody>
137 </tbody>
136 </table>
138 </table>
137
139
138 <div class="pagination-wh pagination-left">
140 <div class="pagination-wh pagination-left">
139 ${c.pagination.pager('$link_previous ~2~ $link_next')}
141 ${c.pagination.pager('$link_previous ~2~ $link_next')}
140 </div>
142 </div>
141 </div>
143 </div>
142 </div>
144 </div>
143
145
144 <script type="text/javascript" src="${h.url('/js/graph.js')}"></script>
146 <script type="text/javascript" src="${h.url('/js/graph.js')}"></script>
145 <script type="text/javascript">
147 <script type="text/javascript">
146 YAHOO.util.Event.onDOMReady(function(){
148 YAHOO.util.Event.onDOMReady(function(){
147
149
148 //Monitor range checkboxes and build a link to changesets
150 //Monitor range checkboxes and build a link to changesets
149 //ranges
151 //ranges
150 var checkboxes = YUD.getElementsByClassName('changeset_range');
152 var checkboxes = YUD.getElementsByClassName('changeset_range');
151 // register our routes needed for this view
153 // register our routes needed for this view
152 pyroutes.register('changeset_home', "${h.url('changeset_home', repo_name='%(repo_name)s', revision='%(revision)s')}", ['repo_name', 'revision']);
154 pyroutes.register('changeset_home', "${h.url('changeset_home', repo_name='%(repo_name)s', revision='%(revision)s')}", ['repo_name', 'revision']);
153 pyroutes.register('changelog_home', "${h.url('changelog_home', repo_name='%(repo_name)s')}", ['repo_name']);
155 pyroutes.register('changelog_home', "${h.url('changelog_home', repo_name='%(repo_name)s')}", ['repo_name']);
154 pyroutes.register('pullrequest_home', "${h.url('pullrequest_home', repo_name='%(repo_name)s')}", ['repo_name']);
156 pyroutes.register('pullrequest_home', "${h.url('pullrequest_home', repo_name='%(repo_name)s')}", ['repo_name']);
155
157
156 var checkbox_checker = function(e){
158 var checkbox_checker = function(e){
157 var checked_checkboxes = [];
159 var checked_checkboxes = [];
158 for (pos in checkboxes){
160 for (pos in checkboxes){
159 if(checkboxes[pos].checked){
161 if(checkboxes[pos].checked){
160 checked_checkboxes.push(checkboxes[pos]);
162 checked_checkboxes.push(checkboxes[pos]);
161 }
163 }
162 }
164 }
163 if(YUD.get('open_new_pr')){
165 if(YUD.get('open_new_pr')){
164 if(checked_checkboxes.length>1){
166 if(checked_checkboxes.length>1){
165 YUD.setStyle('open_new_pr','display','none');
167 YUD.setStyle('open_new_pr','display','none');
166 } else {
168 } else {
167 YUD.setStyle('open_new_pr','display','');
169 YUD.setStyle('open_new_pr','display','');
168 if(checked_checkboxes.length>0){
170 if(checked_checkboxes.length>0){
169 YUD.get('open_new_pr').innerHTML = _TM['Open new pull request for selected changesets'];
171 YUD.get('open_new_pr').innerHTML = _TM['Open new pull request for selected changesets'];
170 }else{
172 }else{
171 YUD.get('open_new_pr').innerHTML = _TM['Open new pull request'];
173 YUD.get('open_new_pr').innerHTML = _TM['Open new pull request'];
172 }
174 }
173 }
175 }
174 }
176 }
175
177
176 if(checked_checkboxes.length>0){
178 if(checked_checkboxes.length>0){
177 var rev_end = checked_checkboxes[0].name;
179 var rev_end = checked_checkboxes[0].name;
178 var rev_start = checked_checkboxes[checked_checkboxes.length-1].name;
180 var rev_start = checked_checkboxes[checked_checkboxes.length-1].name;
179 var url = pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}',
181 var url = pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}',
180 'revision': rev_start+'...'+rev_end});
182 'revision': rev_start+'...'+rev_end});
181
183
182 var link = (rev_start == rev_end)
184 var link = (rev_start == rev_end)
183 ? _TM['Show selected changeset __S']
185 ? _TM['Show selected changeset __S']
184 : _TM['Show selected changesets __S -> __E'];
186 : _TM['Show selected changesets __S -> __E'];
185
187
186 link = link.replace('__S',rev_start.substr(0,6));
188 link = link.replace('__S',rev_start.substr(0,6));
187 link = link.replace('__E',rev_end.substr(0,6));
189 link = link.replace('__E',rev_end.substr(0,6));
188 YUD.get('rev_range_container').href = url;
190 YUD.get('rev_range_container').href = url;
189 YUD.get('rev_range_container').innerHTML = link;
191 YUD.get('rev_range_container').innerHTML = link;
190 YUD.setStyle('rev_range_container','display','');
192 YUD.setStyle('rev_range_container','display','');
191 YUD.setStyle('rev_range_clear','display','');
193 YUD.setStyle('rev_range_clear','display','');
192
194
193 YUD.get('open_new_pr').href = pyroutes.url('pullrequest_home',
195 YUD.get('open_new_pr').href = pyroutes.url('pullrequest_home',
194 {'repo_name': '${c.repo_name}',
196 {'repo_name': '${c.repo_name}',
195 'rev_start': rev_start,
197 'rev_start': rev_start,
196 'rev_end': rev_end})
198 'rev_end': rev_end})
197
199
198 YUD.setStyle('compare_fork','display','none');
200 YUD.setStyle('compare_fork','display','none');
199 }else{
201 }else{
200 YUD.setStyle('rev_range_container','display','none');
202 YUD.setStyle('rev_range_container','display','none');
201 YUD.setStyle('rev_range_clear','display','none');
203 YUD.setStyle('rev_range_clear','display','none');
202 %if c.branch_name:
204 %if c.branch_name:
203 YUD.get('open_new_pr').href = pyroutes.url('pullrequest_home',
205 YUD.get('open_new_pr').href = pyroutes.url('pullrequest_home',
204 {'repo_name': '${c.repo_name}',
206 {'repo_name': '${c.repo_name}',
205 'branch':'${c.branch_name}'});
207 'branch':'${c.branch_name}'});
206 %else:
208 %else:
207 YUD.get('open_new_pr').href = pyroutes.url('pullrequest_home',
209 YUD.get('open_new_pr').href = pyroutes.url('pullrequest_home',
208 {'repo_name': '${c.repo_name}'});
210 {'repo_name': '${c.repo_name}'});
209 %endif
211 %endif
210 YUD.setStyle('compare_fork','display','');
212 YUD.setStyle('compare_fork','display','');
211 }
213 }
212 };
214 };
213 YUE.onDOMReady(checkbox_checker);
215 YUE.onDOMReady(checkbox_checker);
214 YUE.on(checkboxes,'click', checkbox_checker);
216 YUE.on(checkboxes,'click', checkbox_checker);
215
217
216 YUE.on('rev_range_clear','click',function(e){
218 YUE.on('rev_range_clear','click',function(e){
217 for (var i=0; i<checkboxes.length; i++){
219 for (var i=0; i<checkboxes.length; i++){
218 var cb = checkboxes[i];
220 var cb = checkboxes[i];
219 cb.checked = false;
221 cb.checked = false;
220 }
222 }
221 checkbox_checker();
223 checkbox_checker();
222 YUE.preventDefault(e);
224 YUE.preventDefault(e);
223 });
225 });
224
226
225 var msgs = YUQ('.message');
227 var msgs = YUQ('.message');
226 // get first element height
228 // get first element height
227 var el = YUQ('#graph_content .container')[0];
229 var el = YUQ('#graph_content .container')[0];
228 var row_h = el.clientHeight;
230 var row_h = el.clientHeight;
229 for(var i=0;i<msgs.length;i++){
231 for(var i=0;i<msgs.length;i++){
230 var m = msgs[i];
232 var m = msgs[i];
231
233
232 var h = m.clientHeight;
234 var h = m.clientHeight;
233 var pad = YUD.getStyle(m,'padding');
235 var pad = YUD.getStyle(m,'padding');
234 if(h > row_h){
236 if(h > row_h){
235 var offset = row_h - (h+12);
237 var offset = row_h - (h+12);
236 YUD.setStyle(m.nextElementSibling,'display','block');
238 YUD.setStyle(m.nextElementSibling,'display','block');
237 YUD.setStyle(m.nextElementSibling,'margin-top',offset+'px');
239 YUD.setStyle(m.nextElementSibling,'margin-top',offset+'px');
238 };
240 };
239 }
241 }
240 YUE.on(YUQ('.expand'),'click',function(e){
242 YUE.on(YUQ('.expand'),'click',function(e){
241 var elem = e.currentTarget.parentNode.parentNode;
243 var elem = e.currentTarget.parentNode.parentNode;
242 YUD.setStyle(e.currentTarget,'display','none');
244 YUD.setStyle(e.currentTarget,'display','none');
243 YUD.setStyle(elem,'height','auto');
245 YUD.setStyle(elem,'height','auto');
244
246
245 //redraw the graph, line_count and jsdata are global vars
247 //redraw the graph, line_count and jsdata are global vars
246 set_canvas(100);
248 set_canvas(100);
247
249
248 var r = new BranchRenderer();
250 var r = new BranchRenderer();
249 r.render(jsdata,100,line_count);
251 r.render(jsdata,100,line_count);
250
252
251 });
253 });
252
254
253 // change branch filter
255 // change branch filter
254 YUE.on(YUD.get('branch_filter'),'change',function(e){
256 YUE.on(YUD.get('branch_filter'),'change',function(e){
255 var selected_branch = e.currentTarget.options[e.currentTarget.selectedIndex].value;
257 var selected_branch = e.currentTarget.options[e.currentTarget.selectedIndex].value;
256 if(selected_branch != ''){
258 if(selected_branch != ''){
257 window.location = pyroutes.url('changelog_home', {'repo_name': '${c.repo_name}',
259 window.location = pyroutes.url('changelog_home', {'repo_name': '${c.repo_name}',
258 'branch':selected_branch});
260 'branch':selected_branch});
259 }else{
261 }else{
260 window.location = pyroutes.url('changelog_home', {'repo_name': '${c.repo_name}'});
262 window.location = pyroutes.url('changelog_home', {'repo_name': '${c.repo_name}'});
261 }
263 }
262 });
264 });
263
265
264 function set_canvas(width) {
266 function set_canvas(width) {
265 var c = document.getElementById('graph_nodes');
267 var c = document.getElementById('graph_nodes');
266 var t = document.getElementById('graph_content');
268 var t = document.getElementById('graph_content');
267 canvas = document.getElementById('graph_canvas');
269 canvas = document.getElementById('graph_canvas');
268 var div_h = t.clientHeight;
270 var div_h = t.clientHeight;
269 canvas.setAttribute('height',div_h);
271 canvas.setAttribute('height',div_h);
270 canvas.setAttribute('width',width);
272 canvas.setAttribute('width',width);
271 };
273 };
272 var heads = 1;
274 var heads = 1;
273 var line_count = 0;
275 var line_count = 0;
274 var jsdata = ${c.jsdata|n};
276 var jsdata = ${c.jsdata|n};
275
277
276 for (var i=0;i<jsdata.length;i++) {
278 for (var i=0;i<jsdata.length;i++) {
277 var in_l = jsdata[i][2];
279 var in_l = jsdata[i][2];
278 for (var j in in_l) {
280 for (var j in in_l) {
279 var m = in_l[j][1];
281 var m = in_l[j][1];
280 if (m > line_count)
282 if (m > line_count)
281 line_count = m;
283 line_count = m;
282 }
284 }
283 }
285 }
284 set_canvas(100);
286 set_canvas(100);
285
287
286 var r = new BranchRenderer();
288 var r = new BranchRenderer();
287 r.render(jsdata,100,line_count);
289 r.render(jsdata,100,line_count);
288
290
289 });
291 });
290 </script>
292 </script>
291 %else:
293 %else:
292 ${_('There are no changes yet')}
294 ${_('There are no changes yet')}
293 %endif
295 %endif
294 </div>
296 </div>
295 </div>
297 </div>
296 </%def>
298 </%def>
@@ -1,112 +1,112 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 %if c.repo_changesets:
2 %if c.repo_changesets:
3 <table class="table_disp">
3 <table class="table_disp">
4 <tr>
4 <tr>
5 <th class="left">${_('Revision')}</th>
5 <th class="left">${_('Revision')}</th>
6 <th class="left">${_('Commit message')}</th>
6 <th class="left">${_('Commit message')}</th>
7 <th class="left">${_('Age')}</th>
7 <th class="left">${_('Age')}</th>
8 <th class="left">${_('Author')}</th>
8 <th class="left">${_('Author')}</th>
9 <th class="left">${_('Refs')}</th>
9 <th class="left">${_('Refs')}</th>
10 </tr>
10 </tr>
11 %for cnt,cs in enumerate(c.repo_changesets):
11 %for cnt,cs in enumerate(c.repo_changesets):
12 <tr class="parity${cnt%2}">
12 <tr class="parity${cnt%2}">
13 <td>
13 <td>
14 <div>
14 <div>
15 <div class="changeset-status-container">
15 <div class="changeset-status-container">
16 %if c.comments.get(cs.raw_id,[]):
16 %if c.comments.get(cs.raw_id,[]):
17 <div class="comments-container">
17 <div class="comments-container">
18 <div class="comments-cnt" title="${('comments')}">
18 <div class="comments-cnt" title="${('comments')}">
19 <a href="${h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id,anchor='comment-%s' % c.comments[cs.raw_id][0].comment_id)}">
19 <a href="${h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id,anchor='comment-%s' % c.comments[cs.raw_id][0].comment_id)}">
20 ${len(c.comments[cs.raw_id])}
20 ${len(c.comments[cs.raw_id])}
21 </a>
21 </a>
22 </div>
22 </div>
23 </div>
23 </div>
24 %endif
24 %endif
25 %if c.statuses.get(cs.raw_id):
25 %if c.statuses.get(cs.raw_id):
26 <div class="changeset-status-ico">
26 <div class="changeset-status-ico">
27 %if c.statuses.get(cs.raw_id)[2]:
27 %if c.statuses.get(cs.raw_id)[2]:
28 <a class="tooltip" title="${_('Click to open associated pull request #%s' % c.statuses.get(cs.raw_id)[2])}" href="${h.url('pullrequest_show',repo_name=c.statuses.get(cs.raw_id)[3],pull_request_id=c.statuses.get(cs.raw_id)[2])}">
28 <a class="tooltip" title="${_('Changeset status: %s\nClick to open associated pull request #%s') % (c.statuses.get(cs.raw_id)[0], c.statuses.get(cs.raw_id)[2])}" href="${h.url('pullrequest_show',repo_name=c.statuses.get(cs.raw_id)[3],pull_request_id=c.statuses.get(cs.raw_id)[2])}">
29 <img src="${h.url('/images/icons/flag_status_%s.png' % c.statuses.get(cs.raw_id)[0])}" />
29 <img src="${h.url('/images/icons/flag_status_%s.png' % c.statuses.get(cs.raw_id)[0])}" />
30 </a>
30 </a>
31 %else:
31 %else:
32 <img src="${h.url('/images/icons/flag_status_%s.png' % c.statuses.get(cs.raw_id)[0])}" />
32 <img src="${h.url('/images/icons/flag_status_%s.png' % c.statuses.get(cs.raw_id)[0])}" />
33 %endif
33 %endif
34 </div>
34 </div>
35 %endif
35 %endif
36 </div>
36 </div>
37 <pre><a href="${h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id)}">${h.show_id(cs)}</a></pre>
37 <pre><a href="${h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id)}">${h.show_id(cs)}</a></pre>
38 </div>
38 </div>
39 </td>
39 </td>
40 <td>
40 <td>
41 ${h.urlify_commit(h.truncate(cs.message,50),c.repo_name, h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}
41 ${h.urlify_commit(h.truncate(cs.message,50),c.repo_name, h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}
42 </td>
42 </td>
43 <td><span class="tooltip" title="${h.tooltip(h.fmt_date(cs.date))}">
43 <td><span class="tooltip" title="${h.tooltip(h.fmt_date(cs.date))}">
44 ${h.age(cs.date)}</span>
44 ${h.age(cs.date)}</span>
45 </td>
45 </td>
46 <td title="${cs.author}">${h.person(cs.author)}</td>
46 <td title="${cs.author}">${h.person(cs.author)}</td>
47 <td>
47 <td>
48 %if h.is_hg(c.rhodecode_repo):
48 %if h.is_hg(c.rhodecode_repo):
49 %for book in cs.bookmarks:
49 %for book in cs.bookmarks:
50 <div class="booktag" title="${_('Bookmark %s') % book}">
50 <div class="booktag" title="${_('Bookmark %s') % book}">
51 ${h.link_to(h.shorter(book),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))}
51 ${h.link_to(h.shorter(book),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))}
52 </div>
52 </div>
53 %endfor
53 %endfor
54 %endif
54 %endif
55 %for tag in cs.tags:
55 %for tag in cs.tags:
56 <div class="tagtag" title="${_('Tag %s') % tag}">
56 <div class="tagtag" title="${_('Tag %s') % tag}">
57 ${h.link_to(h.shorter(tag),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))}
57 ${h.link_to(h.shorter(tag),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))}
58 </div>
58 </div>
59 %endfor
59 %endfor
60 %if cs.branch:
60 %if cs.branch:
61 <div class="branchtag" title="${_('Branch %s' % cs.branch)}">
61 <div class="branchtag" title="${_('Branch %s' % cs.branch)}">
62 ${h.link_to(h.shorter(cs.branch),h.url('changelog_home',repo_name=c.repo_name,branch=cs.branch))}
62 ${h.link_to(h.shorter(cs.branch),h.url('changelog_home',repo_name=c.repo_name,branch=cs.branch))}
63 </div>
63 </div>
64 %endif
64 %endif
65 </td>
65 </td>
66 </tr>
66 </tr>
67 %endfor
67 %endfor
68
68
69 </table>
69 </table>
70
70
71 <script type="text/javascript">
71 <script type="text/javascript">
72 YUE.onDOMReady(function(){
72 YUE.onDOMReady(function(){
73 YUE.delegate("shortlog_data","click",function(e, matchedEl, container){
73 YUE.delegate("shortlog_data","click",function(e, matchedEl, container){
74 ypjax(e.target.href,"shortlog_data",function(){tooltip_activate();});
74 ypjax(e.target.href,"shortlog_data",function(){tooltip_activate();});
75 YUE.preventDefault(e);
75 YUE.preventDefault(e);
76 },'.pager_link');
76 },'.pager_link');
77 });
77 });
78 </script>
78 </script>
79
79
80 <div class="pagination-wh pagination-left">
80 <div class="pagination-wh pagination-left">
81 ${c.repo_changesets.pager('$link_previous ~2~ $link_next')}
81 ${c.repo_changesets.pager('$link_previous ~2~ $link_next')}
82 </div>
82 </div>
83 %else:
83 %else:
84
84
85 %if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name):
85 %if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name):
86 <h4>${_('Add or upload files directly via RhodeCode')}</h4>
86 <h4>${_('Add or upload files directly via RhodeCode')}</h4>
87 <div style="margin: 20px 30px;">
87 <div style="margin: 20px 30px;">
88 <div id="add_node_id" class="add_node">
88 <div id="add_node_id" class="add_node">
89 <a class="ui-btn" href="${h.url('files_add_home',repo_name=c.repo_name,revision=0,f_path='')}">${_('Add new file')}</a>
89 <a class="ui-btn" href="${h.url('files_add_home',repo_name=c.repo_name,revision=0,f_path='')}">${_('Add new file')}</a>
90 </div>
90 </div>
91 </div>
91 </div>
92 %endif
92 %endif
93
93
94
94
95 <h4>${_('Push new repo')}</h4>
95 <h4>${_('Push new repo')}</h4>
96 <pre>
96 <pre>
97 ${c.rhodecode_repo.alias} clone ${c.clone_repo_url}
97 ${c.rhodecode_repo.alias} clone ${c.clone_repo_url}
98 ${c.rhodecode_repo.alias} add README # add first file
98 ${c.rhodecode_repo.alias} add README # add first file
99 ${c.rhodecode_repo.alias} commit -m "Initial" # commit with message
99 ${c.rhodecode_repo.alias} commit -m "Initial" # commit with message
100 ${c.rhodecode_repo.alias} push ${'origin master' if h.is_git(c.rhodecode_repo) else ''} # push changes back
100 ${c.rhodecode_repo.alias} push ${'origin master' if h.is_git(c.rhodecode_repo) else ''} # push changes back
101 </pre>
101 </pre>
102
102
103 <h4>${_('Existing repository?')}</h4>
103 <h4>${_('Existing repository?')}</h4>
104 <pre>
104 <pre>
105 %if h.is_git(c.rhodecode_repo):
105 %if h.is_git(c.rhodecode_repo):
106 git remote add origin ${c.clone_repo_url}
106 git remote add origin ${c.clone_repo_url}
107 git push -u origin master
107 git push -u origin master
108 %else:
108 %else:
109 hg push ${c.clone_repo_url}
109 hg push ${c.clone_repo_url}
110 %endif
110 %endif
111 </pre>
111 </pre>
112 %endif
112 %endif
@@ -1,41 +1,41 b''
1 ## Changesets table !
1 ## Changesets table !
2 <div class="container">
2 <div class="container">
3 %if not c.cs_ranges:
3 %if not c.cs_ranges:
4 <span class="empty_data">${_('No changesets')}</span>
4 <span class="empty_data">${_('No changesets')}</span>
5 %else:
5 %else:
6 <table class="compare_view_commits noborder">
6 <table class="compare_view_commits noborder">
7 %for cs in reversed(c.cs_ranges):
7 %for cs in reversed(c.cs_ranges):
8 <tr>
8 <tr>
9 <td>
9 <td>
10 %if cs.raw_id in c.statuses:
10 %if cs.raw_id in c.statuses:
11 <div title="${c.statuses[cs.raw_id][1]}" class="changeset-status-ico"><img src="${h.url('/images/icons/flag_status_%s.png' % c.statuses[cs.raw_id][0])}" /></div>
11 <div title="${_('Changeset status: %s') % c.statuses[cs.raw_id][1]}" class="changeset-status-ico"><img src="${h.url('/images/icons/flag_status_%s.png' % c.statuses[cs.raw_id][0])}" /></div>
12 %endif
12 %endif
13 </td>
13 </td>
14 <td><span class="tooltip" title="${h.tooltip(h.age(cs.date))}">${cs.date}</span></td>
14 <td><span class="tooltip" title="${h.tooltip(h.age(cs.date))}">${cs.date}</span></td>
15 <td><div class="gravatar"><img alt="gravatar" src="${h.gravatar_url(h.email_or_none(cs.author),14)}"/></div></td>
15 <td><div class="gravatar"><img alt="gravatar" src="${h.gravatar_url(h.email_or_none(cs.author),14)}"/></div></td>
16 <td><div class="author">${h.person(cs.author)}</div></td>
16 <td><div class="author">${h.person(cs.author)}</div></td>
17 <td>${h.link_to('r%s:%s' % (cs.revision,h.short_id(cs.raw_id)),h.url('changeset_home',repo_name=c.other_repo.repo_name,revision=cs.raw_id))}
17 <td>${h.link_to('r%s:%s' % (cs.revision,h.short_id(cs.raw_id)),h.url('changeset_home',repo_name=c.other_repo.repo_name,revision=cs.raw_id))}
18 %if c.as_form:
18 %if c.as_form:
19 ${h.hidden('revisions',cs.raw_id)}
19 ${h.hidden('revisions',cs.raw_id)}
20 %endif
20 %endif
21 </td>
21 </td>
22 <td>
22 <td>
23 %if cs.branch:
23 %if cs.branch:
24 <span class="branchtag">${cs.branch}</span>
24 <span class="branchtag">${cs.branch}</span>
25 %endif
25 %endif
26 </td>
26 </td>
27 <td><div class="message tooltip" title="${h.tooltip(cs.message)}" style="white-space:normal">${h.urlify_commit(h.shorter(cs.message, 60),c.repo_name)}</div></td>
27 <td><div class="message tooltip" title="${h.tooltip(cs.message)}" style="white-space:normal">${h.urlify_commit(h.shorter(cs.message, 60),c.repo_name)}</div></td>
28 </tr>
28 </tr>
29 %endfor
29 %endfor
30 </table>
30 </table>
31 %if c.ancestor:
31 %if c.ancestor:
32 <span class="ancestor">${_('Ancestor')}:
32 <span class="ancestor">${_('Ancestor')}:
33 ${h.link_to(h.short_id(c.ancestor),h.url('changeset_home',repo_name=c.repo_name,revision=c.ancestor))}
33 ${h.link_to(h.short_id(c.ancestor),h.url('changeset_home',repo_name=c.repo_name,revision=c.ancestor))}
34 </span>
34 </span>
35 %endif
35 %endif
36 %if c.as_form:
36 %if c.as_form:
37 ${h.hidden('ancestor_rev',c.ancestor)}
37 ${h.hidden('ancestor_rev',c.ancestor)}
38 ${h.hidden('merge_rev',c.cs_ranges[-1].raw_id)}
38 ${h.hidden('merge_rev',c.cs_ranges[-1].raw_id)}
39 %endif
39 %endif
40 %endif
40 %endif
41 </div>
41 </div>
General Comments 0
You need to be logged in to leave comments. Login now