Show More
@@ -873,18 +873,17 b' class RepoFilesView(RepoAppView):' | |||
|
873 | 873 | self.db_repo_name, self.db_repo.repo_id, commit.raw_id, f_path) |
|
874 | 874 | return {'nodes': metadata} |
|
875 | 875 | |
|
876 | def _create_references( | |
|
877 | self, branches_or_tags, symbolic_reference, f_path): | |
|
876 | def _create_references(self, branches_or_tags, symbolic_reference, f_path, ref_type): | |
|
878 | 877 | items = [] |
|
879 | 878 | for name, commit_id in branches_or_tags.items(): |
|
880 | sym_ref = symbolic_reference(commit_id, name, f_path) | |
|
881 | items.append((sym_ref, name)) | |
|
879 | sym_ref = symbolic_reference(commit_id, name, f_path, ref_type) | |
|
880 | items.append((sym_ref, name, ref_type)) | |
|
882 | 881 | return items |
|
883 | 882 | |
|
884 | def _symbolic_reference(self, commit_id, name, f_path): | |
|
883 | def _symbolic_reference(self, commit_id, name, f_path, ref_type): | |
|
885 | 884 | return commit_id |
|
886 | 885 | |
|
887 | def _symbolic_reference_svn(self, commit_id, name, f_path): | |
|
886 | def _symbolic_reference_svn(self, commit_id, name, f_path, ref_type): | |
|
888 | 887 | new_f_path = vcspath.join(name, f_path) |
|
889 | 888 | return u'%s@%s' % (new_f_path, commit_id) |
|
890 | 889 | |
@@ -914,7 +913,7 b' class RepoFilesView(RepoAppView):' | |||
|
914 | 913 | for commit in commits: |
|
915 | 914 | branch = ' (%s)' % commit.branch if commit.branch else '' |
|
916 | 915 | n_desc = 'r%s:%s%s' % (commit.idx, commit.short_id, branch) |
|
917 | commits_group[0].append((commit.raw_id, n_desc,)) | |
|
916 | commits_group[0].append((commit.raw_id, n_desc, 'sha')) | |
|
918 | 917 | history.append(commits_group) |
|
919 | 918 | |
|
920 | 919 | symbolic_reference = self._symbolic_reference |
@@ -930,11 +929,11 b' class RepoFilesView(RepoAppView):' | |||
|
930 | 929 | symbolic_reference = self._symbolic_reference_svn |
|
931 | 930 | |
|
932 | 931 | branches = self._create_references( |
|
933 | self.rhodecode_vcs_repo.branches, symbolic_reference, f_path) | |
|
932 | self.rhodecode_vcs_repo.branches, symbolic_reference, f_path, 'branch') | |
|
934 | 933 | branches_group = (branches, _("Branches")) |
|
935 | 934 | |
|
936 | 935 | tags = self._create_references( |
|
937 | self.rhodecode_vcs_repo.tags, symbolic_reference, f_path) | |
|
936 | self.rhodecode_vcs_repo.tags, symbolic_reference, f_path, 'tag') | |
|
938 | 937 | tags_group = (tags, _("Tags")) |
|
939 | 938 | |
|
940 | 939 | history.append(branches_group) |
@@ -962,7 +961,7 b' class RepoFilesView(RepoAppView):' | |||
|
962 | 961 | for obj in file_history: |
|
963 | 962 | res.append({ |
|
964 | 963 | 'text': obj[1], |
|
965 | 'children': [{'id': o[0], 'text': o[1]} for o in obj[0]] | |
|
964 | 'children': [{'id': o[0], 'text': o[1], 'type': o[2]} for o in obj[0]] | |
|
966 | 965 | }) |
|
967 | 966 | |
|
968 | 967 | data = { |
@@ -199,6 +199,7 b' class _GetError(object):' | |||
|
199 | 199 | if form_errors and field_name in form_errors: |
|
200 | 200 | return literal(tmpl % form_errors.get(field_name)) |
|
201 | 201 | |
|
202 | ||
|
202 | 203 | get_error = _GetError() |
|
203 | 204 | |
|
204 | 205 | |
@@ -215,25 +216,21 b' class _ToolTip(object):' | |||
|
215 | 216 | tooltip_title = tooltip_title.replace('<', '<').replace('>', '>') |
|
216 | 217 | return tooltip_title |
|
217 | 218 | |
|
219 | ||
|
218 | 220 | tooltip = _ToolTip() |
|
219 | 221 | |
|
220 | 222 | |
|
221 | def files_breadcrumbs(repo_name, commit_id, file_path, at_ref=None): | |
|
223 | def files_breadcrumbs(repo_name, commit_id, file_path, at_ref=None, limit_items=False): | |
|
222 | 224 | if isinstance(file_path, str): |
|
223 | 225 | file_path = safe_unicode(file_path) |
|
226 | ||
|
224 | 227 | route_qry = {'at': at_ref} if at_ref else None |
|
225 | 228 | |
|
226 | # TODO: johbo: Is this always a url like path, or is this operating | |
|
227 | # system dependent? | |
|
228 | path_segments = file_path.split('/') | |
|
229 | ||
|
230 | repo_name_html = escape(repo_name) | |
|
231 | if len(path_segments) == 1 and path_segments[0] == '': | |
|
232 | url_segments = [repo_name_html] | |
|
233 | else: | |
|
229 | # first segment is a `..` link to repo files | |
|
230 | root_name = literal(u'<i class="icon-home"></i>') | |
|
234 | 231 |
|
|
235 | 232 |
|
|
236 |
|
|
|
233 | root_name, | |
|
237 | 234 |
|
|
238 | 235 |
|
|
239 | 236 |
|
@@ -242,6 +239,7 b' def files_breadcrumbs(repo_name, commit_' | |||
|
242 | 239 |
|
|
243 | 240 |
|
|
244 | 241 | |
|
242 | path_segments = file_path.split('/') | |
|
245 | 243 | last_cnt = len(path_segments) - 1 |
|
246 | 244 | for cnt, segment in enumerate(path_segments): |
|
247 | 245 | if not segment: |
@@ -262,7 +260,16 b' def files_breadcrumbs(repo_name, commit_' | |||
|
262 | 260 | else: |
|
263 | 261 | url_segments.append(segment_html) |
|
264 | 262 | |
|
265 | return literal('/'.join(url_segments)) | |
|
263 | limited_url_segments = url_segments[:1] + ['...'] + url_segments[-5:] | |
|
264 | if limit_items and len(limited_url_segments) < len(url_segments): | |
|
265 | url_segments = limited_url_segments | |
|
266 | ||
|
267 | full_path = file_path | |
|
268 | icon = '<i class="file-breadcrumb-copy tooltip icon-clipboard clipboard-action" data-clipboard-text="{}" title="Copy the full path"></i>'.format(full_path) | |
|
269 | if file_path == '': | |
|
270 | return root_name | |
|
271 | else: | |
|
272 | return literal(' / '.join(url_segments) + icon) | |
|
266 | 273 | |
|
267 | 274 | |
|
268 | 275 | def code_highlight(code, lexer, formatter, use_hl_filter=False): |
@@ -2192,11 +2192,12 b' h3.files_location{' | |||
|
2192 | 2192 | } |
|
2193 | 2193 | } |
|
2194 | 2194 | |
|
2195 | } | |
|
2196 | ||
|
2195 | 2197 |
|
|
2196 | 2198 |
|
|
2197 | 2199 |
|
|
2198 | 2200 |
|
|
2199 | } | |
|
2200 | 2201 | |
|
2201 | 2202 | .search_activate { |
|
2202 | 2203 | display: table-cell; |
@@ -1,12 +1,12 b'' | |||
|
1 | 1 | @font-face { |
|
2 | 2 | font-family: 'rcicons'; |
|
3 | 3 | |
|
4 |
src: url('../fonts/RCIcons/rcicons.eot? |
|
|
5 |
src: url('../fonts/RCIcons/rcicons.eot? |
|
|
6 |
url('../fonts/RCIcons/rcicons.woff2? |
|
|
7 |
url('../fonts/RCIcons/rcicons.woff? |
|
|
8 |
url('../fonts/RCIcons |
|
|
9 |
url('../fonts/RCIcons/rcicons.svg? |
|
|
4 | src: url('../fonts/RCIcons/rcicons.eot?9641970'); | |
|
5 | src: url('../fonts/RCIcons/rcicons.eot?9641970#iefix') format('embedded-opentype'), | |
|
6 | url('../fonts/RCIcons/rcicons.woff2?9641970') format('woff2'), | |
|
7 | url('../fonts/RCIcons/rcicons.woff?9641970') format('woff'), | |
|
8 | url('../fonts/RCIcons/rcicons.ttf?9641970') format('truetype'), | |
|
9 | url('../fonts/RCIcons/rcicons.svg?9641970#rcicons') format('svg'); | |
|
10 | 10 | |
|
11 | 11 | font-weight: normal; |
|
12 | 12 | font-style: normal; |
@@ -186,6 +186,7 b'' | |||
|
186 | 186 | .icon-minus:before { content: '\e820'; } /* '' */ |
|
187 | 187 | .icon-info-circled:before { content: '\e821'; } /* '' */ |
|
188 | 188 | .icon-upload:before { content: '\e822'; } /* '' */ |
|
189 | .icon-home:before { content: '\e823'; } /* '' */ | |
|
189 | 190 | .icon-git:before { content: '\e82a'; } /* '' */ |
|
190 | 191 | .icon-hg:before { content: '\e82d'; } /* '' */ |
|
191 | 192 | .icon-svn:before { content: '\e82e'; } /* '' */ |
@@ -425,7 +425,6 b'' | |||
|
425 | 425 | } |
|
426 | 426 | |
|
427 | 427 | .stats-info { |
|
428 | margin-top: 5px; | |
|
429 | 428 | color: @grey4; |
|
430 | 429 | } |
|
431 | 430 | |
@@ -434,7 +433,6 b'' | |||
|
434 | 433 | text-align: right; |
|
435 | 434 | color: @grey4; |
|
436 | 435 | padding: 10px; |
|
437 | margin-top: 15px; | |
|
438 | 436 | } |
|
439 | 437 | |
|
440 | 438 | .file-container { |
@@ -552,6 +552,12 b'' | |||
|
552 | 552 | "src": "fontelico" |
|
553 | 553 | }, |
|
554 | 554 | { |
|
555 | "uid": "513ac180ff85bd275f2b736720cbbf5e", | |
|
556 | "css": "home", | |
|
557 | "code": 59427, | |
|
558 | "src": "entypo" | |
|
559 | }, | |
|
560 | { | |
|
555 | 561 | "uid": "c43db6645e7515889fc2193294f50767", |
|
556 | 562 | "css": "plus", |
|
557 | 563 | "code": 59411, |
|
1 | NO CONTENT: modified file, binary diff hidden |
@@ -76,6 +76,8 b'' | |||
|
76 | 76 | |
|
77 | 77 | <glyph glyph-name="upload" unicode="" d="M714 29q0 14-10 25t-25 10-25-10-11-25 11-25 25-11 25 11 10 25z m143 0q0 14-10 25t-26 10-25-10-10-25 10-25 25-11 26 11 10 25z m72 125v-179q0-22-16-38t-38-16h-821q-23 0-38 16t-16 38v179q0 22 16 38t38 15h238q12-31 39-51t62-20h143q34 0 61 20t40 51h238q22 0 38-15t16-38z m-182 361q-9-22-33-22h-143v-250q0-15-10-25t-25-11h-143q-15 0-25 11t-11 25v250h-143q-23 0-33 22-9 22 8 39l250 250q10 10 25 10t25-10l250-250q18-17 8-39z" horiz-adv-x="928.6" /> |
|
78 | 78 | |
|
79 | <glyph glyph-name="home" unicode="" d="M888 336q16-16 11-27t-27-11l-84 0 0-310q0-14-1-21t-8-13-23-6l-204 0 0 310-204 0 0-310-194 0q-28 0-35 10t-7 30l0 310-84 0q-22 0-27 11t11 27l400 402q16 16 38 16t38-16z" horiz-adv-x="900" /> | |
|
80 | ||
|
79 | 81 | <glyph glyph-name="git" unicode="" d="M929 844h-858c-36 0-65-30-65-65v-857c0-36 30-65 65-65h857c36 0 65 30 65 65v857c1 35-29 65-64 65z m-729-549c4-11 9-20 14-27 6-8 14-14 22-18 9-4 19-6 29-6 9 0 16 1 24 2 7 2 14 4 20 7l6 51h-27c-4 0-8 1-10 4-2 1-3 5-3 7l5 39h105l-16-131c-8-7-16-12-25-15-9-4-18-8-28-10-10-3-18-5-30-7-10-1-21-2-33-2-20 0-38 4-54 11-16 8-30 18-41 30-12 13-20 28-27 45-6 18-10 36-10 56 0 18 3 34 7 50 3 17 10 30 17 44 8 14 16 25 26 36 10 12 22 20 34 28 13 7 26 14 41 17 15 4 30 7 47 7 13 0 25-2 36-4 11-3 21-6 29-10 8-4 16-9 22-14 6-5 13-11 18-16l-20-31c-4-5-9-8-14-9-5-1-10 0-16 4-5 3-10 6-14 8-5 3-9 5-14 7-5 1-10 2-15 3-5 2-11 2-17 2-14 0-27-3-38-9-11-6-21-14-29-25-8-10-15-24-18-38-5-15-7-31-7-48-1-14 2-27 4-38z m336-102h-71l39 315h71l-39-315z m343 258h-80l-33-258h-70l32 258h-80l7 57h231l-7-57z" horiz-adv-x="1000" /> |
|
80 | 82 | |
|
81 | 83 | <glyph glyph-name="hg" unicode="" d="M927 841h-853c-36 0-65-29-65-65v-853c0-36 29-65 65-65h853c36 0 65 29 65 65v853c0 36-29 65-65 65z m-483-648h-70l16 133h-113l-17-133h-70l39 313h70l-16-132h113l16 132h71l-39-313z m177 101c3-11 8-20 14-27 7-8 14-14 23-18 8-4 18-6 28-6 9 0 16 1 23 3 7 1 14 3 20 6l6 51h-27c-4 0-7 1-9 3-3 3-3 6-3 9l5 39h104l-16-131c-8-6-16-11-25-15-9-5-18-8-27-11-9-2-19-4-30-6-10-1-21-2-33-2-19 0-37 4-53 11-16 7-30 17-41 29-11 13-20 28-26 45-7 17-10 35-10 55 0 17 2 34 6 50 4 15 10 30 17 43 7 14 16 26 26 36 10 11 22 20 34 28 13 7 27 13 41 17 14 4 30 7 46 7 13 0 25-2 36-4 11-3 20-6 29-10 8-4 16-9 23-14 7-5 13-11 18-17l-23-28c-4-5-8-8-13-9-5-1-11 0-16 3-5 4-10 7-14 9-5 3-9 5-14 6-4 2-9 3-14 4-5 1-11 1-17 1-14 0-27-3-38-8-11-6-21-14-29-25-8-10-15-23-19-38-5-15-7-31-7-49 0-13 2-26 5-37z" horiz-adv-x="1000" /> |
|
1 | NO CONTENT: modified file, binary diff hidden |
|
1 | NO CONTENT: modified file, binary diff hidden |
|
1 | NO CONTENT: modified file, binary diff hidden |
@@ -73,10 +73,3 b' var select2RefSwitcher = function(target' | |||
|
73 | 73 | {'repo_name': templateContext.repo_name}); |
|
74 | 74 | select2RefBaseSwitcher(targetElement, loadUrl, initialData); |
|
75 | 75 | }; |
|
76 | ||
|
77 | var select2FileHistorySwitcher = function(targetElement, initialData, state) { | |
|
78 | var loadUrl = pyroutes.url('repo_file_history', | |
|
79 | {'repo_name': templateContext.repo_name, 'commit_id': state.rev, | |
|
80 | 'f_path': state.f_path}); | |
|
81 | select2RefBaseSwitcher(targetElement, loadUrl, initialData); | |
|
82 | }; |
@@ -3,7 +3,7 b'' | |||
|
3 | 3 | |
|
4 | 4 | <table class="table rctable file_history"> |
|
5 | 5 | %for cnt,cs in enumerate(c.pagination): |
|
6 | <tr id="chg_${cnt+1}" class="${'tablerow%s' % (cnt%2)}"> | |
|
6 | <tr id="chg_${cnt+1}" class="${('tablerow%s' % (cnt%2))}"> | |
|
7 | 7 | <td class="td-user"> |
|
8 | 8 | ${base.gravatar_with_user(cs.author, 16)} |
|
9 | 9 | </td> |
@@ -33,7 +33,19 b'' | |||
|
33 | 33 | ${_('Show File')} |
|
34 | 34 | </a> |
|
35 | 35 | </td> |
|
36 | <td class="td-actions"> | |
|
37 | <a href="${h.route_path('repo_compare',repo_name=c.repo_name, source_ref_type="rev", source_ref=cs.raw_id,target_ref_type="rev", target_ref=c.commit_id,_query=dict(merge='1',f_path=c.changelog_for_path))}"> | |
|
38 | ${_('Diff File')} | |
|
39 | </a> | |
|
40 | </td> | |
|
36 | 41 | </tr> |
|
37 | 42 | %endfor |
|
43 | <tr> | |
|
44 | <td colspan="6"> | |
|
45 | <a id="file_history_overview_full" href="${h.route_path('repo_changelog_file',repo_name=c.repo_name, commit_id=c.commit_id, f_path=c.f_path)}"> | |
|
46 | ${_('Show Full History')} | |
|
47 | </a> | |
|
48 | </td> | |
|
49 | </tr> | |
|
38 | 50 | </table> |
|
39 | 51 | </div> |
@@ -10,6 +10,7 b'' | |||
|
10 | 10 | <span class="user commit-author">${h.link_to_user(user)}</span> |
|
11 | 11 | % if c.file_author: |
|
12 | 12 | <span class="commit-date">- ${h.age_component(c.file_last_commit.date)}</span> |
|
13 | <a href="#ShowAuthors" id="show_authors" class="action_link"> - ${_('Load All Authors')}</a> | |
|
13 | 14 | % elif c.file_last_commit.author_email==email: |
|
14 | 15 | <span> (${_('last author')})</span> |
|
15 | 16 | % endif |
@@ -27,13 +28,7 b'' | |||
|
27 | 28 | % endif |
|
28 | 29 | </td> |
|
29 | 30 | </tr> |
|
30 | <tr> | |
|
31 | <td colspan="2"> | |
|
32 | % if c.file_author: | |
|
33 | <a href="#ShowAuthors" id="show_authors" class="action_link">${_('Show Authors')}</a> | |
|
34 | % endif | |
|
35 | </td> | |
|
36 | </tr> | |
|
31 | ||
|
37 | 32 |
|
|
38 | 33 | </table> |
|
39 | 34 | % endif |
@@ -118,82 +118,134 b'' | |||
|
118 | 118 | timeagoActivate(); |
|
119 | 119 | }); |
|
120 | 120 | metadataRequest.fail(function (data, textStatus, errorThrown) { |
|
121 | console.log(data); | |
|
122 | 121 | if (data.status != 0) { |
|
123 | 122 | alert("Error while fetching metadata.\nError code {0} ({1}).Please consider reloading the page".format(data.status,data.statusText)); |
|
124 | 123 | } |
|
125 | 124 | }); |
|
126 | 125 | }; |
|
127 | 126 | |
|
128 |
var |
|
|
129 | timeagoActivate(); | |
|
130 | ||
|
131 | if ($('#trimmed_message_box').height() < 50) { | |
|
132 | $('#message_expand').hide(); | |
|
133 | } | |
|
134 | ||
|
135 | $('#message_expand').on('click', function(e) { | |
|
136 | $('#trimmed_message_box').css('max-height', 'none'); | |
|
137 | $(this).hide(); | |
|
138 | }); | |
|
139 | ||
|
127 | var initFileJS = function () { | |
|
140 | 128 | var state = getState('callbacks'); |
|
141 | 129 | |
|
142 | // VIEW FOR FILE SOURCE | |
|
143 | if (fileSourcePage) { | |
|
144 | // variants for with source code, not tree view | |
|
145 | ||
|
146 | 130 |
|
|
147 | 131 |
|
|
148 | 132 | |
|
149 |
|
|
|
133 | // file history select2 used for history of file, and switch to | |
|
150 | 134 |
|
|
135 | at_ref: atRef, | |
|
151 | 136 |
|
|
152 |
|
|
|
137 | text: '${c.commit.raw_id}', | |
|
153 | 138 |
|
|
154 |
|
|
|
155 | files_url: null | |
|
139 | raw_id: '${c.commit.raw_id}', | |
|
140 | idx: ${c.commit.idx}, | |
|
141 | files_url: null, | |
|
156 | 142 |
|
|
157 | 143 | |
|
158 | select2FileHistorySwitcher('#diff1', initialCommitData, state); | |
|
144 | // check if we have ref info. | |
|
145 | var selectedRef = fileTreeRefs[atRef]; | |
|
146 | if (selectedRef !== undefined) { | |
|
147 | $.extend(initialCommitData, selectedRef) | |
|
148 | } | |
|
149 | ||
|
150 | var loadUrl = pyroutes.url('repo_file_history', {'repo_name': templateContext.repo_name, 'commit_id': state.rev,'f_path': state.f_path}); | |
|
151 | var cacheKey = '__SINGLE_FILE_REFS__'; | |
|
152 | var cachedDataSource = {}; | |
|
159 | 153 | |
|
160 | // show at, diff to actions handlers | |
|
161 | $('#diff1').on('change', function(e) { | |
|
162 | $('#diff_to_commit').removeClass('disabled').removeAttr("disabled"); | |
|
163 | $('#diff_to_commit').val(_gettext('Diff to Commit ') + e.val.truncateAfter(8, '...')); | |
|
154 | var loadRefsData = function (query) { | |
|
155 | $.ajax({ | |
|
156 | url: loadUrl, | |
|
157 | data: {}, | |
|
158 | dataType: 'json', | |
|
159 | type: 'GET', | |
|
160 | success: function (data) { | |
|
161 | cachedDataSource[cacheKey] = data; | |
|
162 | query.callback({results: data.results}); | |
|
163 | } | |
|
164 | }); | |
|
165 | }; | |
|
164 | 166 | |
|
165 | $('#show_at_commit').removeClass('disabled').removeAttr("disabled"); | |
|
166 | $('#show_at_commit').val(_gettext('Show at Commit ') + e.val.truncateAfter(8, '...')); | |
|
167 | var feedRefsData = function (query, cachedData) { | |
|
168 | var data = {results: []}; | |
|
169 | //filter results | |
|
170 | $.each(cachedData.results, function () { | |
|
171 | var section = this.text; | |
|
172 | var children = []; | |
|
173 | $.each(this.children, function () { | |
|
174 | if (query.term.length === 0 || this.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0) { | |
|
175 | children.push(this) | |
|
176 | } | |
|
177 | }); | |
|
178 | data.results.push({ | |
|
179 | 'text': section, | |
|
180 | 'children': children | |
|
181 | }) | |
|
167 | 182 | }); |
|
168 | 183 | |
|
169 | $('#diff_to_commit').on('click', function(e) { | |
|
170 | var diff1 = $('#diff1').val(); | |
|
171 | var diff2 = $('#diff2').val(); | |
|
184 | query.callback(data); | |
|
185 | }; | |
|
186 | ||
|
187 | var select2FileHistorySwitcher = function (targetElement, loadUrl, initialData) { | |
|
188 | var formatResult = function (result, container, query) { | |
|
189 | return formatSelect2SelectionRefs(result); | |
|
190 | }; | |
|
191 | ||
|
192 | var formatSelection = function (data, container) { | |
|
193 | var commit_ref = data; | |
|
172 | 194 | |
|
173 |
var |
|
|
174 | repo_name: templateContext.repo_name, | |
|
175 | source_ref: diff1, | |
|
176 |
|
|
|
177 | target_ref: diff2, | |
|
178 | target_ref_type: 'rev', | |
|
179 | merge: 1, | |
|
180 | f_path: state.f_path | |
|
195 | var tmpl = ''; | |
|
196 | if (commit_ref.type === 'sha') { | |
|
197 | tmpl = (commit_ref.raw_id || "").substr(0,8); | |
|
198 | } else if (commit_ref.type === 'branch') { | |
|
199 | tmpl = tmpl.concat('<i class="icon-branch"></i> '); | |
|
200 | tmpl = tmpl.concat(escapeHtml(commit_ref.text)); | |
|
201 | } else if (commit_ref.type === 'tag') { | |
|
202 | tmpl = tmpl.concat('<i class="icon-tag"></i> '); | |
|
203 | tmpl = tmpl.concat(escapeHtml(commit_ref.text)); | |
|
204 | } else if (commit_ref.type === 'book') { | |
|
205 | tmpl = tmpl.concat('<i class="icon-bookmark"></i> '); | |
|
206 | tmpl = tmpl.concat(escapeHtml(commit_ref.text)); | |
|
207 | } | |
|
208 | var idx = commit_ref.idx || 0; | |
|
209 | tmpl = tmpl.concat('<span class="select-index-number">r{0}</span>'.format(idx)); | |
|
210 | return tmpl | |
|
181 | 211 |
|
|
182 | window.location = pyroutes.url('repo_compare', url_data); | |
|
212 | ||
|
213 | $(targetElement).select2({ | |
|
214 | dropdownAutoWidth: true, | |
|
215 | width: "resolve", | |
|
216 | containerCssClass: "drop-menu", | |
|
217 | dropdownCssClass: "drop-menu-dropdown", | |
|
218 | query: function(query) { | |
|
219 | var cachedData = cachedDataSource[cacheKey]; | |
|
220 | if (cachedData) { | |
|
221 | feedRefsData(query, cachedData) | |
|
222 | } else { | |
|
223 | loadRefsData(query) | |
|
224 | } | |
|
225 | }, | |
|
226 | initSelection: function(element, callback) { | |
|
227 | callback(initialData); | |
|
228 | }, | |
|
229 | formatResult: formatResult, | |
|
230 | formatSelection: formatSelection | |
|
183 | 231 |
|
|
184 | 232 | |
|
185 | $('#show_at_commit').on('click', function(e) { | |
|
186 | var diff1 = $('#diff1').val(); | |
|
233 | }; | |
|
234 | ||
|
235 | select2FileHistorySwitcher('#file_refs_filter', loadUrl, initialCommitData); | |
|
187 | 236 | |
|
188 | var annotate = $('#annotate').val(); | |
|
189 | if (annotate === "True") { | |
|
237 | $('#file_refs_filter').on('change', function(e) { | |
|
238 | var data = $('#file_refs_filter').select2('data'); | |
|
239 | var commit_id = data.id; | |
|
240 | ||
|
241 | if ("${c.annotate}" === "True") { | |
|
190 | 242 |
|
|
191 | 243 |
|
|
192 |
|
|
|
244 | 'commit_id': commit_id, 'f_path': state.f_path}); | |
|
193 | 245 |
|
|
194 | 246 |
|
|
195 | 247 |
|
|
196 |
|
|
|
248 | 'commit_id': commit_id, 'f_path': state.f_path}); | |
|
197 | 249 |
|
|
198 | 250 |
|
|
199 | 251 | |
@@ -236,12 +288,14 b'' | |||
|
236 | 288 |
|
|
237 | 289 |
|
|
238 | 290 |
|
|
239 |
|
|
|
291 | }); | |
|
240 | 292 |
|
|
241 | 293 | |
|
242 | } | |
|
243 | // VIEW FOR FILE TREE BROWSER | |
|
244 | else { | |
|
294 | ||
|
295 | }; | |
|
296 | ||
|
297 | var initTreeJS = function () { | |
|
298 | var state = getState('callbacks'); | |
|
245 | 299 |
|
|
246 | 300 | |
|
247 | 301 |
|
@@ -330,7 +384,7 b'' | |||
|
330 | 384 | |
|
331 | 385 |
|
|
332 | 386 |
|
|
333 |
|
|
|
387 | tmpl = (commit_ref.raw_id || "").substr(0,8); | |
|
334 | 388 |
|
|
335 | 389 |
|
|
336 | 390 |
|
@@ -342,7 +396,8 b'' | |||
|
342 | 396 |
|
|
343 | 397 |
|
|
344 | 398 | |
|
345 | tmpl = tmpl.concat('<span class="select-index-number">r{0}</span>'.format(commit_ref.idx)); | |
|
399 | var idx = commit_ref.idx || 0; | |
|
400 | tmpl = tmpl.concat('<span class="select-index-number">r{0}</span>'.format(idx)); | |
|
346 | 401 |
|
|
347 | 402 |
|
|
348 | 403 | |
@@ -376,11 +431,26 b'' | |||
|
376 | 431 |
|
|
377 | 432 |
|
|
378 | 433 | |
|
379 | } | |
|
380 | 434 | }; |
|
381 | 435 | |
|
382 | 436 | $(document).ready(function() { |
|
383 |
|
|
|
437 | timeagoActivate(); | |
|
438 | ||
|
439 | if ($('#trimmed_message_box').height() < 50) { | |
|
440 | $('#message_expand').hide(); | |
|
441 | } | |
|
442 | ||
|
443 | $('#message_expand').on('click', function(e) { | |
|
444 | $('#trimmed_message_box').css('max-height', 'none'); | |
|
445 | $(this).hide(); | |
|
446 | }); | |
|
447 | ||
|
448 | if (fileSourcePage) { | |
|
449 | initFileJS() | |
|
450 | } else { | |
|
451 | initTreeJS() | |
|
452 | } | |
|
453 | ||
|
384 | 454 | var search_GET = "${request.GET.get('search','')}"; |
|
385 | 455 | if (search_GET === "1") { |
|
386 | 456 | NodeFilter.initFilter(); |
@@ -17,18 +17,28 b'' | |||
|
17 | 17 | </div> |
|
18 | 18 | |
|
19 | 19 | % if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name): |
|
20 | <div title="${_('Add New File')}" class="btn btn-primary new-file"> | |
|
21 | <a href="${h.route_path('repo_files_add_file',repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path, _anchor='edit')}"> | |
|
22 |
${_(' |
|
|
20 | <div> | |
|
21 | <a class="btn btn-primary new-file" href="${h.route_path('repo_files_add_file',repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path, _anchor='edit')}"> | |
|
22 | ${_('Upload File')} | |
|
23 | </a> | |
|
24 | <a class="btn btn-primary new-file" href="${h.route_path('repo_files_add_file',repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path, _anchor='edit')}"> | |
|
25 | ${_('Add File')} | |
|
26 | </a> | |
|
23 | 27 | </div> |
|
24 | 28 | % endif |
|
25 | 29 | |
|
26 | 30 | % if c.enable_downloads: |
|
27 | 31 | <% at_path = '{}'.format(request.GET.get('at') or c.commit.raw_id[:6]) %> |
|
28 | 32 | <div class="btn btn-default new-file"> |
|
33 | % if c.f_path == '/': | |
|
29 | 34 | <a href="${h.route_path('repo_archivefile',repo_name=c.repo_name, fname='{}.zip'.format(c.commit.raw_id))}"> |
|
30 |
${_('Download ZIP |
|
|
35 | ${_('Download full tree ZIP')} | |
|
31 | 36 | </a> |
|
37 | % else: | |
|
38 | <a href="${h.route_path('repo_archivefile',repo_name=c.repo_name, fname='{}.zip'.format(c.commit.raw_id))}"> | |
|
39 | ${_('Download this tree ZIP')} | |
|
40 | </a> | |
|
41 | % endif | |
|
32 | 42 | </div> |
|
33 | 43 | % endif |
|
34 | 44 | |
@@ -45,6 +55,7 b'' | |||
|
45 | 55 | </div> |
|
46 | 56 | |
|
47 | 57 | </div> |
|
58 | ||
|
48 | 59 | ## file tree is computed from caches, and filled in |
|
49 | 60 | <div id="file-tree"> |
|
50 | 61 | ${c.file_tree |n} |
@@ -17,19 +17,13 b'' | |||
|
17 | 17 | </thead> |
|
18 | 18 | |
|
19 | 19 | <tbody id="tbody"> |
|
20 | %if c.file.parent: | |
|
21 |
<t |
|
|
22 | <td class="td-componentname"> | |
|
23 | <a href="${h.route_path('repo_files',repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.file.parent.path, _query=query)}"> | |
|
24 | <i class="icon-directory"></i>.. | |
|
25 | </a> | |
|
20 | <tr> | |
|
21 | <td colspan="5"> | |
|
22 | ||
|
23 | ${h.files_breadcrumbs(c.repo_name,c.commit.raw_id,c.file.path, request.GET.get('at'), limit_items=True)} | |
|
24 | ||
|
26 | 25 | </td> |
|
27 | <td></td> | |
|
28 | <td></td> | |
|
29 | <td></td> | |
|
30 | <td></td> | |
|
31 | 26 |
|
|
32 | %endif | |
|
33 | 27 | %for cnt,node in enumerate(c.file): |
|
34 | 28 | <tr class="parity${cnt%2}"> |
|
35 | 29 | <td class="td-componentname"> |
@@ -13,14 +13,7 b'' | |||
|
13 | 13 | |
|
14 | 14 | <div class="summary-detail"> |
|
15 | 15 | <div class="summary-detail-header"> |
|
16 | <div class="breadcrumbs files_location"> | |
|
17 | <h4> | |
|
18 | ${h.files_breadcrumbs(c.repo_name,c.commit.raw_id,c.file.path, request.GET.get('at'))} | |
|
19 | %if c.annotate: | |
|
20 | - ${_('annotation')} | |
|
21 | %endif | |
|
22 | </h4> | |
|
23 | </div> | |
|
16 | ||
|
24 | 17 | </div><!--end summary-detail-header--> |
|
25 | 18 | |
|
26 | 19 | % if c.file.is_submodule(): |
@@ -1,16 +1,61 b'' | |||
|
1 | 1 | <%namespace name="sourceblock" file="/codeblocks/source.mako"/> |
|
2 | 2 | |
|
3 |
<div id="codeblock" class=" |
|
|
4 |
<div class=" |
|
|
3 | <div id="codeblock" class="browserblock"> | |
|
4 | <div class="browser-header"> | |
|
5 | <div class="browser-nav"> | |
|
6 | <div class="pull-left"> | |
|
7 | ## loads the history for a file | |
|
8 | ${h.hidden('file_refs_filter')} | |
|
9 | </div> | |
|
10 | ||
|
11 | <div class="pull-right"> | |
|
12 | ||
|
13 | ## Download | |
|
14 | % if c.lf_node: | |
|
15 | <a class="btn btn-default" href="${h.route_path('repo_file_download',repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path, _query=dict(lf=1))}"> | |
|
16 | ${_('Download largefile')} | |
|
17 | </a> | |
|
18 | % else: | |
|
19 | <a class="btn btn-default" href="${h.route_path('repo_file_download',repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path)}"> | |
|
20 | ${_('Download file')} | |
|
21 | </a> | |
|
22 | % endif | |
|
23 | ||
|
24 | %if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name): | |
|
25 | ## on branch head, can edit files | |
|
26 | %if c.on_branch_head and c.branch_or_raw_id and not c.file.is_binary: | |
|
27 | ## binary files are delete only | |
|
28 | % if c.file.is_binary: | |
|
29 | ${h.link_to(_('Edit'), '#Edit', class_="btn btn-default disabled tooltip", title=_('Editing binary files not allowed'))} | |
|
30 | ${h.link_to(_('Delete'), h.route_path('repo_files_remove_file',repo_name=c.repo_name,commit_id=c.branch_or_raw_id,f_path=c.f_path, _anchor='edit'),class_="btn btn-danger")} | |
|
31 | % else: | |
|
32 | <a class="btn btn-default" href="${h.route_path('repo_files_edit_file',repo_name=c.repo_name,commit_id=c.branch_or_raw_id,f_path=c.f_path, _anchor='edit')}"> | |
|
33 | ${_('Edit on branch: ')}<code>${c.branch_name}</code> | |
|
34 | </a> | |
|
35 | ||
|
36 | <a class="btn btn-danger" href="${h.route_path('repo_files_remove_file',repo_name=c.repo_name,commit_id=c.branch_or_raw_id,f_path=c.f_path, _anchor='edit')}"> | |
|
37 | ${_('Delete')} | |
|
38 | </a> | |
|
39 | % endif | |
|
40 | ## not on head, forbid all | |
|
41 | % else: | |
|
42 | ${h.link_to(_('Edit'), '#Edit', class_="btn btn-default disabled tooltip", title=_('Editing files allowed only when on branch head commit'))} | |
|
43 | ${h.link_to(_('Delete'), '#Delete', class_="btn btn-default btn-danger disabled tooltip", title=_('Deleting files allowed only when on branch head commit'))} | |
|
44 | % endif | |
|
45 | %endif | |
|
46 | ||
|
47 | </div> | |
|
48 | </div> | |
|
49 | <div id="file_history_container"></div> | |
|
50 | ||
|
51 | </div> | |
|
52 | </div> | |
|
53 | ||
|
54 | <div class="codeblock codeblock-header"> | |
|
55 | <div> | |
|
56 | ${h.files_breadcrumbs(c.repo_name,c.commit.raw_id,c.file.path, request.GET.get('at'))} | |
|
57 | </div> | |
|
5 | 58 | <div class="stats"> |
|
6 | <span class="stats-filename"> | |
|
7 | <strong> | |
|
8 | <i class="icon-file-text"></i> | |
|
9 | ${c.file.unicode_path_safe} | |
|
10 | </strong> | |
|
11 | </span> | |
|
12 | <span class="item last"><i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${c.f_path}" title="${_('Copy the full path')}"></i></span> | |
|
13 | <br/> | |
|
14 | 59 | |
|
15 | 60 | % if c.lf_node: |
|
16 | 61 | <span title="${_('This file is a pointer to large binary file')}"> | ${_('LargeFile')} ${h.format_byte_size_binary(c.lf_node.size)} </span> |
@@ -22,50 +67,22 b'' | |||
|
22 | 67 | <span> | ${c.file.mimetype} </span> |
|
23 | 68 | <span> | ${h.get_lexer_for_filenode(c.file).__class__.__name__}</span> |
|
24 | 69 | </div> |
|
70 | ||
|
25 | 71 | </div> |
|
26 |
<div class=" |
|
|
27 | <a id="file_history_overview" href="#"> | |
|
72 | <div class="pull-right"> | |
|
73 | <a id="file_history_overview" href="#loadHistory"> | |
|
28 | 74 | ${_('History')} |
|
29 | 75 | </a> |
|
30 | <a id="file_history_overview_full" style="display: none" href="${h.route_path('repo_changelog_file',repo_name=c.repo_name, commit_id=c.commit.raw_id, f_path=c.f_path)}"> | |
|
31 | ${_('Show Full History')} | |
|
32 | </a> | | |
|
76 | | | |
|
33 | 77 | %if c.annotate: |
|
34 | 78 | ${h.link_to(_('Source'), h.route_path('repo_files', repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path))} |
|
35 | 79 | %else: |
|
36 | 80 | ${h.link_to(_('Annotation'), h.route_path('repo_files:annotated',repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path))} |
|
37 | 81 | %endif |
|
38 | 82 | | ${h.link_to(_('Raw'), h.route_path('repo_file_raw',repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path))} |
|
39 | | | |
|
40 | % if c.lf_node: | |
|
41 | <a href="${h.route_path('repo_file_download',repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path, _query=dict(lf=1))}"> | |
|
42 | ${_('Download largefile')} | |
|
43 | </a> | |
|
44 | % else: | |
|
45 | <a href="${h.route_path('repo_file_download',repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path)}"> | |
|
46 | ${_('Download')} | |
|
47 | </a> | |
|
48 | % endif | |
|
49 | 83 |
|
|
50 | %if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name): | |
|
51 | | | |
|
52 | %if c.on_branch_head and c.branch_or_raw_id and not c.file.is_binary: | |
|
53 | <a href="${h.route_path('repo_files_edit_file',repo_name=c.repo_name,commit_id=c.branch_or_raw_id,f_path=c.f_path, _anchor='edit')}"> | |
|
54 | ${_('Edit on Branch:{}').format(c.branch_name)} | |
|
55 | </a> | |
|
56 | | <a class="btn-danger btn-link" href="${h.route_path('repo_files_remove_file',repo_name=c.repo_name,commit_id=c.branch_or_raw_id,f_path=c.f_path, _anchor='edit')}">${_('Delete')} | |
|
57 | </a> | |
|
58 | %elif c.on_branch_head and c.branch_or_raw_id and c.file.is_binary: | |
|
59 | ${h.link_to(_('Edit'), '#', class_="btn btn-link disabled tooltip", title=_('Editing binary files not allowed'))} | |
|
60 | | ${h.link_to(_('Delete'), h.route_path('repo_files_remove_file',repo_name=c.repo_name,commit_id=c.branch_or_raw_id,f_path=c.f_path, _anchor='edit'),class_="btn-danger btn-link")} | |
|
61 | %else: | |
|
62 | ${h.link_to(_('Edit'), '#', class_="btn btn-link disabled tooltip", title=_('Editing files allowed only when on branch head commit'))} | |
|
63 | | ${h.link_to(_('Delete'), '#', class_="btn btn-danger btn-link disabled tooltip", title=_('Deleting files allowed only when on branch head commit'))} | |
|
64 | %endif | |
|
65 | %endif | |
|
66 | 84 | </div> |
|
67 | </div> | |
|
68 | <div id="file_history_container"></div> | |
|
85 | ||
|
69 | 86 | <div class="code-body"> |
|
70 | 87 | %if c.file.is_binary: |
|
71 | 88 | <% rendered_binary = h.render_binary(c.repo_name, c.file)%> |
@@ -36,29 +36,6 b'' | |||
|
36 | 36 | </div> |
|
37 | 37 | </div> |
|
38 | 38 | </div> |
|
39 | ||
|
40 | ||
|
41 | <div class="fieldset collapsable-content" data-toggle="summary-details"> | |
|
42 | <div class="left-label-summary-files"> | |
|
43 | <p class="spacing">${_('Show/Diff file')}</p> | |
|
44 | <div class="right-label-summary"> | |
|
45 | ${h.hidden('diff1')} | |
|
46 | ${h.hidden('diff2',c.commit.raw_id)} | |
|
47 | ${h.hidden('annotate', c.annotate)} | |
|
48 | </div> | |
|
49 | </div> | |
|
50 | </div> | |
|
51 | ||
|
52 | ||
|
53 | <div class="fieldset collapsable-content" data-toggle="summary-details"> | |
|
54 | <div class="left-label-summary-files"> | |
|
55 | <p>${_('Action')}</p> | |
|
56 | <div class="right-label-summary"> | |
|
57 | ${h.submit('diff_to_commit',_('Diff to Commit'),class_="btn disabled",disabled="true")} | |
|
58 | ${h.submit('show_at_commit',_('Show at Commit'),class_="btn disabled",disabled="true")} | |
|
59 | </div> | |
|
60 | </div> | |
|
61 | </div> | |
|
62 | 39 | </div> |
|
63 | 40 | |
|
64 | 41 | <div class="right-content"> |
General Comments 0
You need to be logged in to leave comments.
Login now