##// END OF EJS Templates
repos, repo groups, user groups: visually show what user is an owner, and if...
marcink -
r225:48a40e43 default
parent child Browse files
Show More
@@ -1,293 +1,320 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:none; }
14 label { display: inline; border:none; padding:none; }
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 &:before { content:none; }
222 &:before { content:none; }
223 &:after {
223 &:after {
224 content: "";
224 content: "";
225 float: left;
225 float: left;
226 display: block;
226 display: block;
227 height: @padding;
227 height: @padding;
228 width: 100%;
228 width: 100%;
229 }
229 }
230 }
230 }
231 }
231 }
232
232
233 .drop-menu {
233 .drop-menu {
234 float: left;
234 float: left;
235 margin: 0 @input-padding 0 0;
235 margin: 0 @input-padding 0 0;
236 }
236 }
237
237
238 .help-block,
238 .help-block,
239 .error-message {
239 .error-message {
240 display: block;
240 display: block;
241 clear: both;
241 clear: both;
242 margin: @textmargin 0;
242 margin: @textmargin 0;
243 }
243 }
244
244
245 .error-message {
245 .error-message {
246 margin-top: 5px;
246 margin-top: 5px;
247 }
247 }
248
248
249 input[type=submit] {
249 input[type=submit] {
250 &:extend(.btn-primary);
250 &:extend(.btn-primary);
251
251
252 &:hover {
252 &:hover {
253 &:extend(.btn-primary:hover);
253 &:extend(.btn-primary:hover);
254 }
254 }
255 }
255 }
256
256
257 input[type=reset] {
257 input[type=reset] {
258 &:extend(.btn-default);
258 &:extend(.btn-default);
259
259
260 &:hover {
260 &:hover {
261 &:extend(.btn-default:hover);
261 &:extend(.btn-default:hover);
262 }
262 }
263 }
263 }
264
264
265 select,
265 select,
266 option:checked {
266 option:checked {
267 background-color: @rclightblue;
267 background-color: @rclightblue;
268 }
268 }
269
269
270 }
270 }
271
271
272 .badged-field {
273 .user-badge {
274 line-height: 25px;
275 padding: 10px 5px;
276 border-radius: @border-radius;
277 border-top: 1px solid @rclightblue;
278 border-left: 1px solid @rclightblue;
279 border-bottom: 1px solid @rclightblue;
280 font-size: 14px;
281 font-style: normal;
282 color: @text-light;
283 display: inline-block;
284 vertical-align: top;
285 cursor: default;
286 margin-right: -2px;
287 }
288 .badge-input-container {
289 display: flex;
290 position: relative;
291 }
292 .user-disabled {
293 text-decoration: line-through;
294 }
295 .badge-input-wrap {
296 display: inline-block;
297 }
298 }
272
299
273 // for situations where we wish to display the form value but not the form input
300 // for situations where we wish to display the form value but not the form input
274 input.input-valuedisplay {
301 input.input-valuedisplay {
275 border: none;
302 border: none;
276 }
303 }
277
304
278 // for forms which only display information
305 // for forms which only display information
279 .infoform {
306 .infoform {
280 .fields {
307 .fields {
281 .field {
308 .field {
282 label,
309 label,
283 .label,
310 .label,
284 input,
311 input,
285 .input {
312 .input {
286 margin-top: 0;
313 margin-top: 0;
287 margin-bottom: 0;
314 margin-bottom: 0;
288 padding-top: 0;
315 padding-top: 0;
289 padding-bottom: 0;
316 padding-bottom: 0;
290 }
317 }
291 }
318 }
292 }
319 }
293 }
320 }
@@ -1,72 +1,84 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <%namespace name="base" file="/base/base.html"/>
3
2 <div class="panel panel-default">
4 <div class="panel panel-default">
3 <div class="panel-heading">
5 <div class="panel-heading">
4 <h3 class="panel-title">${_('Settings for Repository Group: %s') % c.repo_group.name}</h3>
6 <h3 class="panel-title">${_('Settings for Repository Group: %s') % c.repo_group.name}</h3>
5 </div>
7 </div>
6 <div class="panel-body">
8 <div class="panel-body">
7 ${h.secure_form(url('update_repo_group',group_name=c.repo_group.group_name),method='put')}
9 ${h.secure_form(url('update_repo_group',group_name=c.repo_group.group_name),method='put')}
8 <div class="form">
10 <div class="form">
9 <!-- fields -->
11 <!-- fields -->
10 <div class="fields">
12 <div class="fields">
11 <div class="field">
13 <div class="field">
12 <div class="label">
14 <div class="label">
13 <label for="group_name">${_('Group Name')}:</label>
15 <label for="group_name">${_('Group Name')}:</label>
14 </div>
16 </div>
15 <div class="input">
17 <div class="input">
16 ${h.text('group_name',class_='medium')}
18 ${h.text('group_name',class_='medium')}
17 </div>
19 </div>
18 </div>
20 </div>
19 <div class="field">
21
22 <div class="field badged-field">
20 <div class="label">
23 <div class="label">
21 <label for="user">${_('Owner')}:</label>
24 <label for="user">${_('Owner')}:</label>
22 </div>
25 </div>
23 <div class="input">
26 <div class="input">
24 ${h.text('user', class_="medium", autocomplete="off")}
27 <div class="badge-input-container">
25 <span class="help-block">${_('Change Repository Group Owner.')}</span>
28 <div class="user-badge">
29 ${base.gravatar_with_user(c.repo_group.user.email, show_disabled=not c.repo_group.user.active)}
30 </div>
31 <div class="badge-input-wrap">
32 ${h.text('user', class_="medium", autocomplete="off")}
33 </div>
34 </div>
35 <form:error name="user"/>
36 <p class="help-block">${_('Change owner of this repository group.')}</p>
26 </div>
37 </div>
27 </div>
38 </div>
39
28 <div class="field">
40 <div class="field">
29 <div class="label label-textarea">
41 <div class="label label-textarea">
30 <label for="group_description">${_('Description')}:</label>
42 <label for="group_description">${_('Description')}:</label>
31 </div>
43 </div>
32 <div class="textarea text-area editor">
44 <div class="textarea text-area editor">
33 ${h.textarea('group_description',cols=23,rows=5,class_="medium")}
45 ${h.textarea('group_description',cols=23,rows=5,class_="medium")}
34 </div>
46 </div>
35 </div>
47 </div>
36
48
37 <div class="field">
49 <div class="field">
38 <div class="label">
50 <div class="label">
39 <label for="group_parent_id">${_('Group parent')}:</label>
51 <label for="group_parent_id">${_('Group parent')}:</label>
40 </div>
52 </div>
41 <div class="select">
53 <div class="select">
42 ${h.select('group_parent_id','',c.repo_groups,class_="medium")}
54 ${h.select('group_parent_id','',c.repo_groups,class_="medium")}
43 </div>
55 </div>
44 </div>
56 </div>
45 <div class="field">
57 <div class="field">
46 <div class="label label-checkbox">
58 <div class="label label-checkbox">
47 <label for="enable_locking">${_('Enable Repository Locking')}:</label>
59 <label for="enable_locking">${_('Enable Repository Locking')}:</label>
48 </div>
60 </div>
49 <div class="checkboxes">
61 <div class="checkboxes">
50 ${h.checkbox('enable_locking',value="True")}
62 ${h.checkbox('enable_locking',value="True")}
51 <span class="help-block">${_('Repository locking will be enabled on all subgroups and repositories inside this repository group. Pulling from a repository locks it, and it is unlocked by pushing back by the same user.')}</span>
63 <span class="help-block">${_('Repository locking will be enabled on all subgroups and repositories inside this repository group. Pulling from a repository locks it, and it is unlocked by pushing back by the same user.')}</span>
52 </div>
64 </div>
53 </div>
65 </div>
54 <div class="buttons">
66 <div class="buttons">
55 ${h.submit('save',_('Save'),class_="btn")}
67 ${h.submit('save',_('Save'),class_="btn")}
56 ${h.reset('reset',_('Reset'),class_="btn")}
68 ${h.reset('reset',_('Reset'),class_="btn")}
57 </div>
69 </div>
58 </div>
70 </div>
59 </div>
71 </div>
60 ${h.end_form()}
72 ${h.end_form()}
61 </div>
73 </div>
62 </div>
74 </div>
63 <script>
75 <script>
64 $(document).ready(function(){
76 $(document).ready(function(){
65 $("#group_parent_id").select2({
77 $("#group_parent_id").select2({
66 'containerCssClass': "drop-menu",
78 'containerCssClass': "drop-menu",
67 'dropdownCssClass': "drop-menu-dropdown",
79 'dropdownCssClass': "drop-menu-dropdown",
68 'dropdownAutoWidth': true
80 'dropdownAutoWidth': true
69 });
81 });
70 UsersAutoComplete('user', '${c.rhodecode_user.user_id}');
82 UsersAutoComplete('user', '${c.rhodecode_user.user_id}');
71 })
83 })
72 </script>
84 </script>
@@ -1,225 +1,238 b''
1 ## -*- coding: utf-8 -*-
2 <%namespace name="base" file="/base/base.html"/>
3
1 <div class="panel panel-default">
4 <div class="panel panel-default">
2 <div class="panel-heading">
5 <div class="panel-heading">
3 <h3 class="panel-title">${_('Settings for Repository: %s') % c.repo_info.repo_name}</h3>
6 <h3 class="panel-title">${_('Settings for Repository: %s') % c.repo_info.repo_name}</h3>
4 </div>
7 </div>
5 <div class="panel-body">
8 <div class="panel-body">
6 ${h.secure_form(url('repo', repo_name=c.repo_info.repo_name),method='put')}
9 ${h.secure_form(url('repo', repo_name=c.repo_info.repo_name),method='put')}
7 <div class="form">
10 <div class="form">
8 <!-- fields -->
11 <!-- fields -->
9 <div class="fields">
12 <div class="fields">
10 <div class="field">
13 <div class="field">
11 <div class="label">
14 <div class="label">
12 <label for="repo_name">${_('Name')}:</label>
15 <label for="repo_name">${_('Name')}:</label>
13 </div>
16 </div>
14 <div class="input">
17 <div class="input">
15 ${h.text('repo_name',class_="medium")}
18 ${h.text('repo_name',class_="medium")}
16 <p class="help-block">${_('Non-changeable id')}: `_${c.repo_info.repo_id}` <span><a id="show_more_clone_id" href="#">${_('what is that ?')}</a></span></p>
19 <p class="help-block">${_('Non-changeable id')}: `_${c.repo_info.repo_id}` <span><a id="show_more_clone_id" href="#">${_('what is that ?')}</a></span></p>
17 <p id="clone_id" style="display:none;">
20 <p id="clone_id" style="display:none;">
18 ${_('URL by id')}: `${c.repo_info.clone_url(with_id=True)}` </br>
21 ${_('URL by id')}: `${c.repo_info.clone_url(with_id=True)}` </br>
19 ${_('''In case this repository is renamed or moved into another group the repository url changes.
22 ${_('''In case this repository is renamed or moved into another group the repository url changes.
20 Using above url guarantees that this repository will always be accessible under such url.
23 Using above url guarantees that this repository will always be accessible under such url.
21 Useful for CI systems, or any other cases that you need to hardcode the url into 3rd party service.''')}</p>
24 Useful for CI systems, or any other cases that you need to hardcode the url into 3rd party service.''')}</p>
22 </div>
25 </div>
23 </div>
26 </div>
24 % if c.repo_info.repo_type != 'svn':
27 % if c.repo_info.repo_type != 'svn':
25 <div class="field">
28 <div class="field">
26 <div class="label">
29 <div class="label">
27 <label for="clone_uri">${_('Remote uri')}:</label>
30 <label for="clone_uri">${_('Remote uri')}:</label>
28 </div>
31 </div>
29 <div class="input">
32 <div class="input">
30 %if c.repo_info.clone_uri:
33 %if c.repo_info.clone_uri:
31 <div id="clone_uri_hidden" class='text-as-placeholder'>
34 <div id="clone_uri_hidden" class='text-as-placeholder'>
32 <span id="clone_uri_hidden_value">${c.repo_info.clone_uri_hidden}</span>
35 <span id="clone_uri_hidden_value">${c.repo_info.clone_uri_hidden}</span>
33 <span class="link" id="edit_clone_uri"><i class="icon-edit"></i>${_('edit')}</span>
36 <span class="link" id="edit_clone_uri"><i class="icon-edit"></i>${_('edit')}</span>
34 </div>
37 </div>
35 <div id="alter_clone_uri" style="display: none">
38 <div id="alter_clone_uri" style="display: none">
36 ${h.text('clone_uri',class_="medium", placeholder=_('new value, leave empty to remove'))}
39 ${h.text('clone_uri',class_="medium", placeholder=_('new value, leave empty to remove'))}
37 ${h.hidden('clone_uri_change', 'OLD')}
40 ${h.hidden('clone_uri_change', 'OLD')}
38 <span class="link" id="cancel_edit_clone_uri">${_('cancel')}</span>
41 <span class="link" id="cancel_edit_clone_uri">${_('cancel')}</span>
39 </div>
42 </div>
40 %else:
43 %else:
41 ## not set yet, display form to set it
44 ## not set yet, display form to set it
42 ${h.text('clone_uri',class_="medium")}
45 ${h.text('clone_uri',class_="medium")}
43 ${h.hidden('clone_uri_change', 'NEW')}
46 ${h.hidden('clone_uri_change', 'NEW')}
44 %endif
47 %endif
45 <p id="alter_clone_uri_help_block" class="help-block">${_('http[s] url where from repository was imported, also used for doing remote pulls.')}</p>
48 <p id="alter_clone_uri_help_block" class="help-block">${_('http[s] url where from repository was imported, also used for doing remote pulls.')}</p>
46 </div>
49 </div>
47 </div>
50 </div>
48 % else:
51 % else:
49 ${h.hidden('clone_uri', '')}
52 ${h.hidden('clone_uri', '')}
50 % endif
53 % endif
51 <div class="field">
54 <div class="field">
52 <div class="label">
55 <div class="label">
53 <label for="repo_group">${_('Repository group')}:</label>
56 <label for="repo_group">${_('Repository group')}:</label>
54 </div>
57 </div>
55 <div class="select">
58 <div class="select">
56 ${h.select('repo_group','',c.repo_groups,class_="medium")}
59 ${h.select('repo_group','',c.repo_groups,class_="medium")}
57 %if c.personal_repo_group:
60 %if c.personal_repo_group:
58 <a style="padding: 4px" href="#" id="select_my_group" data-personal-group-id="${c.personal_repo_group.group_id}">${_('Select my personal group (%(repo_group_name)s)') % {'repo_group_name': c.personal_repo_group.group_name}}</a>
61 <a style="padding: 4px" href="#" id="select_my_group" data-personal-group-id="${c.personal_repo_group.group_id}">${_('Select my personal group (%(repo_group_name)s)') % {'repo_group_name': c.personal_repo_group.group_name}}</a>
59 %endif
62 %endif
60 <p class="help-block">${_('Optional select a group to put this repository into.')}</p>
63 <p class="help-block">${_('Optional select a group to put this repository into.')}</p>
61 </div>
64 </div>
62 </div>
65 </div>
63 <div class="field">
66 <div class="field">
64 <div class="label">
67 <div class="label">
65 <label for="repo_landing_rev">${_('Landing commit')}:</label>
68 <label for="repo_landing_rev">${_('Landing commit')}:</label>
66 </div>
69 </div>
67 <div class="select">
70 <div class="select">
68 ${h.select('repo_landing_rev','',c.landing_revs,class_="medium")}
71 ${h.select('repo_landing_rev','',c.landing_revs,class_="medium")}
69 <p class="help-block">${_('Default commit for files page, downloads, whoosh and readme')}</p>
72 <p class="help-block">${_('Default commit for files page, downloads, whoosh and readme')}</p>
70 </div>
73 </div>
71 </div>
74 </div>
72 <div class="field">
75
76 <div class="field badged-field">
73 <div class="label">
77 <div class="label">
74 <label for="user">${_('Owner')}:</label>
78 <label for="user">${_('Owner')}:</label>
75 </div>
79 </div>
76 <div class="input">
80 <div class="input">
77 ${h.text('user', class_="medium", autocomplete="off")}
81 <div class="badge-input-container">
78 <p class="help-block">${_('Change owner of this repository.')}</p>
82 <div class="user-badge">
83 ${base.gravatar_with_user(c.repo_info.user.email, show_disabled=not c.repo_info.user.active)}
84 </div>
85 <div class="badge-input-wrap">
86 ${h.text('user', class_="medium", autocomplete="off")}
87 </div>
88 </div>
89 <form:error name="user"/>
90 <p class="help-block">${_('Change owner of this repository.')}</p>
79 </div>
91 </div>
80 </div>
92 </div>
93
81 <div class="field">
94 <div class="field">
82 <div class="label label-textarea">
95 <div class="label label-textarea">
83 <label for="repo_description">${_('Description')}:</label>
96 <label for="repo_description">${_('Description')}:</label>
84 </div>
97 </div>
85 <div class="textarea text-area editor">
98 <div class="textarea text-area editor">
86 ${h.textarea('repo_description', )}
99 ${h.textarea('repo_description', )}
87 <p class="help-block">${_('Keep it short and to the point. Use a README file for longer descriptions.')}</p>
100 <p class="help-block">${_('Keep it short and to the point. Use a README file for longer descriptions.')}</p>
88 </div>
101 </div>
89 </div>
102 </div>
90
103
91 <div class="field">
104 <div class="field">
92 <div class="label label-checkbox">
105 <div class="label label-checkbox">
93 <label for="repo_private">${_('Private repository')}:</label>
106 <label for="repo_private">${_('Private repository')}:</label>
94 </div>
107 </div>
95 <div class="checkboxes">
108 <div class="checkboxes">
96 ${h.checkbox('repo_private',value="True")}
109 ${h.checkbox('repo_private',value="True")}
97 <span class="help-block">${_('Private repositories are only visible to people explicitly added as collaborators.')}</span>
110 <span class="help-block">${_('Private repositories are only visible to people explicitly added as collaborators.')}</span>
98 </div>
111 </div>
99 </div>
112 </div>
100 <div class="field">
113 <div class="field">
101 <div class="label label-checkbox">
114 <div class="label label-checkbox">
102 <label for="repo_enable_statistics">${_('Enable statistics')}:</label>
115 <label for="repo_enable_statistics">${_('Enable statistics')}:</label>
103 </div>
116 </div>
104 <div class="checkboxes">
117 <div class="checkboxes">
105 ${h.checkbox('repo_enable_statistics',value="True")}
118 ${h.checkbox('repo_enable_statistics',value="True")}
106 <span class="help-block">${_('Enable statistics window on summary page.')}</span>
119 <span class="help-block">${_('Enable statistics window on summary page.')}</span>
107 </div>
120 </div>
108 </div>
121 </div>
109 <div class="field">
122 <div class="field">
110 <div class="label label-checkbox">
123 <div class="label label-checkbox">
111 <label for="repo_enable_downloads">${_('Enable downloads')}:</label>
124 <label for="repo_enable_downloads">${_('Enable downloads')}:</label>
112 </div>
125 </div>
113 <div class="checkboxes">
126 <div class="checkboxes">
114 ${h.checkbox('repo_enable_downloads',value="True")}
127 ${h.checkbox('repo_enable_downloads',value="True")}
115 <span class="help-block">${_('Enable download menu on summary page.')}</span>
128 <span class="help-block">${_('Enable download menu on summary page.')}</span>
116 </div>
129 </div>
117 </div>
130 </div>
118 <div class="field">
131 <div class="field">
119 <div class="label label-checkbox">
132 <div class="label label-checkbox">
120 <label for="repo_enable_locking">${_('Enable automatic locking')}:</label>
133 <label for="repo_enable_locking">${_('Enable automatic locking')}:</label>
121 </div>
134 </div>
122 <div class="checkboxes">
135 <div class="checkboxes">
123 ${h.checkbox('repo_enable_locking',value="True")}
136 ${h.checkbox('repo_enable_locking',value="True")}
124 <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>
137 <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>
125 </div>
138 </div>
126 </div>
139 </div>
127
140
128 %if c.visual.repository_fields:
141 %if c.visual.repository_fields:
129 ## EXTRA FIELDS
142 ## EXTRA FIELDS
130 %for field in c.repo_fields:
143 %for field in c.repo_fields:
131 <div class="field">
144 <div class="field">
132 <div class="label">
145 <div class="label">
133 <label for="${field.field_key_prefixed}">${field.field_label} (${field.field_key}):</label>
146 <label for="${field.field_key_prefixed}">${field.field_label} (${field.field_key}):</label>
134 </div>
147 </div>
135 <div class="input input-medium">
148 <div class="input input-medium">
136 ${h.text(field.field_key_prefixed, field.field_value, class_='medium')}
149 ${h.text(field.field_key_prefixed, field.field_value, class_='medium')}
137 %if field.field_desc:
150 %if field.field_desc:
138 <span class="help-block">${field.field_desc}</span>
151 <span class="help-block">${field.field_desc}</span>
139 %endif
152 %endif
140 </div>
153 </div>
141 </div>
154 </div>
142 %endfor
155 %endfor
143 %endif
156 %endif
144 <div class="buttons">
157 <div class="buttons">
145 ${h.submit('save',_('Save'),class_="btn")}
158 ${h.submit('save',_('Save'),class_="btn")}
146 ${h.reset('reset',_('Reset'),class_="btn")}
159 ${h.reset('reset',_('Reset'),class_="btn")}
147 </div>
160 </div>
148 </div>
161 </div>
149 </div>
162 </div>
150 ${h.end_form()}
163 ${h.end_form()}
151 </div>
164 </div>
152 </div>
165 </div>
153
166
154 <script>
167 <script>
155 $(document).ready(function(){
168 $(document).ready(function(){
156 var select2Options = {
169 var select2Options = {
157 'containerCssClass': "drop-menu",
170 'containerCssClass': "drop-menu",
158 'dropdownCssClass': "drop-menu-dropdown",
171 'dropdownCssClass': "drop-menu-dropdown",
159 'dropdownAutoWidth': true
172 'dropdownAutoWidth': true
160 };
173 };
161
174
162 var cloneUrl = function() {
175 var cloneUrl = function() {
163 var alterButton = $('#alter_clone_uri');
176 var alterButton = $('#alter_clone_uri');
164 var editButton = $('#edit_clone_uri');
177 var editButton = $('#edit_clone_uri');
165 var cancelEditButton = $('#cancel_edit_clone_uri');
178 var cancelEditButton = $('#cancel_edit_clone_uri');
166 var hiddenUrl = $('#clone_uri_hidden');
179 var hiddenUrl = $('#clone_uri_hidden');
167 var hiddenUrlValue = $('#clone_uri_hidden_value');
180 var hiddenUrlValue = $('#clone_uri_hidden_value');
168 var input = $('#clone_uri');
181 var input = $('#clone_uri');
169 var helpBlock = $('#alter_clone_uri_help_block');
182 var helpBlock = $('#alter_clone_uri_help_block');
170 var changedFlag = $('#clone_uri_change');
183 var changedFlag = $('#clone_uri_change');
171 var originalText = helpBlock.html();
184 var originalText = helpBlock.html();
172 var obfuscatedUrl = hiddenUrlValue.html();
185 var obfuscatedUrl = hiddenUrlValue.html();
173
186
174 var edit = function(e) {
187 var edit = function(e) {
175 alterButton.show();
188 alterButton.show();
176 editButton.hide();
189 editButton.hide();
177 hiddenUrl.hide();
190 hiddenUrl.hide();
178
191
179 //add the old value next to input for verification
192 //add the old value next to input for verification
180 helpBlock.html("(" + obfuscatedUrl + ")" + "<br\>" + originalText);
193 helpBlock.html("(" + obfuscatedUrl + ")" + "<br\>" + originalText);
181 changedFlag.val('MOD');
194 changedFlag.val('MOD');
182 };
195 };
183
196
184 var cancelEdit = function(e) {
197 var cancelEdit = function(e) {
185 alterButton.hide();
198 alterButton.hide();
186 editButton.show();
199 editButton.show();
187 hiddenUrl.show();
200 hiddenUrl.show();
188
201
189 helpBlock.html(originalText);
202 helpBlock.html(originalText);
190 changedFlag.val('OLD');
203 changedFlag.val('OLD');
191 input.val('');
204 input.val('');
192 };
205 };
193
206
194 var initEvents = function() {
207 var initEvents = function() {
195 editButton.on('click', edit);
208 editButton.on('click', edit);
196 cancelEditButton.on('click', cancelEdit);
209 cancelEditButton.on('click', cancelEdit);
197 };
210 };
198
211
199 var setInitialState = function() {
212 var setInitialState = function() {
200 if (input.hasClass('error')) {
213 if (input.hasClass('error')) {
201 alterButton.show();
214 alterButton.show();
202 editButton.hide();
215 editButton.hide();
203 hiddenUrl.hide();
216 hiddenUrl.hide();
204 }
217 }
205 };
218 };
206
219
207 setInitialState();
220 setInitialState();
208 initEvents();
221 initEvents();
209 }();
222 }();
210
223
211 $('#show_more_clone_id').on('click', function(e){
224 $('#show_more_clone_id').on('click', function(e){
212 $('#clone_id').show();
225 $('#clone_id').show();
213 e.preventDefault();
226 e.preventDefault();
214 });
227 });
215
228
216 $('#repo_landing_rev').select2(select2Options);
229 $('#repo_landing_rev').select2(select2Options);
217 $('#repo_group').select2(select2Options);
230 $('#repo_group').select2(select2Options);
218
231
219 UsersAutoComplete('user', '${c.rhodecode_user.user_id}');
232 UsersAutoComplete('user', '${c.rhodecode_user.user_id}');
220 $('#select_my_group').on('click', function(e){
233 $('#select_my_group').on('click', function(e){
221 e.preventDefault();
234 e.preventDefault();
222 $("#repo_group").val($(this).data('personalGroupId')).trigger("change");
235 $("#repo_group").val($(this).data('personalGroupId')).trigger("change");
223 });
236 });
224 });
237 });
225 </script>
238 </script>
@@ -1,131 +1,144 b''
1 ## -*- coding: utf-8 -*-
2 <%namespace name="base" file="/base/base.html"/>
3
1 <div class="panel panel-default">
4 <div class="panel panel-default">
2 <div class="panel-heading">
5 <div class="panel-heading">
3 <h3 class="panel-title">${_('User Group: %s') % c.user_group.users_group_name}</h3>
6 <h3 class="panel-title">${_('User Group: %s') % c.user_group.users_group_name}</h3>
4 </div>
7 </div>
5 <div class="panel-body">
8 <div class="panel-body">
6 ${h.secure_form(url('update_users_group', user_group_id=c.user_group.users_group_id),method='put', id='edit_users_group')}
9 ${h.secure_form(url('update_users_group', user_group_id=c.user_group.users_group_id),method='put', id='edit_users_group')}
7 <div class="form">
10 <div class="form">
8 <!-- fields -->
11 <!-- fields -->
9 <div class="fields">
12 <div class="fields">
10 <div class="field">
13 <div class="field">
11 <div class="label">
14 <div class="label">
12 <label for="users_group_name">${_('Group name')}:</label>
15 <label for="users_group_name">${_('Group name')}:</label>
13 </div>
16 </div>
14 <div class="input">
17 <div class="input">
15 ${h.text('users_group_name',class_='medium')}
18 ${h.text('users_group_name',class_='medium')}
16 </div>
19 </div>
17 </div>
20 </div>
18 <div class="field">
21
22 <div class="field badged-field">
19 <div class="label">
23 <div class="label">
20 <label for="user">${_('Owner')}:</label>
24 <label for="user">${_('Owner')}:</label>
21 </div>
25 </div>
22 <div class="input">
26 <div class="input">
23 ${h.text('user', class_="medium", autocomplete="off")}
27 <div class="badge-input-container">
24 <span class="help-block">${_('Change owner of this user group.')}</span>
28 <div class="user-badge">
29 ${base.gravatar_with_user(c.user_group.user.email, show_disabled=not c.user_group.user.active)}
30 </div>
31 <div class="badge-input-wrap">
32 ${h.text('user', class_="medium", autocomplete="off")}
33 </div>
34 </div>
35 <form:error name="user"/>
36 <p class="help-block">${_('Change owner of this user group.')}</p>
25 </div>
37 </div>
26 </div>
38 </div>
39
27 <div class="field">
40 <div class="field">
28 <div class="label label-textarea">
41 <div class="label label-textarea">
29 <label for="user_group_description">${_('Description')}:</label>
42 <label for="user_group_description">${_('Description')}:</label>
30 </div>
43 </div>
31 <div class="textarea textarea-small editor">
44 <div class="textarea textarea-small editor">
32 ${h.textarea('user_group_description',cols=23,rows=5,class_="medium")}
45 ${h.textarea('user_group_description',cols=23,rows=5,class_="medium")}
33 <span class="help-block">${_('Short, optional description for this user group.')}</span>
46 <span class="help-block">${_('Short, optional description for this user group.')}</span>
34 </div>
47 </div>
35 </div>
48 </div>
36 <div class="field">
49 <div class="field">
37 <div class="label label-checkbox">
50 <div class="label label-checkbox">
38 <label for="users_group_active">${_('Active')}:</label>
51 <label for="users_group_active">${_('Active')}:</label>
39 </div>
52 </div>
40 <div class="checkboxes">
53 <div class="checkboxes">
41 ${h.checkbox('users_group_active',value=True)}
54 ${h.checkbox('users_group_active',value=True)}
42 </div>
55 </div>
43 </div>
56 </div>
44 <div class="field">
57 <div class="field">
45 <div class="label">
58 <div class="label">
46 <label for="users_group_active">${_('Search')}:</label>
59 <label for="users_group_active">${_('Search')}:</label>
47 ${h.text('from_user_group',
60 ${h.text('from_user_group',
48 placeholder="user/usergroup",
61 placeholder="user/usergroup",
49 class_="medium")}
62 class_="medium")}
50 </div>
63 </div>
51 <div class="select side-by-side-selector">
64 <div class="select side-by-side-selector">
52 <div class="left-group">
65 <div class="left-group">
53 <label class="text"><strong>${_('Chosen group members')}</strong></label>
66 <label class="text"><strong>${_('Chosen group members')}</strong></label>
54 ${h.select('users_group_members',[x[0] for x in c.group_members],c.group_members,multiple=True,size=8,)}
67 ${h.select('users_group_members',[x[0] for x in c.group_members],c.group_members,multiple=True,size=8,)}
55 <div class="btn" id="remove_all_elements" >
68 <div class="btn" id="remove_all_elements" >
56 ${_('Remove all elements')}
69 ${_('Remove all elements')}
57 <i class="icon-chevron-right"></i>
70 <i class="icon-chevron-right"></i>
58 </div>
71 </div>
59 </div>
72 </div>
60 <div class="middle-group">
73 <div class="middle-group">
61 <i id="add_element" class="icon-chevron-left"></i>
74 <i id="add_element" class="icon-chevron-left"></i>
62 <br />
75 <br />
63 <i id="remove_element" class="icon-chevron-right"></i>
76 <i id="remove_element" class="icon-chevron-right"></i>
64 </div>
77 </div>
65 <div class="right-group">
78 <div class="right-group">
66 <label class="text" >${_('Available users')}
79 <label class="text" >${_('Available users')}
67 </label>
80 </label>
68 ${h.select('available_members',[],c.available_members,multiple=True,size=8,)}
81 ${h.select('available_members',[],c.available_members,multiple=True,size=8,)}
69 <div class="btn" id="add_all_elements" >
82 <div class="btn" id="add_all_elements" >
70 <i class="icon-chevron-left"></i>${_('Add all elements')}
83 <i class="icon-chevron-left"></i>${_('Add all elements')}
71 </div>
84 </div>
72 </div>
85 </div>
73 </div>
86 </div>
74 </div>
87 </div>
75 <div class="buttons">
88 <div class="buttons">
76 ${h.submit('Save',_('Save'),class_="btn")}
89 ${h.submit('Save',_('Save'),class_="btn")}
77 </div>
90 </div>
78 </div>
91 </div>
79 </div>
92 </div>
80 ${h.end_form()}
93 ${h.end_form()}
81 </div>
94 </div>
82 </div>
95 </div>
83 <script>
96 <script>
84 $(document).ready(function(){
97 $(document).ready(function(){
85 MultiSelectWidget('users_group_members','available_members','edit_users_group');
98 MultiSelectWidget('users_group_members','available_members','edit_users_group');
86
99
87 $("#group_parent_id").select2({
100 $("#group_parent_id").select2({
88 'containerCssClass': "drop-menu",
101 'containerCssClass': "drop-menu",
89 'dropdownCssClass': "drop-menu-dropdown",
102 'dropdownCssClass': "drop-menu-dropdown",
90 'dropdownAutoWidth': true
103 'dropdownAutoWidth': true
91 });
104 });
92
105
93 $('#from_user_group').autocomplete({
106 $('#from_user_group').autocomplete({
94 serviceUrl: pyroutes.url('user_autocomplete_data'),
107 serviceUrl: pyroutes.url('user_autocomplete_data'),
95 minChars:2,
108 minChars:2,
96 maxHeight:400,
109 maxHeight:400,
97 width:300,
110 width:300,
98 deferRequestBy: 300, //miliseconds
111 deferRequestBy: 300, //miliseconds
99 showNoSuggestionNotice: true,
112 showNoSuggestionNotice: true,
100 params: { user_groups:true },
113 params: { user_groups:true },
101 formatResult: autocompleteFormatResult,
114 formatResult: autocompleteFormatResult,
102 lookupFilter: autocompleteFilterResult,
115 lookupFilter: autocompleteFilterResult,
103 onSelect: function(element, suggestion){
116 onSelect: function(element, suggestion){
104
117
105 function preSelectUserIds(uids) {
118 function preSelectUserIds(uids) {
106 $('#available_members').val(uids);
119 $('#available_members').val(uids);
107 $('#users_group_members').val(uids);
120 $('#users_group_members').val(uids);
108 }
121 }
109
122
110 if (suggestion.value_type == 'user_group') {
123 if (suggestion.value_type == 'user_group') {
111 $.getJSON(
124 $.getJSON(
112 pyroutes.url('edit_user_group_members',
125 pyroutes.url('edit_user_group_members',
113 {'user_group_id': suggestion.id}),
126 {'user_group_id': suggestion.id}),
114 function(data) {
127 function(data) {
115 var uids = [];
128 var uids = [];
116 $.each(data.members, function(idx, user) {
129 $.each(data.members, function(idx, user) {
117 var userid = user[0],
130 var userid = user[0],
118 username = user[1];
131 username = user[1];
119 uids.push(userid.toString());
132 uids.push(userid.toString());
120 });
133 });
121 preSelectUserIds(uids)
134 preSelectUserIds(uids)
122 }
135 }
123 );
136 );
124 } else if (suggestion.value_type == 'user') {
137 } else if (suggestion.value_type == 'user') {
125 preSelectUserIds([suggestion.id.toString()]);
138 preSelectUserIds([suggestion.id.toString()]);
126 }
139 }
127 }
140 }
128 });
141 });
129 UsersAutoComplete('user', '${c.rhodecode_user.user_id}');
142 UsersAutoComplete('user', '${c.rhodecode_user.user_id}');
130 })
143 })
131 </script>
144 </script>
General Comments 0
You need to be logged in to leave comments. Login now