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