From 46e3608487c0d1d54f53e0c6505216f269404764 Mon Sep 17 00:00:00 2001 From: Mali Oz Date: Tue, 18 Jun 2024 13:25:04 -0300 Subject: [PATCH 1/9] Remove "todas as notas" (v. #105) --- resources/views/user/show.blade.php | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/resources/views/user/show.blade.php b/resources/views/user/show.blade.php index 1e3bfa0..7376902 100644 --- a/resources/views/user/show.blade.php +++ b/resources/views/user/show.blade.php @@ -34,15 +34,5 @@
@include('turma.table',['turmas' => $user->turmas, 'editButton' => false, 'removeButton' => true])
- - -

Todas as Notas

-
-
-
- Esta tabela contém todas as notas já registradas para esse usuário. Note que para uma nota ser válida ela precisa ter data anterior ao prazo correspondente. Apenas a máxima nota válida é usada. -
- @include('nota.table',['notas' => $user->notas]) -
@endsection From 07a96f87c863075b1b9754f46a4fccf266c0fd37 Mon Sep 17 00:00:00 2001 From: Mali Oz Date: Tue, 18 Jun 2024 15:13:37 -0300 Subject: [PATCH 2/9] avoid cacheing views on dev --- docker-deploy.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docker-deploy.sh b/docker-deploy.sh index 0f602ba..ff3729c 100755 --- a/docker-deploy.sh +++ b/docker-deploy.sh @@ -14,5 +14,10 @@ php artisan migrate --force php artisan route:clear php artisan config:clear php artisan cache:clear -php artisan view:cache -php artisan event:cache +php artisan view:clear +php artisan event:clear +# Cache views and events only on production +if [ "$APP_ENV" == "production" ]; then + php artisan view:cache + php artisan event:cache +fi From b3216df14faad52c7088ba0d050d8c31d333b715 Mon Sep 17 00:00:00 2001 From: Mali Oz Date: Tue, 18 Jun 2024 15:13:51 -0300 Subject: [PATCH 3/9] remove buttons from ex index --- resources/views/exercicio/table.blade.php | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/resources/views/exercicio/table.blade.php b/resources/views/exercicio/table.blade.php index 5cfd594..1f4399d 100644 --- a/resources/views/exercicio/table.blade.php +++ b/resources/views/exercicio/table.blade.php @@ -2,7 +2,6 @@ Título - Ações @@ -15,15 +14,6 @@ - - - - - @can ('edit', $value) - Editar - @endcan - - @endforeach From 067100ac13f3f54b5315a5d4ce3faaa0f3b12357 Mon Sep 17 00:00:00 2001 From: Mali Oz Date: Tue, 18 Jun 2024 15:18:45 -0300 Subject: [PATCH 4/9] remove buttons from user index --- resources/views/user/index.blade.php | 2 +- resources/views/user/table.blade.php | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/resources/views/user/index.blade.php b/resources/views/user/index.blade.php index 523538c..17a4410 100644 --- a/resources/views/user/index.blade.php +++ b/resources/views/user/index.blade.php @@ -14,6 +14,6 @@
{{ Session::get('message') }}
@endif -@include('user.table',['editButton'=>true]) +@include('user.table') @endsection diff --git a/resources/views/user/table.blade.php b/resources/views/user/table.blade.php index fff43e2..b0dec04 100644 --- a/resources/views/user/table.blade.php +++ b/resources/views/user/table.blade.php @@ -7,7 +7,9 @@ Turmas @endunless Admin - Ações + @if ($editButton ?? '' or $removeButton ?? '') + Ações + @endif @@ -44,6 +46,7 @@ + @if ($editButton ?? '' or $removeButton ?? '') @@ -61,8 +64,8 @@ @endif + @endif @endforeach - From d4f88e9bd024aff4676835d0123d43f2d38dd83f Mon Sep 17 00:00:00 2001 From: Mali Oz Date: Tue, 18 Jun 2024 15:25:21 -0300 Subject: [PATCH 5/9] minimize calls to @can edit turma --- resources/views/turma/show.blade.php | 7 ++++++- resources/views/user/table.blade.php | 2 -- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/resources/views/turma/show.blade.php b/resources/views/turma/show.blade.php index 050a1d0..78ae6a5 100644 --- a/resources/views/turma/show.blade.php +++ b/resources/views/turma/show.blade.php @@ -9,7 +9,12 @@

Membros

- @include('user.table',['users' => $turma->users, 'editButton' => true, 'removeButton' => true]) + @can ('edit', $turma) + @include('user.table',['users' => $turma->users, + 'removeButton' => true]) + @else + @include('user.table',['users' => $turma->users]) + @endcan
@if($prazosFuturos ?? '') diff --git a/resources/views/user/table.blade.php b/resources/views/user/table.blade.php index b0dec04..60e8545 100644 --- a/resources/views/user/table.blade.php +++ b/resources/views/user/table.blade.php @@ -58,9 +58,7 @@ @if ($removeButton ?? '') - @can ('edit', $turma) Remover - @endcan @endif From 55c02707d394850bdaa29fa9ee1611207c291c0e Mon Sep 17 00:00:00 2001 From: Mali Oz Date: Tue, 18 Jun 2024 15:30:54 -0300 Subject: [PATCH 6/9] remove actions from prazo table --- resources/views/prazo/table.blade.php | 36 +++++++-------------------- 1 file changed, 9 insertions(+), 27 deletions(-) diff --git a/resources/views/prazo/table.blade.php b/resources/views/prazo/table.blade.php index b2e1354..ac4b924 100644 --- a/resources/views/prazo/table.blade.php +++ b/resources/views/prazo/table.blade.php @@ -4,18 +4,16 @@ @unless ($exercicio ?? "") Exercicio @endif + @unless ($turma ?? "") Turma @endif - Prazo + + Prazo + @if ($user ?? "") Nota @endif - @if ($turma ?? "") - @can ('edit', $turma) - Ações - @endcan - @endif @@ -40,34 +38,18 @@ @endif - {{ $value->prazo }} - @if ($user ?? "") + - {{ $user->notaFinal($value) }} + {{ $value->prazo }} - @endif - @if ($turma ?? "") - @can ('edit', $turma) + @if ($user ?? "") - - - @if ($removeButton ?? '') -
id)}}"> - {{ csrf_field() }} - {{ method_field('DELETE') }} - -
- -
-
- @endif - + {{ $user->notaFinal($value) }} - @endcan @endif + @endforeach - From 361689c60cc33bd6e7b483d8ecc55465effc8dfe Mon Sep 17 00:00:00 2001 From: Mali Oz Date: Wed, 19 Jun 2024 14:23:18 -0300 Subject: [PATCH 7/9] fix some documentations --- app/Http/Controllers/UserController.php | 8 ++++---- app/Models/User.php | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 7597724..be3cbe5 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -59,7 +59,7 @@ public function store(Request $request) /** * Show the profile of a given User. * - * @param App\Models\User $user + * @param User $user * @return \Illuminate\View\View */ public function show(User $user) @@ -83,7 +83,7 @@ public function show(User $user) /** * Show the form for editing the specified resource. * - * @param App\Models\User $user + * @param User $user * @return \Illuminate\Http\Response */ public function edit(User $user) @@ -99,7 +99,7 @@ public function edit(User $user) * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request - * @param App\Models\User $user + * @param User $user * @return \Illuminate\Http\Response */ public function update(Request $request, User $user) @@ -132,7 +132,7 @@ public function update(Request $request, User $user) /** * Remove the specified resource from storage. * - * @param App\Models\User $user + * @param User $user * @return \Illuminate\Http\Response */ public function destroy(User $user) diff --git a/app/Models/User.php b/app/Models/User.php index 0aa2cec..3098f10 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -67,7 +67,7 @@ public function isAdmin() { /** * Nota final (atual) dentro do prazo (get from DB) * - * @var App\Model\Prazo $prazo + * @var Prazo $prazo * @return float */ public function getNotaFinal(Prazo $prazo) { @@ -80,7 +80,7 @@ public function getNotaFinal(Prazo $prazo) { /** * Nota final (atual) dentro do prazo * - * @var App\Model\Prazo $prazo + * @var Prazo $prazo * @return float */ public function notaFinal(Prazo $prazo) { @@ -90,7 +90,7 @@ public function notaFinal(Prazo $prazo) { /** * Notas dentro do prazo * - * @var App\Model\Prazo $prazo + * @var Prazo $prazo */ public function notasValidas(Prazo $prazo) { return $this->notas From c5609df86bf6d793fd9bebaf6788c44e231dc729 Mon Sep 17 00:00:00 2001 From: Mali Oz Date: Wed, 19 Jun 2024 14:24:32 -0300 Subject: [PATCH 8/9] Revert "remove buttons from ex index" This reverts commit b3216df14faad52c7088ba0d050d8c31d333b715. --- resources/views/exercicio/table.blade.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/resources/views/exercicio/table.blade.php b/resources/views/exercicio/table.blade.php index 1f4399d..5cfd594 100644 --- a/resources/views/exercicio/table.blade.php +++ b/resources/views/exercicio/table.blade.php @@ -2,6 +2,7 @@ Título + Ações @@ -14,6 +15,15 @@ + + + + + @can ('edit', $value) + Editar + @endcan + + @endforeach From 43a3ae1826179dd567303c20c0bdb941ca009e31 Mon Sep 17 00:00:00 2001 From: Mali Oz Date: Wed, 19 Jun 2024 14:37:28 -0300 Subject: [PATCH 9/9] edit button now optional --- resources/views/exercicio/index.blade.php | 2 +- resources/views/exercicio/table.blade.php | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/resources/views/exercicio/index.blade.php b/resources/views/exercicio/index.blade.php index ee108a0..ade151e 100644 --- a/resources/views/exercicio/index.blade.php +++ b/resources/views/exercicio/index.blade.php @@ -23,7 +23,7 @@
{{ Session::get('message') }}
@endif - @include('exercicio.table') + @include('exercicio.table', ['editButton' => true]) diff --git a/resources/views/exercicio/table.blade.php b/resources/views/exercicio/table.blade.php index 5cfd594..3640ef3 100644 --- a/resources/views/exercicio/table.blade.php +++ b/resources/views/exercicio/table.blade.php @@ -2,7 +2,9 @@ Título - Ações + @if ($editButton ?? '') + Ações + @endif @@ -16,14 +18,18 @@ + @if ($editButton ?? '') + @if ($editButton ?? '') @can ('edit', $value) Editar @endcan + @endif + @endif @endforeach