Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optim #125

Merged
merged 9 commits into from
Jun 19, 2024
Merged

Optim #125

Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions docker-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Lobz marked this conversation as resolved.
Show resolved Hide resolved
php artisan view:cache
php artisan event:cache
fi
10 changes: 0 additions & 10 deletions resources/views/exercicio/table.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<thead>
<tr>
<td>Título</td>
<td>Ações</td>
</tr>
</thead>
<tbody>
Expand All @@ -15,15 +14,6 @@
</div>
</a>
</td>
Lobz marked this conversation as resolved.
Show resolved Hide resolved

<td>

<!-- edit -->
@can ('edit', $value)
<a class="btn btn-small btn-edit" href="{{ URL::to('exercicio/' . $value->id . '/edit') }}">Editar</a>
@endcan

</td>
</tr>
@endforeach
</tbody>
Expand Down
36 changes: 9 additions & 27 deletions resources/views/prazo/table.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,16 @@
@unless ($exercicio ?? "")
<td>Exercicio</td>
@endif

@unless ($turma ?? "")
<td>Turma</td>
@endif
<td>Prazo</td>

<td>Prazo</td>

@if ($user ?? "")
<td>Nota</td>
@endif
@if ($turma ?? "")
@can ('edit', $turma)
<td>Ações</td>
@endcan
@endif
</tr>
</thead>
<tbody>
Expand All @@ -40,34 +38,18 @@
</a>
</td>
@endif
<td>{{ $value->prazo }}</td>
@if ($user ?? "")

<td>
{{ $user->notaFinal($value) }}
{{ $value->prazo }}
</td>
@endif

@if ($turma ?? "")
@can ('edit', $turma)
@if ($user ?? "")
<td>

Lobz marked this conversation as resolved.
Show resolved Hide resolved
<!-- remove -->
@if ($removeButton ?? '')
<form method="POST" action="{{URL::to("/prazo/".$value->id)}}">
{{ csrf_field() }}
{{ method_field('DELETE') }}

<div class="form-group">
<input type="submit" class="btn btn-remove" value="Remover">
</div>
</form>
@endif

{{ $user->notaFinal($value) }}
</td>
@endcan
@endif

</tr>
@endforeach
</tbody>
</table>

7 changes: 6 additions & 1 deletion resources/views/turma/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@
<h2>Membros</h2>
</a>
<div class="collapse show" id="collapseMembros">
@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
</div>

@if($prazosFuturos ?? '')
Expand Down
2 changes: 1 addition & 1 deletion resources/views/user/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
<div class="alert alert-info">{{ Session::get('message') }}</div>
@endif

@include('user.table',['editButton'=>true])
@include('user.table')
</div>
@endsection
10 changes: 0 additions & 10 deletions resources/views/user/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,5 @@
<div class="collapse show" id="collapseTurmas">
@include('turma.table',['turmas' => $user->turmas, 'editButton' => false, 'removeButton' => true])
</div>

Lobz marked this conversation as resolved.
Show resolved Hide resolved
<a class="collapse-button" data-toggle="collapse" href="#collapseNotas" role="button" aria-expanded="true" aria-controls="collapseNotas">
<h4>Todas as Notas</h4>
</a>
<div class="collapse" id="collapseNotas">
<div class="alert alert-info">
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.
</div>
@include('nota.table',['notas' => $user->notas])
</div>
</div>
@endsection
9 changes: 5 additions & 4 deletions resources/views/user/table.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
<td>Turmas</td>
@endunless
<td>Admin</td>
<td>Ações</td>
@if ($editButton ?? '' or $removeButton ?? '')
<td>Ações</td>
@endif
</tr>
</thead>
<tbody>
Expand Down Expand Up @@ -44,6 +46,7 @@
</a>
</td>

@if ($editButton ?? '' or $removeButton ?? '')
<td>

<!-- edit -->
Expand All @@ -55,14 +58,12 @@

<!-- remove -->
@if ($removeButton ?? '')
@can ('edit', $turma)
<a class="btn btn-small btn-remove" href="{{ URL::to('turma/' . $turma->id . '/remove/'.$value->id) }}">Remover</a>
@endcan
@endif

</td>
@endif
</tr>
@endforeach
</tbody>
</table>