Skip to content

Commit

Permalink
revised manage_access-Template according to bootstrap/css
Browse files Browse the repository at this point in the history
  • Loading branch information
Frank Hoffmann authored and dwt committed Jun 5, 2018
1 parent da44f34 commit accd0c6
Showing 1 changed file with 105 additions and 139 deletions.
244 changes: 105 additions & 139 deletions src/OFS/dtml/access.dtml
Expand Up @@ -4,152 +4,118 @@
<dtml-var manage_tabs>
</dtml-if>
</dtml-with>
<p>
The listing below shows the current security settings for this item.
Permissions are rows and roles are columns. Checkboxes are used to
indicate where roles are assigned permissions. You can also assign
<strong><a href="manage_listLocalRoles">local roles</a></strong> to
users, which give users extra roles in the context of this object and
its subobjects.
</p>

<p>
When a role is assigned to a permission, users with the given role
will be able to perform tasks associated with the permission on this
item. When the <em>Acquire permission settings</em> checkbox is selected
then the containing objects's permission settings are used. Note: the
acquired permission settings may be augmented by selecting Roles for
a permission in addition to selecting to acquire permissions.
</p>
<main class="<dtml-var "meta_type.replace(' ', '-')"> <dtml-var "URL0[_.len(URL1)+1:]">">
<p class="form-help">
The listing below shows the current security settings for this item.
Permissions are rows and roles are columns. Checkboxes are used to
indicate where roles are assigned permissions. You can also assign
<strong><a href="manage_listLocalRoles">local roles</a></strong> to
users, which give users extra roles in the context of this object and
its subobjects.<br />
When a role is assigned to a permission, users with the given role
will be able to perform tasks associated with the permission on this
item. When the <em>Acquire permission settings</em> checkbox is selected
then the containing objects's permission settings are used. Note: the
acquired permission settings may be augmented by selecting Roles for
a permission in addition to selecting to acquire permissions.
</p>

<form action="manage_reportUserPermissions" method="get" class="form-inline mb-4">
<div class="form-group">
<label for="username" class="col-sm-2">Username:</label>
<div class="col-sm-10">
<input class="form-control" type="text" id="username" name="user" placeholder="Enter name of user ..." />
<input type="submit" class="btn btn-primary mr-sm-2"
title="Show me the user permissions and roles in the context of the current object"
value="Show permissions" />
</div>
</div>
</form>

<form action="manage_reportUserPermissions"
method="GET"
class="form-inline">
<div class="form-group mb-2">
<label for="username" class="form-label mr-sm-2">
Username:
</label>
<input type="text"
class="form-control mr-sm-2"
id="username"
name="user"
size="20" />
<input type="submit"
class="form-control btn btn-outline-info mr-sm-2"
value="Show me the user permissions and roles in the context of the current object" />
</div>
</form>
<dtml-with expr="_.namespace(valid_roles=valid_roles())">
<form action="manage_changePermissions" method="post">
<table class="table table-hover">
<thead>
<tr>
<th scope="col" colspan="2">Permission</th>
<th scope="col" colspan="<dtml-var expr="_.len(valid_roles)">">Roles</th>
<th class="blank">&nbsp;</th>
</tr>
</thead>
<tbody>
<dtml-in permission_settings mapping>
<dtml-if "not (_['sequence-index']%10)">
<tr>
<th colspan="2" class="zmi-akcquire-title" title="Acquire permission settings">
<dtml-unless isTopLevelPrincipiaApplicationObject>
<a href="manage_acquiredForm">Acquire
<dtml-unless sequence-index> <span class="d-none d-sm-block">permission settings</span></dtml-unless>
</a>
</dtml-unless>
</th>
<dtml-in valid_roles>
<th class="zmi-rolename" title="&dtml-sequence-item;"><div><span>&dtml-sequence-item;</span></div></th>
</dtml-in valid_roles>
<th class="blank">&nbsp;</th>
</tr>
</dtml-if>
<tr>
<td class="zmi-akcquire-check"">
<dtml-unless isTopLevelPrincipiaApplicationObject>
<input type="checkbox" name="acquire_&dtml-hashed_name;" &dtml-acquire; />
</dtml-unless>
</td>
<td class="zmi-akcquire-title nowrap">
<a href="manage_permissionForm?permission_to_manage=&dtml.url_quote-name;">&dtml-name;</a>
</td>
<dtml-in roles mapping>
<td class="zmi-rolename-check" title="<dtml-var "valid_roles[_['sequence-index']]"> ">
<input type="checkbox" name="&dtml-name;" &dtml-checked; />
</td>
</dtml-in>
<td class="blank">&nbsp;</td>
</tr>
</dtml-in permission_settings>
</tbody>
</table>
<div class="zmi-controls">
<input type="submit" class="btn btn-primary" name="submit" value="Save Changes" />
</div>
</form>
</dtml-with>

<dtml-with expr="_.namespace(valid_roles=valid_roles())">
<form action="manage_changePermissions" method="post">

<table class="table table-striped table-hover" nowrap>
<thead>
<tr class="table-secondary">
<dtml-unless isTopLevelPrincipiaApplicationObject>
<th scope="col">&nbsp;</th>
</dtml-unless>
<th scope="col">
Permission
</th>
<th scope="col" colspan="<dtml-var expr="_.len(valid_roles)">">
Roles
</th>
</tr>
<dtml-if "_['id'] != 'acl_users'">

<dtml-in permission_settings mapping>
<p class="form-help mt-4">
You can define new roles by entering a role name and clicking the
&quot;Add Role&quot; button.
</p>

<dtml-if "not (_['sequence-index']%10)">
<tr>
<dtml-unless isTopLevelPrincipiaApplicationObject>
<td>
<strong>
<a href="manage_acquiredForm">Acquire<dtml-unless sequence-index><BR>permission<BR>settings</dtml-unless></a>?
</strong>
</td>
</dtml-unless>
<td></td>
<dtml-in valid_roles>
<td>
<a href="manage_roleForm?role_to_manage=&dtml.url_quote-sequence-item;">
&dtml-sequence-item;
</a>
</td>
</dtml-in valid_roles>
</tr>
</dtml-if>
</thead>

<tbody>
<tr>
<dtml-unless isTopLevelPrincipiaApplicationObject>
<td>
<input type="checkbox" name="acquire_&dtml-hashed_name;" &dtml-acquire; />
</td>
</dtml-unless>
<td nowrap>
<a href="manage_permissionForm?permission_to_manage=&dtml.url_quote-name;">&dtml-name;</a>
</td>
<dtml-in roles mapping>
<td>
<input type="checkbox" name="&dtml-name;" &dtml-checked; />
</td>
</dtml-in>
</tr>
</dtml-in permission_settings>

<tr>
<dtml-if isTopLevelPrincipiaApplicationObject>
<td colspan="<dtml-var expr="_.len(valid_roles)+1">">
<dtml-else>
<td colspan="<dtml-var expr="_.len(valid_roles)+2">">
</dtml-if>
<input type="submit"
class="btn btn-outline-secondary"
name="submit"
value="Save Changes" />
</td>
</tr>
</tbody>
</table>
</form>
</dtml-with>

<dtml-if "_['id'] != 'acl_users'">
<p>
You can define new roles by entering a role name and clicking the
&quot;Add Role&quot; button.
</p>

<form action="manage_defined_roles"
method="post">
User defined roles:
<div class="form-group mb-2 form-inline">
<input type="text"
class="form-control mr-sm-2 col-4"
name="role"
size="20" />
<input type="submit"
class="form-control btn btn-outline-info mr-sm-2"
name="submit"
value="Add Role" />
</div>
<dtml-if userdefined_roles>
<div class="form-group mb-2 form-inline">
<select name="roles:list" class="form-control col-4 mr-sm-2" >
<dtml-in userdefined_roles>
<option value="&dtml-sequence-item;">&dtml-sequence-item;</option>
</dtml-in userdefined_roles>
</select>
<input type="submit"
class="btn btn-outline-danger mr-sm-2"
name="submit"
value="Delete Role" />
</div>
</dtml-if userdefined_roles>
</form>
</dtml-if>
<form action="manage_defined_roles" method="post" class="form">
<div class="form-group">
<label for="username" class="nowrap">User defined roles</label>
<div class="form-inline">
<input type="text" class="form-control col-sm-6 col-md-3 mr-2" id="role" name="role" placeholder="Define a new user role ..." />
<input type="submit" class="btn btn-primary" name="submit" value="Add Role" />
</div>
</div>
<dtml-if userdefined_roles>
<div class="form-group">
<div class="form-inline">
<select name="roles:list" class="form-control col-sm-6 col-md-3 mr-2">
<dtml-in userdefined_roles>
<option value="&dtml-sequence-item;">&dtml-sequence-item;</option>
</dtml-in userdefined_roles>
</select>
<input type="submit" class="btn btn-primary" name="submit" value="Delete Role" />
</div>
</div>
</dtml-if>
</form>
</dtml-if >
</main>

<dtml-var manage_page_footer>

0 comments on commit accd0c6

Please sign in to comment.