From 23ba66f53a9f90f713076d28dfedef3ebb52701b Mon Sep 17 00:00:00 2001 From: Mali Oz Date: Wed, 14 Aug 2024 14:29:55 -0300 Subject: [PATCH 1/4] =?UTF-8?q?instru=C3=A7=C3=B5es=20de=20como=20fazer=20?= =?UTF-8?q?backup=20pelo=20docker?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + README.md | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 0ae59f0..8586db8 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ Homestead.json Homestead.yaml npm-debug.log yarn-error.log +bak.sql diff --git a/README.md b/README.md index 8da7f57..497f97f 100644 --- a/README.md +++ b/README.md @@ -77,8 +77,23 @@ Para mais detalhes, consulte a [documentação do Cypress](https://docs.cypress. O notaR está configurado com ferramentas de debug e profiling para ajudar no desenvolvimento. Para habilitar o Xdebug, abra o arquivo docker/php/php.ini, descomente a linha de xdebug.mode e construa novamente os containers. O debug pode ser feito na sua IDE (no VSCode, é recomendado instalar a -extensão Xdebug) e os arquivos de profiling serão gerados na pasta storage/logs e podem ser lidos +extensão Xdebug) e os arquivos de profiling serão gerados na pasta storage/logs e podem ser lidos com o KCacheGrind. +# Backup do banco de dados mysql no Docker + +Para fazer o dump do banco de dados, primeiro entre no contêiner passando as variáveis de ambiente do .env: +``` +docker exec -ti --env-file=.env notar_mysql_1 bash +``` +E em seguida faça o dump usando as variáveis de ambiente: +``` +mysqldump -uroot -p${DB_PASSWORD} ${DB_DATABASE} > bak.sql +``` +Por fim, copie o arquivo de backup do contêiner para fora do contêiner: +``` +docker cp notar_mysql_1:bak.sql . +``` + ## Licença de uso O código fonte do notaR está disponível sob licença GPLv3. From f62771f81c6009ee4040fdb187a74271fc2a2811 Mon Sep 17 00:00:00 2001 From: Mali Oz Date: Wed, 14 Aug 2024 14:47:27 -0300 Subject: [PATCH 2/4] fix #135 + add chevrons to collapsibles (turma) --- resources/views/turma/show.blade.php | 47 +++++++++++++++++++--------- 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/resources/views/turma/show.blade.php b/resources/views/turma/show.blade.php index 113b531..fd5238b 100644 --- a/resources/views/turma/show.blade.php +++ b/resources/views/turma/show.blade.php @@ -6,11 +6,17 @@

{!! nl2br($turma->description) !!}

- @can('seeMembers', $turma) - -

Membros

+ @can('viewMembers', $turma) +
-
+
@can ('edit', $turma) @include('user.table',['users' => $turma->users, 'removeButton' => true]) @@ -20,21 +26,34 @@
@endcan - @if($prazosFuturos ?? '') - -

Prazos Futuros

+ @if($prazosPassados ?? '') +
-
- @include('prazo.table',['prazos' => $prazosFuturos]) +
+ @include('prazo.table',['prazos' => $prazosPassados])
@endif - @if($prazosPassados ?? '') - -

Prazos Passados

+ @if($prazosFuturos ?? '') +
+

+ Prazos Futuros + +

-
- @include('prazo.table',['prazos' => $prazosPassados]) +
+ @include('prazo.table',['prazos' => $prazosFuturos])
@endif From de5da6aab064c7008f4d6e52ed82c54e3584f826 Mon Sep 17 00:00:00 2001 From: Mali Oz Date: Wed, 14 Aug 2024 14:59:32 -0300 Subject: [PATCH 3/4] add chevron to turma edit and user view --- resources/views/turma/edit.blade.php | 58 ++++++++++++++++++++-------- resources/views/user/show.blade.php | 44 +++++++++++++++------ 2 files changed, 73 insertions(+), 29 deletions(-) diff --git a/resources/views/turma/edit.blade.php b/resources/views/turma/edit.blade.php index 2168092..e5beb79 100644 --- a/resources/views/turma/edit.blade.php +++ b/resources/views/turma/edit.blade.php @@ -12,7 +12,10 @@ @include ('includes.error_alert')
- + @error('name')
{{ $message }}
@enderror @@ -34,7 +37,11 @@
- + @error('description')
{{ $message }}
@enderror @@ -60,35 +67,52 @@
- -

Membros

+
@include('user.table',['users' => $turma->users, 'editButton' => true, 'removeButton' => true])
- @if($prazosFuturos ?? '') - -

Prazos Futuros

-
-
- @include('prazo.table',['prazos' => $prazosFuturos]) -
- - @endif - @if($prazosPassados ?? '') - -

Prazos Passados

+
@include('prazo.table',['prazos' => $prazosPassados])
@endif + @if($prazosFuturos ?? '') + +
+ @include('prazo.table',['prazos' => $prazosFuturos]) +
+ + @endif @can ('delete', $turma) -
id)}}"> + id)}}"> {{ csrf_field() }} {{ method_field('DELETE') }} diff --git a/resources/views/user/show.blade.php b/resources/views/user/show.blade.php index 7376902..8d8d054 100644 --- a/resources/views/user/show.blade.php +++ b/resources/views/user/show.blade.php @@ -10,26 +10,46 @@
- @if($prazosFuturos ?? '') - -

Prazos Futuros

+ + @if($prazosPassados ?? '') +
-
- @include('prazo.table',['prazos' => $prazosFuturos]) +
+ @include('prazo.table',['prazos' => $prazosPassados])
@endif - @if($prazosPassados ?? '') - -

Notas Passadas

+ @if($prazosFuturos ?? '') +
-
- @include('prazo.table',['prazos' => $prazosPassados]) +
+ @include('prazo.table',['prazos' => $prazosFuturos])
+ @endif - -

Turmas

+
+

+ Turmas + +

@include('turma.table',['turmas' => $user->turmas, 'editButton' => false, 'removeButton' => true]) From e6570edae6657b46847172d58e6a3833103f07b4 Mon Sep 17 00:00:00 2001 From: Mali Oz Date: Wed, 14 Aug 2024 15:10:26 -0300 Subject: [PATCH 4/4] fix #134 (order relatorio realizacao) --- app/Http/Controllers/RelatorioController.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/RelatorioController.php b/app/Http/Controllers/RelatorioController.php index ee2883e..2743894 100644 --- a/app/Http/Controllers/RelatorioController.php +++ b/app/Http/Controllers/RelatorioController.php @@ -93,8 +93,9 @@ public function relatorioNotas (Turma $turma) { */ public function relatorioRealizacao (Turma $turma) { + $prazos = $turma->prazos->sortBy('exercicio.name'); $nusers = $turma->users->count(); - foreach($turma->prazos as $prazo) { + foreach($prazos as $prazo) { $arr = collect(); foreach($turma->users as $user) { $notas = $user->notasValidas($prazo); @@ -127,7 +128,7 @@ public function relatorioRealizacao (Turma $turma) { } $colnames = ['Exercício','Tentaram','Tiveram nota máxima', 'Média de Tentativas', 'Média de Notas']; - $mytable = $turma->prazos->pluck('resumo'); + $mytable = $prazos->pluck('resumo'); $mytable->prepend($colnames); return $mytable; }