Show More
@@ -1,302 +1,302 b'' | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 |
|
2 | |||
3 | <%inherit file="/base/base.mako"/> |
|
3 | <%inherit file="/base/base.mako"/> | |
4 | <%namespace name="base" file="/base/base.mako"/> |
|
4 | <%namespace name="base" file="/base/base.mako"/> | |
5 | <%namespace name="diff_block" file="/changeset/diff_block.mako"/> |
|
5 | <%namespace name="diff_block" file="/changeset/diff_block.mako"/> | |
6 | <%namespace name="file_base" file="/files/base.mako"/> |
|
6 | <%namespace name="file_base" file="/files/base.mako"/> | |
7 |
|
7 | |||
8 | <%def name="title()"> |
|
8 | <%def name="title()"> | |
9 | ${_('{} Commit').format(c.repo_name)} - ${h.show_id(c.commit)} |
|
9 | ${_('{} Commit').format(c.repo_name)} - ${h.show_id(c.commit)} | |
10 | %if c.rhodecode_name: |
|
10 | %if c.rhodecode_name: | |
11 | · ${h.branding(c.rhodecode_name)} |
|
11 | · ${h.branding(c.rhodecode_name)} | |
12 | %endif |
|
12 | %endif | |
13 | </%def> |
|
13 | </%def> | |
14 |
|
14 | |||
15 | <%def name="menu_bar_nav()"> |
|
15 | <%def name="menu_bar_nav()"> | |
16 | ${self.menu_items(active='repositories')} |
|
16 | ${self.menu_items(active='repositories')} | |
17 | </%def> |
|
17 | </%def> | |
18 |
|
18 | |||
19 | <%def name="menu_bar_subnav()"> |
|
19 | <%def name="menu_bar_subnav()"> | |
20 | ${self.repo_menu(active='commits')} |
|
20 | ${self.repo_menu(active='commits')} | |
21 | </%def> |
|
21 | </%def> | |
22 |
|
22 | |||
23 | <%def name="main()"> |
|
23 | <%def name="main()"> | |
24 | <script type="text/javascript"> |
|
24 | <script type="text/javascript"> | |
25 | // TODO: marcink switch this to pyroutes |
|
25 | // TODO: marcink switch this to pyroutes | |
26 | 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__')}"; |
|
26 | 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__')}"; | |
27 | templateContext.commit_data.commit_id = "${c.commit.raw_id}"; |
|
27 | templateContext.commit_data.commit_id = "${c.commit.raw_id}"; | |
28 | </script> |
|
28 | </script> | |
29 |
|
29 | |||
30 | <div class="box"> |
|
30 | <div class="box"> | |
31 |
|
31 | |||
32 | <div class="summary"> |
|
32 | <div class="summary"> | |
33 |
|
33 | |||
34 | <div class="fieldset"> |
|
34 | <div class="fieldset"> | |
35 | <div class="left-content"> |
|
35 | <div class="left-content"> | |
36 | <% |
|
36 | <% | |
37 | rc_user = h.discover_user(c.commit.author_email) |
|
37 | rc_user = h.discover_user(c.commit.author_email) | |
38 | %> |
|
38 | %> | |
39 | <div class="left-content-avatar"> |
|
39 | <div class="left-content-avatar"> | |
40 | ${base.gravatar(c.commit.author_email, 30, tooltip=True, user=rc_user)} |
|
40 | ${base.gravatar(c.commit.author_email, 30, tooltip=(True if rc_user else False), user=rc_user)} | |
41 | </div> |
|
41 | </div> | |
42 |
|
42 | |||
43 | <div class="left-content-message"> |
|
43 | <div class="left-content-message"> | |
44 | <div class="fieldset collapsable-content no-hide" data-toggle="summary-details"> |
|
44 | <div class="fieldset collapsable-content no-hide" data-toggle="summary-details"> | |
45 | <div class="commit truncate-wrap">${h.urlify_commit_message(h.chop_at_smart(c.commit.message, '\n', suffix_if_chopped='...'), c.repo_name)}</div> |
|
45 | <div class="commit truncate-wrap">${h.urlify_commit_message(h.chop_at_smart(c.commit.message, '\n', suffix_if_chopped='...'), c.repo_name)}</div> | |
46 | </div> |
|
46 | </div> | |
47 |
|
47 | |||
48 | <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none"> |
|
48 | <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none"> | |
49 | <div class="commit">${h.urlify_commit_message(c.commit.message,c.repo_name)}</div> |
|
49 | <div class="commit">${h.urlify_commit_message(c.commit.message,c.repo_name)}</div> | |
50 | </div> |
|
50 | </div> | |
51 |
|
51 | |||
52 | <div class="fieldset" data-toggle="summary-details"> |
|
52 | <div class="fieldset" data-toggle="summary-details"> | |
53 | <div class=""> |
|
53 | <div class=""> | |
54 | <table> |
|
54 | <table> | |
55 | <tr class="file_author"> |
|
55 | <tr class="file_author"> | |
56 |
|
56 | |||
57 | <td> |
|
57 | <td> | |
58 | <span class="user commit-author">${h.link_to_user(rc_user or c.commit.author)}</span> |
|
58 | <span class="user commit-author">${h.link_to_user(rc_user or c.commit.author)}</span> | |
59 | <span class="commit-date">- ${h.age_component(c.commit.date)}</span> |
|
59 | <span class="commit-date">- ${h.age_component(c.commit.date)}</span> | |
60 | </td> |
|
60 | </td> | |
61 |
|
61 | |||
62 | <td> |
|
62 | <td> | |
63 | ## second cell for consistency with files |
|
63 | ## second cell for consistency with files | |
64 | </td> |
|
64 | </td> | |
65 | </tr> |
|
65 | </tr> | |
66 | </table> |
|
66 | </table> | |
67 | </div> |
|
67 | </div> | |
68 | </div> |
|
68 | </div> | |
69 |
|
69 | |||
70 | </div> |
|
70 | </div> | |
71 | </div> |
|
71 | </div> | |
72 |
|
72 | |||
73 | <div class="right-content"> |
|
73 | <div class="right-content"> | |
74 |
|
74 | |||
75 | <div data-toggle="summary-details"> |
|
75 | <div data-toggle="summary-details"> | |
76 | <div class="tags tags-main"> |
|
76 | <div class="tags tags-main"> | |
77 | <code><a href="${h.route_path('repo_commit',repo_name=c.repo_name,commit_id=c.commit.raw_id)}">${h.show_id(c.commit)}</a></code> |
|
77 | <code><a href="${h.route_path('repo_commit',repo_name=c.repo_name,commit_id=c.commit.raw_id)}">${h.show_id(c.commit)}</a></code> | |
78 | <i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${c.commit.raw_id}" title="${_('Copy the full commit id')}"></i> |
|
78 | <i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${c.commit.raw_id}" title="${_('Copy the full commit id')}"></i> | |
79 | ${file_base.refs(c.commit)} |
|
79 | ${file_base.refs(c.commit)} | |
80 |
|
80 | |||
81 | ## phase |
|
81 | ## phase | |
82 | % if hasattr(c.commit, 'phase') and getattr(c.commit, 'phase') != 'public': |
|
82 | % if hasattr(c.commit, 'phase') and getattr(c.commit, 'phase') != 'public': | |
83 | <span class="tag phase-${c.commit.phase} tooltip" title="${_('Commit phase')}"> |
|
83 | <span class="tag phase-${c.commit.phase} tooltip" title="${_('Commit phase')}"> | |
84 | <i class="icon-info"></i>${c.commit.phase} |
|
84 | <i class="icon-info"></i>${c.commit.phase} | |
85 | </span> |
|
85 | </span> | |
86 | % endif |
|
86 | % endif | |
87 |
|
87 | |||
88 | ## obsolete commits |
|
88 | ## obsolete commits | |
89 | % if getattr(c.commit, 'obsolete', False): |
|
89 | % if getattr(c.commit, 'obsolete', False): | |
90 | <span class="tag obsolete-${c.commit.obsolete} tooltip" title="${_('Evolve State')}"> |
|
90 | <span class="tag obsolete-${c.commit.obsolete} tooltip" title="${_('Evolve State')}"> | |
91 | ${_('obsolete')} |
|
91 | ${_('obsolete')} | |
92 | </span> |
|
92 | </span> | |
93 | % endif |
|
93 | % endif | |
94 |
|
94 | |||
95 | ## hidden commits |
|
95 | ## hidden commits | |
96 | % if getattr(c.commit, 'hidden', False): |
|
96 | % if getattr(c.commit, 'hidden', False): | |
97 | <span class="tag hidden-${c.commit.hidden} tooltip" title="${_('Evolve State')}"> |
|
97 | <span class="tag hidden-${c.commit.hidden} tooltip" title="${_('Evolve State')}"> | |
98 | ${_('hidden')} |
|
98 | ${_('hidden')} | |
99 | </span> |
|
99 | </span> | |
100 | % endif |
|
100 | % endif | |
101 | </div> |
|
101 | </div> | |
102 |
|
102 | |||
103 | %if c.statuses: |
|
103 | %if c.statuses: | |
104 | <div class="tag status-tag-${c.statuses[0]} pull-right"> |
|
104 | <div class="tag status-tag-${c.statuses[0]} pull-right"> | |
105 | <i class="icon-circle review-status-${c.statuses[0]}"></i> |
|
105 | <i class="icon-circle review-status-${c.statuses[0]}"></i> | |
106 | <div class="pull-right">${h.commit_status_lbl(c.statuses[0])}</div> |
|
106 | <div class="pull-right">${h.commit_status_lbl(c.statuses[0])}</div> | |
107 | </div> |
|
107 | </div> | |
108 | %endif |
|
108 | %endif | |
109 |
|
109 | |||
110 | </div> |
|
110 | </div> | |
111 |
|
111 | |||
112 | </div> |
|
112 | </div> | |
113 | </div> |
|
113 | </div> | |
114 |
|
114 | |||
115 | <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;"> |
|
115 | <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;"> | |
116 | <div class="left-label-summary"> |
|
116 | <div class="left-label-summary"> | |
117 | <p>${_('Commit navigation')}:</p> |
|
117 | <p>${_('Commit navigation')}:</p> | |
118 | <div class="right-label-summary"> |
|
118 | <div class="right-label-summary"> | |
119 | <span id="parent_link" class="tag tagtag"> |
|
119 | <span id="parent_link" class="tag tagtag"> | |
120 | <a href="#parentCommit" title="${_('Parent Commit')}"><i class="icon-left icon-no-margin"></i>${_('parent')}</a> |
|
120 | <a href="#parentCommit" title="${_('Parent Commit')}"><i class="icon-left icon-no-margin"></i>${_('parent')}</a> | |
121 | </span> |
|
121 | </span> | |
122 |
|
122 | |||
123 | <span id="child_link" class="tag tagtag"> |
|
123 | <span id="child_link" class="tag tagtag"> | |
124 | <a href="#childCommit" title="${_('Child Commit')}">${_('child')}<i class="icon-right icon-no-margin"></i></a> |
|
124 | <a href="#childCommit" title="${_('Child Commit')}">${_('child')}<i class="icon-right icon-no-margin"></i></a> | |
125 | </span> |
|
125 | </span> | |
126 | </div> |
|
126 | </div> | |
127 | </div> |
|
127 | </div> | |
128 | </div> |
|
128 | </div> | |
129 |
|
129 | |||
130 | <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;"> |
|
130 | <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;"> | |
131 | <div class="left-label-summary"> |
|
131 | <div class="left-label-summary"> | |
132 | <p>${_('Diff options')}:</p> |
|
132 | <p>${_('Diff options')}:</p> | |
133 | <div class="right-label-summary"> |
|
133 | <div class="right-label-summary"> | |
134 | <div class="diff-actions"> |
|
134 | <div class="diff-actions"> | |
135 | <a href="${h.route_path('repo_commit_raw',repo_name=c.repo_name,commit_id=c.commit.raw_id)}"> |
|
135 | <a href="${h.route_path('repo_commit_raw',repo_name=c.repo_name,commit_id=c.commit.raw_id)}"> | |
136 | ${_('Raw Diff')} |
|
136 | ${_('Raw Diff')} | |
137 | </a> |
|
137 | </a> | |
138 | | |
|
138 | | | |
139 | <a href="${h.route_path('repo_commit_patch',repo_name=c.repo_name,commit_id=c.commit.raw_id)}"> |
|
139 | <a href="${h.route_path('repo_commit_patch',repo_name=c.repo_name,commit_id=c.commit.raw_id)}"> | |
140 | ${_('Patch Diff')} |
|
140 | ${_('Patch Diff')} | |
141 | </a> |
|
141 | </a> | |
142 | | |
|
142 | | | |
143 | <a href="${h.route_path('repo_commit_download',repo_name=c.repo_name,commit_id=c.commit.raw_id,_query=dict(diff='download'))}"> |
|
143 | <a href="${h.route_path('repo_commit_download',repo_name=c.repo_name,commit_id=c.commit.raw_id,_query=dict(diff='download'))}"> | |
144 | ${_('Download Diff')} |
|
144 | ${_('Download Diff')} | |
145 | </a> |
|
145 | </a> | |
146 | </div> |
|
146 | </div> | |
147 | </div> |
|
147 | </div> | |
148 | </div> |
|
148 | </div> | |
149 | </div> |
|
149 | </div> | |
150 |
|
150 | |||
151 | <div class="clear-fix"></div> |
|
151 | <div class="clear-fix"></div> | |
152 |
|
152 | |||
153 | <div class="btn-collapse" data-toggle="summary-details"> |
|
153 | <div class="btn-collapse" data-toggle="summary-details"> | |
154 | ${_('Show More')} |
|
154 | ${_('Show More')} | |
155 | </div> |
|
155 | </div> | |
156 |
|
156 | |||
157 | </div> |
|
157 | </div> | |
158 |
|
158 | |||
159 | <div class="cs_files"> |
|
159 | <div class="cs_files"> | |
160 | <%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/> |
|
160 | <%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/> | |
161 | ${cbdiffs.render_diffset_menu(c.changes[c.commit.raw_id])} |
|
161 | ${cbdiffs.render_diffset_menu(c.changes[c.commit.raw_id])} | |
162 | ${cbdiffs.render_diffset( |
|
162 | ${cbdiffs.render_diffset( | |
163 | c.changes[c.commit.raw_id], commit=c.commit, use_comments=True,inline_comments=c.inline_comments )} |
|
163 | c.changes[c.commit.raw_id], commit=c.commit, use_comments=True,inline_comments=c.inline_comments )} | |
164 | </div> |
|
164 | </div> | |
165 |
|
165 | |||
166 | ## template for inline comment form |
|
166 | ## template for inline comment form | |
167 | <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/> |
|
167 | <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/> | |
168 |
|
168 | |||
169 | ## comments heading with count |
|
169 | ## comments heading with count | |
170 | <div class="comments-heading"> |
|
170 | <div class="comments-heading"> | |
171 | <i class="icon-comment"></i> |
|
171 | <i class="icon-comment"></i> | |
172 | ${_('Comments')} ${len(c.comments)} |
|
172 | ${_('Comments')} ${len(c.comments)} | |
173 | </div> |
|
173 | </div> | |
174 |
|
174 | |||
175 | ## render comments |
|
175 | ## render comments | |
176 | ${comment.generate_comments(c.comments)} |
|
176 | ${comment.generate_comments(c.comments)} | |
177 |
|
177 | |||
178 | ## main comment form and it status |
|
178 | ## main comment form and it status | |
179 | ${comment.comments(h.route_path('repo_commit_comment_create', repo_name=c.repo_name, commit_id=c.commit.raw_id), |
|
179 | ${comment.comments(h.route_path('repo_commit_comment_create', repo_name=c.repo_name, commit_id=c.commit.raw_id), | |
180 | h.commit_status(c.rhodecode_db_repo, c.commit.raw_id))} |
|
180 | h.commit_status(c.rhodecode_db_repo, c.commit.raw_id))} | |
181 | </div> |
|
181 | </div> | |
182 |
|
182 | |||
183 | ## FORM FOR MAKING JS ACTION AS CHANGESET COMMENTS |
|
183 | ## FORM FOR MAKING JS ACTION AS CHANGESET COMMENTS | |
184 | <script type="text/javascript"> |
|
184 | <script type="text/javascript"> | |
185 |
|
185 | |||
186 | $(document).ready(function() { |
|
186 | $(document).ready(function() { | |
187 |
|
187 | |||
188 | var boxmax = parseInt($('#trimmed_message_box').css('max-height'), 10); |
|
188 | var boxmax = parseInt($('#trimmed_message_box').css('max-height'), 10); | |
189 | if($('#trimmed_message_box').height() === boxmax){ |
|
189 | if($('#trimmed_message_box').height() === boxmax){ | |
190 | $('#message_expand').show(); |
|
190 | $('#message_expand').show(); | |
191 | } |
|
191 | } | |
192 |
|
192 | |||
193 | $('#message_expand').on('click', function(e){ |
|
193 | $('#message_expand').on('click', function(e){ | |
194 | $('#trimmed_message_box').css('max-height', 'none'); |
|
194 | $('#trimmed_message_box').css('max-height', 'none'); | |
195 | $(this).hide(); |
|
195 | $(this).hide(); | |
196 | }); |
|
196 | }); | |
197 |
|
197 | |||
198 | $('.show-inline-comments').on('click', function(e){ |
|
198 | $('.show-inline-comments').on('click', function(e){ | |
199 | var boxid = $(this).attr('data-comment-id'); |
|
199 | var boxid = $(this).attr('data-comment-id'); | |
200 | var button = $(this); |
|
200 | var button = $(this); | |
201 |
|
201 | |||
202 | if(button.hasClass("comments-visible")) { |
|
202 | if(button.hasClass("comments-visible")) { | |
203 | $('#{0} .inline-comments'.format(boxid)).each(function(index){ |
|
203 | $('#{0} .inline-comments'.format(boxid)).each(function(index){ | |
204 | $(this).hide(); |
|
204 | $(this).hide(); | |
205 | }); |
|
205 | }); | |
206 | button.removeClass("comments-visible"); |
|
206 | button.removeClass("comments-visible"); | |
207 | } else { |
|
207 | } else { | |
208 | $('#{0} .inline-comments'.format(boxid)).each(function(index){ |
|
208 | $('#{0} .inline-comments'.format(boxid)).each(function(index){ | |
209 | $(this).show(); |
|
209 | $(this).show(); | |
210 | }); |
|
210 | }); | |
211 | button.addClass("comments-visible"); |
|
211 | button.addClass("comments-visible"); | |
212 | } |
|
212 | } | |
213 | }); |
|
213 | }); | |
214 |
|
214 | |||
215 | // next links |
|
215 | // next links | |
216 | $('#child_link').on('click', function(e){ |
|
216 | $('#child_link').on('click', function(e){ | |
217 | // fetch via ajax what is going to be the next link, if we have |
|
217 | // fetch via ajax what is going to be the next link, if we have | |
218 | // >1 links show them to user to choose |
|
218 | // >1 links show them to user to choose | |
219 | if(!$('#child_link').hasClass('disabled')){ |
|
219 | if(!$('#child_link').hasClass('disabled')){ | |
220 | $.ajax({ |
|
220 | $.ajax({ | |
221 | url: '${h.route_path('repo_commit_children',repo_name=c.repo_name, commit_id=c.commit.raw_id)}', |
|
221 | url: '${h.route_path('repo_commit_children',repo_name=c.repo_name, commit_id=c.commit.raw_id)}', | |
222 | success: function(data) { |
|
222 | success: function(data) { | |
223 | if(data.results.length === 0){ |
|
223 | if(data.results.length === 0){ | |
224 | $('#child_link').html("${_('No Child Commits')}").addClass('disabled'); |
|
224 | $('#child_link').html("${_('No Child Commits')}").addClass('disabled'); | |
225 | } |
|
225 | } | |
226 | if(data.results.length === 1){ |
|
226 | if(data.results.length === 1){ | |
227 | var commit = data.results[0]; |
|
227 | var commit = data.results[0]; | |
228 | window.location = pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': commit.raw_id}); |
|
228 | window.location = pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': commit.raw_id}); | |
229 | } |
|
229 | } | |
230 | else if(data.results.length === 2){ |
|
230 | else if(data.results.length === 2){ | |
231 | $('#child_link').addClass('disabled'); |
|
231 | $('#child_link').addClass('disabled'); | |
232 | $('#child_link').addClass('double'); |
|
232 | $('#child_link').addClass('double'); | |
233 |
|
233 | |||
234 | var _html = ''; |
|
234 | var _html = ''; | |
235 | _html +='<a title="__title__" href="__url__"><span class="tag branchtag"><i class="icon-code-fork"></i>__branch__</span> __rev__</a> ' |
|
235 | _html +='<a title="__title__" href="__url__"><span class="tag branchtag"><i class="icon-code-fork"></i>__branch__</span> __rev__</a> ' | |
236 | .replace('__branch__', data.results[0].branch) |
|
236 | .replace('__branch__', data.results[0].branch) | |
237 | .replace('__rev__','r{0}:{1}'.format(data.results[0].revision, data.results[0].raw_id.substr(0,6))) |
|
237 | .replace('__rev__','r{0}:{1}'.format(data.results[0].revision, data.results[0].raw_id.substr(0,6))) | |
238 | .replace('__title__', data.results[0].message) |
|
238 | .replace('__title__', data.results[0].message) | |
239 | .replace('__url__', pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': data.results[0].raw_id})); |
|
239 | .replace('__url__', pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': data.results[0].raw_id})); | |
240 | _html +=' | '; |
|
240 | _html +=' | '; | |
241 | _html +='<a title="__title__" href="__url__"><span class="tag branchtag"><i class="icon-code-fork"></i>__branch__</span> __rev__</a> ' |
|
241 | _html +='<a title="__title__" href="__url__"><span class="tag branchtag"><i class="icon-code-fork"></i>__branch__</span> __rev__</a> ' | |
242 | .replace('__branch__', data.results[1].branch) |
|
242 | .replace('__branch__', data.results[1].branch) | |
243 | .replace('__rev__','r{0}:{1}'.format(data.results[1].revision, data.results[1].raw_id.substr(0,6))) |
|
243 | .replace('__rev__','r{0}:{1}'.format(data.results[1].revision, data.results[1].raw_id.substr(0,6))) | |
244 | .replace('__title__', data.results[1].message) |
|
244 | .replace('__title__', data.results[1].message) | |
245 | .replace('__url__', pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': data.results[1].raw_id})); |
|
245 | .replace('__url__', pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': data.results[1].raw_id})); | |
246 | $('#child_link').html(_html); |
|
246 | $('#child_link').html(_html); | |
247 | } |
|
247 | } | |
248 | } |
|
248 | } | |
249 | }); |
|
249 | }); | |
250 | e.preventDefault(); |
|
250 | e.preventDefault(); | |
251 | } |
|
251 | } | |
252 | }); |
|
252 | }); | |
253 |
|
253 | |||
254 | // prev links |
|
254 | // prev links | |
255 | $('#parent_link').on('click', function(e){ |
|
255 | $('#parent_link').on('click', function(e){ | |
256 | // fetch via ajax what is going to be the next link, if we have |
|
256 | // fetch via ajax what is going to be the next link, if we have | |
257 | // >1 links show them to user to choose |
|
257 | // >1 links show them to user to choose | |
258 | if(!$('#parent_link').hasClass('disabled')){ |
|
258 | if(!$('#parent_link').hasClass('disabled')){ | |
259 | $.ajax({ |
|
259 | $.ajax({ | |
260 | url: '${h.route_path("repo_commit_parents",repo_name=c.repo_name, commit_id=c.commit.raw_id)}', |
|
260 | url: '${h.route_path("repo_commit_parents",repo_name=c.repo_name, commit_id=c.commit.raw_id)}', | |
261 | success: function(data) { |
|
261 | success: function(data) { | |
262 | if(data.results.length === 0){ |
|
262 | if(data.results.length === 0){ | |
263 | $('#parent_link').html('${_('No Parent Commits')}').addClass('disabled'); |
|
263 | $('#parent_link').html('${_('No Parent Commits')}').addClass('disabled'); | |
264 | } |
|
264 | } | |
265 | if(data.results.length === 1){ |
|
265 | if(data.results.length === 1){ | |
266 | var commit = data.results[0]; |
|
266 | var commit = data.results[0]; | |
267 | window.location = pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': commit.raw_id}); |
|
267 | window.location = pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': commit.raw_id}); | |
268 | } |
|
268 | } | |
269 | else if(data.results.length === 2){ |
|
269 | else if(data.results.length === 2){ | |
270 | $('#parent_link').addClass('disabled'); |
|
270 | $('#parent_link').addClass('disabled'); | |
271 | $('#parent_link').addClass('double'); |
|
271 | $('#parent_link').addClass('double'); | |
272 |
|
272 | |||
273 | var _html = ''; |
|
273 | var _html = ''; | |
274 | _html +='<a title="__title__" href="__url__"><span class="tag branchtag"><i class="icon-code-fork"></i>__branch__</span> __rev__</a>' |
|
274 | _html +='<a title="__title__" href="__url__"><span class="tag branchtag"><i class="icon-code-fork"></i>__branch__</span> __rev__</a>' | |
275 | .replace('__branch__', data.results[0].branch) |
|
275 | .replace('__branch__', data.results[0].branch) | |
276 | .replace('__rev__','r{0}:{1}'.format(data.results[0].revision, data.results[0].raw_id.substr(0,6))) |
|
276 | .replace('__rev__','r{0}:{1}'.format(data.results[0].revision, data.results[0].raw_id.substr(0,6))) | |
277 | .replace('__title__', data.results[0].message) |
|
277 | .replace('__title__', data.results[0].message) | |
278 | .replace('__url__', pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': data.results[0].raw_id})); |
|
278 | .replace('__url__', pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': data.results[0].raw_id})); | |
279 | _html +=' | '; |
|
279 | _html +=' | '; | |
280 | _html +='<a title="__title__" href="__url__"><span class="tag branchtag"><i class="icon-code-fork"></i>__branch__</span> __rev__</a>' |
|
280 | _html +='<a title="__title__" href="__url__"><span class="tag branchtag"><i class="icon-code-fork"></i>__branch__</span> __rev__</a>' | |
281 | .replace('__branch__', data.results[1].branch) |
|
281 | .replace('__branch__', data.results[1].branch) | |
282 | .replace('__rev__','r{0}:{1}'.format(data.results[1].revision, data.results[1].raw_id.substr(0,6))) |
|
282 | .replace('__rev__','r{0}:{1}'.format(data.results[1].revision, data.results[1].raw_id.substr(0,6))) | |
283 | .replace('__title__', data.results[1].message) |
|
283 | .replace('__title__', data.results[1].message) | |
284 | .replace('__url__', pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': data.results[1].raw_id})); |
|
284 | .replace('__url__', pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': data.results[1].raw_id})); | |
285 | $('#parent_link').html(_html); |
|
285 | $('#parent_link').html(_html); | |
286 | } |
|
286 | } | |
287 | } |
|
287 | } | |
288 | }); |
|
288 | }); | |
289 | e.preventDefault(); |
|
289 | e.preventDefault(); | |
290 | } |
|
290 | } | |
291 | }); |
|
291 | }); | |
292 |
|
292 | |||
293 | // browse tree @ revision |
|
293 | // browse tree @ revision | |
294 | $('#files_link').on('click', function(e){ |
|
294 | $('#files_link').on('click', function(e){ | |
295 | window.location = '${h.route_path('repo_files:default_path',repo_name=c.repo_name, commit_id=c.commit.raw_id)}'; |
|
295 | window.location = '${h.route_path('repo_files:default_path',repo_name=c.repo_name, commit_id=c.commit.raw_id)}'; | |
296 | e.preventDefault(); |
|
296 | e.preventDefault(); | |
297 | }); |
|
297 | }); | |
298 |
|
298 | |||
299 | }) |
|
299 | }) | |
300 | </script> |
|
300 | </script> | |
301 |
|
301 | |||
302 | </%def> |
|
302 | </%def> |
@@ -1,63 +1,65 b'' | |||||
1 | <%namespace name="base" file="/base/base.mako"/> |
|
1 | <%namespace name="base" file="/base/base.mako"/> | |
2 | <%namespace name="file_base" file="/files/base.mako"/> |
|
2 | <%namespace name="file_base" file="/files/base.mako"/> | |
3 |
|
3 | |||
4 | <div class="summary"> |
|
4 | <div class="summary"> | |
5 | <div class="fieldset"> |
|
5 | <div class="fieldset"> | |
6 | <div class="left-content"> |
|
6 | <div class="left-content"> | |
7 |
|
7 | <% | ||
|
8 | rc_user = h.discover_user(c.commit.author_email) | |||
|
9 | %> | |||
8 | <div class="left-content-avatar"> |
|
10 | <div class="left-content-avatar"> | |
9 | ${base.gravatar(c.file_last_commit.author_email, 30)} |
|
11 | ${base.gravatar(c.file_last_commit.author_email, 30, tooltip=(True if rc_user else False), user=rc_user)} | |
10 | </div> |
|
12 | </div> | |
11 |
|
13 | |||
12 | <div class="left-content-message"> |
|
14 | <div class="left-content-message"> | |
13 | <div class="fieldset collapsable-content no-hide" data-toggle="summary-details"> |
|
15 | <div class="fieldset collapsable-content no-hide" data-toggle="summary-details"> | |
14 | <div class="commit truncate-wrap">${h.urlify_commit_message(h.chop_at_smart(c.commit.message, '\n', suffix_if_chopped='...'), c.repo_name)}</div> |
|
16 | <div class="commit truncate-wrap">${h.urlify_commit_message(h.chop_at_smart(c.commit.message, '\n', suffix_if_chopped='...'), c.repo_name)}</div> | |
15 | </div> |
|
17 | </div> | |
16 |
|
18 | |||
17 | <div class="fieldset collapsable-content" data-toggle="summary-details"> |
|
19 | <div class="fieldset collapsable-content" data-toggle="summary-details"> | |
18 | <div class="commit">${h.urlify_commit_message(c.commit.message,c.repo_name)}</div> |
|
20 | <div class="commit">${h.urlify_commit_message(c.commit.message,c.repo_name)}</div> | |
19 | </div> |
|
21 | </div> | |
20 |
|
22 | |||
21 | <div class="fieldset" data-toggle="summary-details"> |
|
23 | <div class="fieldset" data-toggle="summary-details"> | |
22 | <div class="" id="file_authors"> |
|
24 | <div class="" id="file_authors"> | |
23 | ## loads single author, or ALL |
|
25 | ## loads single author, or ALL | |
24 | <%include file='file_authors_box.mako'/> |
|
26 | <%include file='file_authors_box.mako'/> | |
25 | </div> |
|
27 | </div> | |
26 | </div> |
|
28 | </div> | |
27 | </div> |
|
29 | </div> | |
28 |
|
30 | |||
29 | <div class="fieldset collapsable-content" data-toggle="summary-details"> |
|
31 | <div class="fieldset collapsable-content" data-toggle="summary-details"> | |
30 | <div class="left-label-summary-files"> |
|
32 | <div class="left-label-summary-files"> | |
31 | <p>${_('File last commit')}:</p> |
|
33 | <p>${_('File last commit')}:</p> | |
32 | <div class="right-label-summary"> |
|
34 | <div class="right-label-summary"> | |
33 | <code><a href="${h.route_path('repo_commit',repo_name=c.repo_name,commit_id=c.file_last_commit.raw_id)}">${h.show_id(c.file_last_commit)}</a></code> |
|
35 | <code><a href="${h.route_path('repo_commit',repo_name=c.repo_name,commit_id=c.file_last_commit.raw_id)}">${h.show_id(c.file_last_commit)}</a></code> | |
34 | ${file_base.refs(c.file_last_commit)} |
|
36 | ${file_base.refs(c.file_last_commit)} | |
35 | </div> |
|
37 | </div> | |
36 | </div> |
|
38 | </div> | |
37 | </div> |
|
39 | </div> | |
38 | </div> |
|
40 | </div> | |
39 |
|
41 | |||
40 | <div class="right-content"> |
|
42 | <div class="right-content"> | |
41 | <div data-toggle="summary-details"> |
|
43 | <div data-toggle="summary-details"> | |
42 | <div class="tags tags-main"> |
|
44 | <div class="tags tags-main"> | |
43 | <code> |
|
45 | <code> | |
44 | <a href="${h.route_path('repo_commit',repo_name=c.repo_name,commit_id=c.commit.raw_id)}">${h.show_id(c.commit)}</a> |
|
46 | <a href="${h.route_path('repo_commit',repo_name=c.repo_name,commit_id=c.commit.raw_id)}">${h.show_id(c.commit)}</a> | |
45 | </code> |
|
47 | </code> | |
46 | <i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${c.commit.raw_id}" title="${_('Copy the full commit id')}"></i> |
|
48 | <i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${c.commit.raw_id}" title="${_('Copy the full commit id')}"></i> | |
47 | ${file_base.refs(c.commit)} |
|
49 | ${file_base.refs(c.commit)} | |
48 | </div> |
|
50 | </div> | |
49 | </div> |
|
51 | </div> | |
50 | </div> |
|
52 | </div> | |
51 |
|
53 | |||
52 | <div class="clear-fix"></div> |
|
54 | <div class="clear-fix"></div> | |
53 |
|
55 | |||
54 | <div class="btn-collapse" data-toggle="summary-details"> |
|
56 | <div class="btn-collapse" data-toggle="summary-details"> | |
55 | ${_('Show More')} |
|
57 | ${_('Show More')} | |
56 | </div> |
|
58 | </div> | |
57 |
|
59 | |||
58 | </div> |
|
60 | </div> | |
59 | </div> |
|
61 | </div> | |
60 |
|
62 | |||
61 | <script> |
|
63 | <script> | |
62 | collapsableContent(); |
|
64 | collapsableContent(); | |
63 | </script> |
|
65 | </script> |
@@ -1,47 +1,49 b'' | |||||
1 | <%namespace name="base" file="/base/base.mako"/> |
|
1 | <%namespace name="base" file="/base/base.mako"/> | |
2 | <%namespace name="file_base" file="/files/base.mako"/> |
|
2 | <%namespace name="file_base" file="/files/base.mako"/> | |
3 |
|
3 | |||
4 | <div class="summary"> |
|
4 | <div class="summary"> | |
5 | <div class="fieldset"> |
|
5 | <div class="fieldset"> | |
6 | <div class="left-content"> |
|
6 | <div class="left-content"> | |
7 |
|
7 | <% | ||
|
8 | rc_user = h.discover_user(c.commit.author_email) | |||
|
9 | %> | |||
8 | <div class="left-content-avatar"> |
|
10 | <div class="left-content-avatar"> | |
9 | ${base.gravatar(c.commit.author_email, 30)} |
|
11 | ${base.gravatar(c.commit.author_email, 30, tooltip=(True if rc_user else False), user=rc_user)} | |
10 | </div> |
|
12 | </div> | |
11 |
|
13 | |||
12 | <div class="left-content-message"> |
|
14 | <div class="left-content-message"> | |
13 | <div class="fieldset collapsable-content no-hide" data-toggle="summary-details"> |
|
15 | <div class="fieldset collapsable-content no-hide" data-toggle="summary-details"> | |
14 | <div class="commit truncate-wrap">${h.urlify_commit_message(h.chop_at_smart(c.commit.message, '\n', suffix_if_chopped='...'), c.repo_name)}</div> |
|
16 | <div class="commit truncate-wrap">${h.urlify_commit_message(h.chop_at_smart(c.commit.message, '\n', suffix_if_chopped='...'), c.repo_name)}</div> | |
15 | </div> |
|
17 | </div> | |
16 |
|
18 | |||
17 | <div class="fieldset collapsable-content" data-toggle="summary-details"> |
|
19 | <div class="fieldset collapsable-content" data-toggle="summary-details"> | |
18 | <div class="commit">${h.urlify_commit_message(c.commit.message,c.repo_name)}</div> |
|
20 | <div class="commit">${h.urlify_commit_message(c.commit.message,c.repo_name)}</div> | |
19 | </div> |
|
21 | </div> | |
20 |
|
22 | |||
21 | <div class="fieldset clear-fix"> |
|
23 | <div class="fieldset clear-fix"> | |
22 | <span class="commit-author">${h.link_to_user(c.commit.author)}</span><span class="commit-date"> - ${h.age_component(c.commit.date)}</span> |
|
24 | <span class="commit-author">${h.link_to_user(c.commit.author)}</span><span class="commit-date"> - ${h.age_component(c.commit.date)}</span> | |
23 | </div> |
|
25 | </div> | |
24 | </div> |
|
26 | </div> | |
25 | </div> |
|
27 | </div> | |
26 |
|
28 | |||
27 | <div class="right-content"> |
|
29 | <div class="right-content"> | |
28 | <div class="tags"> |
|
30 | <div class="tags"> | |
29 | <code> |
|
31 | <code> | |
30 | <a href="${h.route_path('repo_commit',repo_name=c.repo_name,commit_id=c.commit.raw_id)}">${h.show_id(c.commit)}</a> |
|
32 | <a href="${h.route_path('repo_commit',repo_name=c.repo_name,commit_id=c.commit.raw_id)}">${h.show_id(c.commit)}</a> | |
31 | </code> |
|
33 | </code> | |
32 |
|
34 | |||
33 | <i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${c.commit.raw_id}" title="${_('Copy the full commit id')}"></i> |
|
35 | <i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${c.commit.raw_id}" title="${_('Copy the full commit id')}"></i> | |
34 | ${file_base.refs(c.commit)} |
|
36 | ${file_base.refs(c.commit)} | |
35 | </div> |
|
37 | </div> | |
36 | </div> |
|
38 | </div> | |
37 |
|
39 | |||
38 | <div class="clear-fix"></div> |
|
40 | <div class="clear-fix"></div> | |
39 |
|
41 | |||
40 | <div class="btn-collapse" data-toggle="summary-details"> |
|
42 | <div class="btn-collapse" data-toggle="summary-details"> | |
41 | ${_('Show More')} |
|
43 | ${_('Show More')} | |
42 | </div> |
|
44 | </div> | |
43 | </div> |
|
45 | </div> | |
44 | </div> |
|
46 | </div> | |
45 | <script> |
|
47 | <script> | |
46 | collapsableContent(); |
|
48 | collapsableContent(); | |
47 | </script> |
|
49 | </script> |
General Comments 0
You need to be logged in to leave comments.
Login now