Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Walter Felipe
submeta
Commits
697a7c70
Commit
697a7c70
authored
May 21, 2021
by
Carlos André
Browse files
editar projeto
parent
72f53e8f
Changes
4
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/TrabalhoController.php
View file @
697a7c70
...
@@ -1059,7 +1059,7 @@ class TrabalhoController extends Controller
...
@@ -1059,7 +1059,7 @@ class TrabalhoController extends Controller
// Salvando participantes
// Salvando participantes
$this
->
salvarParticipantes
(
$request
,
$edital
,
$projeto
);
$this
->
salvarParticipantes
(
$request
,
$edital
,
$projeto
);
dd
(
"foi"
);
return
redirect
(
route
(
'proponente.projetos'
))
->
with
([
'mensagem'
=>
'Projeto submetido com sucesso!'
]
);
}
}
public
function
atribuirDados
(
Request
$request
,
$edital
,
Trabalho
$projeto
=
null
)
{
public
function
atribuirDados
(
Request
$request
,
$edital
,
Trabalho
$projeto
=
null
)
{
...
@@ -1246,7 +1246,7 @@ class TrabalhoController extends Controller
...
@@ -1246,7 +1246,7 @@ class TrabalhoController extends Controller
$arquivo
->
nome
=
$path
.
$nome
;
$arquivo
->
nome
=
$path
.
$nome
;
$arquivo
->
trabalhoId
=
$projeto
->
id
;
$arquivo
->
trabalhoId
=
$projeto
->
id
;
$arquivo
->
data
=
$agora
;
$arquivo
->
data
=
$agora
;
$arquivo
->
participanteId
=
$
participante
->
id
;
$arquivo
->
participanteId
=
$id
;
$arquivo
->
versaoFinal
=
true
;
$arquivo
->
versaoFinal
=
true
;
$arquivo
->
save
();
$arquivo
->
save
();
}
}
...
@@ -1255,8 +1255,12 @@ class TrabalhoController extends Controller
...
@@ -1255,8 +1255,12 @@ class TrabalhoController extends Controller
// Excluidos
// Excluidos
$participantesExcluidos
=
$participantes
->
diff
(
$participantesPermanecem
);
$participantesExcluidos
=
$participantes
->
diff
(
$participantesPermanecem
);
foreach
(
$participantesExcluidos
as
$participante
)
{
foreach
(
$participantesExcluidos
as
$participante
)
{
$plano
=
$participante
->
planoTrabalho
;
$plano
->
delete
();
$participante
->
delete
();
$participante
->
delete
();
}
}
return
true
;
}
}
if
(
$request
->
emailParticipante
!=
null
)
{
if
(
$request
->
emailParticipante
!=
null
)
{
foreach
(
$request
->
emailParticipante
as
$key
=>
$email
)
{
foreach
(
$request
->
emailParticipante
as
$key
=>
$email
)
{
...
@@ -1351,6 +1355,8 @@ class TrabalhoController extends Controller
...
@@ -1351,6 +1355,8 @@ class TrabalhoController extends Controller
}
}
}
}
}
}
return
true
;
}
}
public
function
atualizar
(
Request
$request
,
$id
)
{
public
function
atualizar
(
Request
$request
,
$id
)
{
...
@@ -1369,6 +1375,6 @@ class TrabalhoController extends Controller
...
@@ -1369,6 +1375,6 @@ class TrabalhoController extends Controller
// Salvando participantes
// Salvando participantes
$this
->
salvarParticipantes
(
$request
,
$edital
,
$projeto
,
true
);
$this
->
salvarParticipantes
(
$request
,
$edital
,
$projeto
,
true
);
dd
(
"foi"
);
return
redirect
(
route
(
'proponente.projetos'
))
->
with
([
'mensagem'
=>
'Projeto atualizado com sucesso!'
]
);
}
}
}
}
\ No newline at end of file
resources/views/projeto/editar.blade.php
View file @
697a7c70
...
@@ -480,10 +480,9 @@
...
@@ -480,10 +480,9 @@
</div>
</div>
<h6 class="
mb
-
1
">Possui plano de trabalho?</h6>
<h6 class="
mb
-
1
">Possui plano de trabalho?</h6>
{
{dd($participantes[1]->user->email)}
}
<button class="
btn
btn
-
primary
mt
-
2
mb
-
2
simPlano
">Sim</button>
<button class="
btn
btn
-
primary
mt
-
2
mb
-
2
simPlano
">Sim</button>
<button class="
btn
btn
-
primary
mt
-
2
mb
-
2
naoPlano
">Não</button>
<button class="
btn
btn
-
primary
mt
-
2
mb
-
2
naoPlano
">Não</button>
{{--
{
{dd($participantes)}
}
--}}
<div id="
planoHabilitado
" style="
display
:@
if
(
$participante
->
planoTrabalho
!=
null
)
block
;
@
else
none
;
@
endif
">
<div id="
planoHabilitado
" style="
display
:@
if
(
$participante
->
planoTrabalho
!=
null
)
block
;
@
else
none
;
@
endif
">
<h5>Dados do plano de trabalho</h5>
<h5>Dados do plano de trabalho</h5>
<div class="
row
">
<div class="
row
">
...
...
resources/views/proponente/projetos.blade.php
View file @
697a7c70
...
@@ -3,14 +3,15 @@
...
@@ -3,14 +3,15 @@
@
section
(
'content'
)
@
section
(
'content'
)
<
div
class
=
"container"
style
=
"margin-top: 100px;"
>
<
div
class
=
"container"
style
=
"margin-top: 100px;"
>
@
if
(
isset
(
$mensagem
))
{{
--
@
if
(
isset
(
$mensagem
))
<
div
class
=
"col-sm-12"
>
<
div
class
=
"col-sm-12"
>
<
br
>
<
br
>
<
div
class
=
"alert alert-success"
>
<
div
class
=
"alert alert-success"
>
<
p
>
{{
$mensagem
}}
</
p
>
<
p
>
{{
$mensagem
}}
</
p
>
</
div
>
</
div
>
</
div
>
</
div
>
@
endif
@
endif
--
}}
<
div
class
=
"container"
>
<
div
class
=
"container"
>
<
div
class
=
"row"
>
<
div
class
=
"row"
>
<
div
class
=
"col-sm-1"
>
<
div
class
=
"col-sm-1"
>
...
@@ -39,91 +40,105 @@
...
@@ -39,91 +40,105 @@
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
@
if
(
session
(
'mensagem'
))
<
div
class
=
"row"
>
<
div
class
=
"col-sm-12"
>
<
br
>
<
div
class
=
"alert alert-success"
>
<
p
>
{{
session
(
'mensagem'
)}}
</
p
>
</
div
>
</
div
>
</
div
>
@
endif
<
hr
>
<
hr
>
<
table
class
=
"table table-bordered"
>
<
div
class
=
"row"
>
<
thead
>
<
div
class
=
"col-md-12"
>
<
tr
>
<
table
class
=
"table table-bordered"
>
<
th
scope
=
"col"
>
Projeto
</
th
>
<
thead
>
<
th
scope
=
"col"
>
Status
</
th
>
<
tr
>
<
th
scope
=
"col"
>
Data
de
Criação
</
th
>
<
th
scope
=
"col"
>
Projeto
</
th
>
<
th
scope
=
"col"
>
Opção
</
th
>
<
th
scope
=
"col"
>
Status
</
th
>
</
tr
>
<
th
scope
=
"col"
>
Data
de
Criação
</
th
>
</
thead
>
<
th
scope
=
"col"
>
Opção
</
th
>
<
tbody
>
</
tr
>
@
foreach
(
$projetos
as
$projeto
)
</
thead
>
<
tbody
>
<
tr
>
@
foreach
(
$projetos
as
$projeto
)
<
td
>
{{
$projeto
->
titulo
}}
<
tr
>
</
td
>
<
td
>
@
if
(
$projeto
->
status
==
'Avaliado'
)
{{
$projeto
->
titulo
}}
<
td
style
=
"color: rgb(6, 85, 6)"
>
Avaliado
</
td
>
</
td
>
@
elseif
(
$projeto
->
status
==
'Submetido'
)
@
if
(
$projeto
->
status
==
'Avaliado'
)
<
td
style
=
"color: rgb(0, 0, 0)"
>
Submetido
</
td
>
<
td
style
=
"color: rgb(6, 85, 6)"
>
Avaliado
</
td
>
@
elseif
(
$projeto
->
status
==
'Rascunho'
)
@
elseif
(
$projeto
->
status
==
'Submetido'
)
<
td
style
=
"color: rgb(0, 0, 0)"
>
Rascunho
</
td
>
<
td
style
=
"color: rgb(0, 0, 0)"
>
Submetido
</
td
>
@
endif
@
elseif
(
$projeto
->
status
==
'Rascunho'
)
<
td
>
{{
date
(
'd/m/Y'
,
strtotime
(
$projeto
->
updated_at
))
}}
</
td
>
<
td
style
=
"color: rgb(0, 0, 0)"
>
Rascunho
</
td
>
<
td
>
@
endif
<
div
class
=
"btn-group dropright dropdown-options"
>
<
td
>
{{
date
(
'd/m/Y'
,
strtotime
(
$projeto
->
updated_at
))
}}
</
td
>
<
a
id
=
"options"
class
=
"dropdown-toggle "
data
-
toggle
=
"dropdown"
aria
-
haspopup
=
"true"
aria
-
expanded
=
"false"
>
<
td
>
<
img
src
=
"
{
{asset('img/icons/ellipsis-v-solid.svg')}
}
"
style
=
"width:8px"
>
<
div
class
=
"btn-group dropright dropdown-options"
>
</
a
>
<
a
id
=
"options"
class
=
"dropdown-toggle "
data
-
toggle
=
"dropdown"
aria
-
haspopup
=
"true"
aria
-
expanded
=
"false"
>
<
div
class
=
"dropdown-menu"
>
<
img
src
=
"
{
{asset('img/icons/ellipsis-v-solid.svg')}
}
"
style
=
"width:8px"
>
@
if
(
$projeto
->
evento
->
inicioSubmissao
<=
$hoje
&&
$hoje
<=
$projeto
->
evento
->
fimSubmissao
)
</
a
>
<
a
href
=
"{{ route('trabalho.editar', ['id' =>
$projeto->id
]) }}"
class
=
"dropdown-item"
style
=
"text-align: center;"
>
<
div
class
=
"dropdown-menu"
>
Editar
@
if
(
$projeto
->
evento
->
inicioSubmissao
<=
$hoje
&&
$hoje
<=
$projeto
->
evento
->
fimSubmissao
)
</
a
>
<
a
href
=
"{{ route('trabalho.editar', ['id' =>
$projeto->id
]) }}"
class
=
"dropdown-item"
style
=
"text-align: center;"
>
<
hr
class
=
"dropdown-hr"
>
Editar
@
else
</
a
>
@
endif
<
a
href
=
"{{ route('trabalho.show', ['id' =>
$projeto->id
]) }}"
class
=
"dropdown-item"
style
=
"text-align: center"
>
Visualizar
</
a
>
{{
--
<
a
href
=
""
class
=
"dropdown-item"
style
=
"text-align: center"
>
Recorrer
</
a
>
<
a
href
=
""
class
=
"dropdown-item"
style
=
"text-align: center"
>
Resultado
</
a
>
--
}}
@
if
(
$projeto
->
status
==
'Submetido'
)
<
hr
class
=
"dropdown-hr"
>
<
hr
class
=
"dropdown-hr"
>
<!--
Button
trigger
modal
-->
@
else
<
button
type
=
"button"
class
=
"dropdown-item dropdown-item-delete"
style
=
"text-align: center"
data
-
toggle
=
"modal"
data
-
target
=
"#modal
{
{$projeto->id}
}
"
>
<
img
src
=
"
{
{asset('img/icons/logo_lixeira.png')}
}
"
alt
=
""
>
Deletar
</
button
>
@
endif
@
endif
<
a
href
=
"{{ route('trabalho.show', ['id' =>
$projeto->id
]) }}"
class
=
"dropdown-item"
style
=
"text-align: center"
>
</
div
>
Visualizar
</
div
>
</
a
>
</
td
>
{{
--
<
a
href
=
""
class
=
"dropdown-item"
style
=
"text-align: center"
>
</
tr
>
Recorrer
</
a
>
<!--
Modal
-->
<
a
href
=
""
class
=
"dropdown-item"
style
=
"text-align: center"
>
<
div
class
=
"modal fade"
id
=
"modal
{
{$projeto->id}
}
"
tabindex
=
"-1"
role
=
"dialog"
aria
-
labelledby
=
"exampleModalLabel"
aria
-
hidden
=
"true"
>
Resultado
<
div
class
=
"modal-dialog"
>
</
a
>
--
}}
<
div
class
=
"modal-content"
>
@
if
(
$projeto
->
status
==
'Submetido'
)
<
div
class
=
"modal-header"
>
<
hr
class
=
"dropdown-hr"
>
<
h5
class
=
"modal-title"
id
=
"exampleModalLabel"
>
Deletar
o
projeto
:
{{
$projeto
->
titulo
}}
</
h5
>
<!--
Button
trigger
modal
-->
<
button
type
=
"button"
class
=
"close"
data
-
dismiss
=
"modal"
aria
-
label
=
"Close"
>
<
button
type
=
"button"
class
=
"dropdown-item dropdown-item-delete"
style
=
"text-align: center"
data
-
toggle
=
"modal"
data
-
target
=
"#modal
{
{$projeto->id}
}
"
>
<
span
aria
-
hidden
=
"true"
>&
times
;
</
span
>
<
img
src
=
"
{
{asset('img/icons/logo_lixeira.png')}
}
"
alt
=
""
>
Deletar
</
button
>
</
button
>
</
div
>
@
endif
<
div
class
=
"modal-body"
>
<
p
>
Você
tem
certeza
que
deseja
deletar
o
projeto
:
{{
$projeto
->
titulo
}}
?</
p
>
</
div
>
</
div
>
</
div
>
<
div
class
=
"modal-footer"
>
</
td
>
<
button
type
=
"button"
class
=
"btn btn-secondary"
data
-
dismiss
=
"modal"
>
Cancelar
</
button
>
</
tr
>
<
a
href
=
"{{ route('trabalho.destroy', ['id' =>
$projeto->id
]) }}"
class
=
"btn btn-primary"
>
Deletar
<!--
Modal
-->
</
a
>
<
div
class
=
"modal fade"
id
=
"modal
{
{$projeto->id}
}
"
tabindex
=
"-1"
role
=
"dialog"
aria
-
labelledby
=
"exampleModalLabel"
aria
-
hidden
=
"true"
>
<
div
class
=
"modal-dialog"
>
<
div
class
=
"modal-content"
>
<
div
class
=
"modal-header"
>
<
h5
class
=
"modal-title"
id
=
"exampleModalLabel"
>
Deletar
o
projeto
:
{{
$projeto
->
titulo
}}
</
h5
>
<
button
type
=
"button"
class
=
"close"
data
-
dismiss
=
"modal"
aria
-
label
=
"Close"
>
<
span
aria
-
hidden
=
"true"
>&
times
;
</
span
>
</
button
>
</
div
>
<
div
class
=
"modal-body"
>
<
p
>
Você
tem
certeza
que
deseja
deletar
o
projeto
:
{{
$projeto
->
titulo
}}
?</
p
>
</
div
>
<
div
class
=
"modal-footer"
>
<
button
type
=
"button"
class
=
"btn btn-secondary"
data
-
dismiss
=
"modal"
>
Cancelar
</
button
>
<
a
href
=
"{{ route('trabalho.destroy', ['id' =>
$projeto->id
]) }}"
class
=
"btn btn-primary"
>
Deletar
</
a
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
@
endforeach
@
endforeach
</
tbody
>
</
tbody
>
</
table
>
</
table
>
</
div
>
</
div
>
</
div
>
</
div
>
@
endsection
@
endsection
...
...
routes/web.php
View file @
697a7c70
...
@@ -102,7 +102,7 @@ Route::prefix('avaliador')->name('avaliador.')->group(function(){
...
@@ -102,7 +102,7 @@ Route::prefix('avaliador')->name('avaliador.')->group(function(){
Route
::
get
(
'/edital/{id}/projetos'
,
'TrabalhoController@projetosDoEdital'
)
->
name
(
'projetos.edital'
);
Route
::
get
(
'/edital/{id}/projetos'
,
'TrabalhoController@projetosDoEdital'
)
->
name
(
'projetos.edital'
);
Route
::
get
(
'/projeto/{id}/visualizar'
,
'TrabalhoController@show'
)
->
name
(
'trabalho.show'
);
Route
::
get
(
'/projeto/{id}/visualizar'
,
'TrabalhoController@show'
)
->
name
(
'trabalho.show'
);
Route
::
get
(
'/projeto/{id}/editar'
,
'TrabalhoController@edit'
)
->
name
(
'trabalho.editar'
);
Route
::
get
(
'/projeto/{id}/editar'
,
'TrabalhoController@edit'
)
->
name
(
'trabalho.editar'
);
Route
::
post
(
'/projeto/{id}/atualizar'
,
'TrabalhoController@atualizar'
)
->
name
(
'trabalho.update'
);
Route
::
post
(
'/projeto/{id}/atualizar'
,
'TrabalhoController@atualizar'
)
->
name
(
'trabalho.update'
);
Route
::
get
(
'/projeto/{id}/excluir'
,
'TrabalhoController@destroy'
)
->
name
(
'trabalho.destroy'
);
Route
::
get
(
'/projeto/{id}/excluir'
,
'TrabalhoController@destroy'
)
->
name
(
'trabalho.destroy'
);
Route
::
get
(
'/projeto/{id}/excluirParticipante'
,
'TrabalhoController@excluirParticipante'
)
->
name
(
'trabalho.excluirParticipante'
);
Route
::
get
(
'/projeto/{id}/excluirParticipante'
,
'TrabalhoController@excluirParticipante'
)
->
name
(
'trabalho.excluirParticipante'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment