##// END OF EJS Templates
Add mousetrap.js file from Mousetrap 1.4.5, under the Apache license....
Add mousetrap.js file from Mousetrap 1.4.5, under the Apache license. The file was download and verified via these commands: $ git clone https://github.com/ccampbell/mousetrap.git $ cd mousetrap; git checkout 1.4.5 The file in that repository named mousetrap.js is exactly the same one that appeared in RhodeCode 2.2.5 in changeset c8d3c0d61d95. The mousetrap.js states clearly that it is licensed under Apache-2.0.

File last commit:

r4116:ffd45b18 rhodecode-2.2.5-gpl
r4126:158ef336 rhodecode-2.2.5-gpl
Show More
perms_summary.html
132 lines | 6.2 KiB | text/html | HtmlLexer
fixed sort of permissions summary it's now perm+name...
r3666 ## snippet for displaying permissions overview for users
Iteration on default permissions...
r3736 ## usage:
## <%namespace name="p" file="/base/perms_summary.html"/>
## ${p.perms_summary(c.perm_user.permissions)}
fixed sort of permissions summary it's now perm+name...
r3666
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 <%def name="perms_summary(permissions, show_all=False, actions=True)">
fixed sort of permissions summary it's now perm+name...
r3666 <div id="perms" class="table">
%for section in sorted(permissions.keys()):
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 <div class="perms_section_head">
${section.replace("_"," ").capitalize()}
%if section != 'global':
<div style="float: right">
${_('show')}:
${h.checkbox('perms_filter_none_%s' % section, 'none', 'checked', class_='perm_filter filter_%s' % section, section=section, perm_type='none')} <label for="${'perms_filter_none_%s' % section}"><span class="perm_tag none">${_('none')}</span></label>
${h.checkbox('perms_filter_read_%s' % section, 'read', 'checked', class_='perm_filter filter_%s' % section, section=section, perm_type='read')} <label for="${'perms_filter_read_%s' % section}"><span class="perm_tag read">${_('read')}</span></label>
${h.checkbox('perms_filter_write_%s' % section, 'write', 'checked', class_='perm_filter filter_%s' % section, section=section, perm_type='write')} <label for="${'perms_filter_write_%s' % section}"> <span class="perm_tag write">${_('write')}</span></label>
${h.checkbox('perms_filter_admin_%s' % section, 'admin', 'checked', class_='perm_filter filter_%s' % section, section=section, perm_type='admin')} <label for="${'perms_filter_admin_%s' % section}"><span class="perm_tag admin">${_('admin')}</span></label>
</div>
%endif
</div>
fixed sort of permissions summary it's now perm+name...
r3666 %if not permissions[section]:
<span class="empty_data">${_('No permissions defined yet')}</span>
%else:
<div id='tbl_list_wrap_${section}' class="yui-skin-sam">
<table id="tbl_list_${section}">
Don't show empty permissions for users, only for admins
r3901 ## global permission box
fixed sort of permissions summary it's now perm+name...
r3666 %if section == 'global':
New default permissions definition for user group create
r3734 <thead>
<tr>
<th colspan="2" class="left">${_('Permission')}</th>
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 %if actions:
New default permissions definition for user group create
r3734 <th class="left">${_('Edit Permission')}</th>
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 %endif
New default permissions definition for user group create
r3734 </thead>
<tbody>
Iteration on default permissions...
r3736 %for k in permissions[section]:
fixed sort of permissions summary it's now perm+name...
r3666 <tr>
New default permissions definition for user group create
r3734 <td colspan="2">
fixed sort of permissions summary it's now perm+name...
r3666 ${h.get_permission_name(k)}
</td>
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 %if actions:
fixed sort of permissions summary it's now perm+name...
r3666 <td>
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 <a href="${h.url('admin_permissions')}">${_('edit')}</a>
fixed sort of permissions summary it's now perm+name...
r3666 </td>
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 %endif
fixed sort of permissions summary it's now perm+name...
r3666 </tr>
%endfor
New default permissions definition for user group create
r3734 </tbody>
fixed sort of permissions summary it's now perm+name...
r3666 %else:
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 ## none/read/write/admin permissions on groups/repos etc
New default permissions definition for user group create
r3734 <thead>
<tr>
<th class="left">${_('Name')}</th>
<th class="left">${_('Permission')}</th>
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 %if actions:
New default permissions definition for user group create
r3734 <th class="left">${_('Edit Permission')}</th>
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 %endif
New default permissions definition for user group create
r3734 </thead>
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 <tbody class="section_${section}">
%for k, section_perm in sorted(permissions[section].items(), key=lambda s: {'none':0, 'read':1,'write':2,'admin':3}.get(s[1].split('.')[-1])):
Don't show empty permissions for users, only for admins
r3901 %if section_perm.split('.')[-1] != 'none' or show_all:
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 <tr class="perm_row ${'%s_%s' % (section, section_perm.split('.')[-1])}">
fixed sort of permissions summary it's now perm+name...
r3666 <td>
%if section == 'repositories':
<a href="${h.url('summary_home',repo_name=k)}">${k}</a>
%elif section == 'repositories_groups':
<a href="${h.url('repos_group_home',group_name=k)}">${k}</a>
New default permissions definition for user group create
r3734 %elif section == 'user_groups':
##<a href="${h.url('edit_users_group',id=k)}">${k}</a>
${k}
fixed sort of permissions summary it's now perm+name...
r3666 %endif
</td>
<td>
<span class="perm_tag ${section_perm.split('.')[-1]}">${section_perm}</span>
</td>
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 %if actions:
fixed sort of permissions summary it's now perm+name...
r3666 <td>
%if section == 'repositories':
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 <a href="${h.url('edit_repo_perms',repo_name=k,anchor='permissions_manage')}">${_('edit')}</a>
fixed sort of permissions summary it's now perm+name...
r3666 %elif section == 'repositories_groups':
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 <a href="${h.url('edit_repo_group_perms',group_name=k,anchor='permissions_manage')}">${_('edit')}</a>
New default permissions definition for user group create
r3734 %elif section == 'user_groups':
##<a href="${h.url('edit_users_group',id=k)}">${_('edit')}</a>
fixed sort of permissions summary it's now perm+name...
r3666 %endif
</td>
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 %endif
fixed sort of permissions summary it's now perm+name...
r3666 </tr>
Don't show empty permissions for users, only for admins
r3901 %endif
fixed sort of permissions summary it's now perm+name...
r3666 %endfor
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 <tr id="empty_${section}" style="display: none"><td colspan="6">${_('No permission defined')}</td></tr>
New default permissions definition for user group create
r3734 </tbody>
fixed sort of permissions summary it's now perm+name...
r3666 %endif
</table>
</div>
%endif
%endfor
</div>
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 <script>
$(document).ready(function(){
var show_empty = function(section){
var visible = $('.section_{0} tr.perm_row:visible'.format(section)).length;
console.log(visible)
console.log($('.section_{0} tr.perm_row:visible'.format(section)))
if(visible == 0){
$('#empty_{0}'.format(section)).show();
}
else{
$('#empty_{0}'.format(section)).hide();
}
}
$('.perm_filter').on('change', function(e){
var self = this;
var section = $(this).attr('section');
var opts = {}
var elems = $('.filter_' + section).each(function(el){
var perm_type = $(this).attr('perm_type');
var checked = this.checked;
opts[perm_type] = checked;
if(checked){
$('.'+section+'_'+perm_type).show();
}
else{
$('.'+section+'_'+perm_type).hide();
}
});
show_empty(section);
})
})
</script>
fixed sort of permissions summary it's now perm+name...
r3666 </%def>