-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix #82 e reorganiza as views de user
- Loading branch information
Showing
7 changed files
with
196 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{{-- Form de deletar --}} | ||
<form method="POST" action="{{url()->current()}}/{{$row->id}}" class="form-inline pull-left"> | ||
@csrf | ||
@method('delete') | ||
<button type="submit" class="btn btn-light text-danger py-0 px-0 delete-item" data-toggle="tooltip" title="Remover"> | ||
<i class="far fa-trash-alt"></i> | ||
</button> | ||
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php #dd($data); ?> | ||
|
||
{{-- enviar $row, $model ['name', 'label'] --}} | ||
|
||
<table class="table table-striped table-sm table-hover datatable-nopagination"> | ||
<thead> | ||
<tr> | ||
@foreach ($fields as $col) | ||
<th>{{ $col['label'] ?? $col['name'] }}</th> | ||
@endforeach | ||
|
||
<th> </th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
@foreach ($rows as $row) | ||
<tr> | ||
|
||
@foreach ($fields as $col) | ||
<td>@include('common/list-table-col-value')</td> | ||
@endforeach | ||
|
||
<td style="width: 40px;"> | ||
<div class="row"> | ||
<div class="mr-2 form-inline"> | ||
@foreach($btns as $btn) | ||
@include($btn) | ||
@endforeach | ||
</div> | ||
</div> | ||
</td> | ||
|
||
</tr> | ||
@endforeach | ||
</tbody> | ||
</table> | ||
|
||
@section('javascripts_bottom') | ||
@parent | ||
<script> | ||
$(document).ready(function() { | ||
oTable = $('.datatable-nopagination').DataTable({ | ||
dom: 'ti' | ||
, "paging": false | ||
}); | ||
}) | ||
</script> | ||
@endsection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
@extends('master') | ||
|
||
<?php #dd($data) ?> | ||
<?php | ||
$rows = $users; | ||
$fields = \App\Models\User::getFields(); | ||
?> | ||
@section('content') | ||
@parent | ||
|
||
<div class="row"> | ||
<div class="col-md-12 form-inline"> | ||
|
||
<span class="h4 mt-2">Usuários</span> | ||
@include('partials.datatable-filter-box') | ||
@include('users.partials.btn-add-modal') | ||
|
||
</div> | ||
</div> | ||
|
||
@include('partials.datatable-list', ['btns'=>['users.partials.btn-change-user','partials.btn-delete']]) | ||
|
||
@endsection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<button type="button" class="btn btn-sm btn-success" onclick="add_modal_form()"> | ||
<i class="fas fa-plus"></i> Novo | ||
</button> | ||
|
||
<!-- Modal --> | ||
<div class="modal fade" id="common-modal-form" data-backdrop="static" tabindex="-1" aria-labelledby="modalPortariaLabel" aria-hidden="true"> | ||
<div class="modal-dialog modal-lg"> | ||
<div class="modal-content"> | ||
<div class="modal-header"> | ||
<h5 class="modal-title" id="modalPortariaLabel">Adicionar pessoas</h5> | ||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> | ||
<span aria-hidden="true">×</span> | ||
</button> | ||
</div> | ||
<div class="modal-body"> | ||
|
||
<div class="list_table_div_form"> | ||
{!! Form::open( ['url'=>'users']) !!} | ||
@method('POST') | ||
@csrf | ||
|
||
<div class="form-group row"> | ||
{{ Form::label('codpes', 'Nome', ['class' => 'col-form-label col-sm-2']) }} | ||
<div class="col-sm-10"> | ||
{{ Form::select('codpes',[], null,['class' => 'form-control', 'placeholder'=>'Digite nome ..']) }} | ||
</div> | ||
</div> | ||
|
||
<div class="text-right"> | ||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Fechar</button> | ||
<button type="submit" class="btn btn-primary">Salvar</button> | ||
</div> | ||
{!! Form::close(); !!} | ||
</div> | ||
|
||
</div> | ||
</div> | ||
{{-- <div class="modal-footer"></div> --}} | ||
</div> | ||
</div> | ||
|
||
@section('javascripts_bottom') | ||
@parent | ||
<script> | ||
$(document).ready(function() { | ||
var pessoasForm = $('#common-modal-form'); | ||
add_modal_form = function() { | ||
pessoasForm.modal(); | ||
} | ||
pessoasForm.find(':input[name=codpes]').select2({ | ||
ajax: { | ||
url: 'search/partenome' | ||
, dataType: 'json' | ||
} | ||
, dropdownParent: pessoasForm | ||
, minimumInputLength: 4 | ||
, theme: 'bootstrap4' | ||
, wdth: 'resolve' | ||
, language: 'pt_br' | ||
}) | ||
}) | ||
</script> | ||
@endsection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<a href="users/{{$row['id']}}/assumir" class="btn btn-sm btn-light" | ||
data-toggle="tooltip" | ||
title="Assumir a identidade do usuário"> | ||
<i class="fas fa-user-nurse"></i> | ||
</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters