##// END OF EJS Templates
#344 optional firstname lastname on user creation...
#344 optional firstname lastname on user creation - on display fallback to username if both empty

File last commit:

r1888:f91d3f9b beta
r1950:4ae17f81 beta
Show More
users_group_edit.html
270 lines | 10.5 KiB | text/html | HtmlLexer
#56 implemented users groups editing,...
r972 ## -*- coding: utf-8 -*-
<%inherit file="/base/base.html"/>
<%def name="title()">
${_('Edit users group')} ${c.users_group.users_group_name} - ${c.rhodecode_name}
</%def>
<%def name="breadcrumbs_links()">
White-space cleanup
r1888 ${h.link_to(_('Admin'),h.url('admin_home'))}
&raquo;
${h.link_to(_('UsersGroups'),h.url('users_groups'))}
#56 implemented users groups editing,...
r972 &raquo;
${_('edit')} "${c.users_group.users_group_name}"
</%def>
<%def name="page_nav()">
${self.menu('admin')}
</%def>
<%def name="main()">
template fixes
r1124 <div class="box box-left">
#56 implemented users groups editing,...
r972 <!-- box / title -->
<div class="title">
White-space cleanup
r1888 ${self.breadcrumbs()}
#56 implemented users groups editing,...
r972 </div>
<!-- end box / title -->
${h.form(url('users_group', id=c.users_group.users_group_id),method='put', id='edit_users_group')}
<div class="form">
<!-- fields -->
<div class="fields">
<div class="field">
<div class="label">
<label for="users_group_name">${_('Group name')}:</label>
</div>
<div class="input">
${h.text('users_group_name',class_='small')}
</div>
</div>
White-space cleanup
r1888
#56 implemented users groups editing,...
r972 <div class="field">
<div class="label label-checkbox">
<label for="users_group_active">${_('Active')}:</label>
</div>
<div class="checkboxes">
${h.checkbox('users_group_active',value=True)}
</div>
</div>
<div class="field">
extended functionality on users groups select box
r985 <div class="label">
#56 implemented users groups editing,...
r972 <label for="users_group_active">${_('Members')}:</label>
</div>
extended functionality on users groups select box
r985 <div class="select">
White-space cleanup
r1888 <table>
#56 implemented users groups editing,...
r972 <tr>
<td>
<div>
<div style="float:left">
extended functionality on users groups select box
r985 <div class="text" style="padding: 0px 0px 6px;">${_('Choosen group members')}</div>
#56 implemented users groups editing,...
r972 ${h.select('users_group_members',[x[0] for x in c.group_members],c.group_members,multiple=True,size=8,style="min-width:210px")}
extended functionality on users groups select box
r985 <div id="remove_all_elements" style="cursor:pointer;text-align:center">
${_('Remove all elements')}
fixed inline comment indicator....
r1701 <img alt="remove" style="vertical-align:text-bottom" src="${h.url('/images/icons/arrow_right.png')}"/>
extended functionality on users groups select box
r985 </div>
#56 implemented users groups editing,...
r972 </div>
<div style="float:left;width:20px;padding-top:50px">
White-space cleanup
r1888 <img alt="add" id="add_element"
style="padding:2px;cursor:pointer"
fixed inline comment indicator....
r1701 src="${h.url('/images/icons/arrow_left.png')}"/>
#56 implemented users groups editing,...
r972 <br />
White-space cleanup
r1888 <img alt="remove" id="remove_element"
style="padding:2px;cursor:pointer"
fixed inline comment indicator....
r1701 src="${h.url('/images/icons/arrow_right.png')}"/>
#56 implemented users groups editing,...
r972 </div>
<div style="float:left">
extended functionality on users groups select box
r985 <div class="text" style="padding: 0px 0px 6px;">${_('Available members')}</div>
#56 implemented users groups editing,...
r972 ${h.select('available_members',[],c.available_members,multiple=True,size=8,style="min-width:210px")}
extended functionality on users groups select box
r985 <div id="add_all_elements" style="cursor:pointer;text-align:center">
fixed inline comment indicator....
r1701 <img alt="add" style="vertical-align:text-bottom" src="${h.url('/images/icons/arrow_left.png')}"/>
extended functionality on users groups select box
r985 ${_('Add all elements')}
White-space cleanup
r1888 </div>
#56 implemented users groups editing,...
r972 </div>
</div>
White-space cleanup
r1888 </td>
</tr>
</table>
</div>
#56 implemented users groups editing,...
r972
White-space cleanup
r1888 </div>
#56 implemented users groups editing,...
r972 <div class="buttons">
Augusto Herrmann
Added pt_BR localization, added i18n wrappers on some places missing, fixed css in settings screen for longer labels.
r1472 ${h.submit('save',_('save'),class_="ui-button")}
White-space cleanup
r1888 </div>
</div>
</div>
${h.end_form()}
#56 implemented users groups editing,...
r972 </div>
White-space cleanup
r1888
#56 implemented users groups editing,...
r972 <script type="text/javascript">
YAHOO.util.Event.onDOMReady(function(){
var D = YAHOO.util.Dom;
var E = YAHOO.util.Event;
White-space cleanup
r1888
#56 implemented users groups editing,...
r972 //definition of containers ID's
var available_container = 'available_members';
var selected_container = 'users_group_members';
White-space cleanup
r1888
#56 implemented users groups editing,...
r972 //form containing containers id
var form_id = 'edit_users_group';
White-space cleanup
r1888
extended functionality on users groups select box
r985 //temp container for selected storage.
#56 implemented users groups editing,...
r972 var cache = new Array();
#56 available options from users groups are now self avare of choosen options and doesn't display.
r1030 var av_cache = new Array();
#56 implemented users groups editing,...
r972 var c = D.get(selected_container);
#56 available options from users groups are now self avare of choosen options and doesn't display.
r1030 var ac = D.get(available_container);
White-space cleanup
r1888
#56 implemented users groups editing,...
r972 //get only selected options for further fullfilment
for(var i = 0;node =c.options[i];i++){
if(node.selected){
//push selected to my temp storage left overs :)
cache.push(node);
#56 available options from users groups are now self avare of choosen options and doesn't display.
r1030 }
#56 implemented users groups editing,...
r972 }
White-space cleanup
r1888
#56 implemented users groups editing,...
r972 //clear 'selected' select
small fix for users groups choose dialog
r1031 //c.options.length = 0;
#56 implemented users groups editing,...
r972
//fill it with remembered options
small fix for users groups choose dialog
r1031 //for(var i = 0;node = cache[i];i++){
// c.options[i]=new Option(node.text, node.value, false, false);
//}
White-space cleanup
r1888
#56 available options from users groups are now self avare of choosen options and doesn't display.
r1030 //get all available options to cache
for(var i = 0;node =ac.options[i];i++){
//push selected to my temp storage left overs :)
av_cache.push(node);
White-space cleanup
r1888 }
#56 available options from users groups are now self avare of choosen options and doesn't display.
r1030 //fill available only with those not in choosen
ac.options.length=0;
tmp_cache = new Array();
White-space cleanup
r1888
#56 available options from users groups are now self avare of choosen options and doesn't display.
r1030 for(var i = 0;node = av_cache[i];i++){
var add = true;
for(var i2 = 0;node_2 = cache[i2];i2++){
if(node.value == node_2.value){
add=false;
break;
}
}
if(add){
tmp_cache.push(new Option(node.text, node.value, false, false));
}
White-space cleanup
r1888 }
#56 available options from users groups are now self avare of choosen options and doesn't display.
r1030 for(var i = 0;node = tmp_cache[i];i++){
ac.options[i] = node;
}
White-space cleanup
r1888
#56 implemented users groups editing,...
r972 function prompts_action_callback(e){
White-space cleanup
r1888
var choosen = D.get(selected_container);
extended functionality on users groups select box
r985 var available = D.get(available_container);
White-space cleanup
r1888
extended functionality on users groups select box
r985 //get checked and unchecked options from field
function get_checked(from_field){
//temp container for storage.
var sel_cache = new Array();
var oth_cache = new Array();
White-space cleanup
r1888
extended functionality on users groups select box
r985 for(var i = 0;node = from_field.options[i];i++){
#56 implemented users groups editing,...
r972 if(node.selected){
extended functionality on users groups select box
r985 //push selected fields :)
sel_cache.push(node);
}
else{
oth_cache.push(node)
#56 implemented users groups editing,...
r972 }
White-space cleanup
r1888 }
extended functionality on users groups select box
r985 return [sel_cache,oth_cache]
}
White-space cleanup
r1888
extended functionality on users groups select box
r985 //fill the field with given options
function fill_with(field,options){
//clear firtst
field.options.length=0;
for(var i = 0;node = options[i];i++){
White-space cleanup
r1888 field.options[i]=new Option(node.text, node.value,
extended functionality on users groups select box
r985 false, false);
}
White-space cleanup
r1888
extended functionality on users groups select box
r985 }
//adds to current field
function add_to(field,options){
for(var i = 0;node = options[i];i++){
White-space cleanup
r1888 field.appendChild(new Option(node.text, node.value,
extended functionality on users groups select box
r985 false, false));
#56 implemented users groups editing,...
r972 }
}
White-space cleanup
r1888
extended functionality on users groups select box
r985 // add action
if (this.id=='add_element'){
var c = get_checked(available);
add_to(choosen,c[0]);
fill_with(available,c[1]);
}
// remove action
if (this.id=='remove_element'){
var c = get_checked(choosen);
add_to(available,c[0]);
White-space cleanup
r1888 fill_with(choosen,c[1]);
}
extended functionality on users groups select box
r985 // add all elements
if(this.id=='add_all_elements'){
for(var i=0; node = available.options[i];i++){
White-space cleanup
r1888 choosen.appendChild(new Option(node.text,
extended functionality on users groups select box
r985 node.value, false, false));
#56 implemented users groups editing,...
r972 }
extended functionality on users groups select box
r985 available.options.length = 0;
#56 implemented users groups editing,...
r972 }
extended functionality on users groups select box
r985 //remove all elements
if(this.id=='remove_all_elements'){
for(var i=0; node = choosen.options[i];i++){
White-space cleanup
r1888 available.appendChild(new Option(node.text,
extended functionality on users groups select box
r985 node.value, false, false));
}
White-space cleanup
r1888 choosen.options.length = 0;
extended functionality on users groups select box
r985 }
White-space cleanup
r1888
#56 implemented users groups editing,...
r972 }
White-space cleanup
r1888
extended functionality on users groups select box
r985 E.addListener(['add_element','remove_element',
'add_all_elements','remove_all_elements'],'click',
prompts_action_callback)
#56 implemented users groups editing,...
r972
E.addListener(form_id,'submit',function(){
var choosen = D.get(selected_container);
for (var i = 0; i < choosen.options.length; i++) {
choosen.options[i].selected = 'selected';
}
White-space cleanup
r1888 })
#56 implemented users groups editing,...
r972 });
White-space cleanup
r1888 </script>
template fixes
r1124 <div class="box box-right">
<!-- box / title -->
<div class="title">
White-space cleanup
r1888 <h5>${_('Permissions')}</h5>
template fixes
r1124 </div>
Fixed permissions for users groups, group can have create repo permission now....
r1271 ${h.form(url('users_group_perm', id=c.users_group.users_group_id), method='put')}
template fixes
r1124 <div class="form">
<!-- fields -->
<div class="fields">
<div class="field">
<div class="label label-checkbox">
Augusto Herrmann
Corrected some label-input linking in templates
r1575 <label for="create_repo_perm">${_('Create repositories')}:</label>
template fixes
r1124 </div>
<div class="checkboxes">
Fixed permissions for users groups, group can have create repo permission now....
r1271 ${h.checkbox('create_repo_perm',value=True)}
template fixes
r1124 </div>
</div>
<div class="buttons">
Augusto Herrmann
Added pt_BR localization, added i18n wrappers on some places missing, fixed css in settings screen for longer labels.
r1472 ${h.submit('save',_('Save'),class_="ui-button")}
${h.reset('reset',_('Reset'),class_="ui-button")}
White-space cleanup
r1888 </div>
</div>
template fixes
r1124 </div>
White-space cleanup
r1888 ${h.end_form()}
template fixes
r1124 </div>
White-space cleanup
r1888 </%def>