Show More
@@ -1,131 +1,131 b'' | |||
|
1 | 1 | <div class="panel panel-default"> |
|
2 | 2 | <div class="panel-heading"> |
|
3 | 3 | <h3 class="panel-title">${_('User Group: %s') % c.user_group.users_group_name}</h3> |
|
4 | 4 | </div> |
|
5 | 5 | <div class="panel-body"> |
|
6 | 6 | ${h.secure_form(url('update_users_group', user_group_id=c.user_group.users_group_id),method='put', id='edit_users_group')} |
|
7 | 7 | <div class="form"> |
|
8 | 8 | <!-- fields --> |
|
9 | 9 | <div class="fields"> |
|
10 | 10 | <div class="field"> |
|
11 | 11 | <div class="label"> |
|
12 | 12 | <label for="users_group_name">${_('Group name')}:</label> |
|
13 | 13 | </div> |
|
14 | 14 | <div class="input"> |
|
15 | 15 | ${h.text('users_group_name',class_='medium')} |
|
16 | 16 | </div> |
|
17 | 17 | </div> |
|
18 | 18 | <div class="field"> |
|
19 | 19 | <div class="label"> |
|
20 | 20 | <label for="user">${_('Owner')}:</label> |
|
21 | 21 | </div> |
|
22 | 22 | <div class="input"> |
|
23 | 23 | ${h.text('user', class_="medium", autocomplete="off")} |
|
24 | 24 | <span class="help-block">${_('Change owner of this user group.')}</span> |
|
25 | 25 | </div> |
|
26 | 26 | </div> |
|
27 | 27 | <div class="field"> |
|
28 | 28 | <div class="label label-textarea"> |
|
29 | 29 | <label for="user_group_description">${_('Description')}:</label> |
|
30 | 30 | </div> |
|
31 | 31 | <div class="textarea textarea-small editor"> |
|
32 | 32 | ${h.textarea('user_group_description',cols=23,rows=5,class_="medium")} |
|
33 | 33 | <span class="help-block">${_('Short, optional description for this user group.')}</span> |
|
34 | 34 | </div> |
|
35 | 35 | </div> |
|
36 | 36 | <div class="field"> |
|
37 | 37 | <div class="label label-checkbox"> |
|
38 | 38 | <label for="users_group_active">${_('Active')}:</label> |
|
39 | 39 | </div> |
|
40 | 40 | <div class="checkboxes"> |
|
41 | 41 | ${h.checkbox('users_group_active',value=True)} |
|
42 | 42 | </div> |
|
43 | 43 | </div> |
|
44 | 44 | <div class="field"> |
|
45 | 45 | <div class="label"> |
|
46 |
<label for="users_group_active">${_(' |
|
|
46 | <label for="users_group_active">${_('Search')}:</label> | |
|
47 | 47 | ${h.text('from_user_group', |
|
48 |
placeholder=" |
|
|
48 | placeholder="user/usergroup", | |
|
49 | 49 | class_="medium")} |
|
50 | 50 | </div> |
|
51 | 51 | <div class="select side-by-side-selector"> |
|
52 | 52 | <div class="left-group"> |
|
53 |
<label class="text" |
|
|
53 | <label class="text"><strong>${_('Chosen group members')}</strong></label> | |
|
54 | 54 | ${h.select('users_group_members',[x[0] for x in c.group_members],c.group_members,multiple=True,size=8,)} |
|
55 | 55 | <div class="btn" id="remove_all_elements" > |
|
56 | 56 | ${_('Remove all elements')} |
|
57 | 57 | <i class="icon-chevron-right"></i> |
|
58 | 58 | </div> |
|
59 | 59 | </div> |
|
60 | 60 | <div class="middle-group"> |
|
61 | 61 | <i id="add_element" class="icon-chevron-left"></i> |
|
62 | 62 | <br /> |
|
63 | 63 | <i id="remove_element" class="icon-chevron-right"></i> |
|
64 | 64 | </div> |
|
65 | 65 | <div class="right-group"> |
|
66 |
<label class="text" >${_('Available |
|
|
66 | <label class="text" >${_('Available users')} | |
|
67 | 67 | </label> |
|
68 | 68 | ${h.select('available_members',[],c.available_members,multiple=True,size=8,)} |
|
69 | 69 | <div class="btn" id="add_all_elements" > |
|
70 | 70 | <i class="icon-chevron-left"></i>${_('Add all elements')} |
|
71 | 71 | </div> |
|
72 | 72 | </div> |
|
73 | 73 | </div> |
|
74 | 74 | </div> |
|
75 | 75 | <div class="buttons"> |
|
76 | 76 | ${h.submit('Save',_('Save'),class_="btn")} |
|
77 | 77 | </div> |
|
78 | 78 | </div> |
|
79 | 79 | </div> |
|
80 | 80 | ${h.end_form()} |
|
81 | 81 | </div> |
|
82 | 82 | </div> |
|
83 | 83 | <script> |
|
84 | 84 | $(document).ready(function(){ |
|
85 | 85 | MultiSelectWidget('users_group_members','available_members','edit_users_group'); |
|
86 | 86 | |
|
87 | 87 | $("#group_parent_id").select2({ |
|
88 | 88 | 'containerCssClass': "drop-menu", |
|
89 | 89 | 'dropdownCssClass': "drop-menu-dropdown", |
|
90 | 90 | 'dropdownAutoWidth': true |
|
91 | 91 | }); |
|
92 | 92 | |
|
93 | 93 | $('#from_user_group').autocomplete({ |
|
94 | 94 | serviceUrl: pyroutes.url('user_autocomplete_data'), |
|
95 | 95 | minChars:2, |
|
96 | 96 | maxHeight:400, |
|
97 | 97 | width:300, |
|
98 | 98 | deferRequestBy: 300, //miliseconds |
|
99 | 99 | showNoSuggestionNotice: true, |
|
100 | 100 | params: { user_groups:true }, |
|
101 | 101 | formatResult: autocompleteFormatResult, |
|
102 | 102 | lookupFilter: autocompleteFilterResult, |
|
103 | 103 | onSelect: function(element, suggestion){ |
|
104 | 104 | |
|
105 | 105 | function preSelectUserIds(uids) { |
|
106 | 106 | $('#available_members').val(uids); |
|
107 | 107 | $('#users_group_members').val(uids); |
|
108 | 108 | } |
|
109 | 109 | |
|
110 | 110 | if (suggestion.value_type == 'user_group') { |
|
111 | 111 | $.getJSON( |
|
112 | 112 | pyroutes.url('edit_user_group_members', |
|
113 | 113 | {'user_group_id': suggestion.id}), |
|
114 | 114 | function(data) { |
|
115 | 115 | var uids = []; |
|
116 | 116 | $.each(data.members, function(idx, user) { |
|
117 | 117 | var userid = user[0], |
|
118 | 118 | username = user[1]; |
|
119 | 119 | uids.push(userid.toString()); |
|
120 | 120 | }); |
|
121 | 121 | preSelectUserIds(uids) |
|
122 | 122 | } |
|
123 | 123 | ); |
|
124 | 124 | } else if (suggestion.value_type == 'user') { |
|
125 | 125 | preSelectUserIds([suggestion.id.toString()]); |
|
126 | 126 | } |
|
127 | 127 | } |
|
128 | 128 | }); |
|
129 | 129 | UsersAutoComplete('user', '${c.rhodecode_user.user_id}'); |
|
130 | 130 | }) |
|
131 | 131 | </script> |
General Comments 0
You need to be logged in to leave comments.
Login now