Skip to content
This repository has been archived by the owner on Jul 1, 2020. It is now read-only.

Commit

Permalink
Fix ulteriori nella parte di moderazione, creazione e modifica utenti
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxelweb committed Apr 9, 2020
1 parent a8d688f commit fee6b4a
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 72 deletions.
2 changes: 1 addition & 1 deletion resources/views/devices/create.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<h1 class="h3 mb-0 text-gray-800"> Creazione dispositivo</h1>
</div>
<div class="d-sm-flex mb-4 ml-sm-auto">
<a href="{{route('devices.index')}}" class="btn btn-danger btn-icon-split">
<a href="{{route('devices.index')}}" class="btn btn-sm btn-danger btn-icon-split">
<span class="icon text-white-50">
<span class="fas fa-arrow-circle-left"></span>
</span>
Expand Down
10 changes: 5 additions & 5 deletions resources/views/devices/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
@can(['isAdmin'])
<div class="col-auto mb-4">
<a href="{{route('devices.create')}}" class="btn btn-sm btn-success btn-icon-split">
<span class="icon text-white-50">
<span class="fas fa-plus-circle"></span>
</span>s
<span class="icon text-white-50">
<span class="fas fa-plus-circle"></span>
</span>
<span class="text">Aggiungi dispositivo</span>
</a>
</div>
Expand All @@ -31,9 +31,9 @@
<div class="card shadow mb-4">
<a href="#collapseByGateway_{{$deviceOnGateway[0]->gatewayId}}" class="d-block card-header py-3"
data-toggle="collapse" role="button" aria-expanded="true" aria-controls="collapseByGateway_{{$deviceOnGateway[0]->gatewayId}}">
<h6 class="m-0 font-weight-bold text-primary"><span class="fas fa-microchip"></span> Lista dispositivi <code>{{ $deviceOnGateway[0]->name}}</code></h6>
<h6 class="m-0 font-weight-bold text-primary"><span class="fas fa-microchip"></span> Lista dispositivi <code>({{ $deviceOnGateway[0]->name}})</code></h6>
</a>
<div class="collapse show" id="collapseByGateway_{{$deviceOnGateway[0]->gatewayId}}">
<div class="collapse collapsed" id="collapseByGateway_{{$deviceOnGateway[0]->gatewayId}}">
<div class="card-body">
<div class="table-responsive-lg">
<table class="table table-striped table-bordered border-secondary">
Expand Down
1 change: 0 additions & 1 deletion resources/views/logs/show.blade.module

This file was deleted.

29 changes: 14 additions & 15 deletions resources/views/users/create.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<h1 class="h3 mb-0 text-gray-800"> Creazione Utente</h1>
</div>
<div class="d-sm-flex mb-4 ml-sm-auto">
<a href="{{route('users.index')}}" class="btn btn-danger btn-icon-split">
<a href="{{route('users.index')}}" class="btn btn-sm btn-danger btn-icon-split">
<span class="icon text-white-50">
<span class="fas fa-arrow-circle-left"></span>
</span>
Expand All @@ -17,8 +17,8 @@
<div class="card shadow mb-4">
<div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary">
<span class="fas fa-user-edit"></span>
Modifica informazioni
<span class="fas fa-user-plus"></span>
Crea nuovo utente
</h6>
</div>
<div class="card-body">
Expand All @@ -27,7 +27,7 @@
@csrf
@method('POST')
<div class="form-group row">
<label for="inputName" class="col-sm-4 col-form-label"><span class="fas fa-user"></span> Nome</label>
<label for="inputName" class="col-sm-4 col-form-label"><span class="fas fa-signature"></span> Nome</label>
<div class="col-sm-8">
<input type="text" class="form-control @error('name') is-invalid @enderror" id="inputName" placeholder="Nome" value="{{old('name')}}" name="name">
@error('name')
Expand All @@ -38,7 +38,7 @@
</div>
</div>
<div class="form-group row">
<label for="inputSurname" class="col-sm-4 col-form-label"><span class="fas fa-user"></span> Cognome</label>
<label for="inputSurname" class="col-sm-4 col-form-label"><span class="fas fa-file-signature"></span> Cognome</label>
<div class="col-sm-8">
<input type="text" class="form-control @error('surname') is-invalid @enderror" id="inputSurname" placeholder="Cognome" value="{{old('surname')}}" name="surname">
@error('surname')
Expand All @@ -64,7 +64,7 @@
</div>
</div>
<div class="form-group row">
<label for="inputEnte" class="col-sm-4 col-form-label"><span class="fas fa-user-tag"></span> Ente</label>
<label for="inputEnte" class="col-sm-4 col-form-label"><span class="fas fa-dungeon"></span> Ente</label>
<div class="col-sm-8">
<select class="form-control @error('entityId') is-invalid @enderror" name="entityId" id="inputEnte">
@foreach($entities as $entity)
Expand All @@ -80,7 +80,7 @@
</div>
@endcan
<div class="form-group row">
<label for="inputEmail" class="col-sm-4 col-form-label"><span class="fas fa-envelope text-gray-500"></span> Email</label>
<label for="inputEmail" class="col-sm-4 col-form-label"><span class="fas fa-envelope"></span> Email</label>
<div class="col-sm-8">
<input type="email" class="form-control @error('email') is-invalid @enderror" id="inputEmail" placeholder="Email" value="{{old('email')}}" name="email">
@error('email')
Expand All @@ -92,15 +92,14 @@
</div>
</form>
@endcanany
</div>
</div>
<div class="d-sm-flex mb-4 ml-sm-auto float-right">
<button type="submit" class="btn btn-success btn-icon-split">
<span class="icon text-white-50">
<span class="fas fa-plus-circle"></span>
</span>
<span class="text">Aggiungi</span>
<hr>
<button type="submit" class="btn btn-primary btn-icon-split">
<span class="icon text-white-50">
<span class="fas fa-plus-circle"></span>
</span>
<span class="text">Crea utente</span>
</button>
</div>
</div>
</div>
@endsection
30 changes: 12 additions & 18 deletions resources/views/users/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<h1 class="h3 mb-0 text-gray-800"> Modifica profilo</h1>
</div>
<div class="d-sm-flex mb-4 ml-sm-auto">
<a href="{{route('users.index')}}" class="btn btn-danger btn-icon-split">
<a href="{{route('users.index')}}" class="btn btn-sm btn-danger btn-icon-split">
<span class="icon text-white-50">
<span class="fas fa-arrow-circle-left"></span>
</span>
<span class="text">Torna indietro</span>
<span class="text">Torna alla lista utenti</span>
</a>
</div>
<div class="card shadow mb-4">
Expand Down Expand Up @@ -102,9 +102,9 @@
</div>
</div>
<div class="form-group row">
<label for="inputPassword" class="col-sm-4 col-form-label"><span class="fas fa-lock text-success"></span> Password</label>
<label for="inputPassword" class="col-sm-4 col-form-label"><span class="fas fa-lock text-success"></span> Cambio Password (o lascia vuoto)</label>
<div class="col-sm-8">
<input type="password" class="form-control @error('password') is-invalid @enderror" id="inputPassword" placeholder="Password" name="password">
<input type="password" class="form-control @error('password') is-invalid @enderror" id="inputPassword" placeholder="Nuova password o lascia vuoto" name="password">
@error('password')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
Expand Down Expand Up @@ -145,25 +145,19 @@
</div>
</div>
</div>
<hr>
<p class="my-2 small"><span class="fas fa-info-circle text-primary"></span>
*Per attivare l'<em>autenticazione a due fattori</em> è necessario inserire lo username Telegram
e avviare il bot direttamente dall'applicazione, inserendo il comando <code>/start</code> in chat.
</p>
@endcan
<hr>
<button type="submit" class="btn btn-primary btn-icon-split">
<span class="icon text-white-50">
<span class="fas fa-edit"></span>
</span>
<span class="text">Modifica</span>
</button>
</form>
@else
<p>Non puoi modificare un'utente con il tuo stesso ruolo!</p>
<div class="alert alert-danger">Non puoi modificare un'utente con il tuo stesso ruolo!</div>
@endif
</div>
</div>
<div class="d-sm-flex mb-4 ml-sm-auto">
<button type="submit" class="btn btn-success btn-icon-split">
<span class="icon text-white-50">
<span class="fas fa-edit"></span>
</span>
<span class="text">Modifica</span>
</button>
</div>
</div>
@endsection
31 changes: 16 additions & 15 deletions resources/views/users/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,25 @@
<h1 class="h3 mb-0 text-gray-800"> Gestione utenti</h1>
</div>
<div class="d-sm-flex mb-4 ml-sm-auto">
<a href="{{route('dashboard.index')}}" class="btn btn-danger btn-icon-split">
<a href="{{route('dashboard.index')}}" class="btn btn-sm btn-danger btn-icon-split mr-4">
<span class="icon text-white-50">
<span class="fas fa-arrow-circle-left"></span>
</span>
<span class="text">Torna indietro</span>
</a>
</div>
@canany(['isAdmin', 'isMod'])
<div class="d-sm-flex mb-4 ml-sm-auto">
<a href="{{route('users.create')}}" class="btn btn-primary btn-icon-split">
@canany(['isAdmin', 'isMod'])
<a href="{{route('users.create')}}" class="btn btn-sm btn-success btn-icon-split">
<span class="icon text-white-50">
<span class="fas fa-user-plus"></span>
</span>
<span class="text">Aggiungi</span>
</a>
</div>
@endcanany
<span class="text">Crea nuovo utente</span>
</a>
@endcanany
</div>

<div class="card shadow mb-4">
<div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary"><span class="fas fa-users-cog"></span> Lista utenti</h6>
<h6 class="m-0 font-weight-bold text-primary"><span class="fas fa-users"></span> Lista utenti</h6>
</div>
<div class="card-body">
<div class="table-responsive-lg">
Expand All @@ -35,9 +33,9 @@
<tr>
<th>ID</th>
<th>Nome e cognome</th>
<th>Stato</th>
<th>Email</th>
<th>Ruolo</th>
<th>Stato</th>
<th class="bg-secondary"> </th>
</tr>
</thead>
Expand All @@ -46,20 +44,23 @@
<tr>
<td><a href="{{route('users.show', ['userId' => $u->userId ])}}">{{$u->userId}}</a></td>
<td><a href="{{route('users.show', ['userId' => $u->userId ])}}">{{$u->name}} {{$u->surname}}</a></td>
<td>{{$u->getRole()}}</td>
<td>{{$u->email}}</td>
<td>
@if($u->deleted)
<span class="badge badge-danger">Disattivo</span>
@else
<span class="badge badge-success">Attivo</span>
@endif
</td>
<td>
<span class="text-info">{{$u->getRole()}}</span>
</td>
<td>{{$u->email}}</td>

<td class="text-center">
@canany(['isAdmin', 'isMod'])
@if($user->type < Auth::user()->type)
@if($u->type < Auth::user()->type)
<div class="d-sm-flex mb-4 ml-sm-auto">
<a href="{{route('users.edit', $user->userId)}}" class="btn btn-small btn-primary btn-icon-split">
<a href="{{route('users.edit', $u->userId)}}" class="btn btn-sm btn-warning btn-icon-split">
<span class="icon text-white-50">
<span class="fas fa-user-edit"></span>
</span>
Expand Down
Loading

0 comments on commit fee6b4a

Please sign in to comment.