Skip to content

Commit

Permalink
Convert to bootstrap.
Browse files Browse the repository at this point in the history
  • Loading branch information
sallner authored and dwt committed May 17, 2018
1 parent df577d7 commit 9c1002a
Showing 1 changed file with 104 additions and 117 deletions.
221 changes: 104 additions & 117 deletions src/OFS/dtml/access.dtml
Expand Up @@ -4,7 +4,7 @@
<dtml-var manage_tabs>
</dtml-if>
</dtml-with>
<p class="form-help">
<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
Expand All @@ -13,7 +13,7 @@
its subobjects.
</p>

<p class="form-help">
<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
Expand All @@ -23,144 +23,131 @@
</p>


<div>
<form action="manage_reportUserPermissions" method="GET">
Username:
<input type="text" name="user" size="20" />
<input type="submit" value="Show me the user permissions and roles in the context of the current object" />
</form>
</div>
<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 width="100%" cellspacing="0" cellpadding="2" border="0" nowrap>
<tr class="list-header">
<dtml-unless isTopLevelPrincipiaApplicationObject>
<td>&nbsp;</td>
</dtml-unless>
<td align="left" valign="top">
<div class="form-label">
<strong>Permission</strong>
</div>
</td>
<td align="left" colspan="<dtml-var expr="_.len(valid_roles)">">
<div class="form-label">
<strong>Roles</strong>
</div>
</td>
</tr>
<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-in permission_settings mapping>

<dtml-if "not (_['sequence-index']%10)">
<tr class="row-normal">
<dtml-unless isTopLevelPrincipiaApplicationObject>
<td align="left" valign="top">
<div class="form-label">
<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>
</div>
</td>
</dtml-unless>
<td></td>
<dtml-in valid_roles>
<td align="left">
<div class="list-item">
<a href="manage_roleForm?role_to_manage=&dtml.url_quote-sequence-item;">&dtml-sequence-item;</a>
</div>
</td>
</dtml-in valid_roles>
</tr>
</dtml-if>

<dtml-if sequence-odd>
<tr class="row-normal">
<dtml-else>
<tr class="row-hilite">
</dtml-if>
</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>

<dtml-unless isTopLevelPrincipiaApplicationObject>
<td align="left" valign="top">
<input type="checkbox" name="acquire_&dtml-hashed_name;" &dtml-acquire; />
</td>
</dtml-unless>
<td align="left" nowrap>
<div class="list-item">
<a href="manage_permissionForm?permission_to_manage=&dtml.url_quote-name;">&dtml-name;</a>
</div>
</td>
<dtml-in roles mapping>
<td align="center">
<input type="checkbox" name="&dtml-name;" &dtml-checked; />
<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>
</tr>
</dtml-in permission_settings>
<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">" align="left">
<dtml-else>
<td colspan="<dtml-var expr="_.len(valid_roles)+2">" align="left">
</dtml-if>
<div class="form-element">
<input class="form-element" type="submit" name="submit" value="Save Changes" />
</div>
</td>
</tr>
<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 class="form-help" >
<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">
<table cellpadding="2">
<tr>
<td align="left" valign="top">
<div class="form-label">
User defined roles
</td>
<td align="left" valign="top">
&nbsp;
</td>
</tr>
<tr>
<td align="left" valign="top">
<input type="text" name="role" size="16" value="" />
</td>
<td align="left" valign="top">
<div class="form-element">
<input class="form-element" type="submit" name="submit" value="Add Role" />
</div>
</td>
</tr>
<dtml-if userdefined_roles>
<tr>
<td align="left" valign="top">
<div class="form-element">
<select name="roles:list">
<dtml-in userdefined_roles>
<option value="&dtml-sequence-item;">&dtml-sequence-item;</option>
</dtml-in userdefined_roles>
</select>
</div>
</td>
<td align="left" valign="top">
<div class="form-element">
<input class="form-element" type="submit" name="submit"
<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>
</td>
</tr>
</dtml-if userdefined_roles>
</table>
</div>
</dtml-if userdefined_roles>
</form>
</dtml-if>

Expand Down

0 comments on commit 9c1002a

Please sign in to comment.