##// END OF EJS Templates
repo-settings: show owner info even if this user doesn't have an email.
marcink -
r1733:3b110c63 default
parent child Browse files
Show More
@@ -1,260 +1,260 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), method='POST')}
9 ${h.secure_form(h.route_path('edit_repo', repo_name=c.rhodecode_db_repo.repo_name), method='POST')}
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">${_('Non-changeable 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.url('edit_repo_remote', repo_name=c.repo_name))) %>
86 <% pull_link = h.literal(h.link_to('remote sync', h.url('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, 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 <p class="help-block">${_('Keep it short and to the point. Use a README file for longer descriptions.')}</p>
132 <p class="help-block">${_('Keep it short and to the point. Use a README file for longer descriptions.')}</p>
133 </div>
133 </div>
134 </div>
134 </div>
135
135
136 <div class="field">
136 <div class="field">
137 <div class="label label-checkbox">
137 <div class="label label-checkbox">
138 <label for="${c.form['repo_private'].oid}">${_('Private repository')}:</label>
138 <label for="${c.form['repo_private'].oid}">${_('Private repository')}:</label>
139 </div>
139 </div>
140 <div class="checkboxes">
140 <div class="checkboxes">
141 ${c.form['repo_private'].render(css_class='medium')|n}
141 ${c.form['repo_private'].render(css_class='medium')|n}
142 ${c.form.render_error(request, c.form['repo_private'])|n}
142 ${c.form.render_error(request, c.form['repo_private'])|n}
143 <span class="help-block">${_('Private repositories are only visible to people explicitly added as collaborators.')}</span>
143 <span class="help-block">${_('Private repositories are only visible to people explicitly added as collaborators.')}</span>
144 </div>
144 </div>
145 </div>
145 </div>
146 <div class="field">
146 <div class="field">
147 <div class="label label-checkbox">
147 <div class="label label-checkbox">
148 <label for="${c.form['repo_enable_statistics'].oid}">${_('Enable statistics')}:</label>
148 <label for="${c.form['repo_enable_statistics'].oid}">${_('Enable statistics')}:</label>
149 </div>
149 </div>
150 <div class="checkboxes">
150 <div class="checkboxes">
151 ${c.form['repo_enable_statistics'].render(css_class='medium')|n}
151 ${c.form['repo_enable_statistics'].render(css_class='medium')|n}
152 ${c.form.render_error(request, c.form['repo_enable_statistics'])|n}
152 ${c.form.render_error(request, c.form['repo_enable_statistics'])|n}
153 <span class="help-block">${_('Enable statistics window on summary page.')}</span>
153 <span class="help-block">${_('Enable statistics window on summary page.')}</span>
154 </div>
154 </div>
155 </div>
155 </div>
156 <div class="field">
156 <div class="field">
157 <div class="label label-checkbox">
157 <div class="label label-checkbox">
158 <label for="${c.form['repo_enable_downloads'].oid}">${_('Enable downloads')}:</label>
158 <label for="${c.form['repo_enable_downloads'].oid}">${_('Enable downloads')}:</label>
159 </div>
159 </div>
160 <div class="checkboxes">
160 <div class="checkboxes">
161 ${c.form['repo_enable_downloads'].render(css_class='medium')|n}
161 ${c.form['repo_enable_downloads'].render(css_class='medium')|n}
162 ${c.form.render_error(request, c.form['repo_enable_downloads'])|n}
162 ${c.form.render_error(request, c.form['repo_enable_downloads'])|n}
163 <span class="help-block">${_('Enable download menu on summary page.')}</span>
163 <span class="help-block">${_('Enable download menu on summary page.')}</span>
164 </div>
164 </div>
165 </div>
165 </div>
166 <div class="field">
166 <div class="field">
167 <div class="label label-checkbox">
167 <div class="label label-checkbox">
168 <label for="${c.form['repo_enable_locking'].oid}">${_('Enable automatic locking')}:</label>
168 <label for="${c.form['repo_enable_locking'].oid}">${_('Enable automatic locking')}:</label>
169 </div>
169 </div>
170 <div class="checkboxes">
170 <div class="checkboxes">
171 ${c.form['repo_enable_locking'].render(css_class='medium')|n}
171 ${c.form['repo_enable_locking'].render(css_class='medium')|n}
172 ${c.form.render_error(request, c.form['repo_enable_locking'])|n}
172 ${c.form.render_error(request, c.form['repo_enable_locking'])|n}
173 <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>
173 <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>
174 </div>
174 </div>
175 </div>
175 </div>
176
176
177 %if c.visual.repository_fields:
177 %if c.visual.repository_fields:
178 ## EXTRA FIELDS
178 ## EXTRA FIELDS
179 %for field in c.repo_fields:
179 %for field in c.repo_fields:
180 <div class="field">
180 <div class="field">
181 <div class="label">
181 <div class="label">
182 <label for="${field.field_key_prefixed}">${field.field_label} (${field.field_key}):</label>
182 <label for="${field.field_key_prefixed}">${field.field_label} (${field.field_key}):</label>
183 </div>
183 </div>
184 <div class="input input-medium">
184 <div class="input input-medium">
185 ${h.text(field.field_key_prefixed, field.field_value, class_='medium')}
185 ${h.text(field.field_key_prefixed, field.field_value, class_='medium')}
186 %if field.field_desc:
186 %if field.field_desc:
187 <span class="help-block">${field.field_desc}</span>
187 <span class="help-block">${field.field_desc}</span>
188 %endif
188 %endif
189 </div>
189 </div>
190 </div>
190 </div>
191 %endfor
191 %endfor
192 %endif
192 %endif
193 <div class="buttons">
193 <div class="buttons">
194 ${h.submit('save',_('Save'),class_="btn")}
194 ${h.submit('save',_('Save'),class_="btn")}
195 ${h.reset('reset',_('Reset'),class_="btn")}
195 ${h.reset('reset',_('Reset'),class_="btn")}
196 </div>
196 </div>
197 </div>
197 </div>
198 </div>
198 </div>
199 ${h.end_form()}
199 ${h.end_form()}
200 </div>
200 </div>
201 </div>
201 </div>
202
202
203 <script>
203 <script>
204 $(document).ready(function(){
204 $(document).ready(function(){
205 var cloneUrl = function() {
205 var cloneUrl = function() {
206 var alterButton = $('#alter_clone_uri');
206 var alterButton = $('#alter_clone_uri');
207 var editButton = $('#edit_clone_uri');
207 var editButton = $('#edit_clone_uri');
208 var cancelEditButton = $('#cancel_edit_clone_uri');
208 var cancelEditButton = $('#cancel_edit_clone_uri');
209 var hiddenUrl = $('#clone_uri_hidden');
209 var hiddenUrl = $('#clone_uri_hidden');
210 var hiddenUrlValue = $('#clone_uri_hidden_value');
210 var hiddenUrlValue = $('#clone_uri_hidden_value');
211 var input = $('#clone_uri');
211 var input = $('#clone_uri');
212 var helpBlock = $('#alter_clone_uri_help_block');
212 var helpBlock = $('#alter_clone_uri_help_block');
213 var changedFlag = $('#repo_clone_uri_change');
213 var changedFlag = $('#repo_clone_uri_change');
214 var originalText = helpBlock.html();
214 var originalText = helpBlock.html();
215 var obfuscatedUrl = hiddenUrlValue.html();
215 var obfuscatedUrl = hiddenUrlValue.html();
216
216
217 var edit = function(e) {
217 var edit = function(e) {
218 alterButton.show();
218 alterButton.show();
219 editButton.hide();
219 editButton.hide();
220 hiddenUrl.hide();
220 hiddenUrl.hide();
221
221
222 //add the old value next to input for verification
222 //add the old value next to input for verification
223 helpBlock.html("(" + obfuscatedUrl + ")" + "<br\>" + originalText);
223 helpBlock.html("(" + obfuscatedUrl + ")" + "<br\>" + originalText);
224 changedFlag.val('MOD');
224 changedFlag.val('MOD');
225 };
225 };
226
226
227 var cancelEdit = function(e) {
227 var cancelEdit = function(e) {
228 alterButton.hide();
228 alterButton.hide();
229 editButton.show();
229 editButton.show();
230 hiddenUrl.show();
230 hiddenUrl.show();
231
231
232 helpBlock.html(originalText);
232 helpBlock.html(originalText);
233 changedFlag.val('OLD');
233 changedFlag.val('OLD');
234 input.val('');
234 input.val('');
235 };
235 };
236
236
237 var initEvents = function() {
237 var initEvents = function() {
238 editButton.on('click', edit);
238 editButton.on('click', edit);
239 cancelEditButton.on('click', cancelEdit);
239 cancelEditButton.on('click', cancelEdit);
240 };
240 };
241
241
242 var setInitialState = function() {
242 var setInitialState = function() {
243 if (input.hasClass('error')) {
243 if (input.hasClass('error')) {
244 alterButton.show();
244 alterButton.show();
245 editButton.hide();
245 editButton.hide();
246 hiddenUrl.hide();
246 hiddenUrl.hide();
247 }
247 }
248 };
248 };
249
249
250 setInitialState();
250 setInitialState();
251 initEvents();
251 initEvents();
252 }();
252 }();
253
253
254 selectMyGroup = function(element) {
254 selectMyGroup = function(element) {
255 $("#repo_group").val($(element).data('personalGroupId')).trigger("change");
255 $("#repo_group").val($(element).data('personalGroupId')).trigger("change");
256 };
256 };
257
257
258 UsersAutoComplete('repo_owner', '${c.rhodecode_user.user_id}');
258 UsersAutoComplete('repo_owner', '${c.rhodecode_user.user_id}');
259 });
259 });
260 </script>
260 </script>
General Comments 0
You need to be logged in to leave comments. Login now