##// END OF EJS Templates
commit-page: show phase on commit page....
marcink -
r1675:17141ceb default
parent child Browse files
Show More
@@ -1,331 +1,336 b''
1 1 ## -*- coding: utf-8 -*-
2 2
3 3 <%inherit file="/base/base.mako"/>
4 4 <%namespace name="diff_block" file="/changeset/diff_block.mako"/>
5 5
6 6 <%def name="title()">
7 7 ${_('%s Commit') % c.repo_name} - ${h.show_id(c.commit)}
8 8 %if c.rhodecode_name:
9 9 &middot; ${h.branding(c.rhodecode_name)}
10 10 %endif
11 11 </%def>
12 12
13 13 <%def name="menu_bar_nav()">
14 14 ${self.menu_items(active='repositories')}
15 15 </%def>
16 16
17 17 <%def name="menu_bar_subnav()">
18 18 ${self.repo_menu(active='changelog')}
19 19 </%def>
20 20
21 21 <%def name="main()">
22 22 <script>
23 23 // TODO: marcink switch this to pyroutes
24 24 AJAX_COMMENT_DELETE_URL = "${url('changeset_comment_delete',repo_name=c.repo_name,comment_id='__COMMENT_ID__')}";
25 25 templateContext.commit_data.commit_id = "${c.commit.raw_id}";
26 26 </script>
27 27 <div class="box">
28 28 <div class="title">
29 29 ${self.repo_page_title(c.rhodecode_db_repo)}
30 30 </div>
31 31
32 32 <div id="changeset_compare_view_content" class="summary changeset">
33 33 <div class="summary-detail">
34 34 <div class="summary-detail-header">
35 35 <span class="breadcrumbs files_location">
36 36 <h4>${_('Commit')}
37 37 <code>
38 38 ${h.show_id(c.commit)}
39 % if hasattr(c.commit, 'phase'):
40 <span class="tag phase-${c.commit.phase} tooltip" title="${_('commit phase')}">${c.commit.phase}</span>
41 % endif
39 42 </code>
40 43 </h4>
41 44 </span>
45 <div class="pull-right">
42 46 <span id="parent_link">
43 47 <a href="#" title="${_('Parent Commit')}">${_('Parent')}</a>
44 48 </span>
45 49 |
46 50 <span id="child_link">
47 51 <a href="#" title="${_('Child Commit')}">${_('Child')}</a>
48 52 </span>
49 53 </div>
54 </div>
50 55
51 56 <div class="fieldset">
52 57 <div class="left-label">
53 58 ${_('Description')}:
54 59 </div>
55 60 <div class="right-content">
56 61 <div id="trimmed_message_box" class="commit">${h.urlify_commit_message(c.commit.message,c.repo_name)}</div>
57 62 <div id="message_expand" style="display:none;">
58 63 ${_('Expand')}
59 64 </div>
60 65 </div>
61 66 </div>
62 67
63 68 %if c.statuses:
64 69 <div class="fieldset">
65 70 <div class="left-label">
66 71 ${_('Commit status')}:
67 72 </div>
68 73 <div class="right-content">
69 74 <div class="changeset-status-ico">
70 75 <div class="${'flag_status %s' % c.statuses[0]} pull-left"></div>
71 76 </div>
72 77 <div title="${_('Commit status')}" class="changeset-status-lbl">[${h.commit_status_lbl(c.statuses[0])}]</div>
73 78 </div>
74 79 </div>
75 80 %endif
76 81
77 82 <div class="fieldset">
78 83 <div class="left-label">
79 84 ${_('References')}:
80 85 </div>
81 86 <div class="right-content">
82 87 <div class="tags">
83 88
84 89 %if c.commit.merge:
85 90 <span class="mergetag tag">
86 91 <i class="icon-merge"></i>${_('merge')}
87 92 </span>
88 93 %endif
89 94
90 95 %if h.is_hg(c.rhodecode_repo):
91 96 %for book in c.commit.bookmarks:
92 97 <span class="booktag tag" title="${_('Bookmark %s') % book}">
93 98 <a href="${h.url('files_home',repo_name=c.repo_name,revision=c.commit.raw_id)}"><i class="icon-bookmark"></i>${h.shorter(book)}</a>
94 99 </span>
95 100 %endfor
96 101 %endif
97 102
98 103 %for tag in c.commit.tags:
99 104 <span class="tagtag tag" title="${_('Tag %s') % tag}">
100 105 <a href="${h.url('files_home',repo_name=c.repo_name,revision=c.commit.raw_id)}"><i class="icon-tag"></i>${tag}</a>
101 106 </span>
102 107 %endfor
103 108
104 109 %if c.commit.branch:
105 110 <span class="branchtag tag" title="${_('Branch %s') % c.commit.branch}">
106 111 <a href="${h.url('files_home',repo_name=c.repo_name,revision=c.commit.raw_id)}"><i class="icon-code-fork"></i>${h.shorter(c.commit.branch)}</a>
107 112 </span>
108 113 %endif
109 114 </div>
110 115 </div>
111 116 </div>
112 117
113 118 <div class="fieldset">
114 119 <div class="left-label">
115 120 ${_('Diff options')}:
116 121 </div>
117 122 <div class="right-content">
118 123 <div class="diff-actions">
119 124 <a href="${h.url('changeset_raw_home',repo_name=c.repo_name,revision=c.commit.raw_id)}" class="tooltip" title="${h.tooltip(_('Raw diff'))}">
120 125 ${_('Raw Diff')}
121 126 </a>
122 127 |
123 128 <a href="${h.url('changeset_patch_home',repo_name=c.repo_name,revision=c.commit.raw_id)}" class="tooltip" title="${h.tooltip(_('Patch diff'))}">
124 129 ${_('Patch Diff')}
125 130 </a>
126 131 |
127 132 <a href="${h.url('changeset_download_home',repo_name=c.repo_name,revision=c.commit.raw_id,diff='download')}" class="tooltip" title="${h.tooltip(_('Download diff'))}">
128 133 ${_('Download Diff')}
129 134 </a>
130 135 |
131 136 ${c.ignorews_url(request.GET)}
132 137 |
133 138 ${c.context_url(request.GET)}
134 139 </div>
135 140 </div>
136 141 </div>
137 142
138 143 <div class="fieldset">
139 144 <div class="left-label">
140 145 ${_('Comments')}:
141 146 </div>
142 147 <div class="right-content">
143 148 <div class="comments-number">
144 149 %if c.comments:
145 150 <a href="#comments">${ungettext("%d Commit comment", "%d Commit comments", len(c.comments)) % len(c.comments)}</a>,
146 151 %else:
147 152 ${ungettext("%d Commit comment", "%d Commit comments", len(c.comments)) % len(c.comments)}
148 153 %endif
149 154 %if c.inline_cnt:
150 155 <a href="#" onclick="return Rhodecode.comments.nextComment();" id="inline-comments-counter">${ungettext("%d Inline Comment", "%d Inline Comments", c.inline_cnt) % c.inline_cnt}</a>
151 156 %else:
152 157 ${ungettext("%d Inline Comment", "%d Inline Comments", c.inline_cnt) % c.inline_cnt}
153 158 %endif
154 159 </div>
155 160 </div>
156 161 </div>
157 162
158 163 <div class="fieldset">
159 164 <div class="left-label">
160 165 ${_('Unresolved TODOs')}:
161 166 </div>
162 167 <div class="right-content">
163 168 <div class="comments-number">
164 169 % if c.unresolved_comments:
165 170 % for co in c.unresolved_comments:
166 171 <a class="permalink" href="#comment-${co.comment_id}" onclick="Rhodecode.comments.scrollToComment($('#comment-${co.comment_id}'))"> #${co.comment_id}</a>${'' if loop.last else ','}
167 172 % endfor
168 173 % else:
169 174 ${_('There are no unresolved TODOs')}
170 175 % endif
171 176 </div>
172 177 </div>
173 178 </div>
174 179
175 180 </div> <!-- end summary-detail -->
176 181
177 182 <div id="commit-stats" class="sidebar-right">
178 183 <div class="summary-detail-header">
179 184 <h4 class="item">
180 185 ${_('Author')}
181 186 </h4>
182 187 </div>
183 188 <div class="sidebar-right-content">
184 189 ${self.gravatar_with_user(c.commit.author)}
185 190 <div class="user-inline-data">- ${h.age_component(c.commit.date)}</div>
186 191 </div>
187 192 </div><!-- end sidebar -->
188 193 </div> <!-- end summary -->
189 194 <div class="cs_files">
190 195 <%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/>
191 196 ${cbdiffs.render_diffset_menu()}
192 197 ${cbdiffs.render_diffset(
193 198 c.changes[c.commit.raw_id], commit=c.commit, use_comments=True)}
194 199 </div>
195 200
196 201 ## template for inline comment form
197 202 <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/>
198 203
199 204 ## render comments
200 205 ${comment.generate_comments(c.comments)}
201 206
202 207 ## main comment form and it status
203 208 ${comment.comments(h.url('changeset_comment', repo_name=c.repo_name, revision=c.commit.raw_id),
204 209 h.commit_status(c.rhodecode_db_repo, c.commit.raw_id))}
205 210 </div>
206 211
207 212 ## FORM FOR MAKING JS ACTION AS CHANGESET COMMENTS
208 213 <script type="text/javascript">
209 214
210 215 $(document).ready(function() {
211 216
212 217 var boxmax = parseInt($('#trimmed_message_box').css('max-height'), 10);
213 218 if($('#trimmed_message_box').height() === boxmax){
214 219 $('#message_expand').show();
215 220 }
216 221
217 222 $('#message_expand').on('click', function(e){
218 223 $('#trimmed_message_box').css('max-height', 'none');
219 224 $(this).hide();
220 225 });
221 226
222 227 $('.show-inline-comments').on('click', function(e){
223 228 var boxid = $(this).attr('data-comment-id');
224 229 var button = $(this);
225 230
226 231 if(button.hasClass("comments-visible")) {
227 232 $('#{0} .inline-comments'.format(boxid)).each(function(index){
228 233 $(this).hide();
229 234 });
230 235 button.removeClass("comments-visible");
231 236 } else {
232 237 $('#{0} .inline-comments'.format(boxid)).each(function(index){
233 238 $(this).show();
234 239 });
235 240 button.addClass("comments-visible");
236 241 }
237 242 });
238 243
239 244
240 245 // next links
241 246 $('#child_link').on('click', function(e){
242 247 // fetch via ajax what is going to be the next link, if we have
243 248 // >1 links show them to user to choose
244 249 if(!$('#child_link').hasClass('disabled')){
245 250 $.ajax({
246 251 url: '${h.url('changeset_children',repo_name=c.repo_name, revision=c.commit.raw_id)}',
247 252 success: function(data) {
248 253 if(data.results.length === 0){
249 254 $('#child_link').html("${_('No Child Commits')}").addClass('disabled');
250 255 }
251 256 if(data.results.length === 1){
252 257 var commit = data.results[0];
253 258 window.location = pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': commit.raw_id});
254 259 }
255 260 else if(data.results.length === 2){
256 261 $('#child_link').addClass('disabled');
257 262 $('#child_link').addClass('double');
258 263 var _html = '';
259 264 _html +='<a title="__title__" href="__url__">__rev__</a> '
260 265 .replace('__rev__','r{0}:{1}'.format(data.results[0].revision, data.results[0].raw_id.substr(0,6)))
261 266 .replace('__title__', data.results[0].message)
262 267 .replace('__url__', pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': data.results[0].raw_id}));
263 268 _html +=' | ';
264 269 _html +='<a title="__title__" href="__url__">__rev__</a> '
265 270 .replace('__rev__','r{0}:{1}'.format(data.results[1].revision, data.results[1].raw_id.substr(0,6)))
266 271 .replace('__title__', data.results[1].message)
267 272 .replace('__url__', pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': data.results[1].raw_id}));
268 273 $('#child_link').html(_html);
269 274 }
270 275 }
271 276 });
272 277 e.preventDefault();
273 278 }
274 279 });
275 280
276 281 // prev links
277 282 $('#parent_link').on('click', function(e){
278 283 // fetch via ajax what is going to be the next link, if we have
279 284 // >1 links show them to user to choose
280 285 if(!$('#parent_link').hasClass('disabled')){
281 286 $.ajax({
282 287 url: '${h.url("changeset_parents",repo_name=c.repo_name, revision=c.commit.raw_id)}',
283 288 success: function(data) {
284 289 if(data.results.length === 0){
285 290 $('#parent_link').html('${_('No Parent Commits')}').addClass('disabled');
286 291 }
287 292 if(data.results.length === 1){
288 293 var commit = data.results[0];
289 294 window.location = pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': commit.raw_id});
290 295 }
291 296 else if(data.results.length === 2){
292 297 $('#parent_link').addClass('disabled');
293 298 $('#parent_link').addClass('double');
294 299 var _html = '';
295 300 _html +='<a title="__title__" href="__url__">Parent __rev__</a>'
296 301 .replace('__rev__','r{0}:{1}'.format(data.results[0].revision, data.results[0].raw_id.substr(0,6)))
297 302 .replace('__title__', data.results[0].message)
298 303 .replace('__url__', pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': data.results[0].raw_id}));
299 304 _html +=' | ';
300 305 _html +='<a title="__title__" href="__url__">Parent __rev__</a>'
301 306 .replace('__rev__','r{0}:{1}'.format(data.results[1].revision, data.results[1].raw_id.substr(0,6)))
302 307 .replace('__title__', data.results[1].message)
303 308 .replace('__url__', pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}','revision': data.results[1].raw_id}));
304 309 $('#parent_link').html(_html);
305 310 }
306 311 }
307 312 });
308 313 e.preventDefault();
309 314 }
310 315 });
311 316
312 317 if (location.hash) {
313 318 var result = splitDelimitedHash(location.hash);
314 319 var line = $('html').find(result.loc);
315 320 if (line.length > 0){
316 321 offsetScroll(line, 70);
317 322 }
318 323 }
319 324
320 325 // browse tree @ revision
321 326 $('#files_link').on('click', function(e){
322 327 window.location = '${h.url('files_home',repo_name=c.repo_name, revision=c.commit.raw_id, f_path='')}';
323 328 e.preventDefault();
324 329 });
325 330
326 331 // inject comments into their proper positions
327 332 var file_comments = $('.inline-comment-placeholder');
328 333 })
329 334 </script>
330 335
331 336 </%def>
General Comments 0
You need to be logged in to leave comments. Login now