mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Completada visualizacion y traduccion de roles y permisos
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card card-info">
|
||||
<h3 class="card-header"><?= $boxTitle ?? $pageTitle ?></h3>
|
||||
<h3 class="card-header"><?= lang("RolesPermisos.editRol") ?></h3>
|
||||
<div class="card-body">
|
||||
<?= formAlert() ?>
|
||||
<form id="groupForm" method="post" class="card-body" action="<?= $formAction ?>">
|
||||
@ -14,79 +14,81 @@
|
||||
|
||||
<div class="row g-3">
|
||||
<input type="hidden"
|
||||
name="id_group"
|
||||
name="id"
|
||||
value="<?= old('id', $group->id) ?>"
|
||||
>
|
||||
<div class="col-md-6">
|
||||
<div class="col-md-4">
|
||||
<label for="title" class="form-label text-dark">
|
||||
<?= lang("App.group_field_title") ?>
|
||||
<?= lang("RolesPermisos.rolName") ?>
|
||||
</label>
|
||||
<input type="text" name="name" id="name" class="form-control"
|
||||
value="<?= old('name', $group->name) ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row g-3 mt-3">
|
||||
<div class="col-md-6">
|
||||
<button type="button" name="select_all"
|
||||
id="select_all"
|
||||
class="btn btn-primary me-sm-3 me-1">
|
||||
<i class="la la-toggle-on"></i> <?= lang("App.group_btn_select") ?>
|
||||
</button>
|
||||
<button type="button" name="remove_all"
|
||||
id="remove_all"
|
||||
class="btn btn-secondary ">
|
||||
<i class="la la-toggle-off"></i> <?= lang("App.group_btn_remove") ?>
|
||||
</button>
|
||||
<div class="col-md-8">
|
||||
<label for="description" class="form-label text-dark">
|
||||
<?= lang("RolesPermisos.rolDescription") ?>
|
||||
</label>
|
||||
<input type="text" name="description" id="description" class="form-control"
|
||||
value="<?= old('description', $group->description) ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row g-3 mt-3">
|
||||
<div class="col-md-12">
|
||||
<h5>Role Permissions</h5>
|
||||
<h5><?= lang("RolesPermisos.rolPermissions") ?></h5>
|
||||
<!-- Permission table -->
|
||||
<div class="table-responsive">
|
||||
<table class="table table-flush-spacing">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="text-nowrap fw-semibold">
|
||||
Recurso
|
||||
<td class="text-nowrap fw-semibold" colspan="1">
|
||||
<?= lang("RolesPermisos.adminRol") ?>
|
||||
<i class="ti ti-info-circle" data-bs-toggle="tooltip"
|
||||
data-bs-placement="top"
|
||||
aria-label="<?= lang("RolesPermisos.adminRolTooltip") ?>"
|
||||
data-bs-original-title="<?= lang("RolesPermisos.adminRolTooltip") ?>">
|
||||
</i>
|
||||
</td>
|
||||
<td colspan="3">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" name="selectAll">
|
||||
<label class="form-check-label" for="selectAll">
|
||||
<?= lang("RolesPermisos.selectAll") ?>
|
||||
</label>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="form-check">
|
||||
<input type="checkbox"
|
||||
id="recurso_name"
|
||||
name="recurso_name"
|
||||
class="form-check-input"
|
||||
checked
|
||||
>
|
||||
<label for="recurso_name"
|
||||
class="form-check-label">Permiso</label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php /*foreach (getAllClass() as $item): ?>
|
||||
<?php if (empty($item['path'])): ?>
|
||||
<?php foreach ($permisos as $permiso): ?>
|
||||
<tr>
|
||||
<td colspan="4" class="text-nowrap fw-semibold">
|
||||
<?= $permiso->name ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php foreach ($permiso->rules as $key => $rules): ?>
|
||||
<tr>
|
||||
<td class="text-nowrap fw-semibold"><?= getDictionary($item['name']) ?></td>
|
||||
<?php foreach ($item['methods'] as $subitem): ?>
|
||||
<?php if (!getIgnoreMethod($subitem)): ?>
|
||||
<td>
|
||||
<div class="form-check">
|
||||
<input type="checkbox"
|
||||
id="<?= $item['name'] . '_' . $subitem ?>"
|
||||
name="<?= $item['name'] . '_' . $subitem ?>"
|
||||
class="form-check-input"
|
||||
<?= ruleIsChecked($group->rules, $item['name'], $subitem) ? 'checked' : '' ?>
|
||||
>
|
||||
<label for="<?= $item['name'] . '_' . $subitem ?>"
|
||||
class="form-check-label"><?= getDictionary($subitem) ?></label>
|
||||
</div>
|
||||
</td>
|
||||
<?php endif; ?>
|
||||
<td class="text-nowrap fw-semibold" >
|
||||
  <?= lang("RolesPermisos." . $key . "Section") ?>
|
||||
</td>
|
||||
<?php foreach ($rules as $rule): ?>
|
||||
<td>
|
||||
<div class="form-check">
|
||||
<input type="checkbox"
|
||||
id="<?= $key . '_' . $rule ?>"
|
||||
name="<?= $key . '_' . $rule ?>"
|
||||
class="form-check-input"
|
||||
<?= ruleIsChecked($group->rules, $key, $rule) ? 'checked' : '' ?>
|
||||
>
|
||||
<label for="<?= $key . '_' . $rule ?>" class="form-check-label">
|
||||
<?= lang("RolesPermisos." . $rule . "Permission") ?>
|
||||
</label>
|
||||
</div>
|
||||
</td>
|
||||
<?php endforeach; ?>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; */?>
|
||||
<?php endforeach;
|
||||
endforeach;
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@ -109,15 +111,12 @@
|
||||
|
||||
<?= $this->section('additionalInlineJs') ?>
|
||||
|
||||
$('#select_all').on('click', function () {
|
||||
$(':checkbox').each(function() {
|
||||
this.checked = true;
|
||||
});
|
||||
});
|
||||
$('#remove_all').on('click', function () {
|
||||
$(':checkbox').each(function() {
|
||||
this.checked = false;
|
||||
$('input[name="selectAll"]').click(function() {
|
||||
var checkedStatus = this.checked;
|
||||
$('input[type="checkbox"]').each(function() {
|
||||
this.checked = checkedStatus;
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
@ -5,7 +5,7 @@
|
||||
<div class="col-md-12">
|
||||
<div class="card card-info">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><?= lang('Group.grouplist') ?></h3>
|
||||
<h3 class="card-title"><?= lang('RolesPermisos.pageTitle') ?></h3>
|
||||
</div><!--//.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="container-xxl flex-grow-1 container-p-y">
|
||||
@ -31,7 +31,7 @@
|
||||
>
|
||||
<?= lang('Basic.global.addNew') ?>
|
||||
</button>
|
||||
<p class="mb-0 mt-1">Añadir rol si no existe</p>
|
||||
<p class="mb-0 mt-1"><?= lang("RolesPermisos.addRol") ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -43,7 +43,7 @@
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="d-flex justify-content-between">
|
||||
<h6 class="fw-normal mb-2"><?= $model->getUsersWithRol($item->keyword); ?> usuarios en total</h6>
|
||||
<h6 class="fw-normal mb-2"><?= $model->getUsersWithRol($item->keyword); ?><?= lang("RolesPermisos.totalUsers") ?></h6>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between align-items-end mt-1">
|
||||
<div class="role-heading">
|
||||
|
||||
Reference in New Issue
Block a user