Skip to content

Commit

Permalink
Melhorias de código
Browse files Browse the repository at this point in the history
  • Loading branch information
edersoares committed Jul 1, 2024
1 parent 1d9e7f7 commit 3966645
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 50 deletions.
2 changes: 1 addition & 1 deletion ieducar/intranet/styles/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ input, select, textarea, span.select2.select2-container.select2-container--defau
border: solid 1px #cddce6 !important;
color: #47728f;
border-radius: 3px;
font-family: 'Open Sans' !important;
font-family: 'Open Sans', sans-serif !important;
}

input:read-only {
Expand Down
94 changes: 45 additions & 49 deletions resources/views/accesslevel/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
@endif

<table width="100%" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="formdktd" colspan="2" height="24"><b>Novo </b></td>
</tr>
Expand Down Expand Up @@ -85,65 +84,62 @@
</span>
</td>
</tr>
</tbody>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
<tbody>
<tr><td colspan="2"><hr></td></tr>
<tr>
<td class="formlttd">
<span class="form">Procure pelo nome do menu: </span><input type="text" v-model="search" placeholder="Digite o menu que procura" style="width: 300px;">
</td>
<td class="formlttd">
<div style="clear: both;"><small class="text-muted">Marcar opção para todos</small></div>
<div class="radiogroup">
<button type="button" @click="menus.forEach(menu => menu.processes.forEach(item => processes[item.process] = 3))">Exclui</button>
<button type="button" @click="menus.forEach(menu => menu.processes.forEach(item => processes[item.process] = 2))">Cadastra</button>
<button type="button" @click="menus.forEach(menu => menu.processes.forEach(item => processes[item.process] = 1))">Visualiza</button>
<button type="button" @click="menus.forEach(menu => menu.processes.forEach(item => processes[item.process] = 0))">Sem permissão</button>
</div>
</td>
</tr>
<template v-for="menu in menus">
<tr><td colspan="2"><hr></td></tr>
<tr>
<td class="formlttd">
<span class="form">Procure pelo nome do menu: </span><input type="text" v-model="search" placeholder="Digite o menu que procura" style="width: 300px;">
<td class="formlttd" height="24">
<b style="font-size: 16px">@{{ menu.menu.title }}</b>
</td>
<td class="formlttd">
<div style="clear: both;"><small class="text-muted">Marcar opção para todos</small></div>
<td class="formlttd" height="24">
<div style="clear: both;"><small class="text-muted">Marcar opção para todos os itens: <b>@{{ menu.menu.title }}</b></small></div>
<div class="radiogroup">
<button type="button" @click="menus.forEach(menu => menu.processes.forEach(item => processes[item.process] = 3))">Exclui</button>
<button type="button" @click="menus.forEach(menu => menu.processes.forEach(item => processes[item.process] = 2))">Cadastra</button>
<button type="button" @click="menus.forEach(menu => menu.processes.forEach(item => processes[item.process] = 1))">Visualiza</button>
<button type="button" @click="menus.forEach(menu => menu.processes.forEach(item => processes[item.process] = 0))">Sem permissão</button>
<button type="button" @click="menu.processes.forEach(item => processes[item.process] = 3)">Exclui</button>
<button type="button" @click="menu.processes.forEach(item => processes[item.process] = 2)">Cadastra</button>
<button type="button" @click="menu.processes.forEach(item => processes[item.process] = 1)">Visualiza</button>
<button type="button" @click="menu.processes.forEach(item => processes[item.process] = 0)">Sem permissão</button>
</div>
</td>
</tr>
<template v-for="menu in menus">
<tr><td colspan="2"><hr></td></tr>
<tr>
<td class="formlttd" height="24">
<b style="font-size: 16px">@{{ menu.menu.title }}</b>
</td>
<td class="formlttd" height="24">
<div style="clear: both;"><small class="text-muted">Marcar opção para todos os itens: <b>@{{ menu.menu.title }}</b></small></div>
<div class="radiogroup">
<button type="button" @click="menu.processes.forEach(item => processes[item.process] = 3)">Exclui</button>
<button type="button" @click="menu.processes.forEach(item => processes[item.process] = 2)">Cadastra</button>
<button type="button" @click="menu.processes.forEach(item => processes[item.process] = 1)">Visualiza</button>
<button type="button" @click="menu.processes.forEach(item => processes[item.process] = 0)">Sem permissão</button>
</div>
</td>
</tr>
<tr v-for="(process, i) in menu.processes" v-show="process.title.slugify().includes(search.slugify())">
<td :class="{ formmdtd: i % 2 == 0, formlttd: i % 2 != 0 }">
<span class="form">@{{ process.title }}</span>
<br>
<a :href="process.link" target="_blank"><sup>@{{ process.description }}</sup></a>
</td>
<td :class="{ formmdtd: i % 2 == 0, formlttd: i % 2 != 0 }" width="500">
<access-level-menu-radiogroup :process="process" v-model="processes[process.process]"></access-level-menu-radiogroup>
</td>
</tr>
</template>
<tr><td class="tableDetalheLinhaSeparador" colspan="2"></td></tr>
<tr class="linhaBotoes">
<td colspan="2" align="center">
<button class="btn-green" type="submit">Salvar</button>
<a class="btn" href="{{ Asset::get('/usuarios/tipos') }}">Cancelar</a>
@can('remove', 554)
@if($userType->getKey())
<button class="btn" type="button" onclick="this.form._method.value = 'delete'; this.form.action = '{{ Asset::get('/usuarios/tipos/' . $userType->getKey()) }}'; this.form.submit()">Excluir</button>
@endif
@endcan
<tr v-for="(process, i) in menu.processes" v-show="process.title.slugify().includes(search.slugify())">
<td :class="{ formmdtd: i % 2 == 0, formlttd: i % 2 != 0 }">
<span class="form">@{{ process.title }}</span>
<br>
<a :href="process.link" target="_blank"><sup>@{{ process.description }}</sup></a>
</td>
<td :class="{ formmdtd: i % 2 == 0, formlttd: i % 2 != 0 }" width="500">
<access-level-menu-radiogroup :process="process" v-model="processes[process.process]"></access-level-menu-radiogroup>
</td>
</tr>
</tbody>
</template>
<tr><td class="tableDetalheLinhaSeparador" colspan="2"></td></tr>
<tr class="linhaBotoes">
<td colspan="2" align="center">
<button class="btn-green" type="submit">Salvar</button>
<a class="btn" href="{{ Asset::get('/usuarios/tipos') }}">Cancelar</a>
@can('remove', 554)
@if($userType->getKey())
<button class="btn" type="button" onclick="this.form._method.value = 'delete'; this.form.action = '{{ Asset::get('/usuarios/tipos/' . $userType->getKey()) }}'; this.form.submit()">Excluir</button>
@endif
@endcan
</td>
</tr>
</table>
</form>
</div>
Expand Down

0 comments on commit 3966645

Please sign in to comment.