##// END OF EJS Templates
repo-settings: non-changeable is a bad name. We use permalink notation in the app.
marcink -
r2415:fef13094 default
parent child Browse files
Show More
@@ -1,266 +1,266 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <%namespace name="base" file="/base/base.mako"/>
2 <%namespace name="base" file="/base/base.mako"/>
3
3
4 <div class="panel panel-default">
4 <div class="panel panel-default">
5 <div class="panel-heading">
5 <div class="panel-heading">
6 <h3 class="panel-title">${_('Settings for Repository: %s') % c.rhodecode_db_repo.repo_name}</h3>
6 <h3 class="panel-title">${_('Settings for Repository: %s') % c.rhodecode_db_repo.repo_name}</h3>
7 </div>
7 </div>
8 <div class="panel-body">
8 <div class="panel-body">
9 ${h.secure_form(h.route_path('edit_repo', repo_name=c.rhodecode_db_repo.repo_name), request=request)}
9 ${h.secure_form(h.route_path('edit_repo', repo_name=c.rhodecode_db_repo.repo_name), request=request)}
10 <div class="form">
10 <div class="form">
11 <!-- fields -->
11 <!-- fields -->
12 <div class="fields">
12 <div class="fields">
13
13
14 <div class="field">
14 <div class="field">
15 <div class="label">
15 <div class="label">
16 <label for="repo_name">${_('Name')}:</label>
16 <label for="repo_name">${_('Name')}:</label>
17 </div>
17 </div>
18 <div class="input">
18 <div class="input">
19 ${c.form['repo_name'].render(css_class='medium', oid='repo_name')|n}
19 ${c.form['repo_name'].render(css_class='medium', oid='repo_name')|n}
20 ${c.form.render_error(request, c.form['repo_name'])|n}
20 ${c.form.render_error(request, c.form['repo_name'])|n}
21
21
22 <p class="help-block">${_('Non-changeable id')}: `_${c.rhodecode_db_repo.repo_id}` <span><a href="#" onclick="$('#clone_id').toggle();return false">${_('what is that ?')}</a></span></p>
22 <p class="help-block">${_('permalink id')}: `_${c.rhodecode_db_repo.repo_id}` <span><a href="#" onclick="$('#clone_id').toggle();return false">${_('what is that ?')}</a></span></p>
23 <p id="clone_id" style="display:none;">
23 <p id="clone_id" style="display:none;">
24 ${_('URL by id')}: `${c.rhodecode_db_repo.clone_url(with_id=True)}` <br/>
24 ${_('URL by id')}: `${c.rhodecode_db_repo.clone_url(with_id=True)}` <br/>
25 ${_('''In case this repository is renamed or moved into another group the repository url changes.
25 ${_('''In case this repository is renamed or moved into another group the repository url changes.
26 Using above url guarantees that this repository will always be accessible under such url.
26 Using above url guarantees that this repository will always be accessible under such url.
27 Useful for CI systems, or any other cases that you need to hardcode the url into 3rd party service.''')}</p>
27 Useful for CI systems, or any other cases that you need to hardcode the url into 3rd party service.''')}</p>
28 </div>
28 </div>
29 </div>
29 </div>
30
30
31 <div class="field">
31 <div class="field">
32 <div class="label">
32 <div class="label">
33 <label for="repo_group">${_('Repository group')}:</label>
33 <label for="repo_group">${_('Repository group')}:</label>
34 </div>
34 </div>
35 <div class="select">
35 <div class="select">
36 ${c.form['repo_group'].render(css_class='medium', oid='repo_group')|n}
36 ${c.form['repo_group'].render(css_class='medium', oid='repo_group')|n}
37 ${c.form.render_error(request, c.form['repo_group'])|n}
37 ${c.form.render_error(request, c.form['repo_group'])|n}
38
38
39 % if c.personal_repo_group:
39 % if c.personal_repo_group:
40 <a class="btn" href="#" data-personal-group-name="${c.personal_repo_group.group_name}" data-personal-group-id="${c.personal_repo_group.group_id}" onclick="selectMyGroup(this); return false">
40 <a class="btn" href="#" data-personal-group-name="${c.personal_repo_group.group_name}" data-personal-group-id="${c.personal_repo_group.group_id}" onclick="selectMyGroup(this); return false">
41 ${_('Select my personal group (`%(repo_group_name)s`)') % {'repo_group_name': c.personal_repo_group.group_name}}
41 ${_('Select my personal group (`%(repo_group_name)s`)') % {'repo_group_name': c.personal_repo_group.group_name}}
42 </a>
42 </a>
43 % endif
43 % endif
44 <p class="help-block">${_('Optional select a group to put this repository into.')}</p>
44 <p class="help-block">${_('Optional select a group to put this repository into.')}</p>
45 </div>
45 </div>
46 </div>
46 </div>
47
47
48 % if c.rhodecode_db_repo.repo_type != 'svn':
48 % if c.rhodecode_db_repo.repo_type != 'svn':
49 <div class="field">
49 <div class="field">
50 <div class="label">
50 <div class="label">
51 <label for="clone_uri">${_('Remote uri')}:</label>
51 <label for="clone_uri">${_('Remote uri')}:</label>
52 </div>
52 </div>
53 <div class="input">
53 <div class="input">
54 %if c.rhodecode_db_repo.clone_uri:
54 %if c.rhodecode_db_repo.clone_uri:
55 ## display, if we don't have any errors
55 ## display, if we don't have any errors
56 % if not c.form['repo_clone_uri'].error:
56 % if not c.form['repo_clone_uri'].error:
57 <div id="clone_uri_hidden" class='text-as-placeholder'>
57 <div id="clone_uri_hidden" class='text-as-placeholder'>
58 <span id="clone_uri_hidden_value">${c.rhodecode_db_repo.clone_uri_hidden}</span>
58 <span id="clone_uri_hidden_value">${c.rhodecode_db_repo.clone_uri_hidden}</span>
59 <span class="link" id="edit_clone_uri"><i class="icon-edit"></i>${_('edit')}</span>
59 <span class="link" id="edit_clone_uri"><i class="icon-edit"></i>${_('edit')}</span>
60 </div>
60 </div>
61 % endif
61 % endif
62
62
63 ## alter field
63 ## alter field
64 <div id="alter_clone_uri" style="${'' if c.form['repo_clone_uri'].error else 'display: none'}">
64 <div id="alter_clone_uri" style="${'' if c.form['repo_clone_uri'].error else 'display: none'}">
65 ${c.form['repo_clone_uri'].render(css_class='medium', oid='clone_uri', placeholder=_('enter new value, or leave empty to remove'))|n}
65 ${c.form['repo_clone_uri'].render(css_class='medium', oid='clone_uri', placeholder=_('enter new value, or leave empty to remove'))|n}
66 ${c.form.render_error(request, c.form['repo_clone_uri'])|n}
66 ${c.form.render_error(request, c.form['repo_clone_uri'])|n}
67 % if c.form['repo_clone_uri'].error:
67 % if c.form['repo_clone_uri'].error:
68 ## we got error from form subit, means we modify the url
68 ## we got error from form subit, means we modify the url
69 ${h.hidden('repo_clone_uri_change', 'MOD')}
69 ${h.hidden('repo_clone_uri_change', 'MOD')}
70 % else:
70 % else:
71 ${h.hidden('repo_clone_uri_change', 'OLD')}
71 ${h.hidden('repo_clone_uri_change', 'OLD')}
72 % endif
72 % endif
73
73
74 % if not c.form['repo_clone_uri'].error:
74 % if not c.form['repo_clone_uri'].error:
75 <span class="link" id="cancel_edit_clone_uri">${_('cancel')}</span>
75 <span class="link" id="cancel_edit_clone_uri">${_('cancel')}</span>
76 % endif
76 % endif
77
77
78 </div>
78 </div>
79 %else:
79 %else:
80 ## not set yet, display form to set it
80 ## not set yet, display form to set it
81 ${c.form['repo_clone_uri'].render(css_class='medium', oid='clone_uri')|n}
81 ${c.form['repo_clone_uri'].render(css_class='medium', oid='clone_uri')|n}
82 ${c.form.render_error(request, c.form['repo_clone_uri'])|n}
82 ${c.form.render_error(request, c.form['repo_clone_uri'])|n}
83 ${h.hidden('repo_clone_uri_change', 'NEW')}
83 ${h.hidden('repo_clone_uri_change', 'NEW')}
84 %endif
84 %endif
85 <p id="alter_clone_uri_help_block" class="help-block">
85 <p id="alter_clone_uri_help_block" class="help-block">
86 <% pull_link = h.literal(h.link_to('remote sync', h.route_path('edit_repo_remote', repo_name=c.repo_name))) %>
86 <% pull_link = h.literal(h.link_to('remote sync', h.route_path('edit_repo_remote', repo_name=c.repo_name))) %>
87 ${_('http[s] url where from repository was imported, this field can used for doing {pull_link}.').format(pull_link=pull_link)|n} <br/>
87 ${_('http[s] url where from repository was imported, this field can used for doing {pull_link}.').format(pull_link=pull_link)|n} <br/>
88 ${_('This field is stored encrypted inside Database, a format of http://user:password@server.com/repo_name can be used and will be hidden from display.')}
88 ${_('This field is stored encrypted inside Database, a format of http://user:password@server.com/repo_name can be used and will be hidden from display.')}
89 </p>
89 </p>
90 </div>
90 </div>
91 </div>
91 </div>
92 % else:
92 % else:
93 ${h.hidden('repo_clone_uri', '')}
93 ${h.hidden('repo_clone_uri', '')}
94 % endif
94 % endif
95
95
96 <div class="field">
96 <div class="field">
97 <div class="label">
97 <div class="label">
98 <label for="repo_landing_commit_ref">${_('Landing commit')}:</label>
98 <label for="repo_landing_commit_ref">${_('Landing commit')}:</label>
99 </div>
99 </div>
100 <div class="select">
100 <div class="select">
101 ${c.form['repo_landing_commit_ref'].render(css_class='medium', oid='repo_landing_commit_ref')|n}
101 ${c.form['repo_landing_commit_ref'].render(css_class='medium', oid='repo_landing_commit_ref')|n}
102 ${c.form.render_error(request, c.form['repo_landing_commit_ref'])|n}
102 ${c.form.render_error(request, c.form['repo_landing_commit_ref'])|n}
103 <p class="help-block">${_('Default commit for files page, downloads, full text search index and readme')}</p>
103 <p class="help-block">${_('Default commit for files page, downloads, full text search index and readme')}</p>
104 </div>
104 </div>
105 </div>
105 </div>
106
106
107 <div class="field badged-field">
107 <div class="field badged-field">
108 <div class="label">
108 <div class="label">
109 <label for="repo_owner">${_('Owner')}:</label>
109 <label for="repo_owner">${_('Owner')}:</label>
110 </div>
110 </div>
111 <div class="input">
111 <div class="input">
112 <div class="badge-input-container">
112 <div class="badge-input-container">
113 <div class="user-badge">
113 <div class="user-badge">
114 ${base.gravatar_with_user(c.rhodecode_db_repo.user.email or c.rhodecode_db_repo.user.username, show_disabled=not c.rhodecode_db_repo.user.active)}
114 ${base.gravatar_with_user(c.rhodecode_db_repo.user.email or c.rhodecode_db_repo.user.username, show_disabled=not c.rhodecode_db_repo.user.active)}
115 </div>
115 </div>
116 <div class="badge-input-wrap">
116 <div class="badge-input-wrap">
117 ${c.form['repo_owner'].render(css_class='medium', oid='repo_owner')|n}
117 ${c.form['repo_owner'].render(css_class='medium', oid='repo_owner')|n}
118 </div>
118 </div>
119 </div>
119 </div>
120 ${c.form.render_error(request, c.form['repo_owner'])|n}
120 ${c.form.render_error(request, c.form['repo_owner'])|n}
121 <p class="help-block">${_('Change owner of this repository.')}</p>
121 <p class="help-block">${_('Change owner of this repository.')}</p>
122 </div>
122 </div>
123 </div>
123 </div>
124
124
125 <div class="field">
125 <div class="field">
126 <div class="label label-textarea">
126 <div class="label label-textarea">
127 <label for="repo_description">${_('Description')}:</label>
127 <label for="repo_description">${_('Description')}:</label>
128 </div>
128 </div>
129 <div class="textarea text-area editor">
129 <div class="textarea text-area editor">
130 ${c.form['repo_description'].render(css_class='medium', oid='repo_description')|n}
130 ${c.form['repo_description'].render(css_class='medium', oid='repo_description')|n}
131 ${c.form.render_error(request, c.form['repo_description'])|n}
131 ${c.form.render_error(request, c.form['repo_description'])|n}
132
132
133 <% metatags_url = h.literal('''<a href="#metatagsShow" onclick="$('#meta-tags-desc').toggle();return false">meta-tags</a>''') %>
133 <% metatags_url = h.literal('''<a href="#metatagsShow" onclick="$('#meta-tags-desc').toggle();return false">meta-tags</a>''') %>
134 <span class="help-block">${_('Plain text format with support of {metatags}. Add a README file for longer descriptions').format(metatags=metatags_url)|n}</span>
134 <span class="help-block">${_('Plain text format with support of {metatags}. Add a README file for longer descriptions').format(metatags=metatags_url)|n}</span>
135 <span id="meta-tags-desc" style="display: none">
135 <span id="meta-tags-desc" style="display: none">
136 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
136 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
137 ${dt.metatags_help()}
137 ${dt.metatags_help()}
138 </span>
138 </span>
139 </div>
139 </div>
140 </div>
140 </div>
141
141
142 <div class="field">
142 <div class="field">
143 <div class="label label-checkbox">
143 <div class="label label-checkbox">
144 <label for="${c.form['repo_private'].oid}">${_('Private repository')}:</label>
144 <label for="${c.form['repo_private'].oid}">${_('Private repository')}:</label>
145 </div>
145 </div>
146 <div class="checkboxes">
146 <div class="checkboxes">
147 ${c.form['repo_private'].render(css_class='medium')|n}
147 ${c.form['repo_private'].render(css_class='medium')|n}
148 ${c.form.render_error(request, c.form['repo_private'])|n}
148 ${c.form.render_error(request, c.form['repo_private'])|n}
149 <span class="help-block">${_('Private repositories are only visible to people explicitly added as collaborators.')}</span>
149 <span class="help-block">${_('Private repositories are only visible to people explicitly added as collaborators.')}</span>
150 </div>
150 </div>
151 </div>
151 </div>
152 <div class="field">
152 <div class="field">
153 <div class="label label-checkbox">
153 <div class="label label-checkbox">
154 <label for="${c.form['repo_enable_statistics'].oid}">${_('Enable statistics')}:</label>
154 <label for="${c.form['repo_enable_statistics'].oid}">${_('Enable statistics')}:</label>
155 </div>
155 </div>
156 <div class="checkboxes">
156 <div class="checkboxes">
157 ${c.form['repo_enable_statistics'].render(css_class='medium')|n}
157 ${c.form['repo_enable_statistics'].render(css_class='medium')|n}
158 ${c.form.render_error(request, c.form['repo_enable_statistics'])|n}
158 ${c.form.render_error(request, c.form['repo_enable_statistics'])|n}
159 <span class="help-block">${_('Enable statistics window on summary page.')}</span>
159 <span class="help-block">${_('Enable statistics window on summary page.')}</span>
160 </div>
160 </div>
161 </div>
161 </div>
162 <div class="field">
162 <div class="field">
163 <div class="label label-checkbox">
163 <div class="label label-checkbox">
164 <label for="${c.form['repo_enable_downloads'].oid}">${_('Enable downloads')}:</label>
164 <label for="${c.form['repo_enable_downloads'].oid}">${_('Enable downloads')}:</label>
165 </div>
165 </div>
166 <div class="checkboxes">
166 <div class="checkboxes">
167 ${c.form['repo_enable_downloads'].render(css_class='medium')|n}
167 ${c.form['repo_enable_downloads'].render(css_class='medium')|n}
168 ${c.form.render_error(request, c.form['repo_enable_downloads'])|n}
168 ${c.form.render_error(request, c.form['repo_enable_downloads'])|n}
169 <span class="help-block">${_('Enable download menu on summary page.')}</span>
169 <span class="help-block">${_('Enable download menu on summary page.')}</span>
170 </div>
170 </div>
171 </div>
171 </div>
172 <div class="field">
172 <div class="field">
173 <div class="label label-checkbox">
173 <div class="label label-checkbox">
174 <label for="${c.form['repo_enable_locking'].oid}">${_('Enable automatic locking')}:</label>
174 <label for="${c.form['repo_enable_locking'].oid}">${_('Enable automatic locking')}:</label>
175 </div>
175 </div>
176 <div class="checkboxes">
176 <div class="checkboxes">
177 ${c.form['repo_enable_locking'].render(css_class='medium')|n}
177 ${c.form['repo_enable_locking'].render(css_class='medium')|n}
178 ${c.form.render_error(request, c.form['repo_enable_locking'])|n}
178 ${c.form.render_error(request, c.form['repo_enable_locking'])|n}
179 <span class="help-block">${_('Enable automatic locking on repository. Pulling from this repository creates a lock that can be released by pushing back by the same user')}</span>
179 <span class="help-block">${_('Enable automatic locking on repository. Pulling from this repository creates a lock that can be released by pushing back by the same user')}</span>
180 </div>
180 </div>
181 </div>
181 </div>
182
182
183 %if c.visual.repository_fields:
183 %if c.visual.repository_fields:
184 ## EXTRA FIELDS
184 ## EXTRA FIELDS
185 %for field in c.repo_fields:
185 %for field in c.repo_fields:
186 <div class="field">
186 <div class="field">
187 <div class="label">
187 <div class="label">
188 <label for="${field.field_key_prefixed}">${field.field_label} (${field.field_key}):</label>
188 <label for="${field.field_key_prefixed}">${field.field_label} (${field.field_key}):</label>
189 </div>
189 </div>
190 <div class="input input-medium">
190 <div class="input input-medium">
191 ${h.text(field.field_key_prefixed, field.field_value, class_='medium')}
191 ${h.text(field.field_key_prefixed, field.field_value, class_='medium')}
192 %if field.field_desc:
192 %if field.field_desc:
193 <span class="help-block">${field.field_desc}</span>
193 <span class="help-block">${field.field_desc}</span>
194 %endif
194 %endif
195 </div>
195 </div>
196 </div>
196 </div>
197 %endfor
197 %endfor
198 %endif
198 %endif
199 <div class="buttons">
199 <div class="buttons">
200 ${h.submit('save',_('Save'),class_="btn")}
200 ${h.submit('save',_('Save'),class_="btn")}
201 ${h.reset('reset',_('Reset'),class_="btn")}
201 ${h.reset('reset',_('Reset'),class_="btn")}
202 </div>
202 </div>
203 </div>
203 </div>
204 </div>
204 </div>
205 ${h.end_form()}
205 ${h.end_form()}
206 </div>
206 </div>
207 </div>
207 </div>
208
208
209 <script>
209 <script>
210 $(document).ready(function(){
210 $(document).ready(function(){
211 var cloneUrl = function() {
211 var cloneUrl = function() {
212 var alterButton = $('#alter_clone_uri');
212 var alterButton = $('#alter_clone_uri');
213 var editButton = $('#edit_clone_uri');
213 var editButton = $('#edit_clone_uri');
214 var cancelEditButton = $('#cancel_edit_clone_uri');
214 var cancelEditButton = $('#cancel_edit_clone_uri');
215 var hiddenUrl = $('#clone_uri_hidden');
215 var hiddenUrl = $('#clone_uri_hidden');
216 var hiddenUrlValue = $('#clone_uri_hidden_value');
216 var hiddenUrlValue = $('#clone_uri_hidden_value');
217 var input = $('#clone_uri');
217 var input = $('#clone_uri');
218 var helpBlock = $('#alter_clone_uri_help_block');
218 var helpBlock = $('#alter_clone_uri_help_block');
219 var changedFlag = $('#repo_clone_uri_change');
219 var changedFlag = $('#repo_clone_uri_change');
220 var originalText = helpBlock.html();
220 var originalText = helpBlock.html();
221 var obfuscatedUrl = hiddenUrlValue.html();
221 var obfuscatedUrl = hiddenUrlValue.html();
222
222
223 var edit = function(e) {
223 var edit = function(e) {
224 alterButton.show();
224 alterButton.show();
225 editButton.hide();
225 editButton.hide();
226 hiddenUrl.hide();
226 hiddenUrl.hide();
227
227
228 //add the old value next to input for verification
228 //add the old value next to input for verification
229 helpBlock.html("(" + obfuscatedUrl + ")" + "<br\>" + originalText);
229 helpBlock.html("(" + obfuscatedUrl + ")" + "<br\>" + originalText);
230 changedFlag.val('MOD');
230 changedFlag.val('MOD');
231 };
231 };
232
232
233 var cancelEdit = function(e) {
233 var cancelEdit = function(e) {
234 alterButton.hide();
234 alterButton.hide();
235 editButton.show();
235 editButton.show();
236 hiddenUrl.show();
236 hiddenUrl.show();
237
237
238 helpBlock.html(originalText);
238 helpBlock.html(originalText);
239 changedFlag.val('OLD');
239 changedFlag.val('OLD');
240 input.val('');
240 input.val('');
241 };
241 };
242
242
243 var initEvents = function() {
243 var initEvents = function() {
244 editButton.on('click', edit);
244 editButton.on('click', edit);
245 cancelEditButton.on('click', cancelEdit);
245 cancelEditButton.on('click', cancelEdit);
246 };
246 };
247
247
248 var setInitialState = function() {
248 var setInitialState = function() {
249 if (input.hasClass('error')) {
249 if (input.hasClass('error')) {
250 alterButton.show();
250 alterButton.show();
251 editButton.hide();
251 editButton.hide();
252 hiddenUrl.hide();
252 hiddenUrl.hide();
253 }
253 }
254 };
254 };
255
255
256 setInitialState();
256 setInitialState();
257 initEvents();
257 initEvents();
258 }();
258 }();
259
259
260 selectMyGroup = function(element) {
260 selectMyGroup = function(element) {
261 $("#repo_group").val($(element).data('personalGroupId')).trigger("change");
261 $("#repo_group").val($(element).data('personalGroupId')).trigger("change");
262 };
262 };
263
263
264 UsersAutoComplete('repo_owner', '${c.rhodecode_user.user_id}');
264 UsersAutoComplete('repo_owner', '${c.rhodecode_user.user_id}');
265 });
265 });
266 </script>
266 </script>
General Comments 0
You need to be logged in to leave comments. Login now