Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#2375] start of admin template fixes
- Loading branch information
Showing
2 changed files
with
187 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
{% extends "page.html" %} | ||
|
||
{% block title %}{{ _('Administration - Authorization') }} - {{ super() }}{% endblock %} | ||
|
||
{% block breadcrumb_content %} | ||
{% endblock %} | ||
|
||
{% macro authz_form_table(id, roles, users, user_role_dict) %} | ||
<table class="table table-bordered table-striped table-condensed"> | ||
<tr> | ||
<th> User </th> | ||
{% for role in roles %} | ||
<th> {{ role }} </th> | ||
{% endfor %} | ||
</tr> | ||
{% for user in users %} | ||
<tr> | ||
<td> | ||
{{ h.linked_user(user) }} | ||
</td> | ||
{% for role in roles %} | ||
<td> | ||
<input type="hidden" name="{{ h.literal( '%s$%s' % (user,role)) }}" value="submitted"/> | ||
{% if user_role_dict[(user,role)] %} | ||
<input type="checkbox" | ||
name="{{ h.literal( '%s$%s' % (user,role)) }}" | ||
checked='checked'/> | ||
{% else %} | ||
<input type="checkbox" | ||
name="{{ h.literal( '%s$%s' % (user,role)) }}" | ||
/> | ||
{% endif %} | ||
</td> | ||
{% endfor %} | ||
</tr> | ||
{% endfor %} | ||
</table> | ||
{% endmacro %} | ||
|
||
|
||
{% macro authz_add_table(roles) %} | ||
<table class="table table-bordered table-striped table-condensed"> | ||
<tr> | ||
<th>User</th> | ||
{% for role in roles %} | ||
<th> {{ role }} </th> | ||
{% endfor %} | ||
</tr> | ||
<tr> | ||
<td> | ||
<input type="textbox" name="new_user_name" class="autocomplete-user" /> | ||
</td> | ||
{% for role in roles %} | ||
<td> | ||
<input type="hidden" name="{{ h.literal( '%s' % role) }}" value="submitted"/> | ||
<input type="checkbox" name="{{ h.literal( '%s' % role) }}"/> | ||
</td> | ||
{% endfor %} | ||
</tr> | ||
</table> | ||
{% endmacro %} | ||
|
||
{% macro authz_form_group_table(id, roles, users, user_role_dict) %} | ||
<table class="table table-bordered table-striped table-condensed"> | ||
<tr> | ||
<th>User Group</th> | ||
{% for role in roles %} | ||
<th> {{ role }} </th> | ||
{% endfor %} | ||
</tr> | ||
{% for user in users %} | ||
<tr> | ||
<td> | ||
{{ h.linked_authorization_group(user) }} | ||
</td> | ||
{% for role in roles %} | ||
<td> | ||
<input type="hidden" name="${ h.literal( '%s$%s' % (user,role)) }" value="submitted"/> | ||
{% if user_role_dict[(user,role)] %} | ||
<input type="checkbox" | ||
name="{{ h.literal( '%s$%s' % (user,role)) }}" | ||
checked='checked'/> | ||
{% else %} | ||
<input type="checkbox" | ||
name="{{ h.literal( '%s$%s' % (user,role)) }}" | ||
/> | ||
{% endif %} | ||
</td> | ||
{% endfor %} | ||
</tr> | ||
{% endfor %} | ||
</table> | ||
{% endmacro %} | ||
|
||
|
||
{% macro authz_add_group_table(roles) %} | ||
<table class="table table-bordered table-striped table-condensed"> | ||
<tr> | ||
<th>User Group</th> | ||
{% for role in roles %} | ||
<th> {{ role }} </th> | ||
{% endfor %} | ||
</tr> | ||
<tr> | ||
<td> | ||
<input type="textbox" name="new_user_name" class="autocomplete-authzgroup" /> | ||
</td> | ||
{% for role in roles %} | ||
<td> | ||
<input type="hidden" name="{{ h.literal( '%s' % role) }}" value="submitted"/> | ||
<input type="checkbox" name="{{ h.literal( '%s' % role) }}"/> | ||
</td> | ||
{% endfor %} | ||
</tr> | ||
</table> | ||
{% endmacro %} | ||
|
||
{% block primary %} | ||
<article class="module"> | ||
<div class="module-content"> | ||
<h1 class="page-heading">{{ _('Administration - Authorization') }}</h1> | ||
<h3>Update Existing Roles</h3> | ||
<form id="theform" method="POST"> | ||
{{ authz_form_table('theform', c.roles, c.users, c.user_role_dict) }} | ||
<button type="submit" name="save" class="btn btn-primary"> | ||
Save Changes | ||
</button> | ||
<div class="clear"></div> | ||
</form> | ||
|
||
<h3>Add Roles for Any User</h3> | ||
<form id="addform" method="POST"> | ||
{{ authz_add_table(c.roles) }} | ||
<button type="submit" name="add" class="btn btn-primary">Add Role</button> | ||
<div class="clear"></div> | ||
</form> | ||
|
||
<hr/> | ||
|
||
{% if c.are_any_authz_groups %} | ||
<h3>Existing Roles for Authorization Groups</h3> | ||
|
||
<form id="authzgroup_form" method="POST"> | ||
{{ authz_form_group_table('authzgroup_form', c.roles, c.authz_groups, c.authz_groups_role_dict) }} | ||
<button type="submit" name="authz_save" class="btn btn-primary">Save Changes</button> | ||
<div class="clear"></div> | ||
</form> | ||
|
||
<h3>Add Roles for Any Authorization Group</h3> | ||
|
||
<form id="authzgroup_addform" method="POST"> | ||
{{ authz_add_group_table(c.roles) }} | ||
<button type="submit" name="authz_add" class="btn btn-primary">Add Role</button> | ||
<div class="clear"></div> | ||
</form> | ||
{% endif %} | ||
</div> | ||
</article> | ||
{% endblock %} | ||
|
||
{% block sidebar %}{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{% extends "page.html" %} | ||
|
||
{% block title %}{{ _('Administration') }} - {{ super() }}{% endblock %} | ||
|
||
{% block breadcrumb_content %} | ||
{% endblock %} | ||
|
||
{% block primary %} | ||
<article class="module"> | ||
<div class="module-content"> | ||
<h1 class="page-heading">{{ _('Current Sysadmins') }}</h1> | ||
<p>You can change sysadmins on the | ||
<a href="{% url_for controller='admin', action='authz' %}">authorization page</a> | ||
.</p> | ||
<ul> | ||
{% for user in c.sysadmins %} | ||
<li py:for="user in c.sysadmins"> | ||
{{ h.linked_user(user) }} | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
</div> | ||
</article> | ||
{% endblock %} | ||
|
||
{% block sidebar %}{% endblock %} |