annotate rhodecode/templates/admin/users_groups/users_group_edit.html @ 1575:e0b069468de0 beta

Corrected some label-input linking in templates
author Augusto Herrmann <augusto.herrmann@planejamento.gov.br>
date Wed, 19 Oct 2011 14:48:08 -0200
parents aaec08ad9daf
children b702d0d4b030
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
972
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
1 ## -*- coding: utf-8 -*-
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
2 <%inherit file="/base/base.html"/>
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
3
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
4 <%def name="title()">
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
5 ${_('Edit users group')} ${c.users_group.users_group_name} - ${c.rhodecode_name}
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
6 </%def>
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
7
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
8 <%def name="breadcrumbs_links()">
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
9 ${h.link_to(_('Admin'),h.url('admin_home'))}
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
10 &raquo;
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
11 ${h.link_to(_('UsersGroups'),h.url('users_groups'))}
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
12 &raquo;
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
13 ${_('edit')} "${c.users_group.users_group_name}"
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
14 </%def>
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
15
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
16 <%def name="page_nav()">
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
17 ${self.menu('admin')}
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
18 </%def>
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
19
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
20 <%def name="main()">
1124
c52de8aa10e0 template fixes
Marcin Kuzminski <marcin@python-works.com>
parents: 1051
diff changeset
21 <div class="box box-left">
972
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
22 <!-- box / title -->
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
23 <div class="title">
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
24 ${self.breadcrumbs()}
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
25 </div>
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
26 <!-- end box / title -->
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
27 ${h.form(url('users_group', id=c.users_group.users_group_id),method='put', id='edit_users_group')}
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
28 <div class="form">
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
29 <!-- fields -->
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
30 <div class="fields">
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
31 <div class="field">
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
32 <div class="label">
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
33 <label for="users_group_name">${_('Group name')}:</label>
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
34 </div>
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
35 <div class="input">
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
36 ${h.text('users_group_name',class_='small')}
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
37 </div>
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
38 </div>
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
39
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
40 <div class="field">
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
41 <div class="label label-checkbox">
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
42 <label for="users_group_active">${_('Active')}:</label>
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
43 </div>
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
44 <div class="checkboxes">
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
45 ${h.checkbox('users_group_active',value=True)}
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
46 </div>
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
47 </div>
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
48 <div class="field">
985
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
49 <div class="label">
972
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
50 <label for="users_group_active">${_('Members')}:</label>
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
51 </div>
985
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
52 <div class="select">
972
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
53 <table>
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
54 <tr>
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
55 <td>
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
56 <div>
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
57 <div style="float:left">
985
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
58 <div class="text" style="padding: 0px 0px 6px;">${_('Choosen group members')}</div>
972
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
59 ${h.select('users_group_members',[x[0] for x in c.group_members],c.group_members,multiple=True,size=8,style="min-width:210px")}
985
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
60 <div id="remove_all_elements" style="cursor:pointer;text-align:center">
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
61 ${_('Remove all elements')}
1051
90eadff2c2a8 changed all urls for IMAGES files to use pylons url function
Marcin Kuzminski <marcin@python-works.com>
parents: 1031
diff changeset
62 <img alt="remove" style="vertical-align:text-bottom" src="${h.url("/images/icons/arrow_right.png")}"/>
985
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
63 </div>
972
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
64 </div>
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
65 <div style="float:left;width:20px;padding-top:50px">
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
66 <img alt="add" id="add_element"
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
67 style="padding:2px;cursor:pointer"
1051
90eadff2c2a8 changed all urls for IMAGES files to use pylons url function
Marcin Kuzminski <marcin@python-works.com>
parents: 1031
diff changeset
68 src="${h.url("/images/icons/arrow_left.png")}"/>
972
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
69 <br />
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
70 <img alt="remove" id="remove_element"
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
71 style="padding:2px;cursor:pointer"
1051
90eadff2c2a8 changed all urls for IMAGES files to use pylons url function
Marcin Kuzminski <marcin@python-works.com>
parents: 1031
diff changeset
72 src="${h.url("/images/icons/arrow_right.png")}"/>
972
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
73 </div>
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
74 <div style="float:left">
985
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
75 <div class="text" style="padding: 0px 0px 6px;">${_('Available members')}</div>
972
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
76 ${h.select('available_members',[],c.available_members,multiple=True,size=8,style="min-width:210px")}
985
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
77 <div id="add_all_elements" style="cursor:pointer;text-align:center">
1051
90eadff2c2a8 changed all urls for IMAGES files to use pylons url function
Marcin Kuzminski <marcin@python-works.com>
parents: 1031
diff changeset
78 <img alt="add" style="vertical-align:text-bottom" src="${h.url("/images/icons/arrow_left.png")}"/>
985
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
79 ${_('Add all elements')}
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
80 </div>
972
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
81 </div>
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
82 </div>
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
83 </td>
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
84 </tr>
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
85 </table>
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
86 </div>
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
87
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
88 </div>
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
89 <div class="buttons">
1472
aaec08ad9daf Added pt_BR localization, added i18n wrappers on some places missing, fixed css in settings screen for longer labels.
Augusto Herrmann <augusto.herrmann@planejamento.gov.br>
parents: 1271
diff changeset
90 ${h.submit('save',_('save'),class_="ui-button")}
972
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
91 </div>
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
92 </div>
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
93 </div>
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
94 ${h.end_form()}
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
95 </div>
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
96
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
97 <script type="text/javascript">
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
98 YAHOO.util.Event.onDOMReady(function(){
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
99 var D = YAHOO.util.Dom;
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
100 var E = YAHOO.util.Event;
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
101
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
102 //definition of containers ID's
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
103 var available_container = 'available_members';
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
104 var selected_container = 'users_group_members';
1030
6b37f08de732 #56 available options from users groups are now self avare of choosen options and doesn't display.
Marcin Kuzminski <marcin@python-works.com>
parents: 987
diff changeset
105
972
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
106 //form containing containers id
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
107 var form_id = 'edit_users_group';
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
108
985
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
109 //temp container for selected storage.
972
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
110 var cache = new Array();
1030
6b37f08de732 #56 available options from users groups are now self avare of choosen options and doesn't display.
Marcin Kuzminski <marcin@python-works.com>
parents: 987
diff changeset
111 var av_cache = new Array();
972
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
112 var c = D.get(selected_container);
1030
6b37f08de732 #56 available options from users groups are now self avare of choosen options and doesn't display.
Marcin Kuzminski <marcin@python-works.com>
parents: 987
diff changeset
113 var ac = D.get(available_container);
972
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
114
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
115 //get only selected options for further fullfilment
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
116 for(var i = 0;node =c.options[i];i++){
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
117 if(node.selected){
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
118 //push selected to my temp storage left overs :)
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
119 cache.push(node);
1030
6b37f08de732 #56 available options from users groups are now self avare of choosen options and doesn't display.
Marcin Kuzminski <marcin@python-works.com>
parents: 987
diff changeset
120 }
972
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
121 }
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
122
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
123 //clear 'selected' select
1031
d1009f6bbc9c small fix for users groups choose dialog
Marcin Kuzminski <marcin@python-works.com>
parents: 1030
diff changeset
124 //c.options.length = 0;
972
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
125
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
126 //fill it with remembered options
1031
d1009f6bbc9c small fix for users groups choose dialog
Marcin Kuzminski <marcin@python-works.com>
parents: 1030
diff changeset
127 //for(var i = 0;node = cache[i];i++){
d1009f6bbc9c small fix for users groups choose dialog
Marcin Kuzminski <marcin@python-works.com>
parents: 1030
diff changeset
128 // c.options[i]=new Option(node.text, node.value, false, false);
d1009f6bbc9c small fix for users groups choose dialog
Marcin Kuzminski <marcin@python-works.com>
parents: 1030
diff changeset
129 //}
972
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
130
1030
6b37f08de732 #56 available options from users groups are now self avare of choosen options and doesn't display.
Marcin Kuzminski <marcin@python-works.com>
parents: 987
diff changeset
131
6b37f08de732 #56 available options from users groups are now self avare of choosen options and doesn't display.
Marcin Kuzminski <marcin@python-works.com>
parents: 987
diff changeset
132 //get all available options to cache
6b37f08de732 #56 available options from users groups are now self avare of choosen options and doesn't display.
Marcin Kuzminski <marcin@python-works.com>
parents: 987
diff changeset
133 for(var i = 0;node =ac.options[i];i++){
6b37f08de732 #56 available options from users groups are now self avare of choosen options and doesn't display.
Marcin Kuzminski <marcin@python-works.com>
parents: 987
diff changeset
134 //push selected to my temp storage left overs :)
6b37f08de732 #56 available options from users groups are now self avare of choosen options and doesn't display.
Marcin Kuzminski <marcin@python-works.com>
parents: 987
diff changeset
135 av_cache.push(node);
6b37f08de732 #56 available options from users groups are now self avare of choosen options and doesn't display.
Marcin Kuzminski <marcin@python-works.com>
parents: 987
diff changeset
136 }
6b37f08de732 #56 available options from users groups are now self avare of choosen options and doesn't display.
Marcin Kuzminski <marcin@python-works.com>
parents: 987
diff changeset
137
6b37f08de732 #56 available options from users groups are now self avare of choosen options and doesn't display.
Marcin Kuzminski <marcin@python-works.com>
parents: 987
diff changeset
138 //fill available only with those not in choosen
6b37f08de732 #56 available options from users groups are now self avare of choosen options and doesn't display.
Marcin Kuzminski <marcin@python-works.com>
parents: 987
diff changeset
139 ac.options.length=0;
6b37f08de732 #56 available options from users groups are now self avare of choosen options and doesn't display.
Marcin Kuzminski <marcin@python-works.com>
parents: 987
diff changeset
140 tmp_cache = new Array();
6b37f08de732 #56 available options from users groups are now self avare of choosen options and doesn't display.
Marcin Kuzminski <marcin@python-works.com>
parents: 987
diff changeset
141
6b37f08de732 #56 available options from users groups are now self avare of choosen options and doesn't display.
Marcin Kuzminski <marcin@python-works.com>
parents: 987
diff changeset
142 for(var i = 0;node = av_cache[i];i++){
6b37f08de732 #56 available options from users groups are now self avare of choosen options and doesn't display.
Marcin Kuzminski <marcin@python-works.com>
parents: 987
diff changeset
143 var add = true;
6b37f08de732 #56 available options from users groups are now self avare of choosen options and doesn't display.
Marcin Kuzminski <marcin@python-works.com>
parents: 987
diff changeset
144 for(var i2 = 0;node_2 = cache[i2];i2++){
6b37f08de732 #56 available options from users groups are now self avare of choosen options and doesn't display.
Marcin Kuzminski <marcin@python-works.com>
parents: 987
diff changeset
145 if(node.value == node_2.value){
6b37f08de732 #56 available options from users groups are now self avare of choosen options and doesn't display.
Marcin Kuzminski <marcin@python-works.com>
parents: 987
diff changeset
146 add=false;
6b37f08de732 #56 available options from users groups are now self avare of choosen options and doesn't display.
Marcin Kuzminski <marcin@python-works.com>
parents: 987
diff changeset
147 break;
6b37f08de732 #56 available options from users groups are now self avare of choosen options and doesn't display.
Marcin Kuzminski <marcin@python-works.com>
parents: 987
diff changeset
148 }
6b37f08de732 #56 available options from users groups are now self avare of choosen options and doesn't display.
Marcin Kuzminski <marcin@python-works.com>
parents: 987
diff changeset
149 }
6b37f08de732 #56 available options from users groups are now self avare of choosen options and doesn't display.
Marcin Kuzminski <marcin@python-works.com>
parents: 987
diff changeset
150 if(add){
6b37f08de732 #56 available options from users groups are now self avare of choosen options and doesn't display.
Marcin Kuzminski <marcin@python-works.com>
parents: 987
diff changeset
151 tmp_cache.push(new Option(node.text, node.value, false, false));
6b37f08de732 #56 available options from users groups are now self avare of choosen options and doesn't display.
Marcin Kuzminski <marcin@python-works.com>
parents: 987
diff changeset
152 }
6b37f08de732 #56 available options from users groups are now self avare of choosen options and doesn't display.
Marcin Kuzminski <marcin@python-works.com>
parents: 987
diff changeset
153 }
6b37f08de732 #56 available options from users groups are now self avare of choosen options and doesn't display.
Marcin Kuzminski <marcin@python-works.com>
parents: 987
diff changeset
154
6b37f08de732 #56 available options from users groups are now self avare of choosen options and doesn't display.
Marcin Kuzminski <marcin@python-works.com>
parents: 987
diff changeset
155 for(var i = 0;node = tmp_cache[i];i++){
6b37f08de732 #56 available options from users groups are now self avare of choosen options and doesn't display.
Marcin Kuzminski <marcin@python-works.com>
parents: 987
diff changeset
156 ac.options[i] = node;
6b37f08de732 #56 available options from users groups are now self avare of choosen options and doesn't display.
Marcin Kuzminski <marcin@python-works.com>
parents: 987
diff changeset
157 }
6b37f08de732 #56 available options from users groups are now self avare of choosen options and doesn't display.
Marcin Kuzminski <marcin@python-works.com>
parents: 987
diff changeset
158
972
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
159 function prompts_action_callback(e){
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
160
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
161 var choosen = D.get(selected_container);
985
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
162 var available = D.get(available_container);
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
163
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
164 //get checked and unchecked options from field
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
165 function get_checked(from_field){
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
166 //temp container for storage.
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
167 var sel_cache = new Array();
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
168 var oth_cache = new Array();
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
169
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
170 for(var i = 0;node = from_field.options[i];i++){
972
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
171 if(node.selected){
985
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
172 //push selected fields :)
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
173 sel_cache.push(node);
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
174 }
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
175 else{
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
176 oth_cache.push(node)
972
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
177 }
985
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
178 }
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
179
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
180 return [sel_cache,oth_cache]
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
181 }
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
182
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
183 //fill the field with given options
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
184 function fill_with(field,options){
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
185 //clear firtst
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
186 field.options.length=0;
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
187 for(var i = 0;node = options[i];i++){
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
188 field.options[i]=new Option(node.text, node.value,
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
189 false, false);
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
190 }
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
191
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
192 }
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
193 //adds to current field
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
194 function add_to(field,options){
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
195 for(var i = 0;node = options[i];i++){
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
196 field.appendChild(new Option(node.text, node.value,
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
197 false, false));
972
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
198 }
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
199 }
985
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
200
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
201 // add action
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
202 if (this.id=='add_element'){
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
203 var c = get_checked(available);
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
204 add_to(choosen,c[0]);
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
205 fill_with(available,c[1]);
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
206 }
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
207 // remove action
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
208 if (this.id=='remove_element'){
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
209 var c = get_checked(choosen);
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
210 add_to(available,c[0]);
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
211 fill_with(choosen,c[1]);
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
212 }
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
213 // add all elements
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
214 if(this.id=='add_all_elements'){
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
215 for(var i=0; node = available.options[i];i++){
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
216 choosen.appendChild(new Option(node.text,
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
217 node.value, false, false));
972
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
218 }
985
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
219 available.options.length = 0;
972
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
220 }
985
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
221 //remove all elements
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
222 if(this.id=='remove_all_elements'){
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
223 for(var i=0; node = choosen.options[i];i++){
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
224 available.appendChild(new Option(node.text,
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
225 node.value, false, false));
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
226 }
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
227 choosen.options.length = 0;
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
228 }
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
229
972
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
230 }
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
231
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
232
985
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
233 E.addListener(['add_element','remove_element',
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
234 'add_all_elements','remove_all_elements'],'click',
4e38b2bc8835 extended functionality on users groups select box
Marcin Kuzminski <marcin@python-works.com>
parents: 972
diff changeset
235 prompts_action_callback)
972
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
236
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
237 E.addListener(form_id,'submit',function(){
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
238 var choosen = D.get(selected_container);
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
239 for (var i = 0; i < choosen.options.length; i++) {
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
240 choosen.options[i].selected = 'selected';
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
241 }
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
242 })
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
243 });
2c8fd84935a4 #56 implemented users groups editing,
Marcin Kuzminski <marcin@python-works.com>
parents: 956
diff changeset
244 </script>
1124
c52de8aa10e0 template fixes
Marcin Kuzminski <marcin@python-works.com>
parents: 1051
diff changeset
245 <div class="box box-right">
c52de8aa10e0 template fixes
Marcin Kuzminski <marcin@python-works.com>
parents: 1051
diff changeset
246 <!-- box / title -->
c52de8aa10e0 template fixes
Marcin Kuzminski <marcin@python-works.com>
parents: 1051
diff changeset
247 <div class="title">
c52de8aa10e0 template fixes
Marcin Kuzminski <marcin@python-works.com>
parents: 1051
diff changeset
248 <h5>${_('Permissions')}</h5>
c52de8aa10e0 template fixes
Marcin Kuzminski <marcin@python-works.com>
parents: 1051
diff changeset
249 </div>
1271
aa7e45ad0cea Fixed permissions for users groups, group can have create repo permission now.
Marcin Kuzminski <marcin@python-works.com>
parents: 1266
diff changeset
250 ${h.form(url('users_group_perm', id=c.users_group.users_group_id), method='put')}
1124
c52de8aa10e0 template fixes
Marcin Kuzminski <marcin@python-works.com>
parents: 1051
diff changeset
251 <div class="form">
c52de8aa10e0 template fixes
Marcin Kuzminski <marcin@python-works.com>
parents: 1051
diff changeset
252 <!-- fields -->
c52de8aa10e0 template fixes
Marcin Kuzminski <marcin@python-works.com>
parents: 1051
diff changeset
253 <div class="fields">
c52de8aa10e0 template fixes
Marcin Kuzminski <marcin@python-works.com>
parents: 1051
diff changeset
254 <div class="field">
c52de8aa10e0 template fixes
Marcin Kuzminski <marcin@python-works.com>
parents: 1051
diff changeset
255 <div class="label label-checkbox">
1575
e0b069468de0 Corrected some label-input linking in templates
Augusto Herrmann <augusto.herrmann@planejamento.gov.br>
parents: 1472
diff changeset
256 <label for="create_repo_perm">${_('Create repositories')}:</label>
1124
c52de8aa10e0 template fixes
Marcin Kuzminski <marcin@python-works.com>
parents: 1051
diff changeset
257 </div>
c52de8aa10e0 template fixes
Marcin Kuzminski <marcin@python-works.com>
parents: 1051
diff changeset
258 <div class="checkboxes">
1271
aa7e45ad0cea Fixed permissions for users groups, group can have create repo permission now.
Marcin Kuzminski <marcin@python-works.com>
parents: 1266
diff changeset
259 ${h.checkbox('create_repo_perm',value=True)}
1124
c52de8aa10e0 template fixes
Marcin Kuzminski <marcin@python-works.com>
parents: 1051
diff changeset
260 </div>
c52de8aa10e0 template fixes
Marcin Kuzminski <marcin@python-works.com>
parents: 1051
diff changeset
261 </div>
c52de8aa10e0 template fixes
Marcin Kuzminski <marcin@python-works.com>
parents: 1051
diff changeset
262 <div class="buttons">
1472
aaec08ad9daf Added pt_BR localization, added i18n wrappers on some places missing, fixed css in settings screen for longer labels.
Augusto Herrmann <augusto.herrmann@planejamento.gov.br>
parents: 1271
diff changeset
263 ${h.submit('save',_('Save'),class_="ui-button")}
aaec08ad9daf Added pt_BR localization, added i18n wrappers on some places missing, fixed css in settings screen for longer labels.
Augusto Herrmann <augusto.herrmann@planejamento.gov.br>
parents: 1271
diff changeset
264 ${h.reset('reset',_('Reset'),class_="ui-button")}
1124
c52de8aa10e0 template fixes
Marcin Kuzminski <marcin@python-works.com>
parents: 1051
diff changeset
265 </div>
c52de8aa10e0 template fixes
Marcin Kuzminski <marcin@python-works.com>
parents: 1051
diff changeset
266 </div>
c52de8aa10e0 template fixes
Marcin Kuzminski <marcin@python-works.com>
parents: 1051
diff changeset
267 </div>
c52de8aa10e0 template fixes
Marcin Kuzminski <marcin@python-works.com>
parents: 1051
diff changeset
268 ${h.end_form()}
c52de8aa10e0 template fixes
Marcin Kuzminski <marcin@python-works.com>
parents: 1051
diff changeset
269 </div>
1472
aaec08ad9daf Added pt_BR localization, added i18n wrappers on some places missing, fixed css in settings screen for longer labels.
Augusto Herrmann <augusto.herrmann@planejamento.gov.br>
parents: 1271
diff changeset
270 </%def>