permission resource

This commit is contained in:
Etienne Roudeix
2013-10-22 19:51:01 +02:00
parent ca04b87738
commit 44a5909c81
27 changed files with 2753 additions and 493 deletions

View File

@@ -118,59 +118,82 @@
<div class="tab-pane fade {if $oder_tab == 'permissions'}active in{/if}" id="permissions">
<table class="table table-striped table-condensed table-left-aligned">
<caption>
{intl l="Manage permissions"}
</caption>
<thead>
<tr>
<th rowspan="2">{intl l="Resource"}</th>
<th rowspan="2">{intl l="Title"}</th>
<th colspan="4" class="text-center">{intl l="Rights"}</th>
</tr>
<tr>
<th>{intl l="View"}</th>
<th>{intl l="Create"}</th>
<th>{intl l="Update"}</th>
<th>{intl l="Delete"}</th>
</tr>
</thead>
<tbody>
{loop type="resource" name="resource-list" profile=$ID backend_context="1"}
{form name="thelia.admin.profile.resource-access.modification"}
<form method="POST" action="{url path="/admin/configuration/profiles/saveResourceAccess?tab=permissions"}" {form_enctype form=$form} >
{form_hidden_fields form=$form}
{* Be sure to get the product ID, even if the form could not be validated *}
<input type="hidden" name="profile_id" value="{$ID}" />
{if $form_error}<div class="alert alert-danger">{$form_error_message}</div>{/if}
<table class="table table-striped table-condensed table-left-aligned">
<caption>
{intl l="Manage permissions"}
</caption>
<thead>
<tr>
<td>{$CODE}</td>
<td>{$TITLE}</td>
<td>
<div class="make-switch switch-mini" data-on="success" data-off="danger" data-on-label="<i class='glyphicon glyphicon-ok'></i>" data-off-label="<i class='glyphicon glyphicon-remove'></i>">
<input type="checkbox" {if $VIEWABLE == 1}checked="checked"{/if}>
</div>
</td>
<td>
<div class="make-switch switch-mini" data-on="success" data-off="danger" data-on-label="<i class='glyphicon glyphicon-ok'></i>" data-off-label="<i class='glyphicon glyphicon-remove'></i>">
<input type="checkbox" {if $CREATABLE == 1}checked="checked"{/if}>
</div>
</td>
<td>
<div class="make-switch switch-mini" data-on="success" data-off="danger" data-on-label="<i class='glyphicon glyphicon-ok'></i>" data-off-label="<i class='glyphicon glyphicon-remove'></i>">
<input type="checkbox" {if $UPDATABLE == 1}checked="checked"{/if}>
</div>
</td>
<td>
<div class="make-switch switch-mini" data-on="success" data-off="danger" data-on-label="<i class='glyphicon glyphicon-ok'></i>" data-off-label="<i class='glyphicon glyphicon-remove'></i>">
<input type="checkbox" {if $DELETABLE == 1}checked="checked"{/if}>
</div>
<th rowspan="2">{intl l="Resource"}</th>
<th rowspan="2">{intl l="Title"}</th>
<th colspan="4" class="text-center">{intl l="Rights"}</th>
</tr>
<tr>
<th>{intl l="View"}</th>
<th>{intl l="Create"}</th>
<th>{intl l="Update"}</th>
<th>{intl l="Delete"}</th>
</tr>
</thead>
<tbody>
{form_tagged_fields form=$form tag='resources'}
{loop type="resource" name="resource-list" code=$attr_list.resource_code profile=$ID backend_context="1"}
<tr>
<td>{$CODE}</td>
<td>{$TITLE}</td>
<td>
<div class="make-switch switch-mini" data-on="success" data-off="danger" data-on-label="<i class='glyphicon glyphicon-ok'></i>" data-off-label="<i class='glyphicon glyphicon-remove'></i>">
<input name="{$name}" value="VIEW" type="checkbox" {if $VIEWABLE == 1}checked="checked"{/if}>
</div>
</td>
<td>
<div class="make-switch switch-mini" data-on="success" data-off="danger" data-on-label="<i class='glyphicon glyphicon-ok'></i>" data-off-label="<i class='glyphicon glyphicon-remove'></i>">
<input name="{$name}" value="CREATE" type="checkbox" {if $CREATABLE == 1}checked="checked"{/if}>
</div>
</td>
<td>
<div class="make-switch switch-mini" data-on="success" data-off="danger" data-on-label="<i class='glyphicon glyphicon-ok'></i>" data-off-label="<i class='glyphicon glyphicon-remove'></i>">
<input name="{$name}" value="UPDATE" type="checkbox" {if $UPDATABLE == 1}checked="checked"{/if}>
</div>
</td>
<td>
<div class="make-switch switch-mini" data-on="success" data-off="danger" data-on-label="<i class='glyphicon glyphicon-ok'></i>" data-off-label="<i class='glyphicon glyphicon-remove'></i>">
<input name="{$name}" value="DELETE" type="checkbox" {if $DELETABLE == 1}checked="checked"{/if}>
</div>
</td>
</tr>
{/loop}
{/form_tagged_fields}
</tbody>
<tfoot>
<tr>
<td colspan="3">
<button type="submit" class="btn btn-default btn-primary pull-right"><span class="glyphicon glyphicon-check"></span> {intl l="Save"}</button>
</td>
</tr>
{/loop}
</tbody>
<tfoot>
<tr>
<td colspan="3">
<button type="submit" class="btn btn-default btn-primary pull-right"><span class="glyphicon glyphicon-check"></span> {intl l="Save"}</button>
</td>
</tr>
</tfoot>
</table>
</tfoot>
</table>
</form>
{/form}
</div>