##// END OF EJS Templates
env-variables: make it safer if there's a syntax problem inside .ini file....
env-variables: make it safer if there's a syntax problem inside .ini file. It's better to not crash, since it means server wont start. Let users fix problems instead of breaking the startup because of that.

File last commit:

r2980:5cb2321a default
r3237:5cf82ecc default
Show More
repo_group_edit_permissions.mako
218 lines | 12.3 KiB | application/x-mako | MakoHtmlLexer
/ rhodecode / templates / admin / repo_groups / repo_group_edit_permissions.mako
repo-groups: moved to pyramid
r2175 <%namespace name="base" file="/base/base.mako"/>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">${_('Repository Group Permissions')}</h3>
</div>
<div class="panel-body">
${h.secure_form(h.route_path('edit_repo_group_perms_update', repo_group_name=c.repo_group.group_name), request=request)}
<table id="permissions_manage" class="rctable permissions">
<tr>
<th class="td-radio">${_('None')}</th>
<th class="td-radio">${_('Read')}</th>
<th class="td-radio">${_('Write')}</th>
<th class="td-radio">${_('Admin')}</th>
<th class="td-owner">${_('User/User Group')}</th>
dan
permissions: unified looks and buttons on permission pages....
r2980 <th class="td-action"></th>
<th class="td-action"></th>
repo-groups: moved to pyramid
r2175 </tr>
## USERS
%for _user in c.repo_group.permissions():
permissions: add links to permissions summary for each permission pages
r2976 ## super admin/owner row
repo-groups: moved to pyramid
r2175 %if getattr(_user, 'admin_row', None) or getattr(_user, 'owner_row', None):
<tr class="perm_admin_row">
<td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.none', disabled="disabled")}</td>
<td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.read', disabled="disabled")}</td>
<td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.write', disabled="disabled")}</td>
<td class="td-radio">${h.radio('admin_perm_%s' % _user.user_id,'repository.admin', 'repository.admin', disabled="disabled")}</td>
<td class="td-user">
${base.gravatar(_user.email, 16)}
${h.link_to_user(_user.username)}
%if getattr(_user, 'admin_row', None):
(${_('super admin')})
%endif
%if getattr(_user, 'owner_row', None):
(${_('owner')})
%endif
</td>
<td></td>
dan
permissions: unified looks and buttons on permission pages....
r2980 <td class="quick_repo_menu">
permissions: add links to permissions summary for each permission pages
r2976 % if c.rhodecode_user.is_admin:
dan
permissions: unified looks and buttons on permission pages....
r2980 <i class="icon-more"></i>
<div class="menu_items_container" style="display: none;">
<ul class="menu_items">
<li>
${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-groups-permissions'))}
</li>
</ul>
</div>
permissions: add links to permissions summary for each permission pages
r2976 % endif
</td>
repo-groups: moved to pyramid
r2175 </tr>
%else:
<tr>
##forbid revoking permission from yourself, except if you're an super admin
%if c.rhodecode_user.user_id != _user.user_id or c.rhodecode_user.is_admin:
<td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.none', checked=_user.permission=='group.none')}</td>
<td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.read', checked=_user.permission=='group.read')}</td>
<td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.write', checked=_user.permission=='group.write')}</td>
<td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.admin', checked=_user.permission=='group.admin')}</td>
<td class="td-user">
${base.gravatar(_user.email, 16)}
<span class="user">
% if _user.username == h.DEFAULT_USER:
${h.DEFAULT_USER} <span class="user-perm-help-text"> - ${_('permission for all other users')}</span>
% else:
${h.link_to_user(_user.username)}
permissions: add links to permissions summary for each permission pages
r2976 %if getattr(_user, 'duplicate_perm', None):
(${_('inactive duplicate')})
%endif
repo-groups: moved to pyramid
r2175 % endif
</span>
</td>
<td class="td-action">
%if _user.username != h.DEFAULT_USER:
<span class="btn btn-link btn-danger revoke_perm"
member="${_user.user_id}" member_type="user">
dan
permissions: unified looks and buttons on permission pages....
r2980 ${_('Remove')}
repo-groups: moved to pyramid
r2175 </span>
%endif
</td>
dan
permissions: unified looks and buttons on permission pages....
r2980 <td class="quick_repo_menu">
permissions: add links to permissions summary for each permission pages
r2976 % if c.rhodecode_user.is_admin:
dan
permissions: unified looks and buttons on permission pages....
r2980 <i class="icon-more"></i>
<div class="menu_items_container" style="display: none;">
<ul class="menu_items">
<li>
% if _user.username == h.DEFAULT_USER:
${h.link_to('show permissions', h.route_path('admin_permissions_overview', _anchor='repositories-groups-permissions'))}
% else:
${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-groups-permissions'))}
% endif
</li>
</ul>
</div>
permissions: add links to permissions summary for each permission pages
r2976 % endif
</td>
repo-groups: moved to pyramid
r2175 %else:
permissions: add links to permissions summary for each permission pages
r2976 ## special case for currently logged-in user permissions, we make sure he cannot take his own permissions
repo-groups: moved to pyramid
r2175 <td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.none', disabled="disabled")}</td>
<td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.read', disabled="disabled")}</td>
<td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.write', disabled="disabled")}</td>
<td class="td-radio">${h.radio('u_perm_%s' % _user.user_id,'group.admin', disabled="disabled")}</td>
<td class="td-user">
${base.gravatar(_user.email, 16)}
<span class="user">
% if _user.username == h.DEFAULT_USER:
${h.DEFAULT_USER} <span class="user-perm-help-text"> - ${_('permission for all other users')}</span>
% else:
${h.link_to_user(_user.username)}
permissions: add links to permissions summary for each permission pages
r2976 %if getattr(_user, 'duplicate_perm', None):
(${_('inactive duplicate')})
%endif
repo-groups: moved to pyramid
r2175 % endif
<span class="user-perm-help-text">(${_('delegated admin')})</span>
</span>
</td>
<td></td>
dan
permissions: unified looks and buttons on permission pages....
r2980 <td class="quick_repo_menu">
permissions: add links to permissions summary for each permission pages
r2976 % if c.rhodecode_user.is_admin:
dan
permissions: unified looks and buttons on permission pages....
r2980 <i class="icon-more"></i>
<div class="menu_items_container" style="display: none;">
<ul class="menu_items">
<li>
${h.link_to('show permissions', h.route_path('edit_user_perms_summary', user_id=_user.user_id, _anchor='repositories-groups-permissions'))}
</li>
</ul>
</div>
permissions: add links to permissions summary for each permission pages
r2976 % endif
</td>
repo-groups: moved to pyramid
r2175 %endif
</tr>
%endif
%endfor
## USER GROUPS
%for _user_group in c.repo_group.permission_user_groups():
<tr id="id${id(_user_group.users_group_name)}">
<td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'group.none', checked=_user_group.permission=='group.none')}</td>
<td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'group.read', checked=_user_group.permission=='group.read')}</td>
<td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'group.write', checked=_user_group.permission=='group.write')}</td>
<td class="td-radio">${h.radio('g_perm_%s' % _user_group.users_group_id,'group.admin', checked=_user_group.permission=='group.admin')}</td>
<td class="td-componentname">
branch permissions: added logic to define in UI branch permissions....
r2975 <i class="icon-user-group"></i>
repo-groups: moved to pyramid
r2175 %if h.HasPermissionAny('hg.admin')():
<a href="${h.route_path('edit_user_group',user_group_id=_user_group.users_group_id)}">
${_user_group.users_group_name}
</a>
%else:
Bartłomiej Wołyńczyk
Public user group profile Task #5326
r2638 ${h.link_to_group(_user_group.users_group_name)}
repo-groups: moved to pyramid
r2175 %endif
</td>
<td class="td-action">
<span class="btn btn-link btn-danger revoke_perm"
member="${_user_group.users_group_id}" member_type="user_group">
dan
permissions: unified looks and buttons on permission pages....
r2980 ${_('Remove')}
repo-groups: moved to pyramid
r2175 </span>
</td>
dan
permissions: unified looks and buttons on permission pages....
r2980 <td class="quick_repo_menu">
permissions: add links to permissions summary for each permission pages
r2976 % if c.rhodecode_user.is_admin:
dan
permissions: unified looks and buttons on permission pages....
r2980 <i class="icon-more"></i>
<div class="menu_items_container" style="display: none;">
<ul class="menu_items">
<li>
${h.link_to('show permissions', h.route_path('edit_user_group_perms_summary', user_group_id=_user_group.users_group_id, _anchor='repositories-groups-permissions'))}
</li>
</ul>
</div>
permissions: add links to permissions summary for each permission pages
r2976 % endif
</td>
repo-groups: moved to pyramid
r2175 </tr>
%endfor
<tr class="new_members" id="add_perm_input"></tr>
branch permissions: added logic to define in UI branch permissions....
r2975 <tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>
<span id="add_perm" class="link">
${_('Add user/user group')}
</span>
</td>
permissions: add links to permissions summary for each permission pages
r2976 <td></td>
branch permissions: added logic to define in UI branch permissions....
r2975 </tr>
repo-groups: moved to pyramid
r2175 </table>
branch permissions: added logic to define in UI branch permissions....
r2975
repo-groups: moved to pyramid
r2175 <div class="fields">
<div class="field">
<div class="label label-radio">
${_('Apply to children')}:
</div>
<div class="radios">
${h.radio('recursive', 'none', label=_('None'), checked="checked")}
${h.radio('recursive', 'groups', label=_('Repository Groups'))}
${h.radio('recursive', 'repos', label=_('Repositories'))}
${h.radio('recursive', 'all', label=_('Both'))}
<span class="help-block">${_('Set or revoke permissions to selected types of children of this group, including non-private repositories and other groups if chosen.')}</span>
</div>
</div>
</div>
<div class="buttons">
${h.submit('save',_('Save'),class_="btn btn-primary")}
${h.reset('reset',_('Reset'),class_="btn btn-danger")}
</div>
${h.end_form()}
</div>
</div>
<script type="text/javascript">
$('#add_perm').on('click', function(e){
addNewPermInput($(this), 'group');
});
$('.revoke_perm').on('click', function(e){
markRevokePermInput($(this), 'group');
dan
permissions: unified looks and buttons on permission pages....
r2980 });
quick_repo_menu();
repo-groups: moved to pyramid
r2175 </script>