##// END OF EJS Templates
ui: add arrow navigation for parent/child in changelog view....
marcink -
r2884:7ca400b0 default
parent child Browse files
Show More
@@ -1,157 +1,161 b''
1 1 @font-face {
2 2 font-family: 'rcicons';
3 3 src: url('../fonts/RCIcons/rcicons.eot?74666722');
4 4 src: url('../fonts/RCIcons/rcicons.eot?74666722#iefix') format('embedded-opentype'),
5 5 url('../fonts/RCIcons/rcicons.woff2?74666722') format('woff2'),
6 6 url('../fonts/RCIcons/rcicons.woff?74666722') format('woff'),
7 7 url('../fonts/RCIcons/rcicons.ttf?74666722') format('truetype'),
8 8 url('../fonts/RCIcons/rcicons.svg?74666722#rcicons') format('svg');
9 9 font-weight: normal;
10 10 font-style: normal;
11 11 }
12 12 /* Chrome hack: SVG is rendered more smooth in Windozze. 100% magic, uncomment if you need it. */
13 13 /* Note, that will break hinting! In other OS-es font will be not as sharp as it could be */
14 14 /*
15 15 @media screen and (-webkit-min-device-pixel-ratio:0) {
16 16 @font-face {
17 17 font-family: 'rcicons';
18 18 src: url('../fonts/RCIcons/rcicons.svg?74666722#rcicons') format('svg');
19 19 }
20 20 }
21 21 */
22 22
23 23 [class^="icon-"]:before, [class*=" icon-"]:before {
24 24 font-family: "rcicons";
25 25 font-style: normal;
26 26 font-weight: normal;
27 27 speak: none;
28 28
29 29 display: inline-block;
30 30 text-decoration: inherit;
31 31 width: 1em;
32 32 margin-right: .2em;
33 33 text-align: center;
34 34 /* opacity: .8; */
35 35
36 36 /* For safety - reset parent styles, that can break glyph codes*/
37 37 font-variant: normal;
38 38 text-transform: none;
39 39
40 40 /* fix buttons height, for twitter bootstrap */
41 41 line-height: 1em;
42 42
43 43 /* Animation center compensation - margins should be symmetric */
44 44 /* remove if not needed */
45 45 margin-left: .2em;
46 46
47 47 /* you can be more comfortable with increased icons size */
48 48 /* font-size: 120%; */
49 49
50 50 /* Font smoothing. That was taken from TWBS */
51 51 -webkit-font-smoothing: antialiased;
52 52 -moz-osx-font-smoothing: grayscale;
53 53
54 54 /* Uncomment for 3D effect */
55 55 /* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
56 56 }
57 57
58 .icon-no-margin::before {
59 margin: 0;
60
61 }
58 62 // -- ICON CLASSES -- //
59 63
60 64 .icon-bookmark:before { content: '\e803'; } /* 'ξ ƒ' */
61 65 .icon-branch:before { content: '\e804'; } /* 'ξ „' */
62 66 .icon-lock:before { content: '\e806'; } /* 'ξ †' */
63 67 .icon-unlock:before { content: '\e807'; } /* 'ξ ‡' */
64 68 .icon-delete:before { content: '\e808'; } /* '' */
65 69 .icon-false:before { content: '\e808'; } /* '' */
66 70
67 71 .icon-ok:before { content: '\e809'; } /* 'ξ ‰' */
68 72 .icon-true:before { content: '\e809'; } /* 'ξ ‰' */
69 73
70 74 .icon-comment:before { content: '\e80a'; } /* '' */
71 75 .icon-comment-add:before { content: '\e816'; } /* 'ξ –' */
72 76 .icon-comment_toggle:before { content: '\e818'; } /* '' */
73 77
74 78 .icon-feed:before { content: '\e80b'; } /* 'ξ ‹' */
75 79
76 80 .icon-right:before { content: '\e80c'; } /* '' */
77 81 .icon-left:before { content: '\e80d'; } /* '' */
78 82
79 83 .icon-arrow_down:before { content: '\e80e'; } /* '' */
80 84 .icon-arrow_up:before { content: '\e80e'; } /* '' */
81 85
82 86 .icon-group:before { content: '\e812'; } /* 'ξ ’' */
83 87
84 88 .icon-fork:before { content: '\e814'; } /* 'ξ ”' */
85 89 .icon-merge:before { content: '\e814'; } /* 'ξ ”' */
86 90
87 91 .icon-more:before { content: '\e815'; } /* 'ξ •' */
88 92
89 93 .icon-git-inv:before { content: '\e80f'; } /* '' */
90 94 .icon-hg-inv:before { content: '\e810'; } /* '' */
91 95 .icon-svn-inv:before { content: '\e811'; } /* 'ξ ‘' */
92 96
93 97 .icon-git:before { content: '\e81a'; } /* '' */
94 98 .icon-hg:before { content: '\e81b'; } /* 'ξ ›' */
95 99 .icon-svn:before { content: '\e820'; } /* 'ξ  ' */
96 100
97 101 .icon-minus:before { content: '\e81c'; } /* '' */
98 102 .icon-plus:before { content: '\e81d'; } /* '' */
99 103 .icon-remove:before { content: '\e81e'; } /* '' */
100 104 .icon-remove-sign:before { content: '\e81e'; } /* '' */
101 105
102 106 .icon-rhodecode:before { content: '\e81f'; } /* '' */
103 107
104 108 .icon-tag:before { content: '\e821'; } /* 'ξ ‘' */
105 109 .icon-copy:before { content: '\f0c5'; } /* 'οƒ…' */
106 110 .icon-clipboard:before { content: '\f0c5'; } /* 'οƒ…' */
107 111
108 112
109 113 .icon-folder:before { content: '\e813'; } /* 'ξ “' */
110 114 .icon-folder-close:before { content: '\e813'; } /* 'ξ “' */
111 115
112 116 .icon-directory:before { content: '\e800'; } /* 'ξ €' */
113 117 .icon-directory-empty:before { content: '\f114'; } /* 'ο„”' */
114 118 .icon-file-text:before { content: '\f0f6'; } /* 'οƒΆ' */
115 119 .icon-file-text-inv:before { content: '\f15c'; } /* 'ο…œ' */
116 120 .icon-file-code:before { content: '\f1c9'; } /* '' */
117 121
118 122 // MERGED ICONS
119 123
120 124 .icon-repo-private:before { &:extend(.icon-lock:before); }
121 125 .icon-repo-lock:before { &:extend(.icon-lock:before); }
122 126 .icon-unlock-alt:before { &:extend(.icon-unlock:before); }
123 127 .icon-repo-unlock:before { &:extend(.icon-unlock:before); }
124 128 .icon-repo-public:before { &:extend(.icon-unlock:before); }
125 129 .icon-rss-sign:before { &:extend(.icon-feed:before); }
126 130 .icon-code-fork:before { &:extend(.icon-fork:before); }
127 131
128 132 // TRANSFORM
129 133 .icon-arrow_up:before {transform: rotate(180deg);}
130 134 .icon-merge:before {transform: rotate(180deg);}
131 135
132 136 // -- END ICON CLASSES -- //
133 137
134 138
135 139 //--- ICONS STYLING ------------------//
136 140
137 141 .icon-git { color: @color4 !important; }
138 142 .icon-hg { color: @color8 !important; }
139 143 .icon-svn { color: @color1 !important; }
140 144 .icon-git-inv { color: @color4 !important; }
141 145 .icon-hg-inv { color: @color8 !important; }
142 146 .icon-svn-inv { color: @color1 !important; }
143 147 .icon-repo-lock { color: #FF0000; }
144 148 .icon-repo-unlock { color: #FF0000; }
145 149
146 150 .repo-switcher-dropdown .select2-result-label {
147 151 .icon-git:before {
148 152 &:extend(.icon-git-transparent:before);
149 153 }
150 154 .icon-hg:before {
151 155 &:extend(.icon-hg-transparent:before);
152 156 color: @alert4;
153 157 }
154 158 .icon-svn:before {
155 159 &:extend(.icon-svn-transparent:before);
156 160 }
157 161 }
@@ -1,354 +1,354 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 = "${h.route_path('repo_commit_comment_delete',repo_name=c.repo_name,commit_id=c.commit.raw_id,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 <div class="breadcrumbs files_location">
36 36 <h4>
37 37 ${_('Commit')}
38 38
39 39 <code>
40 40 ${h.show_id(c.commit)}
41 41 </code>
42 42 <i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${c.commit.raw_id}" title="${_('Copy the full commit id')}"></i>
43 43 % if hasattr(c.commit, 'phase'):
44 44 <span class="tag phase-${c.commit.phase} tooltip" title="${_('Commit phase')}">${c.commit.phase}</span>
45 45 % endif
46 46
47 47 ## obsolete commits
48 48 % if hasattr(c.commit, 'obsolete'):
49 49 % if c.commit.obsolete:
50 50 <span class="tag obsolete-${c.commit.obsolete} tooltip" title="${_('Evolve State')}">${_('obsolete')}</span>
51 51 % endif
52 52 % endif
53 53
54 54 ## hidden commits
55 55 % if hasattr(c.commit, 'hidden'):
56 56 % if c.commit.hidden:
57 57 <span class="tag hidden-${c.commit.hidden} tooltip" title="${_('Evolve State')}">${_('hidden')}</span>
58 58 % endif
59 59 % endif
60 60 </h4>
61 61
62 62 </div>
63 63 <div class="pull-right">
64 64 <span id="parent_link">
65 <a href="#parentCommit" title="${_('Parent Commit')}">${_('Parent')}</a>
65 <a href="#parentCommit" title="${_('Parent Commit')}"><i class="icon-left icon-no-margin"></i>${_('parent')}</a>
66 66 </span>
67 67 |
68 68 <span id="child_link">
69 <a href="#childCommit" title="${_('Child Commit')}">${_('Child')}</a>
69 <a href="#childCommit" title="${_('Child Commit')}">${_('child')}<i class="icon-right icon-no-margin"></i></a>
70 70 </span>
71 71 </div>
72 72 </div>
73 73
74 74 <div class="fieldset">
75 75 <div class="left-label">
76 76 ${_('Description')}:
77 77 </div>
78 78 <div class="right-content">
79 79 <div id="trimmed_message_box" class="commit">${h.urlify_commit_message(c.commit.message,c.repo_name)}</div>
80 80 <div id="message_expand" style="display:none;">
81 81 ${_('Expand')}
82 82 </div>
83 83 </div>
84 84 </div>
85 85
86 86 %if c.statuses:
87 87 <div class="fieldset">
88 88 <div class="left-label">
89 89 ${_('Commit status')}:
90 90 </div>
91 91 <div class="right-content">
92 92 <div class="changeset-status-ico">
93 93 <div class="${'flag_status %s' % c.statuses[0]} pull-left"></div>
94 94 </div>
95 95 <div title="${_('Commit status')}" class="changeset-status-lbl">[${h.commit_status_lbl(c.statuses[0])}]</div>
96 96 </div>
97 97 </div>
98 98 %endif
99 99
100 100 <div class="fieldset">
101 101 <div class="left-label">
102 102 ${_('References')}:
103 103 </div>
104 104 <div class="right-content">
105 105 <div class="tags">
106 106
107 107 %if c.commit.merge:
108 108 <span class="mergetag tag">
109 109 <i class="icon-merge"></i>${_('merge')}
110 110 </span>
111 111 %endif
112 112
113 113 %if h.is_hg(c.rhodecode_repo):
114 114 %for book in c.commit.bookmarks:
115 115 <span class="booktag tag" title="${h.tooltip(_('Bookmark %s') % book)}">
116 116 <a href="${h.route_path('repo_files:default_path',repo_name=c.repo_name,commit_id=c.commit.raw_id,_query=dict(at=book))}"><i class="icon-bookmark"></i>${h.shorter(book)}</a>
117 117 </span>
118 118 %endfor
119 119 %endif
120 120
121 121 %for tag in c.commit.tags:
122 122 <span class="tagtag tag" title="${h.tooltip(_('Tag %s') % tag)}">
123 123 <a href="${h.route_path('repo_files:default_path',repo_name=c.repo_name,commit_id=c.commit.raw_id,_query=dict(at=tag))}"><i class="icon-tag"></i>${tag}</a>
124 124 </span>
125 125 %endfor
126 126
127 127 %if c.commit.branch:
128 128 <span class="branchtag tag" title="${h.tooltip(_('Branch %s') % c.commit.branch)}">
129 129 <a href="${h.route_path('repo_files:default_path',repo_name=c.repo_name,commit_id=c.commit.raw_id,_query=dict(at=c.commit.branch))}"><i class="icon-code-fork"></i>${h.shorter(c.commit.branch)}</a>
130 130 </span>
131 131 %endif
132 132 </div>
133 133 </div>
134 134 </div>
135 135
136 136 <div class="fieldset">
137 137 <div class="left-label">
138 138 ${_('Diff options')}:
139 139 </div>
140 140 <div class="right-content">
141 141 <div class="diff-actions">
142 142 <a href="${h.route_path('repo_commit_raw',repo_name=c.repo_name,commit_id=c.commit.raw_id)}" class="tooltip" title="${h.tooltip(_('Raw diff'))}">
143 143 ${_('Raw Diff')}
144 144 </a>
145 145 |
146 146 <a href="${h.route_path('repo_commit_patch',repo_name=c.repo_name,commit_id=c.commit.raw_id)}" class="tooltip" title="${h.tooltip(_('Patch diff'))}">
147 147 ${_('Patch Diff')}
148 148 </a>
149 149 |
150 150 <a href="${h.route_path('repo_commit_download',repo_name=c.repo_name,commit_id=c.commit.raw_id,_query=dict(diff='download'))}" class="tooltip" title="${h.tooltip(_('Download diff'))}">
151 151 ${_('Download Diff')}
152 152 </a>
153 153 |
154 154 ${c.ignorews_url(request)}
155 155 |
156 156 ${c.context_url(request)}
157 157 </div>
158 158 </div>
159 159 </div>
160 160
161 161 <div class="fieldset">
162 162 <div class="left-label">
163 163 ${_('Comments')}:
164 164 </div>
165 165 <div class="right-content">
166 166 <div class="comments-number">
167 167 %if c.comments:
168 168 <a href="#comments">${_ungettext("%d Commit comment", "%d Commit comments", len(c.comments)) % len(c.comments)}</a>,
169 169 %else:
170 170 ${_ungettext("%d Commit comment", "%d Commit comments", len(c.comments)) % len(c.comments)}
171 171 %endif
172 172 %if c.inline_cnt:
173 173 <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>
174 174 %else:
175 175 ${_ungettext("%d Inline Comment", "%d Inline Comments", c.inline_cnt) % c.inline_cnt}
176 176 %endif
177 177 </div>
178 178 </div>
179 179 </div>
180 180
181 181 <div class="fieldset">
182 182 <div class="left-label">
183 183 ${_('Unresolved TODOs')}:
184 184 </div>
185 185 <div class="right-content">
186 186 <div class="comments-number">
187 187 % if c.unresolved_comments:
188 188 % for co in c.unresolved_comments:
189 189 <a class="permalink" href="#comment-${co.comment_id}" onclick="Rhodecode.comments.scrollToComment($('#comment-${co.comment_id}'))"> #${co.comment_id}</a>${'' if loop.last else ','}
190 190 % endfor
191 191 % else:
192 192 ${_('There are no unresolved TODOs')}
193 193 % endif
194 194 </div>
195 195 </div>
196 196 </div>
197 197
198 198 </div> <!-- end summary-detail -->
199 199
200 200 <div id="commit-stats" class="sidebar-right">
201 201 <div class="summary-detail-header">
202 202 <h4 class="item">
203 203 ${_('Author')}
204 204 </h4>
205 205 </div>
206 206 <div class="sidebar-right-content">
207 207 ${self.gravatar_with_user(c.commit.author)}
208 208 <div class="user-inline-data">- ${h.age_component(c.commit.date)}</div>
209 209 </div>
210 210 </div><!-- end sidebar -->
211 211 </div> <!-- end summary -->
212 212 <div class="cs_files">
213 213 <%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/>
214 214 ${cbdiffs.render_diffset_menu()}
215 215 ${cbdiffs.render_diffset(
216 216 c.changes[c.commit.raw_id], commit=c.commit, use_comments=True,inline_comments=c.inline_comments )}
217 217 </div>
218 218
219 219 ## template for inline comment form
220 220 <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/>
221 221
222 222 ## render comments
223 223 ${comment.generate_comments(c.comments)}
224 224
225 225 ## main comment form and it status
226 226 ${comment.comments(h.route_path('repo_commit_comment_create', repo_name=c.repo_name, commit_id=c.commit.raw_id),
227 227 h.commit_status(c.rhodecode_db_repo, c.commit.raw_id))}
228 228 </div>
229 229
230 230 ## FORM FOR MAKING JS ACTION AS CHANGESET COMMENTS
231 231 <script type="text/javascript">
232 232
233 233 $(document).ready(function() {
234 234
235 235 var boxmax = parseInt($('#trimmed_message_box').css('max-height'), 10);
236 236 if($('#trimmed_message_box').height() === boxmax){
237 237 $('#message_expand').show();
238 238 }
239 239
240 240 $('#message_expand').on('click', function(e){
241 241 $('#trimmed_message_box').css('max-height', 'none');
242 242 $(this).hide();
243 243 });
244 244
245 245 $('.show-inline-comments').on('click', function(e){
246 246 var boxid = $(this).attr('data-comment-id');
247 247 var button = $(this);
248 248
249 249 if(button.hasClass("comments-visible")) {
250 250 $('#{0} .inline-comments'.format(boxid)).each(function(index){
251 251 $(this).hide();
252 252 });
253 253 button.removeClass("comments-visible");
254 254 } else {
255 255 $('#{0} .inline-comments'.format(boxid)).each(function(index){
256 256 $(this).show();
257 257 });
258 258 button.addClass("comments-visible");
259 259 }
260 260 });
261 261
262 262
263 263 // next links
264 264 $('#child_link').on('click', function(e){
265 265 // fetch via ajax what is going to be the next link, if we have
266 266 // >1 links show them to user to choose
267 267 if(!$('#child_link').hasClass('disabled')){
268 268 $.ajax({
269 269 url: '${h.route_path('repo_commit_children',repo_name=c.repo_name, commit_id=c.commit.raw_id)}',
270 270 success: function(data) {
271 271 if(data.results.length === 0){
272 272 $('#child_link').html("${_('No Child Commits')}").addClass('disabled');
273 273 }
274 274 if(data.results.length === 1){
275 275 var commit = data.results[0];
276 276 window.location = pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': commit.raw_id});
277 277 }
278 278 else if(data.results.length === 2){
279 279 $('#child_link').addClass('disabled');
280 280 $('#child_link').addClass('double');
281 281 var _html = '';
282 282 _html +='<a title="__title__" href="__url__">__rev__</a> '
283 283 .replace('__rev__','r{0}:{1}'.format(data.results[0].revision, data.results[0].raw_id.substr(0,6)))
284 284 .replace('__title__', data.results[0].message)
285 285 .replace('__url__', pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': data.results[0].raw_id}));
286 286 _html +=' | ';
287 287 _html +='<a title="__title__" href="__url__">__rev__</a> '
288 288 .replace('__rev__','r{0}:{1}'.format(data.results[1].revision, data.results[1].raw_id.substr(0,6)))
289 289 .replace('__title__', data.results[1].message)
290 290 .replace('__url__', pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': data.results[1].raw_id}));
291 291 $('#child_link').html(_html);
292 292 }
293 293 }
294 294 });
295 295 e.preventDefault();
296 296 }
297 297 });
298 298
299 299 // prev links
300 300 $('#parent_link').on('click', function(e){
301 301 // fetch via ajax what is going to be the next link, if we have
302 302 // >1 links show them to user to choose
303 303 if(!$('#parent_link').hasClass('disabled')){
304 304 $.ajax({
305 305 url: '${h.route_path("repo_commit_parents",repo_name=c.repo_name, commit_id=c.commit.raw_id)}',
306 306 success: function(data) {
307 307 if(data.results.length === 0){
308 308 $('#parent_link').html('${_('No Parent Commits')}').addClass('disabled');
309 309 }
310 310 if(data.results.length === 1){
311 311 var commit = data.results[0];
312 312 window.location = pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': commit.raw_id});
313 313 }
314 314 else if(data.results.length === 2){
315 315 $('#parent_link').addClass('disabled');
316 316 $('#parent_link').addClass('double');
317 317 var _html = '';
318 318 _html +='<a title="__title__" href="__url__">Parent __rev__</a>'
319 319 .replace('__rev__','r{0}:{1}'.format(data.results[0].revision, data.results[0].raw_id.substr(0,6)))
320 320 .replace('__title__', data.results[0].message)
321 321 .replace('__url__', pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': data.results[0].raw_id}));
322 322 _html +=' | ';
323 323 _html +='<a title="__title__" href="__url__">Parent __rev__</a>'
324 324 .replace('__rev__','r{0}:{1}'.format(data.results[1].revision, data.results[1].raw_id.substr(0,6)))
325 325 .replace('__title__', data.results[1].message)
326 326 .replace('__url__', pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': data.results[1].raw_id}));
327 327 $('#parent_link').html(_html);
328 328 }
329 329 }
330 330 });
331 331 e.preventDefault();
332 332 }
333 333 });
334 334
335 335 if (location.hash) {
336 336 var result = splitDelimitedHash(location.hash);
337 337 var line = $('html').find(result.loc);
338 338 if (line.length > 0){
339 339 offsetScroll(line, 70);
340 340 }
341 341 }
342 342
343 343 // browse tree @ revision
344 344 $('#files_link').on('click', function(e){
345 345 window.location = '${h.route_path('repo_files:default_path',repo_name=c.repo_name, commit_id=c.commit.raw_id)}';
346 346 e.preventDefault();
347 347 });
348 348
349 349 // inject comments into their proper positions
350 350 var file_comments = $('.inline-comment-placeholder');
351 351 })
352 352 </script>
353 353
354 354 </%def>
General Comments 0
You need to be logged in to leave comments. Login now