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
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
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
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 ?? '')
-
- @endif
-
+ {{ $user->notaFinal($value) }}
|
- @endcan
@endif
+
@endforeach
-
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/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/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
diff --git a/resources/views/user/table.blade.php b/resources/views/user/table.blade.php
index fff43e2..60e8545 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 ?? '')
@@ -55,14 +58,12 @@
@if ($removeButton ?? '')
- @can ('edit', $turma)
Remover
- @endcan
@endif
|
+ @endif
@endforeach
-