Show More
The requested changes are too big and content was truncated. Show full diff
1 | NO CONTENT: modified file |
|
NO CONTENT: modified file | ||
The requested commit or file is too big and content was truncated. Show full diff |
@@ -1,290 +1,291 b'' | |||||
1 | <%namespace name="base" file="/base/base.mako"/> |
|
1 | <%namespace name="base" file="/base/base.mako"/> | |
2 |
|
2 | |||
3 | <% |
|
3 | <% | |
4 | elems = [ |
|
4 | elems = [ | |
5 | (_('Repository ID'), c.rhodecode_db_repo.repo_id, '', ''), |
|
5 | (_('Repository ID'), c.rhodecode_db_repo.repo_id, '', ''), | |
6 | (_('Owner'), lambda:base.gravatar_with_user(c.rhodecode_db_repo.user.email), '', ''), |
|
6 | (_('Owner'), lambda:base.gravatar_with_user(c.rhodecode_db_repo.user.email), '', ''), | |
7 | (_('Created on'), h.format_date(c.rhodecode_db_repo.created_on), '', ''), |
|
7 | (_('Created on'), h.format_date(c.rhodecode_db_repo.created_on), '', ''), | |
8 | (_('Updated on'), h.format_date(c.rhodecode_db_repo.updated_on), '', ''), |
|
8 | (_('Updated on'), h.format_date(c.rhodecode_db_repo.updated_on), '', ''), | |
9 | (_('Cached Commit id'), lambda: h.link_to(c.rhodecode_db_repo.changeset_cache.get('short_id'), h.route_path('repo_commit',repo_name=c.repo_name,commit_id=c.rhodecode_db_repo.changeset_cache.get('raw_id'))), '', ''), |
|
9 | (_('Cached Commit id'), lambda: h.link_to(c.rhodecode_db_repo.changeset_cache.get('short_id'), h.route_path('repo_commit',repo_name=c.repo_name,commit_id=c.rhodecode_db_repo.changeset_cache.get('raw_id'))), '', ''), | |
10 | (_('Cached Commit date'), c.rhodecode_db_repo.changeset_cache.get('date'), '', ''), |
|
10 | (_('Cached Commit date'), c.rhodecode_db_repo.changeset_cache.get('date'), '', ''), | |
11 | (_('Attached scoped tokens'), len(c.rhodecode_db_repo.scoped_tokens), '', [x.user for x in c.rhodecode_db_repo.scoped_tokens]), |
|
11 | (_('Attached scoped tokens'), len(c.rhodecode_db_repo.scoped_tokens), '', [x.user for x in c.rhodecode_db_repo.scoped_tokens]), | |
12 | (_('Pull requests source'), len(c.rhodecode_db_repo.pull_requests_source), '', ['pr_id:{}, repo:{}'.format(x.pull_request_id,x.source_repo.repo_name) for x in c.rhodecode_db_repo.pull_requests_source]), |
|
12 | (_('Pull requests source'), len(c.rhodecode_db_repo.pull_requests_source), '', ['pr_id:{}, repo:{}'.format(x.pull_request_id,x.source_repo.repo_name) for x in c.rhodecode_db_repo.pull_requests_source]), | |
13 | (_('Pull requests target'), len(c.rhodecode_db_repo.pull_requests_target), '', ['pr_id:{}, repo:{}'.format(x.pull_request_id,x.target_repo.repo_name) for x in c.rhodecode_db_repo.pull_requests_target]), |
|
13 | (_('Pull requests target'), len(c.rhodecode_db_repo.pull_requests_target), '', ['pr_id:{}, repo:{}'.format(x.pull_request_id,x.target_repo.repo_name) for x in c.rhodecode_db_repo.pull_requests_target]), | |
|
14 | (_('Attached Artifacts'), len(c.rhodecode_db_repo.artifacts), '', ''), | |||
14 | ] |
|
15 | ] | |
15 | %> |
|
16 | %> | |
16 |
|
17 | |||
17 | <div class="panel panel-default"> |
|
18 | <div class="panel panel-default"> | |
18 | <div class="panel-heading" id="advanced-info" > |
|
19 | <div class="panel-heading" id="advanced-info" > | |
19 | <h3 class="panel-title">${_('Repository: %s') % c.rhodecode_db_repo.repo_name} <a class="permalink" href="#advanced-info"> ¶</a></h3> |
|
20 | <h3 class="panel-title">${_('Repository: %s') % c.rhodecode_db_repo.repo_name} <a class="permalink" href="#advanced-info"> ¶</a></h3> | |
20 | </div> |
|
21 | </div> | |
21 | <div class="panel-body"> |
|
22 | <div class="panel-body"> | |
22 | ${base.dt_info_panel(elems)} |
|
23 | ${base.dt_info_panel(elems)} | |
23 | </div> |
|
24 | </div> | |
24 | </div> |
|
25 | </div> | |
25 |
|
26 | |||
26 |
|
27 | |||
27 | <div class="panel panel-default"> |
|
28 | <div class="panel panel-default"> | |
28 | <div class="panel-heading" id="advanced-fork"> |
|
29 | <div class="panel-heading" id="advanced-fork"> | |
29 | <h3 class="panel-title">${_('Fork Reference')} <a class="permalink" href="#advanced-fork"> ¶</a></h3> |
|
30 | <h3 class="panel-title">${_('Fork Reference')} <a class="permalink" href="#advanced-fork"> ¶</a></h3> | |
30 | </div> |
|
31 | </div> | |
31 | <div class="panel-body"> |
|
32 | <div class="panel-body"> | |
32 | ${h.secure_form(h.route_path('edit_repo_advanced_fork', repo_name=c.rhodecode_db_repo.repo_name), request=request)} |
|
33 | ${h.secure_form(h.route_path('edit_repo_advanced_fork', repo_name=c.rhodecode_db_repo.repo_name), request=request)} | |
33 |
|
34 | |||
34 | % if c.rhodecode_db_repo.fork: |
|
35 | % if c.rhodecode_db_repo.fork: | |
35 | <div class="panel-body-title-text">${h.literal(_('This repository is a fork of %(repo_link)s') % {'repo_link': h.link_to_if(c.has_origin_repo_read_perm,c.rhodecode_db_repo.fork.repo_name, h.route_path('repo_summary', repo_name=c.rhodecode_db_repo.fork.repo_name))})} |
|
36 | <div class="panel-body-title-text">${h.literal(_('This repository is a fork of %(repo_link)s') % {'repo_link': h.link_to_if(c.has_origin_repo_read_perm,c.rhodecode_db_repo.fork.repo_name, h.route_path('repo_summary', repo_name=c.rhodecode_db_repo.fork.repo_name))})} | |
36 | | <button class="btn btn-link btn-danger" type="submit">Remove fork reference</button></div> |
|
37 | | <button class="btn btn-link btn-danger" type="submit">Remove fork reference</button></div> | |
37 | % endif |
|
38 | % endif | |
38 |
|
39 | |||
39 | <div class="field"> |
|
40 | <div class="field"> | |
40 | ${h.hidden('id_fork_of')} |
|
41 | ${h.hidden('id_fork_of')} | |
41 | ${h.submit('set_as_fork_%s' % c.rhodecode_db_repo.repo_name,_('Set'),class_="btn btn-small",)} |
|
42 | ${h.submit('set_as_fork_%s' % c.rhodecode_db_repo.repo_name,_('Set'),class_="btn btn-small",)} | |
42 | </div> |
|
43 | </div> | |
43 | <div class="field"> |
|
44 | <div class="field"> | |
44 | <span class="help-block">${_('Manually set this repository as a fork of another from the list')}</span> |
|
45 | <span class="help-block">${_('Manually set this repository as a fork of another from the list')}</span> | |
45 | </div> |
|
46 | </div> | |
46 | ${h.end_form()} |
|
47 | ${h.end_form()} | |
47 | </div> |
|
48 | </div> | |
48 | </div> |
|
49 | </div> | |
49 |
|
50 | |||
50 |
|
51 | |||
51 | <div class="panel panel-default"> |
|
52 | <div class="panel panel-default"> | |
52 | <div class="panel-heading" id="advanced-journal"> |
|
53 | <div class="panel-heading" id="advanced-journal"> | |
53 | <h3 class="panel-title">${_('Public Journal Visibility')} <a class="permalink" href="#advanced-journal"> ¶</a></h3> |
|
54 | <h3 class="panel-title">${_('Public Journal Visibility')} <a class="permalink" href="#advanced-journal"> ¶</a></h3> | |
54 | </div> |
|
55 | </div> | |
55 | <div class="panel-body"> |
|
56 | <div class="panel-body"> | |
56 | ${h.secure_form(h.route_path('edit_repo_advanced_journal', repo_name=c.rhodecode_db_repo.repo_name), request=request)} |
|
57 | ${h.secure_form(h.route_path('edit_repo_advanced_journal', repo_name=c.rhodecode_db_repo.repo_name), request=request)} | |
57 | <div class="field"> |
|
58 | <div class="field"> | |
58 | %if c.in_public_journal: |
|
59 | %if c.in_public_journal: | |
59 | <button class="btn btn-small" type="submit"> |
|
60 | <button class="btn btn-small" type="submit"> | |
60 | ${_('Remove from Public Journal')} |
|
61 | ${_('Remove from Public Journal')} | |
61 | </button> |
|
62 | </button> | |
62 | %else: |
|
63 | %else: | |
63 | <button class="btn btn-small" type="submit"> |
|
64 | <button class="btn btn-small" type="submit"> | |
64 | ${_('Add to Public Journal')} |
|
65 | ${_('Add to Public Journal')} | |
65 | </button> |
|
66 | </button> | |
66 | %endif |
|
67 | %endif | |
67 | </div> |
|
68 | </div> | |
68 | <div class="field" > |
|
69 | <div class="field" > | |
69 | <span class="help-block">${_('All actions made on this repository will be visible to everyone following the public journal.')}</span> |
|
70 | <span class="help-block">${_('All actions made on this repository will be visible to everyone following the public journal.')}</span> | |
70 | </div> |
|
71 | </div> | |
71 | ${h.end_form()} |
|
72 | ${h.end_form()} | |
72 | </div> |
|
73 | </div> | |
73 | </div> |
|
74 | </div> | |
74 |
|
75 | |||
75 |
|
76 | |||
76 | <div class="panel panel-default"> |
|
77 | <div class="panel panel-default"> | |
77 | <div class="panel-heading" id="advanced-locking"> |
|
78 | <div class="panel-heading" id="advanced-locking"> | |
78 | <h3 class="panel-title">${_('Locking state')} <a class="permalink" href="#advanced-locking"> ¶</a></h3> |
|
79 | <h3 class="panel-title">${_('Locking state')} <a class="permalink" href="#advanced-locking"> ¶</a></h3> | |
79 | </div> |
|
80 | </div> | |
80 | <div class="panel-body"> |
|
81 | <div class="panel-body"> | |
81 | ${h.secure_form(h.route_path('edit_repo_advanced_locking', repo_name=c.rhodecode_db_repo.repo_name), request=request)} |
|
82 | ${h.secure_form(h.route_path('edit_repo_advanced_locking', repo_name=c.rhodecode_db_repo.repo_name), request=request)} | |
82 |
|
83 | |||
83 | %if c.rhodecode_db_repo.locked[0]: |
|
84 | %if c.rhodecode_db_repo.locked[0]: | |
84 | <div class="panel-body-title-text">${'Locked by %s on %s. Lock reason: %s' % (h.person_by_id(c.rhodecode_db_repo.locked[0]), |
|
85 | <div class="panel-body-title-text">${'Locked by %s on %s. Lock reason: %s' % (h.person_by_id(c.rhodecode_db_repo.locked[0]), | |
85 | h.format_date(h. time_to_datetime(c.rhodecode_db_repo.locked[1])), c.rhodecode_db_repo.locked[2])}</div> |
|
86 | h.format_date(h. time_to_datetime(c.rhodecode_db_repo.locked[1])), c.rhodecode_db_repo.locked[2])}</div> | |
86 | %else: |
|
87 | %else: | |
87 | <div class="panel-body-title-text">${_('This Repository is not currently locked.')}</div> |
|
88 | <div class="panel-body-title-text">${_('This Repository is not currently locked.')}</div> | |
88 | %endif |
|
89 | %endif | |
89 |
|
90 | |||
90 | <div class="field" > |
|
91 | <div class="field" > | |
91 | %if c.rhodecode_db_repo.locked[0]: |
|
92 | %if c.rhodecode_db_repo.locked[0]: | |
92 | ${h.hidden('set_unlock', '1')} |
|
93 | ${h.hidden('set_unlock', '1')} | |
93 | <button class="btn btn-small" type="submit" |
|
94 | <button class="btn btn-small" type="submit" | |
94 | onclick="return confirm('${_('Confirm to unlock repository.')}');"> |
|
95 | onclick="return confirm('${_('Confirm to unlock repository.')}');"> | |
95 | <i class="icon-unlock"></i> |
|
96 | <i class="icon-unlock"></i> | |
96 | ${_('Unlock repository')} |
|
97 | ${_('Unlock repository')} | |
97 | </button> |
|
98 | </button> | |
98 | %else: |
|
99 | %else: | |
99 | ${h.hidden('set_lock', '1')} |
|
100 | ${h.hidden('set_lock', '1')} | |
100 | <button class="btn btn-small" type="submit" |
|
101 | <button class="btn btn-small" type="submit" | |
101 | onclick="return confirm('${_('Confirm to lock repository.')}');"> |
|
102 | onclick="return confirm('${_('Confirm to lock repository.')}');"> | |
102 | <i class="icon-lock"></i> |
|
103 | <i class="icon-lock"></i> | |
103 | ${_('Lock repository')} |
|
104 | ${_('Lock repository')} | |
104 | </button> |
|
105 | </button> | |
105 | %endif |
|
106 | %endif | |
106 | </div> |
|
107 | </div> | |
107 | <div class="field" > |
|
108 | <div class="field" > | |
108 | <span class="help-block"> |
|
109 | <span class="help-block"> | |
109 | ${_('Force repository locking. This only works when anonymous access is disabled. Pulling from the repository locks the repository to that user until the same user pushes to that repository again.')} |
|
110 | ${_('Force repository locking. This only works when anonymous access is disabled. Pulling from the repository locks the repository to that user until the same user pushes to that repository again.')} | |
110 | </span> |
|
111 | </span> | |
111 | </div> |
|
112 | </div> | |
112 | ${h.end_form()} |
|
113 | ${h.end_form()} | |
113 | </div> |
|
114 | </div> | |
114 | </div> |
|
115 | </div> | |
115 |
|
116 | |||
116 |
|
117 | |||
117 | <div class="panel panel-default"> |
|
118 | <div class="panel panel-default"> | |
118 | <div class="panel-heading" id="advanced-hooks"> |
|
119 | <div class="panel-heading" id="advanced-hooks"> | |
119 | <h3 class="panel-title">${_('Hooks')} <a class="permalink" href="#advanced-hooks"> ¶</a></h3> |
|
120 | <h3 class="panel-title">${_('Hooks')} <a class="permalink" href="#advanced-hooks"> ¶</a></h3> | |
120 | </div> |
|
121 | </div> | |
121 | <div class="panel-body"> |
|
122 | <div class="panel-body"> | |
122 | <table class="rctable"> |
|
123 | <table class="rctable"> | |
123 | <th>${_('Hook type')}</th> |
|
124 | <th>${_('Hook type')}</th> | |
124 | <th>${_('Hook version')}</th> |
|
125 | <th>${_('Hook version')}</th> | |
125 | <th>${_('Current version')}</th> |
|
126 | <th>${_('Current version')}</th> | |
126 | % if c.ver_info_dict: |
|
127 | % if c.ver_info_dict: | |
127 | <tr> |
|
128 | <tr> | |
128 | <td>${_('PRE HOOK')}</td> |
|
129 | <td>${_('PRE HOOK')}</td> | |
129 | <td>${c.ver_info_dict['pre_version']}</td> |
|
130 | <td>${c.ver_info_dict['pre_version']}</td> | |
130 | <td>${c.rhodecode_version}</td> |
|
131 | <td>${c.rhodecode_version}</td> | |
131 | </tr> |
|
132 | </tr> | |
132 | <tr> |
|
133 | <tr> | |
133 | <td>${_('POST HOOK')}</td> |
|
134 | <td>${_('POST HOOK')}</td> | |
134 | <td>${c.ver_info_dict['post_version']}</td> |
|
135 | <td>${c.ver_info_dict['post_version']}</td> | |
135 | <td>${c.rhodecode_version}</td> |
|
136 | <td>${c.rhodecode_version}</td> | |
136 | </tr> |
|
137 | </tr> | |
137 | % else: |
|
138 | % else: | |
138 | <tr> |
|
139 | <tr> | |
139 | <td>${_('Unable to read hook information from VCS Server')}</td> |
|
140 | <td>${_('Unable to read hook information from VCS Server')}</td> | |
140 | </tr> |
|
141 | </tr> | |
141 | % endif |
|
142 | % endif | |
142 | </table> |
|
143 | </table> | |
143 |
|
144 | |||
144 | <a href="${h.route_path('edit_repo_advanced_hooks', repo_name=c.repo_name)}" |
|
145 | <a href="${h.route_path('edit_repo_advanced_hooks', repo_name=c.repo_name)}" | |
145 | onclick="return confirm('${_('Confirm to reinstall hooks for this repository.')}');"> |
|
146 | onclick="return confirm('${_('Confirm to reinstall hooks for this repository.')}');"> | |
146 | ${_('Update Hooks')} |
|
147 | ${_('Update Hooks')} | |
147 | </a> |
|
148 | </a> | |
148 | </div> |
|
149 | </div> | |
149 | </div> |
|
150 | </div> | |
150 |
|
151 | |||
151 | <div class="panel panel-warning"> |
|
152 | <div class="panel panel-warning"> | |
152 | <div class="panel-heading" id="advanced-archive"> |
|
153 | <div class="panel-heading" id="advanced-archive"> | |
153 | <h3 class="panel-title">${_('Archive repository')} <a class="permalink" href="#advanced-archive"> ¶</a></h3> |
|
154 | <h3 class="panel-title">${_('Archive repository')} <a class="permalink" href="#advanced-archive"> ¶</a></h3> | |
154 | </div> |
|
155 | </div> | |
155 | <div class="panel-body"> |
|
156 | <div class="panel-body"> | |
156 | ${h.secure_form(h.route_path('edit_repo_advanced_archive', repo_name=c.repo_name), request=request)} |
|
157 | ${h.secure_form(h.route_path('edit_repo_advanced_archive', repo_name=c.repo_name), request=request)} | |
157 |
|
158 | |||
158 | <div style="margin: 0 0 20px 0" class="fake-space"></div> |
|
159 | <div style="margin: 0 0 20px 0" class="fake-space"></div> | |
159 |
|
160 | |||
160 | <div class="field"> |
|
161 | <div class="field"> | |
161 | <button class="btn btn-small btn-danger" type="submit" |
|
162 | <button class="btn btn-small btn-danger" type="submit" | |
162 | onclick="return confirm('${_('Confirm to archive this repository: %s') % c.repo_name}');"> |
|
163 | onclick="return confirm('${_('Confirm to archive this repository: %s') % c.repo_name}');"> | |
163 | <i class="icon-remove-sign"></i> |
|
164 | <i class="icon-remove-sign"></i> | |
164 | ${_('Archive this repository')} |
|
165 | ${_('Archive this repository')} | |
165 | </button> |
|
166 | </button> | |
166 | </div> |
|
167 | </div> | |
167 | <div class="field"> |
|
168 | <div class="field"> | |
168 | <span class="help-block"> |
|
169 | <span class="help-block"> | |
169 | ${_('Archiving the repository will make it entirely read-only. The repository cannot be committed to.' |
|
170 | ${_('Archiving the repository will make it entirely read-only. The repository cannot be committed to.' | |
170 | 'It is hidden from the search results and dashboard. ')} |
|
171 | 'It is hidden from the search results and dashboard. ')} | |
171 | </span> |
|
172 | </span> | |
172 | </div> |
|
173 | </div> | |
173 |
|
174 | |||
174 | ${h.end_form()} |
|
175 | ${h.end_form()} | |
175 | </div> |
|
176 | </div> | |
176 | </div> |
|
177 | </div> | |
177 |
|
178 | |||
178 |
|
179 | |||
179 | <div class="panel panel-danger"> |
|
180 | <div class="panel panel-danger"> | |
180 | <div class="panel-heading" id="advanced-delete"> |
|
181 | <div class="panel-heading" id="advanced-delete"> | |
181 | <h3 class="panel-title">${_('Delete repository')} <a class="permalink" href="#advanced-delete"> ¶</a></h3> |
|
182 | <h3 class="panel-title">${_('Delete repository')} <a class="permalink" href="#advanced-delete"> ¶</a></h3> | |
182 | </div> |
|
183 | </div> | |
183 | <div class="panel-body"> |
|
184 | <div class="panel-body"> | |
184 | ${h.secure_form(h.route_path('edit_repo_advanced_delete', repo_name=c.repo_name), request=request)} |
|
185 | ${h.secure_form(h.route_path('edit_repo_advanced_delete', repo_name=c.repo_name), request=request)} | |
185 | <table class="display"> |
|
186 | <table class="display"> | |
186 | <tr> |
|
187 | <tr> | |
187 | <td> |
|
188 | <td> | |
188 | ${_ungettext('This repository has %s fork.', 'This repository has %s forks.', c.rhodecode_db_repo.forks.count()) % c.rhodecode_db_repo.forks.count()} |
|
189 | ${_ungettext('This repository has %s fork.', 'This repository has %s forks.', c.rhodecode_db_repo.forks.count()) % c.rhodecode_db_repo.forks.count()} | |
189 | </td> |
|
190 | </td> | |
190 | <td> |
|
191 | <td> | |
191 | %if c.rhodecode_db_repo.forks.count(): |
|
192 | %if c.rhodecode_db_repo.forks.count(): | |
192 | <input type="radio" name="forks" value="detach_forks" checked="checked"/> <label for="forks">${_('Detach forks')}</label> |
|
193 | <input type="radio" name="forks" value="detach_forks" checked="checked"/> <label for="forks">${_('Detach forks')}</label> | |
193 | %endif |
|
194 | %endif | |
194 | </td> |
|
195 | </td> | |
195 | <td> |
|
196 | <td> | |
196 | %if c.rhodecode_db_repo.forks.count(): |
|
197 | %if c.rhodecode_db_repo.forks.count(): | |
197 | <input type="radio" name="forks" value="delete_forks"/> <label for="forks">${_('Delete forks')}</label> |
|
198 | <input type="radio" name="forks" value="delete_forks"/> <label for="forks">${_('Delete forks')}</label> | |
198 | %endif |
|
199 | %endif | |
199 | </td> |
|
200 | </td> | |
200 | </tr> |
|
201 | </tr> | |
201 | <% attached_prs = len(c.rhodecode_db_repo.pull_requests_source + c.rhodecode_db_repo.pull_requests_target) %> |
|
202 | <% attached_prs = len(c.rhodecode_db_repo.pull_requests_source + c.rhodecode_db_repo.pull_requests_target) %> | |
202 | % if c.rhodecode_db_repo.pull_requests_source or c.rhodecode_db_repo.pull_requests_target: |
|
203 | % if c.rhodecode_db_repo.pull_requests_source or c.rhodecode_db_repo.pull_requests_target: | |
203 | <tr> |
|
204 | <tr> | |
204 | <td> |
|
205 | <td> | |
205 | ${_ungettext('This repository has %s attached pull request.', 'This repository has %s attached pull requests.', attached_prs) % attached_prs} |
|
206 | ${_ungettext('This repository has %s attached pull request.', 'This repository has %s attached pull requests.', attached_prs) % attached_prs} | |
206 | <br/> |
|
207 | <br/> | |
207 | ${_('Consider to archive this repository instead.')} |
|
208 | ${_('Consider to archive this repository instead.')} | |
208 | </td> |
|
209 | </td> | |
209 | <td></td> |
|
210 | <td></td> | |
210 | <td></td> |
|
211 | <td></td> | |
211 | </tr> |
|
212 | </tr> | |
212 | % endif |
|
213 | % endif | |
213 | </table> |
|
214 | </table> | |
214 | <div style="margin: 0 0 20px 0" class="fake-space"></div> |
|
215 | <div style="margin: 0 0 20px 0" class="fake-space"></div> | |
215 |
|
216 | |||
216 | <div class="field"> |
|
217 | <div class="field"> | |
217 | <button class="btn btn-small btn-danger" type="submit" |
|
218 | <button class="btn btn-small btn-danger" type="submit" | |
218 | onclick="return confirm('${_('Confirm to delete this repository: %s') % c.repo_name}');"> |
|
219 | onclick="return confirm('${_('Confirm to delete this repository: %s') % c.repo_name}');"> | |
219 | <i class="icon-remove-sign"></i> |
|
220 | <i class="icon-remove-sign"></i> | |
220 | ${_('Delete this repository')} |
|
221 | ${_('Delete this repository')} | |
221 | </button> |
|
222 | </button> | |
222 | </div> |
|
223 | </div> | |
223 | <div class="field"> |
|
224 | <div class="field"> | |
224 | <span class="help-block"> |
|
225 | <span class="help-block"> | |
225 | ${_('This repository will be renamed in a special way in order to make it inaccessible to RhodeCode Enterprise and its VCS systems. If you need to fully delete it from the file system, please do it manually, or with rhodecode-cleanup-repos command available in rhodecode-tools.')} |
|
226 | ${_('This repository will be renamed in a special way in order to make it inaccessible to RhodeCode Enterprise and its VCS systems. If you need to fully delete it from the file system, please do it manually, or with rhodecode-cleanup-repos command available in rhodecode-tools.')} | |
226 | </span> |
|
227 | </span> | |
227 | </div> |
|
228 | </div> | |
228 |
|
229 | |||
229 | ${h.end_form()} |
|
230 | ${h.end_form()} | |
230 | </div> |
|
231 | </div> | |
231 | </div> |
|
232 | </div> | |
232 |
|
233 | |||
233 |
|
234 | |||
234 | <script> |
|
235 | <script> | |
235 |
|
236 | |||
236 | var currentRepoId = ${c.rhodecode_db_repo.repo_id}; |
|
237 | var currentRepoId = ${c.rhodecode_db_repo.repo_id}; | |
237 |
|
238 | |||
238 | var repoTypeFilter = function(data) { |
|
239 | var repoTypeFilter = function(data) { | |
239 | var results = []; |
|
240 | var results = []; | |
240 |
|
241 | |||
241 | if (!data.results[0]) { |
|
242 | if (!data.results[0]) { | |
242 | return data |
|
243 | return data | |
243 | } |
|
244 | } | |
244 |
|
245 | |||
245 | $.each(data.results[0].children, function() { |
|
246 | $.each(data.results[0].children, function() { | |
246 | // filter out the SAME repo, it cannot be used as fork of itself |
|
247 | // filter out the SAME repo, it cannot be used as fork of itself | |
247 | if (this.repo_id != currentRepoId) { |
|
248 | if (this.repo_id != currentRepoId) { | |
248 | this.id = this.repo_id; |
|
249 | this.id = this.repo_id; | |
249 | results.push(this) |
|
250 | results.push(this) | |
250 | } |
|
251 | } | |
251 | }); |
|
252 | }); | |
252 | data.results[0].children = results; |
|
253 | data.results[0].children = results; | |
253 | return data; |
|
254 | return data; | |
254 | }; |
|
255 | }; | |
255 |
|
256 | |||
256 | $("#id_fork_of").select2({ |
|
257 | $("#id_fork_of").select2({ | |
257 | cachedDataSource: {}, |
|
258 | cachedDataSource: {}, | |
258 | minimumInputLength: 2, |
|
259 | minimumInputLength: 2, | |
259 | placeholder: "${_('Change repository') if c.rhodecode_db_repo.fork else _('Pick repository')}", |
|
260 | placeholder: "${_('Change repository') if c.rhodecode_db_repo.fork else _('Pick repository')}", | |
260 | dropdownAutoWidth: true, |
|
261 | dropdownAutoWidth: true, | |
261 | containerCssClass: "drop-menu", |
|
262 | containerCssClass: "drop-menu", | |
262 | dropdownCssClass: "drop-menu-dropdown", |
|
263 | dropdownCssClass: "drop-menu-dropdown", | |
263 | formatResult: formatRepoResult, |
|
264 | formatResult: formatRepoResult, | |
264 | query: $.debounce(250, function(query){ |
|
265 | query: $.debounce(250, function(query){ | |
265 | self = this; |
|
266 | self = this; | |
266 | var cacheKey = query.term; |
|
267 | var cacheKey = query.term; | |
267 | var cachedData = self.cachedDataSource[cacheKey]; |
|
268 | var cachedData = self.cachedDataSource[cacheKey]; | |
268 |
|
269 | |||
269 | if (cachedData) { |
|
270 | if (cachedData) { | |
270 | query.callback({results: cachedData.results}); |
|
271 | query.callback({results: cachedData.results}); | |
271 | } else { |
|
272 | } else { | |
272 | $.ajax({ |
|
273 | $.ajax({ | |
273 | url: pyroutes.url('repo_list_data'), |
|
274 | url: pyroutes.url('repo_list_data'), | |
274 | data: {'query': query.term, repo_type: '${c.rhodecode_db_repo.repo_type}'}, |
|
275 | data: {'query': query.term, repo_type: '${c.rhodecode_db_repo.repo_type}'}, | |
275 | dataType: 'json', |
|
276 | dataType: 'json', | |
276 | type: 'GET', |
|
277 | type: 'GET', | |
277 | success: function(data) { |
|
278 | success: function(data) { | |
278 | data = repoTypeFilter(data); |
|
279 | data = repoTypeFilter(data); | |
279 | self.cachedDataSource[cacheKey] = data; |
|
280 | self.cachedDataSource[cacheKey] = data; | |
280 | query.callback({results: data.results}); |
|
281 | query.callback({results: data.results}); | |
281 | }, |
|
282 | }, | |
282 | error: function(data, textStatus, errorThrown) { |
|
283 | error: function(data, textStatus, errorThrown) { | |
283 | alert("Error while fetching entries.\nError code {0} ({1}).".format(data.status, data.statusText)); |
|
284 | alert("Error while fetching entries.\nError code {0} ({1}).".format(data.status, data.statusText)); | |
284 | } |
|
285 | } | |
285 | }) |
|
286 | }) | |
286 | } |
|
287 | } | |
287 | }) |
|
288 | }) | |
288 | }); |
|
289 | }); | |
289 | </script> |
|
290 | </script> | |
290 |
|
291 |
General Comments 0
You need to be logged in to leave comments.
Login now