##// END OF EJS Templates
ui: owner icon is consistent width for better user experience
super-admin -
r5011:8902033d default
parent child Browse files
Show More
@@ -1,411 +1,411 b''
1 1 // forms.less
2 2 // For use in RhodeCode applications;
3 3 // see style guide documentation for guidelines.
4 4
5 5 form.rcform {
6 6
7 7 // reset for ie
8 8 // using :not(#ie) prevents older browsers from applying these rules
9 9 input[type="radio"],
10 10 input[type="checkbox"] {
11 11 padding: 0;
12 12 border: none;
13 13 }
14 14 label { display: inline; border:none; padding:0; }
15 15 .label { display: none; }
16 16
17 17 max-width: 940px;
18 18 line-height: normal;
19 19 white-space: normal;
20 20 font-size: @basefontsize;
21 21 font-family: @text-light;
22 22 color: @form-textcolor;
23 23
24 24 fieldset,
25 25 .buttons {
26 26 clear: both;
27 27 position: relative;
28 28 display:block;
29 29 width: 100%;
30 30 min-height: 3em;
31 31 margin-bottom: @form-vertical-margin;
32 32 line-height: 1.2em;
33 33
34 34 &:after { //clearfix
35 35 content: "";
36 36 clear: both;
37 37 width: 100%;
38 38 height: 1em;
39 39 }
40 40
41 41 .label:not(#ie) {
42 42 display: inline;
43 43 margin: 0 1em 0 .5em;
44 44 line-height: 1em;
45 45 }
46 46 }
47 47
48 48 legend {
49 49 float: left;
50 50 display: block;
51 51 width: @legend-width;
52 52 margin: 0;
53 53 padding: 0 @padding 0 0;
54 54 }
55 55
56 56 .fields {
57 57 float: left;
58 58 display: block;
59 59 width: 100%;
60 60 max-width: 500px;
61 61 margin: 0 0 @padding -@legend-width;
62 62 padding: 0 0 0 @legend-width;
63 63
64 64 .btn {
65 65 display: inline-block;
66 66 margin: 0 1em @padding 0;
67 67 }
68 68 }
69 69
70 70 input,
71 71 textarea {
72 72 float: left;
73 73 .box-sizing(content-box);
74 74 padding: @input-padding;
75 75 border: @border-thickness-inputs solid @grey4;
76 76 }
77 77
78 78 input {
79 79 float: left;
80 80 margin: 0 @input-padding 0 0;
81 81 line-height: 1em;
82 82 }
83 83
84 84 input[type="text"],
85 85 input[type="password"],
86 86 textarea {
87 87 float: left;
88 88 min-width: 200px;
89 89 margin: 0 1em @padding 0;
90 90 color: @form-textcolor;
91 91 }
92 92
93 93 input[type="text"],
94 94 input[type="password"] {
95 95 height: 1em;
96 96 }
97 97
98 98 textarea {
99 99 width: 100%;
100 100 margin-top: -1em; //so it lines up with legend
101 101 overflow: auto;
102 102 }
103 103
104 104 label:not(#ie) {
105 105 cursor: pointer;
106 106 display: inline-block;
107 107 position: relative;
108 108 background: white;
109 109 border-radius: 4px;
110 110 box-shadow: none;
111 111
112 112 &:hover::after {
113 113 opacity: 0.5;
114 114 }
115 115 }
116 116
117 117 input[type="radio"]:not(#ie),
118 118 input[type="checkbox"]:not(#ie) {
119 119 // Hide the input, but have it still be clickable
120 120 opacity: 0;
121 121 float: left;
122 122 height: 0;
123 123 width: 0;
124 124 margin: 0;
125 125 padding: 0;
126 126 }
127 127 input[type='radio'] + label:not(#ie),
128 128 input[type='checkbox'] + label:not(#ie) {
129 129 margin: 0;
130 130 clear: none;
131 131 }
132 132
133 133 input[type='radio'] + label:not(#ie) {
134 134 .circle (@form-radio-width,white);
135 135 float: left;
136 136 display: inline-block;
137 137 height: @form-radio-width;
138 138 width: @form-radio-width;
139 139 margin: 2px 6px 2px 0;
140 140 border: 1px solid @grey4;
141 141 background-color: white;
142 142 box-shadow: none;
143 143 text-indent: -9999px;
144 144 transition: none;
145 145
146 146 & + .label {
147 147 float: left;
148 148 margin-top: 7px
149 149 }
150 150 }
151 151
152 152 input[type='radio']:checked + label:not(#ie) {
153 153 margin: 0 4px 0 -2px;
154 154 padding: 3px;
155 155 border-style: double;
156 156 border-color: white;
157 157 border-width: thick;
158 158 background-color: @rcblue;
159 159 box-shadow: none;
160 160 }
161 161
162 162 input[type='checkbox'] + label:not(#ie) {
163 163 float: left;
164 164 width: @form-check-width;
165 165 height: @form-check-width;
166 166 margin: 0 5px 1em 0;
167 167 border: 1px solid @grey3;
168 168 .border-radius(@border-radius);
169 169 background-color: white;
170 170 box-shadow: none;
171 171 text-indent: -9999px;
172 172 transition: none;
173 173
174 174 &:after {
175 175 content: '';
176 176 width: 9px;
177 177 height: 5px;
178 178 position: absolute;
179 179 top: 4px;
180 180 left: 4px;
181 181 border: 3px solid @grey3;
182 182 border-top: none;
183 183 border-right: none;
184 184 background: transparent;
185 185 opacity: 0;
186 186 transform: rotate(-45deg);
187 187 filter: progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=0.7071067811865476, M12=-0.7071067811865475, M21=0.7071067811865475, M22=0.7071067811865476); /* IE6,IE7 */
188 188
189 189 -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(SizingMethod='auto expand', M11=0.7071067811865476, M12=-0.7071067811865475, M21=0.7071067811865475, M22=0.7071067811865476)"; /* IE8 */ }
190 190
191 191 & + .label {
192 192 float: left;
193 193 margin-top: 5px
194 194 }
195 195 }
196 196
197 197 input[type=checkbox]:not(#ie) {
198 198 visibility: hidden;
199 199 &:checked + label:after {
200 200 opacity: 1;
201 201 }
202 202 }
203 203
204 204 // center checkbox and label on a drop-down
205 205 .drop-menu + select + input[type='checkbox'] + label:not(#ie) {
206 206 margin-top:10px;
207 207
208 208 & + .label {
209 209 margin-top: 15px;
210 210 }
211 211 }
212 212
213 213 .formlist {
214 214 position: relative;
215 215 float: left;
216 216 margin: 0;
217 217 padding: 0;
218 218
219 219 li {
220 220 list-style-type: none;
221 221
222 222 &:after {
223 223 content: "";
224 224 float: left;
225 225 display: block;
226 226 height: @padding;
227 227 width: 100%;
228 228 }
229 229 }
230 230 }
231 231
232 232 .drop-menu {
233 233 float: left;
234 234
235 235 & + .last-item {
236 236 margin: 0;
237 237 }
238 238
239 239 margin: 0 @input-padding 0 0;
240 240 }
241 241
242 242 .help-block,
243 243 .error-message {
244 244 display: block;
245 245 clear: both;
246 246 margin: @textmargin 0;
247 247 }
248 248
249 249 .error-message {
250 250 margin-top: 5px;
251 251 }
252 252
253 253 input[type=submit] {
254 254 &:extend(.btn-primary);
255 255
256 256 &:hover {
257 257 &:extend(.btn-primary:hover);
258 258 }
259 259 }
260 260
261 261 input[type=reset] {
262 262 &:extend(.btn-default);
263 263
264 264 &:hover {
265 265 &:extend(.btn-default:hover);
266 266 }
267 267 }
268 268
269 269 select,
270 270 option:checked {
271 271 background-color: @rclightblue;
272 272 }
273 273
274 274 }
275 275
276 276 .rcform-element {
277 277
278 278 label { display: inline; border:none; padding:0; }
279 279 .label { display: none; }
280 280
281 281 label:not(#ie) {
282 282 cursor: pointer;
283 283 display: inline-block;
284 284 position: relative;
285 285 background: white;
286 286 border-radius: 4px;
287 287 box-shadow: none;
288 288
289 289 &:hover::after {
290 290 opacity: 0.5;
291 291 }
292 292 }
293 293
294 294 input[type="radio"],
295 295 input[type="checkbox"] {
296 296 padding: 0;
297 297 border: none;
298 298 }
299 299
300 300 input[type="radio"]:not(#ie),
301 301 input[type="checkbox"]:not(#ie) {
302 302 // Hide the input, but have it still be clickable
303 303 opacity: 0;
304 304 float: left;
305 305 height: 0;
306 306 width: 0;
307 307 margin: 0;
308 308 padding: 0;
309 309 }
310 310 input[type='radio'] + label:not(#ie),
311 311 input[type='checkbox'] + label:not(#ie) {
312 312 margin: 0;
313 313 clear: none;
314 314 }
315 315
316 316 input[type='radio'] + label:not(#ie) {
317 317 .circle (@form-radio-width,white);
318 318 float: left;
319 319 display: inline-block;
320 320 height: @form-radio-width;
321 321 width: @form-radio-width;
322 322 margin: 2px 2px 2px 0;
323 323 border: 1px solid @grey4;
324 324 background-color: white;
325 325 box-shadow: none;
326 326 text-indent: -9999px;
327 327 transition: none;
328 328
329 329 & + .label {
330 330 float: left;
331 331 margin-top: 7px
332 332 }
333 333 }
334 334
335 335 input[type='radio']:checked + label:not(#ie) {
336 336 margin: 0 0px 0 -2px;
337 337 padding: 3px;
338 338 border-style: double;
339 339 border-color: white;
340 340 border-width: thick;
341 341 background-color: @rcblue;
342 342 box-shadow: none;
343 343 }
344 344
345 345 fieldset {
346 346 .label:not(#ie) {
347 347 display: inline;
348 348 margin: 0 1em 0 .5em;
349 349 line-height: 1em;
350 350 }
351 351 }
352 352
353 353 }
354 354
355 355 .badged-field {
356 356 .user-badge {
357 line-height: 25px;
357 line-height: 18px;
358 358 padding: .4em;
359 359 border-radius: @border-radius;
360 360 border-top: 1px solid @grey4;
361 361 border-left: 1px solid @grey4;
362 362 border-bottom: 1px solid @grey4;
363 363 font-size: 14px;
364 364 font-style: normal;
365 365 color: @text-light;
366 366 background: @grey7;
367 367 display: inline-block;
368 368 vertical-align: top;
369 369 cursor: default;
370 370 margin-right: -2px;
371 371 }
372 372 .badge-input-container {
373 373 display: flex;
374 374 position: relative;
375 375 }
376 376 .user-disabled {
377 377 text-decoration: line-through;
378 378 }
379 379 .badge-input-wrap {
380 380 display: inline-block;
381 381 }
382 382 }
383 383
384 384 // for situations where we wish to display the form value but not the form input
385 385 input.input-valuedisplay {
386 386 border: none;
387 387 }
388 388
389 389 // for forms which only display information
390 390 .infoform {
391 391 .fields {
392 392 .field {
393 393 label,
394 394 .label,
395 395 input,
396 396 .input {
397 397 margin-top: 0;
398 398 margin-bottom: 0;
399 399 padding-top: 0;
400 400 padding-bottom: 0;
401 401 }
402 402 }
403 403 }
404 404 }
405 405
406 406 .repo-type-radio input {
407 407 margin: 0 0 0 0
408 408 }
409 409 .repo-type-radio label {
410 410 padding-right: 15px;
411 411 }
@@ -1,89 +1,89 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%namespace name="base" file="/base/base.mako"/>
3 3
4 4 <div class="panel panel-default">
5 5 <div class="panel-heading">
6 6 <h3 class="panel-title">${_('Repository Group Settings: {}').format(c.repo_group.name)}</h3>
7 7 </div>
8 8 <div class="panel-body">
9 9 ${h.secure_form(h.route_path('edit_repo_group', repo_group_name=c.repo_group.group_name), request=request)}
10 10 <div class="form">
11 11 <!-- fields -->
12 12 <div class="fields">
13 13 <div class="field">
14 14 <div class="label">
15 15 <label for="group_name">${_('Group name')}:</label>
16 16 </div>
17 17 <div class="input">
18 18 ${c.form['repo_group_name'].render(css_class='medium', oid='group_name')|n}
19 19 ${c.form.render_error(request, c.form['repo_group_name'])|n}
20 20 </div>
21 21 </div>
22 22
23 23 <div class="field">
24 24 <div class="label">
25 25 <label for="repo_group">${_('Repository group')}:</label>
26 26 </div>
27 27 <div class="select">
28 28 ${c.form['repo_group'].render(css_class='medium', oid='repo_group')|n}
29 29 ${c.form.render_error(request, c.form['repo_group'])|n}
30 30
31 31 <p class="help-block">${_('Optional select a parent group to move this repository group into.')}</p>
32 32 </div>
33 33 </div>
34 34
35 35 <div class="field badged-field">
36 36 <div class="label">
37 37 <label for="repo_group_owner">${_('Owner')}:</label>
38 38 </div>
39 39 <div class="input">
40 40 <div class="badge-input-container">
41 41 <div class="user-badge">
42 ${base.gravatar_with_user(c.repo_group.user.email, show_disabled=not c.repo_group.user.active)}
42 ${base.gravatar(c.repo_group.user.email, user=c.repo_group.user, tooltip=True)}
43 43 </div>
44 44 <div class="badge-input-wrap">
45 45 ${c.form['repo_group_owner'].render(css_class='medium', oid='repo_group_owner')|n}
46 46 </div>
47 47 </div>
48 48 ${c.form.render_error(request, c.form['repo_group_owner'])|n}
49 49 <p class="help-block">${_('Change owner of this repository group.')}</p>
50 50 </div>
51 51 </div>
52 52
53 53 <div class="field">
54 54 <div class="label label-textarea">
55 55 <label for="repo_group_description">${_('Description')}:</label>
56 56 </div>
57 57 <div class="textarea text-area editor">
58 58 ${c.form['repo_group_description'].render(css_class='medium', oid='repo_group_description')|n}
59 59 ${c.form.render_error(request, c.form['repo_group_description'])|n}
60 60
61 61 <% metatags_url = h.literal('''<a href="#metatagsShow" onclick="$('#meta-tags-desc').toggle();return false">meta-tags</a>''') %>
62 62 <span class="help-block">
63 63 % if c.visual.stylify_metatags:
64 64 ${_('Plain text format with {metatags} support.').format(metatags=metatags_url)|n}
65 65 % else:
66 66 ${_('Plain text format.')}
67 67 % endif
68 68 </span>
69 69 <span id="meta-tags-desc" style="display: none">
70 70 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
71 71 ${dt.metatags_help()}
72 72 </span>
73 73 </div>
74 74 </div>
75 75
76 76 <div class="buttons">
77 77 ${h.submit('save',_('Save'),class_="btn")}
78 78 ${h.reset('reset',_('Reset'),class_="btn")}
79 79 </div>
80 80 </div>
81 81 </div>
82 82 ${h.end_form()}
83 83 </div>
84 84 </div>
85 85 <script>
86 86 $(document).ready(function(){
87 87 UsersAutoComplete('repo_group_owner', '${c.rhodecode_user.user_id}');
88 88 })
89 89 </script>
@@ -1,337 +1,337 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%namespace name="base" file="/base/base.mako"/>
3 3
4 4 <div class="panel panel-default">
5 5 <div class="panel-heading">
6 6 <h3 class="panel-title">${_('Settings for Repository: %s') % c.rhodecode_db_repo.repo_name}</h3>
7 7 </div>
8 8 <div class="panel-body">
9 9 ${h.secure_form(h.route_path('edit_repo', repo_name=c.rhodecode_db_repo.repo_name), request=request)}
10 10 <div class="form">
11 11 <!-- fields -->
12 12 <div class="fields">
13 13
14 14 <div class="field">
15 15 <div class="label">
16 16 <label for="repo_name">${_('Name')}:</label>
17 17 </div>
18 18 <div class="input">
19 19 ${c.form['repo_name'].render(css_class='medium', oid='repo_name')|n}
20 20 ${c.form.render_error(request, c.form['repo_name'])|n}
21 21
22 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 23 <p id="clone_id" style="display:none;">
24 24 ${_('URL by id')}: `${c.rhodecode_db_repo.clone_url(with_id=True)}` <br/>
25 25 ${_('''In case this repository is renamed or moved into another group the repository url changes.
26 26 Using above url guarantees that this repository will always be accessible under such url.
27 27 Useful for CI systems, or any other cases that you need to hardcode the url into 3rd party service.''')}</p>
28 28 </div>
29 29 </div>
30 30
31 31 <div class="field">
32 32 <div class="label">
33 33 <label for="repo_group">${_('Repository group')}:</label>
34 34 </div>
35 35 <div class="select">
36 36 ${c.form['repo_group'].render(css_class='medium', oid='repo_group')|n}
37 37 ${c.form.render_error(request, c.form['repo_group'])|n}
38 38
39 39 % if c.personal_repo_group:
40 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 41 ${_('Select my personal group (`%(repo_group_name)s`)') % {'repo_group_name': c.personal_repo_group.group_name}}
42 42 </a>
43 43 % endif
44 44 <p class="help-block">${_('Optional select a group to put this repository into.')}</p>
45 45 </div>
46 46 </div>
47 47
48 48 % if c.rhodecode_db_repo.repo_type != 'svn':
49 49 <% sync_link = h.literal(h.link_to('remote sync', h.route_path('edit_repo_remote', repo_name=c.repo_name))) %>
50 50 <div class="field">
51 51 <div class="label">
52 52 <label for="clone_uri">${_('Remote pull uri')}:</label>
53 53 </div>
54 54 <div class="input">
55 55 %if c.rhodecode_db_repo.clone_uri:
56 56 ## display, if we don't have any errors
57 57 % if not c.form['repo_clone_uri'].error:
58 58 <div id="clone_uri_hidden" class='text-as-placeholder'>
59 59 <span id="clone_uri_hidden_value">${c.rhodecode_db_repo.clone_uri_hidden}</span>
60 60 <span class="link" id="edit_clone_uri">${_('edit')}</span>
61 61 </div>
62 62 % endif
63 63
64 64 ## alter field
65 65 <div id="alter_clone_uri" style="${'' if c.form['repo_clone_uri'].error else 'display: none'}">
66 66 ${c.form['repo_clone_uri'].render(css_class='medium', oid='clone_uri', placeholder=_('enter new value, or leave empty to remove'))|n}
67 67 ${c.form.render_error(request, c.form['repo_clone_uri'])|n}
68 68 % if c.form['repo_clone_uri'].error:
69 69 ## we got error from form subit, means we modify the url
70 70 ${h.hidden('repo_clone_uri_change', 'MOD')}
71 71 % else:
72 72 ${h.hidden('repo_clone_uri_change', 'OLD')}
73 73 % endif
74 74
75 75 % if not c.form['repo_clone_uri'].error:
76 76 <span class="link" id="cancel_edit_clone_uri">${_('cancel')}</span>
77 77 % endif
78 78
79 79 </div>
80 80 %else:
81 81 ## not set yet, display form to set it
82 82 ${c.form['repo_clone_uri'].render(css_class='medium', oid='clone_uri')|n}
83 83 ${c.form.render_error(request, c.form['repo_clone_uri'])|n}
84 84 ${h.hidden('repo_clone_uri_change', 'NEW')}
85 85 %endif
86 86 <p id="alter_clone_uri_help_block" class="help-block">
87 87 ${_('http[s] url where from repository was imported. This field can used for doing {sync_link}.').format(sync_link=sync_link)|n} <br/>
88 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 89 </p>
90 90 </div>
91 91 </div>
92 92 <div class="field">
93 93 <div class="label">
94 94 <label for="push_uri">${_('Remote push uri')}:</label>
95 95 </div>
96 96 <div class="input">
97 97 %if c.rhodecode_db_repo.push_uri:
98 98 ## display, if we don't have any errors
99 99 % if not c.form['repo_push_uri'].error:
100 100 <div id="push_uri_hidden" class='text-as-placeholder'>
101 101 <span id="push_uri_hidden_value">${c.rhodecode_db_repo.push_uri_hidden}</span>
102 102 <span class="link" id="edit_push_uri">${_('edit')}</span>
103 103 </div>
104 104 % endif
105 105
106 106 ## alter field
107 107 <div id="alter_push_uri" style="${'' if c.form['repo_push_uri'].error else 'display: none'}">
108 108 ${c.form['repo_push_uri'].render(css_class='medium', oid='push_uri', placeholder=_('enter new value, or leave empty to remove'))|n}
109 109 ${c.form.render_error(request, c.form['repo_push_uri'])|n}
110 110 % if c.form['repo_push_uri'].error:
111 111 ## we got error from form subit, means we modify the url
112 112 ${h.hidden('repo_push_uri_change', 'MOD')}
113 113 % else:
114 114 ${h.hidden('repo_push_uri_change', 'OLD')}
115 115 % endif
116 116
117 117 % if not c.form['repo_push_uri'].error:
118 118 <span class="link" id="cancel_edit_push_uri">${_('cancel')}</span>
119 119 % endif
120 120
121 121 </div>
122 122 %else:
123 123 ## not set yet, display form to set it
124 124 ${c.form['repo_push_uri'].render(css_class='medium', oid='push_uri')|n}
125 125 ${c.form.render_error(request, c.form['repo_push_uri'])|n}
126 126 ${h.hidden('repo_push_uri_change', 'NEW')}
127 127 %endif
128 128 <p id="alter_push_uri_help_block" class="help-block">
129 129 ${_('http[s] url to sync data back. This field can used for doing {sync_link}.').format(sync_link=sync_link)|n} <br/>
130 130 ${_('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.')}
131 131 </p>
132 132 </div>
133 133 </div>
134 134 % else:
135 135 ${h.hidden('repo_clone_uri', '')}
136 136 ${h.hidden('repo_push_uri', '')}
137 137 % endif
138 138
139 139 <div class="field">
140 140 <div class="label">
141 141 <label for="repo_landing_commit_ref">${_('Landing commit')}:</label>
142 142 </div>
143 143 <div class="select">
144 144 ${c.form['repo_landing_commit_ref'].render(css_class='medium', oid='repo_landing_commit_ref')|n}
145 145 ${c.form.render_error(request, c.form['repo_landing_commit_ref'])|n}
146 146 <p class="help-block">${_('The default commit for file pages, downloads, full text search index, and README generation.')}</p>
147 147 </div>
148 148 </div>
149 149
150 150 <div class="field badged-field">
151 151 <div class="label">
152 152 <label for="repo_owner">${_('Owner')}:</label>
153 153 </div>
154 154 <div class="input">
155 155 <div class="badge-input-container">
156 156 <div class="user-badge">
157 ${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)}
157 ${base.gravatar(c.rhodecode_db_repo.user.email or c.rhodecode_db_repo.user.username, user=c.rhodecode_db_repo.user, tooltip=True)}
158 158 </div>
159 159 <div class="badge-input-wrap">
160 160 ${c.form['repo_owner'].render(css_class='medium', oid='repo_owner')|n}
161 161 </div>
162 162 </div>
163 163 ${c.form.render_error(request, c.form['repo_owner'])|n}
164 164 <p class="help-block">${_('Change owner of this repository.')}</p>
165 165 </div>
166 166 </div>
167 167
168 168 <div class="field">
169 169 <div class="label label-textarea">
170 170 <label for="repo_description">${_('Description')}:</label>
171 171 </div>
172 172 <div class="textarea text-area editor">
173 173 ${c.form['repo_description'].render(css_class='medium', oid='repo_description')|n}
174 174 ${c.form.render_error(request, c.form['repo_description'])|n}
175 175
176 176 <% metatags_url = h.literal('''<a href="#metatagsShow" onclick="$('#meta-tags-desc').toggle();return false">meta-tags</a>''') %>
177 177 <span class="help-block">
178 178 % if c.visual.stylify_metatags:
179 179 ${_('Plain text format with {metatags} support.').format(metatags=metatags_url)|n}
180 180 % else:
181 181 ${_('Plain text format.')}
182 182 % endif
183 183 ${_('Add a README file for longer descriptions')}
184 184 </span>
185 185 <span id="meta-tags-desc" style="display: none">
186 186 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
187 187 ${dt.metatags_help()}
188 188 </span>
189 189 </div>
190 190 </div>
191 191
192 192 <div class="field">
193 193 <div class="label label-checkbox">
194 194 <label for="${c.form['repo_private'].oid}">${_('Private repository')}:</label>
195 195 </div>
196 196 <div class="checkboxes">
197 197 ${c.form['repo_private'].render(css_class='medium')|n}
198 198 ${c.form.render_error(request, c.form['repo_private'])|n}
199 199 <span class="help-block">${_('Private repositories are only visible to people explicitly added as collaborators.')}</span>
200 200 </div>
201 201 </div>
202 202 <div class="field">
203 203 <div class="label label-checkbox">
204 204 <label for="${c.form['repo_enable_statistics'].oid}">${_('Enable statistics')}:</label>
205 205 </div>
206 206 <div class="checkboxes">
207 207 ${c.form['repo_enable_statistics'].render(css_class='medium')|n}
208 208 ${c.form.render_error(request, c.form['repo_enable_statistics'])|n}
209 209 <span class="help-block">${_('Enable statistics window on summary page.')}</span>
210 210 </div>
211 211 </div>
212 212 <div class="field">
213 213 <div class="label label-checkbox">
214 214 <label for="${c.form['repo_enable_downloads'].oid}">${_('Enable downloads')}:</label>
215 215 </div>
216 216 <div class="checkboxes">
217 217 ${c.form['repo_enable_downloads'].render(css_class='medium')|n}
218 218 ${c.form.render_error(request, c.form['repo_enable_downloads'])|n}
219 219 <span class="help-block">${_('Enable download menu on summary page.')}</span>
220 220 </div>
221 221 </div>
222 222 <div class="field">
223 223 <div class="label label-checkbox">
224 224 <label for="${c.form['repo_enable_locking'].oid}">${_('Enable automatic locking')}:</label>
225 225 </div>
226 226 <div class="checkboxes">
227 227 ${c.form['repo_enable_locking'].render(css_class='medium')|n}
228 228 ${c.form.render_error(request, c.form['repo_enable_locking'])|n}
229 229 <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>
230 230 </div>
231 231 </div>
232 232
233 233 %if c.visual.repository_fields:
234 234 ## EXTRA FIELDS
235 235 %for field in c.repo_fields:
236 236 <div class="field">
237 237 <div class="label">
238 238 <label for="${field.field_key_prefixed}">${(field.field_label or field.field_key)}:</label>
239 239 </div>
240 240 <div class="input input-medium">
241 241 ${h.text(field.field_key_prefixed, field.field_value, class_='medium')}
242 242 <span class="help-block">
243 243 key: ${field.field_key};
244 244 ${field.field_desc}
245 245 </span>
246 246 </div>
247 247 </div>
248 248 %endfor
249 249 %endif
250 250 <div class="buttons">
251 251 ${h.submit('save',_('Save'),class_="btn")}
252 252 ${h.reset('reset',_('Reset'),class_="btn")}
253 253 </div>
254 254 </div>
255 255 </div>
256 256 ${h.end_form()}
257 257 </div>
258 258 </div>
259 259
260 260 <script>
261 261 $(document).ready(function () {
262 262 var cloneUrl = function (
263 263 alterButton, editButton, cancelEditButton,
264 264 hiddenUrl, hiddenUrlValue, input, helpBlock, changedFlag) {
265 265
266 266 var originalText = helpBlock.html();
267 267 var obfuscatedUrl = hiddenUrlValue.html();
268 268
269 269 var edit = function(e) {
270 270 alterButton.show();
271 271 editButton.hide();
272 272 hiddenUrl.hide();
273 273
274 274 //add the old value next to input for verification
275 275 helpBlock.html("(" + obfuscatedUrl + ")" + "<br\>" + originalText);
276 276 changedFlag.val('MOD');
277 277 };
278 278
279 279 var cancelEdit = function(e) {
280 280 alterButton.hide();
281 281 editButton.show();
282 282 hiddenUrl.show();
283 283
284 284 helpBlock.html(originalText);
285 285 changedFlag.val('OLD');
286 286 input.val('');
287 287 };
288 288
289 289 var initEvents = function() {
290 290 editButton.on('click', edit);
291 291 cancelEditButton.on('click', cancelEdit);
292 292 };
293 293
294 294 var setInitialState = function() {
295 295 if (input.hasClass('error')) {
296 296 alterButton.show();
297 297 editButton.hide();
298 298 hiddenUrl.hide();
299 299 }
300 300 };
301 301
302 302 setInitialState();
303 303 initEvents();
304 304 };
305 305
306 306
307 307 var alterButton = $('#alter_clone_uri');
308 308 var editButton = $('#edit_clone_uri');
309 309 var cancelEditButton = $('#cancel_edit_clone_uri');
310 310 var hiddenUrl = $('#clone_uri_hidden');
311 311 var hiddenUrlValue = $('#clone_uri_hidden_value');
312 312 var input = $('#clone_uri');
313 313 var helpBlock = $('#alter_clone_uri_help_block');
314 314 var changedFlag = $('#repo_clone_uri_change');
315 315 cloneUrl(
316 316 alterButton, editButton, cancelEditButton, hiddenUrl,
317 317 hiddenUrlValue, input, helpBlock, changedFlag);
318 318
319 319 var alterButton = $('#alter_push_uri');
320 320 var editButton = $('#edit_push_uri');
321 321 var cancelEditButton = $('#cancel_edit_push_uri');
322 322 var hiddenUrl = $('#push_uri_hidden');
323 323 var hiddenUrlValue = $('#push_uri_hidden_value');
324 324 var input = $('#push_uri');
325 325 var helpBlock = $('#alter_push_uri_help_block');
326 326 var changedFlag = $('#repo_push_uri_change');
327 327 cloneUrl(
328 328 alterButton, editButton, cancelEditButton, hiddenUrl,
329 329 hiddenUrlValue, input, helpBlock, changedFlag);
330 330
331 331 selectMyGroup = function(element) {
332 332 $("#repo_group").val($(element).data('personalGroupId')).trigger("change");
333 333 };
334 334
335 335 UsersAutoComplete('repo_owner', '${c.rhodecode_user.user_id}');
336 336 });
337 337 </script>
@@ -1,191 +1,191 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%namespace name="base" file="/base/base.mako"/>
3 3
4 4 <div class="panel panel-default">
5 5 <div class="panel-heading">
6 6 <h3 class="panel-title">
7 7 <i class="icon-user-group" title="${_('User group')}"></i>
8 8 ${h.link_to_group(c.user_group.users_group_name)}
9 9 - ${_('Settings')}
10 10 </h3>
11 11 </div>
12 12 <div class="panel-body">
13 13 ${h.secure_form(h.route_path('user_groups_update', user_group_id=c.user_group.users_group_id), id='edit_user_group', request=request)}
14 14 <div class="form">
15 15 <!-- fields -->
16 16 <div class="fields">
17 17 <div class="field">
18 18 <div class="label">
19 19 <label for="users_group_name">${_('Group name')}:</label>
20 20 </div>
21 21 <div class="input">
22 22 ${h.text('users_group_name',class_='medium')}
23 23 </div>
24 24 </div>
25 25
26 26 <div class="field badged-field">
27 27 <div class="label">
28 28 <label for="user">${_('Owner')}:</label>
29 29 </div>
30 30 <div class="input">
31 31 <div class="badge-input-container">
32 32 <div class="user-badge">
33 ${base.gravatar_with_user(c.user_group.user.email, show_disabled=not c.user_group.user.active)}
33 ${base.gravatar(c.user_group.user.email, user=c.user_group.user, tooltip=True)}
34 34 </div>
35 35 <div class="badge-input-wrap">
36 36 ${h.text('user', class_="medium", autocomplete="off")}
37 37 </div>
38 38 </div>
39 39 <form:error name="user"/>
40 40 <p class="help-block">${_('Change owner of this user group.')}</p>
41 41 </div>
42 42 </div>
43 43
44 44 <div class="field">
45 45 <div class="label label-textarea">
46 46 <label for="user_group_description">${_('Description')}:</label>
47 47 </div>
48 48 <div class="textarea textarea-small editor">
49 49 ${h.textarea('user_group_description',cols=23,rows=5,class_="medium")}
50 50 <span class="help-block">${_('Short, optional description for this user group.')}</span>
51 51 </div>
52 52 </div>
53 53 <div class="field">
54 54 <div class="label label-checkbox">
55 55 <label for="users_group_active">${_('Active')}:</label>
56 56 </div>
57 57 <div class="checkboxes">
58 58 ${h.checkbox('users_group_active',value=True)}
59 59 </div>
60 60 </div>
61 61
62 62 <div class="field">
63 63 <div class="label label-checkbox">
64 64 <label for="users_group_active">${_('Add members')}:</label>
65 65 </div>
66 66 <div class="input">
67 67 ${h.text('user_group_add_members', placeholder="user/usergroup", class_="medium")}
68 68 </div>
69 69 </div>
70 70
71 71 <input type="hidden" name="__start__" value="user_group_members:sequence"/>
72 72 <table id="group_members_placeholder" class="rctable group_members">
73 73 <tr>
74 74 <th>${_('Username')}</th>
75 75 <th>${_('Action')}</th>
76 76 </tr>
77 77
78 78 % if c.group_members_obj:
79 79 % for user in c.group_members_obj:
80 80 <tr>
81 81 <td id="member_user_${user.user_id}" class="td-author">
82 82 <div class="group_member">
83 83 ${base.gravatar(user.email, 16, user=user, tooltip=True)}
84 84 <span class="username user">${h.link_to(h.person(user), h.route_path('user_edit',user_id=user.user_id))}</span>
85 85 <input type="hidden" name="__start__" value="member:mapping">
86 86 <input type="hidden" name="member_user_id" value="${user.user_id}">
87 87 <input type="hidden" name="type" value="existing" id="member_${user.user_id}">
88 88 <input type="hidden" name="__end__" value="member:mapping">
89 89 </div>
90 90 </td>
91 91 <td class="">
92 92 <div class="usergroup_member_remove action_button" onclick="removeUserGroupMember(${user.user_id}, true)" style="visibility: visible;">
93 93 <i class="icon-remove"></i>
94 94 </div>
95 95 </td>
96 96 </tr>
97 97 % endfor
98 98
99 99 % else:
100 100 <tr><td colspan="2">${_('No members yet')}</td></tr>
101 101 % endif
102 102 </table>
103 103 <input type="hidden" name="__end__" value="user_group_members:sequence"/>
104 104
105 105 <div class="buttons">
106 106 ${h.submit('Save',_('Save'),class_="btn")}
107 107 </div>
108 108 </div>
109 109 </div>
110 110 ${h.end_form()}
111 111 </div>
112 112 </div>
113 113 <script>
114 114 $(document).ready(function(){
115 115 $("#group_parent_id").select2({
116 116 'containerCssClass': "drop-menu",
117 117 'dropdownCssClass': "drop-menu-dropdown",
118 118 'dropdownAutoWidth': true
119 119 });
120 120
121 121 removeUserGroupMember = function(userId){
122 122 $('#member_'+userId).val('remove');
123 123 $('#member_user_'+userId).addClass('to-delete');
124 124 };
125 125
126 126 $('#user_group_add_members').autocomplete({
127 127 serviceUrl: pyroutes.url('user_autocomplete_data'),
128 128 minChars:2,
129 129 maxHeight:400,
130 130 width:300,
131 131 deferRequestBy: 300, //miliseconds
132 132 showNoSuggestionNotice: true,
133 133 params: { user_groups:true },
134 134 formatResult: autocompleteFormatResult,
135 135 lookupFilter: autocompleteFilterResult,
136 136 onSelect: function(element, suggestion){
137 137
138 138 function addMember(user, fromUserGroup) {
139 139 var gravatar = user.icon_link;
140 140 var username = user.value_display;
141 141 var userLink = pyroutes.url('user_edit', {"user_id": user.id});
142 142 var uid = user.id;
143 143
144 144 if (fromUserGroup) {
145 145 username = username +" "+ _gettext('(from usergroup {0})'.format(fromUserGroup))
146 146 }
147 147
148 148 var elem = $(
149 149 ('<tr>'+
150 150 '<td id="member_user_{6}" class="td-author td-author-new-entry">'+
151 151 '<div class="group_member">'+
152 152 '<img class="gravatar" src="{0}" height="16" width="16">'+
153 153 '<span class="username user"><a href="{1}">{2}</a></span>'+
154 154 '<input type="hidden" name="__start__" value="member:mapping">'+
155 155 '<input type="hidden" name="member_user_id" value="{3}">'+
156 156 '<input type="hidden" name="type" value="new" id="member_{4}">'+
157 157 '<input type="hidden" name="__end__" value="member:mapping">'+
158 158 '</div>'+
159 159 '</td>'+
160 160 '<td class="td-author-new-entry">'+
161 161 '<div class="usergroup_member_remove action_button" onclick="removeUserGroupMember({5}, true)" style="visibility: visible;">'+
162 162 '<i class="icon-remove"></i>'+
163 163 '</div>'+
164 164 '</td>'+
165 165 '</tr>').format(gravatar, userLink, username,
166 166 uid, uid, uid, uid)
167 167 );
168 168 $('#group_members_placeholder').append(elem)
169 169 }
170 170
171 171 if (suggestion.value_type == 'user_group') {
172 172 $.getJSON(
173 173 pyroutes.url('user_group_members_data',
174 174 {'user_group_id': suggestion.id}),
175 175 function(data) {
176 176 $.each(data.members, function(idx, user) {
177 177 addMember(user, suggestion.value)
178 178 });
179 179 }
180 180 );
181 181 } else if (suggestion.value_type == 'user') {
182 182 addMember(suggestion, null);
183 183 }
184 184 $('#user_group_add_members').val('')
185 185 }
186 186 });
187 187
188 188
189 189 UsersAutoComplete('user', '${c.rhodecode_user.user_id}');
190 190 })
191 191 </script>
General Comments 0
You need to be logged in to leave comments. Login now