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
f7f638c4
"app/git@sites.upe.br:walter.felipe/submeta.git" did not exist on "f4970b1f4763b64353ad3707d6c0e6bd6783ad55"
Commit
f7f638c4
authored
Jan 03, 2023
by
Lucas Henrique
Browse files
Adiciona novos tipos de avaliação na edição de evento
parent
d40a70df
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/EventoController.php
View file @
f7f638c4
...
...
@@ -122,6 +122,7 @@ class EventoController extends Controller
'natureza'
=>
[
'required'
],
'coordenador_id'
=>
[
'required'
],
'numParticipantes'
=>
[
'required'
],
'tipoAvaliacao'
=>
[
'required'
],
'inicioSubmissao'
=>
[
'required'
,
'date'
],
'fimSubmissao'
=>
[
'required'
,
'date'
],
'inicioRevisao'
=>
[
'required'
,
'date'
],
...
...
@@ -153,6 +154,7 @@ class EventoController extends Controller
'coordenador_id'
=>
[
'required'
],
'numParticipantes'
=>
[
'required'
],
'nome_docExtra'
=>
[
Rule
::
requiredIf
(
$request
->
check_docExtra
!=
null
),
'max:255'
],
'tipoAvaliacao'
=>
[
'required'
],
#----------------------------------------------
'inicioSubmissao'
=>
[
'required'
,
'date'
,
'after:yesterday'
],
'fimSubmissao'
=>
[
'required'
,
'date'
,
'after_or_equal:inicioSubmissao'
],
...
...
@@ -223,6 +225,7 @@ class EventoController extends Controller
$evento
[
'anexosStatus'
]
=
'final'
;
$evento
[
'inicioProjeto'
]
=
$request
->
inicioProjeto
;
$evento
[
'fimProjeto'
]
=
$request
->
fimProjeto
;
$evento
[
'tipoAvaliacao'
]
=
$request
->
tipoAvaliacao
;
if
(
$request
->
tipoAvaliacao
==
"link"
)
{
$evento
[
'formAvaliacaoExterno'
]
=
$request
->
link
;
}
...
...
@@ -299,7 +302,7 @@ class EventoController extends Controller
$campoAval
=
new
CampoAvaliacao
();
$campoAval
->
nome
=
$request
->
inputField
[
$value
][
'nome'
];
$campoAval
->
nota_maxima
=
$request
->
inputField
[
$value
][
'nota_maxima'
];
if
(
$request
->
has
(
'
inputField[
'
.
$value
.
'
][
"
descricao
"]'
)
){
if
(
$request
->
inputField
[
$value
][
'
descricao
'
]
!=
null
){
$campoAval
->
descricao
=
$request
->
inputField
[
$value
][
'descricao'
];
}
$campoAval
->
prioridade
=
$request
->
inputField
[
$value
][
'prioridade'
];
...
...
@@ -445,11 +448,13 @@ class EventoController extends Controller
$naturezas
=
Natureza
::
orderBy
(
'nome'
)
->
get
();
$yesterday
=
Carbon
::
yesterday
(
'America/Recife'
);
$yesterday
=
$yesterday
->
toDateString
();
$camposAvaliacao
=
CampoAvaliacao
::
where
(
'evento_id'
,
$id
)
->
get
();
return
view
(
'evento.editarEvento'
,[
'evento'
=>
$evento
,
'coordenadores'
=>
$coordenadors
,
'naturezas'
=>
$naturezas
,
'ontem'
=>
$yesterday
,
'coordEvent'
=>
$coordEvent
]);
'coordEvent'
=>
$coordEvent
,
'camposAvaliacao'
=>
$camposAvaliacao
]);
}
/**
...
...
@@ -467,6 +472,7 @@ class EventoController extends Controller
$evento
=
Evento
::
find
(
$id
);
$yesterday
=
Carbon
::
yesterday
(
'America/Recife'
);
$yesterday
=
$yesterday
->
toDateString
();
$camposAvaliacao
=
CampoAvaliacao
::
where
(
'evento_id'
,
$id
);
if
(
$request
->
inicioSubmissao
==
null
||
$request
->
fimSubmissao
==
null
||
...
...
@@ -483,6 +489,7 @@ class EventoController extends Controller
'tipo'
=>
[
'required'
,
'string'
],
'natureza'
=>
[
'required'
],
'numParticipantes'
=>
[
'required'
],
'tipoAvaliacao'
=>
[
'required'
],
'inicioSubmissao'
=>
[
'required'
,
'date'
],
'fimSubmissao'
=>
[
'required'
,
'date'
],
'inicioRevisao'
=>
[
'required'
,
'date'
,
'after:fimSubmissao'
],
...
...
@@ -497,7 +504,6 @@ class EventoController extends Controller
'dt_fimRelatorioFinal'
=>
[
'required'
,
'date'
],
'pdfEdital'
=>
[
'file'
,
'mimes:pdf'
,
'max:2048'
],
'modeloDocumento'
=>
[
'file'
,
'mimes:zip,doc,docx,odt,pdf'
,
'max:2048'
],
'pdfFormAvalExterno'
=>
[
'file'
,
'mimes:pdf,doc,docx,xlsx,xls,csv,zip'
,
'max:2048'
],
'pdfFormAvalRelatorio'
=>
[
'file'
,
'mimes:pdf'
,
'max:2048'
],
'inicioProjeto'
=>
[
'required'
,
'date'
],
'fimProjeto'
=>
[
'required'
,
'date'
],
...
...
@@ -513,6 +519,7 @@ class EventoController extends Controller
'tipo'
=>
[
'required'
,
'string'
],
'natureza'
=>
[
'required'
],
'numParticipantes'
=>
[
'required'
],
'tipoAvaliacao'
=>
[
'required'
],
'inicioSubmissao'
=>
[
'required'
,
'date'
,
'after_or_equal:inicioSubmissao'
],
'fimSubmissao'
=>
[
'required'
,
'date'
,
'after_or_equal:inicioSubmissao'
],
'inicioRevisao'
=>
[
'required'
,
'date'
,
'after:fimSubmissao'
],
...
...
@@ -527,13 +534,30 @@ class EventoController extends Controller
'dt_fimRelatorioFinal'
=>
[
'required'
,
'date'
,
'after_or_equal:dt_inicioRelatorioFinal'
],
'modeloDocumento'
=>
[
'file'
,
'mimes:zip,doc,docx,odt,pdf'
,
'max:2048'
],
'pdfFormAvalExterno'
=>
[
'file'
,
'mimes:pdf,doc,docx,xlsx,xls,csv,zip'
,
'max:2048'
],
'pdfFormAvalRelatorio'
=>
[
'file'
,
'mimes:pdf'
,
'max:2048'
],
'inicioProjeto'
=>
[
'required'
,
'date'
,
'after:resultado_final'
],
'fimProjeto'
=>
[
'required'
,
'date'
,
'after:inicioProjeto'
],
'docTutorial'
=>
[
'file'
,
'mimes:zip,doc,docx,pdf'
,
'max:2048'
],
'nome_docExtra'
=>
[
Rule
::
requiredIf
(
$request
->
check_docExtra
!=
null
)
,
'max:255'
],
]);
if
(
$request
->
tipoAvaliacao
==
'form'
)
{
$validateAvaliacao
=
$request
->
validate
([
'pdfFormAvalExterno'
=>
[(
$request
->
pdfFormAvalExternoPreenchido
!==
'sim'
?
'required'
:
''
),
'file'
,
'mimes:pdf,doc,docx,xlsx,xls,csv,zip'
,
'max:2048'
],
]);
}
elseif
(
$request
->
tipoAvaliacao
==
'campos'
)
{
if
(
$request
->
has
(
'campos'
)){
$validateCampo
=
$request
->
validate
([
'inputField.*.nome'
=>
[
'required'
,
'string'
],
'inputField.*.nota_maxima'
=>
[
'required'
],
'inputField.*.prioridade'
=>
[
'required'
]
]);
}
}
elseif
(
$request
->
tipoAvaliacao
==
'link'
)
{
$validateAvaliacao
=
$request
->
validate
([
'link'
=>
[
'required'
,
'url'
],
]);
}
$evento
->
nome
=
$request
->
nome
;
$evento
->
descricao
=
$request
->
descricao
;
$evento
->
tipo
=
$request
->
tipo
;
...
...
@@ -562,6 +586,11 @@ class EventoController extends Controller
$evento
->
obrigatoriedade_docExtra
=
$request
->
has
(
'obrigatoriedade_docExtra'
);
$evento
->
inicioProjeto
=
$request
->
inicioProjeto
;
$evento
->
fimProjeto
=
$request
->
fimProjeto
;
$evento
->
tipoAvaliacao
=
$request
->
tipoAvaliacao
;
if
(
$request
->
tipoAvaliacao
==
"link"
)
{
$evento
->
formAvaliacaoExterno
=
$request
->
link
;
}
if
(
$request
->
pdfEdital
!=
null
){
$pdfEdital
=
$request
->
pdfEdital
;
$path
=
'pdfEdital/'
.
$evento
->
id
.
'/'
;
...
...
@@ -579,7 +608,7 @@ class EventoController extends Controller
}
if
(
isset
(
$request
->
pdfFormAvalExterno
)){
if
(
isset
(
$request
->
pdfFormAvalExterno
)
&&
(
$request
->
tipoAvaliacao
==
'form'
)
){
$pdfFormAvalExterno
=
$request
->
pdfFormAvalExterno
;
$extension
=
$pdfFormAvalExterno
->
extension
();
$path
=
'pdfFormAvalExterno/'
.
$evento
->
id
.
'/'
;
...
...
@@ -589,7 +618,7 @@ class EventoController extends Controller
$evento
->
formAvaliacaoExterno
=
$path
.
$nome
;
}
if
(
$request
->
docTutorial
!=
null
){
if
(
$request
->
docTutorial
!=
null
&&
(
$request
->
tipoAvaliacao
==
'form'
)
){
$docTutorial
=
$request
->
docTutorial
;
$extension
=
$docTutorial
->
extension
();
$path
=
'docTutorial/'
.
$evento
->
id
.
'/'
;
...
...
@@ -610,6 +639,26 @@ class EventoController extends Controller
$evento
->
update
();
// Editando campos de avaliacao
if
(
$request
->
tipoAvaliacao
==
'campos'
)
{
if
(
$request
->
has
(
'campos'
)){
$camposAvaliacao
->
forceDelete
();
// $numCampos = $camposAvaliacao->count();
// $numNovosCampos = count($request->inputField);
foreach
(
$request
->
get
(
'campos'
)
as
$key
=>
$value
)
{
$campoAval
=
new
CampoAvaliacao
();
$campoAval
->
nome
=
$request
->
inputField
[
$value
][
'nome'
];
$campoAval
->
nota_maxima
=
$request
->
inputField
[
$value
][
'nota_maxima'
];
if
(
$request
->
inputField
[
$value
][
'descricao'
]
!=
null
){
$campoAval
->
descricao
=
$request
->
inputField
[
$value
][
'descricao'
];
}
$campoAval
->
prioridade
=
$request
->
inputField
[
$value
][
'prioridade'
];
$campoAval
->
evento_id
=
$evento
->
id
;
$campoAval
->
save
();
}
}
}
$eventos
=
Evento
::
orderBy
(
'nome'
)
->
get
();
if
(
$tipo_usuario
==
'coordenador'
){
...
...
@@ -664,7 +713,7 @@ class EventoController extends Controller
$evento
->
delete
();
return
redirect
()
->
back
();
return
redirect
()
->
back
()
->
with
([
'mensagem'
=>
'Edital deletado com sucesso!'
])
;
}
public
function
detalhes
(
Request
$request
){
...
...
resources/views/evento/criarEvento.blade.php
View file @
f7f638c4
...
...
@@ -407,7 +407,7 @@
<
div
class
=
"mb-2"
>
<
input
type
=
"radio"
id
=
"radioForm"
name
=
"tipoAvaliacao"
onchange
=
"displayTipoAvaliacao('form')"
@
if
((
old
(
'tipoAvaliacao'
)
==
'form'
)
||
old
(
'tipoAvaliaco'
)
==
""
)
checked
@
endif
value
=
"form"
>
@
if
((
old
(
'tipoAvaliacao'
)
==
'form'
)
||
old
(
'tipoAvaliac
a
o'
)
==
""
)
checked
@
endif
value
=
"form"
>
<
label
for
=
"radioForm"
style
=
"margin-right: 5px"
>
Formulário
(
em
pdf
)
</
label
>
<
input
type
=
"radio"
id
=
"radioCampos"
name
=
"tipoAvaliacao"
onchange
=
"displayTipoAvaliacao('campos')"
...
...
resources/views/evento/editarEvento.blade.php
View file @
f7f638c4
@
extends
(
'layouts.app'
)
@
php
$i
=
0
;
$numCampos
=
0
;
@
endphp
@
section
(
'content'
)
<
div
class
=
"container"
>
<
div
class
=
"row titulo"
>
...
...
@@ -388,6 +390,240 @@
@
endcomponent
</
div
>
</
div
>
<
hr
>
<
div
class
=
"row subtitulo"
>
<
div
class
=
"col-sm-12"
>
<
p
>
Avaliação
</
p
>
</
div
>
</
div
>
<
div
class
=
"my-2"
>
<
p
style
=
"font-size: 16px"
>
Como
a
avaliação
será
realizada
?</
p
>
</
div
>
<
div
class
=
"mb-2"
>
@
if
(
old
(
'tipoAvaliacao'
)
!=
null
)
<
input
type
=
"radio"
id
=
"radioForm"
name
=
"tipoAvaliacao"
onchange
=
"displayTipoAvaliacao('form')"
@
if
((
old
(
'tipoAvaliacao'
)
==
'form'
)
||
old
(
'tipoAvaliacao'
)
==
""
)
checked
@
endif
value
=
"form"
>
<
label
for
=
"radioForm"
style
=
"margin-right: 5px"
>
Formulário
(
em
pdf
)
</
label
>
<
input
type
=
"radio"
id
=
"radioCampos"
name
=
"tipoAvaliacao"
onchange
=
"displayTipoAvaliacao('campos')"
@
if
(
old
(
'tipoAvaliacao'
)
==
'campos'
)
checked
@
endif
value
=
"campos"
>
<
label
for
=
"radioCampos"
style
=
"margin-right: 5px"
>
Barema
</
label
>
<
input
type
=
"radio"
id
=
"radioLink"
name
=
"tipoAvaliacao"
onchange
=
"displayTipoAvaliacao('link')"
@
if
(
old
(
'tipoAvaliacao'
)
==
'link'
)
checked
@
endif
value
=
"link"
>
<
label
for
=
"radioLink"
style
=
"margin-right: 5px"
>
Link
</
label
><
br
>
@
else
<
input
type
=
"radio"
id
=
"radioForm"
name
=
"tipoAvaliacao"
onchange
=
"displayTipoAvaliacao('form')"
@
if
(
$evento
->
tipoAvaliacao
==
'form'
||
$evento
->
tipoAvaliacao
==
''
)
checked
@
endif
value
=
"form"
>
<
label
for
=
"radioForm"
style
=
"margin-right: 5px"
>
Formulário
(
em
pdf
)
</
label
>
<
input
type
=
"radio"
id
=
"radioCampos"
name
=
"tipoAvaliacao"
onchange
=
"displayTipoAvaliacao('campos')"
@
if
(
$evento
->
tipoAvaliacao
==
'campos'
)
checked
@
endif
value
=
"campos"
>
<
label
for
=
"radioCampos"
style
=
"margin-right: 5px"
>
Barema
</
label
>
<
input
type
=
"radio"
id
=
"radioLink"
name
=
"tipoAvaliacao"
onchange
=
"displayTipoAvaliacao('link')"
@
if
(
$evento
->
tipoAvaliacao
==
'link'
)
checked
@
endif
value
=
"link"
>
<
label
for
=
"radioLink"
style
=
"margin-right: 5px"
>
Link
</
label
><
br
>
@
endif
</
div
>
<
div
class
=
"row justify-content-center"
style
=
"margin-top:10px"
id
=
"displayForm"
>
<
div
class
=
"col-sm-6"
>
<
div
class
=
"form-group"
>
<
label
for
=
"pdfEdital"
>
Formulário
para
avaliador
<
i
>
ad
hoc
</
i
>:<
span
style
=
"color: red; font-weight: bold;"
>*</
span
></
label
>
<
a
href
=
"{{route('download', ['file' =>
$evento->formAvaliacaoExterno
])}}"
target
=
"_new"
style
=
"font-size: 20px; color: #114048ff;"
>
<
img
class
=
""
src
=
"
{
{asset('img/icons/file-download-solid.svg')}
}
"
style
=
"width:20px"
>
</
a
>
<
input
type
=
"file"
accept
=
".pdf,.doc,.docx,.xlsx,.xls,.csv,.zip"
class
=
"form-control-file @error('pdfFormAvalExterno') is-invalid @enderror"
name
=
"pdfFormAvalExterno"
value
=
"{{ old('pdfFormAvalExterno') }}"
id
=
"pdfFormAvalExterno"
>
<
small
>
O
arquivo
selecionado
deve
ter
até
2
mb
.
</
small
>
@
error
(
'pdfFormAvalExterno'
)
<
span
class
=
"invalid-feedback"
role
=
"alert"
>
<
strong
>
{{
$message
}}
</
strong
>
</
span
>
@
enderror
</
div
>
</
div
>
<
div
class
=
"col-sm-6"
>
<
div
class
=
"form-group"
>
<
label
for
=
"pdfEdital"
>
Documento
auxiliar
para
Avaliador
:</
label
>
@
if
(
$evento
->
docTutorial
!=
null
)
<
a
href
=
"{{route('download', ['file' =>
$evento->docTutorial
])}}"
target
=
"_new"
style
=
"font-size: 20px; color: #114048ff;"
>
<
img
class
=
""
src
=
"
{
{asset('img/icons/file-download-solid.svg')}
}
"
style
=
"width:20px"
>
</
a
>
@
else
<
a
>
<
i
class
=
"fas fa-times-circle fa-2x"
style
=
"color:red; font-size:25px"
></
i
>
</
a
>
@
endif
<
input
type
=
"file"
class
=
"form-control-file @error('docTutorial') is-invalid @enderror"
name
=
"docTutorial"
value
=
"{{ old('docTutorial') }}"
id
=
"docTutorial"
>
<
small
>
O
arquivo
selecionado
deve
ser
no
formato
PDF
de
até
2
mb
.
</
small
>
@
error
(
'docTutorial'
)
<
span
class
=
"invalid-feedback"
role
=
"alert"
>
<
strong
>
{{
$message
}}
</
strong
>
</
span
>
@
enderror
</
div
>
</
div
>
</
div
>
<
div
class
=
"row justify-content-center"
style
=
"margin-top:10px; display: none"
id
=
"displayCampos"
>
<
table
class
=
"table table-bordered col-sm-12"
id
=
"dynamicAddRemove"
>
<
tr
>
<
th
>
Nome
<
span
style
=
"color:red; font-weight:bold;"
>*</
span
></
th
>
<
th
>
Descrição
</
th
>
<
th
>
Nota
Máxima
<
span
style
=
"color:red; font-weight:bold;"
>*</
span
></
th
>
<
th
>
Prioridade
<
span
style
=
"color:red; font-weight:bold;"
>*</
span
></
th
>
<
th
>
Ação
</
th
>
</
tr
>
@
if
(
isset
(
$camposAvaliacao
))
@
foreach
(
$camposAvaliacao
as
$campoAvaliacao
)
@
if
(
$numCampos
==
0
)
<
tr
>
<
td
><
input
type
=
"text"
name
=
"inputField[
{
{$i}
}
][nome]"
class
=
"form-control nome @error('inputField.*.nome') is-invalid @enderror"
value
=
"{{
$campoAvaliacao->nome
}}"
/>
@
error
(
'inputField.*.nome'
)
<
span
class
=
"invalid-feedback"
role
=
"alert"
>
<
strong
>
{{
$message
}}
</
strong
>
</
span
>
@
enderror
</
td
>
<
td
><
input
type
=
"text"
name
=
"inputField[
{
{$i}
}
][descricao]"
class
=
"form-control descricao @error('inputField.*.descricao') is-invalid @enderror"
value
=
"{{
$campoAvaliacao->descricao
}}"
/>
@
error
(
'inputField.*.descricao'
)
<
span
class
=
"invalid-feedback"
role
=
"alert"
>
<
strong
>
{{
$message
}}
</
strong
>
</
span
>
@
enderror
</
td
>
<
td
><
input
type
=
"number"
min
=
"1"
step
=
"1"
name
=
"inputField[
{
{$i}
}
][nota_maxima]"
class
=
"form-control nota_maxima @error('inputField.*.nota_maxima') is-invalid @enderror"
value
=
"{{
$campoAvaliacao->nota_maxima
}}"
/>
@
error
(
'inputField.*.nota_maxima'
)
<
span
class
=
"invalid-feedback"
role
=
"alert"
>
<
strong
>
{{
$message
}}
</
strong
>
</
span
>
@
enderror
</
td
>
<
td
>
<
select
name
=
"inputField[
{
{$i}
}
][prioridade]"
class
=
"form-control prioridade @error('inputField.*.prioridade') is-invalid @enderror"
>
<
option
value
=
""
>--
ORDEM
--</
option
>
<
option
value
=
"1"
class
=
"ordem_option"
>
1
</
option
>
</
select
>
@
error
(
'inputField.*.prioridade'
)
<
span
class
=
"invalid-feedback"
role
=
"alert"
>
<
strong
>
{{
$message
}}
</
strong
>
</
span
>
@
enderror
</
td
>
<
td
><
button
type
=
"button"
name
=
"add"
id
=
"dynamic-ar"
class
=
"btn btn-outline-primary"
>
Adicionar
</
button
></
td
>
</
tr
>
@
else
<
tr
>
<
td
><
input
type
=
"text"
name
=
"inputField[
{
{$i}
}
][nome]"
class
=
"form-control nome @error('inputField.*.nome') is-invalid @enderror"
value
=
"{{
$campoAvaliacao->nome
}}"
/>
@
error
(
'inputField.*.nome'
)
<
span
class
=
"invalid-feedback"
role
=
"alert"
>
<
strong
>
{{
$message
}}
</
strong
>
</
span
>
@
enderror
</
td
>
<
td
><
input
type
=
"text"
name
=
"inputField[
{
{$i}
}
][descricao]"
class
=
"form-control descricao @error('inputField.*.descricao') is-invalid @enderror"
value
=
"{{
$campoAvaliacao->descricao
}}"
/>
@
error
(
'inputField.*.descricao'
)
<
span
class
=
"invalid-feedback"
role
=
"alert"
>
<
strong
>
{{
$message
}}
</
strong
>
</
span
>
@
enderror
</
td
>
<
td
><
input
type
=
"number"
min
=
"1"
step
=
"1"
name
=
"inputField[
{
{$i}
}
][nota_maxima]"
class
=
"form-control nota_maxima @error('inputField.*.nota_maxima') is-invalid @enderror"
value
=
"{{
$campoAvaliacao->nota_maxima
}}"
/>
@
error
(
'inputField.*.nota_maxima'
)
<
span
class
=
"invalid-feedback"
role
=
"alert"
>
<
strong
>
{{
$message
}}
</
strong
>
</
span
>
@
enderror
</
td
>
<
td
>
<
select
name
=
"inputField[
{
{$i}
}
][prioridade]"
class
=
"form-control prioridade @error('inputField.*.prioridade') is-invalid @enderror"
>
<
option
value
=
""
>--
ORDEM
--</
option
>
<
option
value
=
"1"
class
=
"ordem_option"
>
1
</
option
>
</
select
>
@
error
(
'inputField.*.prioridade'
)
<
span
class
=
"invalid-feedback"
role
=
"alert"
>
<
strong
>
{{
$message
}}
</
strong
>
</
span
>
@
enderror
</
td
>
<
td
><
button
type
=
"button"
class
=
"btn btn-outline-danger remove-input-field"
name
=
"removeButton[
{
{$i}
}
]"
>
Remover
</
button
></
td
>
</
tr
>
@
endif
@
php
++
$i
;
++
$numCampos
;
@
endphp
@
endforeach
@
else
<
tr
>
<
td
><
input
type
=
"text"
name
=
"inputField[0][nome]"
class
=
"form-control nome @error('inputField.*.nome') is-invalid @enderror"
value
=
"{{ old('inputField[0][nome]') }}"
/>
@
error
(
'inputField.*.nome'
)
<
span
class
=
"invalid-feedback"
role
=
"alert"
>
<
strong
>
{{
$message
}}
</
strong
>
</
span
>
@
enderror
</
td
>
<
td
><
input
type
=
"text"
name
=
"inputField[0][descricao]"
class
=
"form-control descricao @error('inputField.*.descricao') is-invalid @enderror"
value
=
"{{ old('inputField[0][descricao]') }}"
/>
@
error
(
'inputField.*.descricao'
)
<
span
class
=
"invalid-feedback"
role
=
"alert"
>
<
strong
>
{{
$message
}}
</
strong
>
</
span
>
@
enderror
</
td
>
<
td
><
input
type
=
"number"
min
=
"1"
step
=
"1"
name
=
"inputField[0][nota_maxima]"
class
=
"form-control nota_maxima @error('inputField.*.nota_maxima') is-invalid @enderror"
value
=
"{{ old('inputField[0][nota_maxima]') }}"
/>
@
error
(
'inputField.*.nota_maxima'
)
<
span
class
=
"invalid-feedback"
role
=
"alert"
>
<
strong
>
{{
$message
}}
</
strong
>
</
span
>
@
enderror
</
td
>
<
td
>
<
select
name
=
"inputField[0][prioridade]"
class
=
"form-control prioridade @error('inputField.*.prioridade') is-invalid @enderror"
>
<
option
value
=
""
selected
>--
ORDEM
--</
option
>
<
option
value
=
"1"
class
=
"ordem_option"
>
1
</
option
>
</
select
>
@
error
(
'inputField.*.prioridade'
)
<
span
class
=
"invalid-feedback"
role
=
"alert"
>
<
strong
>
{{
$message
}}
</
strong
>
</
span
>
@
enderror
</
td
>
<
td
><
button
type
=
"button"
name
=
"add"
id
=
"dynamic-ar"
class
=
"btn btn-outline-primary"
>
Adicionar
</
button
></
td
>
</
tr
>
@
endif
</
table
>
@
if
(
$errors
->
has
(
'inputField.*'
))
<
div
class
=
"col-sm-12 alert alert-danger"
id
=
"inputFieldError"
>
Você
deve
preencher
os
campos
obrigatórios
.
</
div
>
@
endif
<
div
class
=
"col-sm-12 alert alert-danger"
style
=
"display: none"
id
=
"nota_maxima_invalida"
>
A
soma
das
notas
máximas
não
pode
ser
maior
que
10.
</
div
>
<
input
type
=
"checkbox"
id
=
"checkB[0]"
checked
name
=
"campos[]"
value
=
"0"
hidden
>
<
input
type
=
"number"
name
=
"somaNotas"
value
=
"0"
id
=
"somaNotas"
hidden
>
</
div
>
<
div
class
=
"col-sm-12 row"
style
=
"margin-top:10px; display: none"
id
=
"displayLink"
>
<
label
for
=
"link"
class
=
"col-form-label"
>
{{
__
(
'Link para o formulário:'
)
}}
<
span
style
=
"color:red; font-weight:bold;"
>*</
span
></
label
>
<
input
id
=
"link"
type
=
"text"
class
=
"form-control @error("
link
") is-invalid @enderror"
name
=
"link"
value
=
"{{ old('link') }}"
>
@
error
(
'link'
)
<
span
class
=
"invalid-feedback"
role
=
"alert"
>
<
strong
>
{{
$message
}}
</
strong
>
</
span
>
@
enderror
</
div
>
<
hr
>
<
div
class
=
"row subtitulo"
>
<
div
class
=
"col-sm-12"
>
...
...
@@ -400,9 +636,15 @@
<
div
class
=
"col-sm-6"
>
<
div
class
=
"form-group"
>
<
label
for
=
"pdfEdital"
>
PDF
do
Edital
:<
span
style
=
"color: red; font-weight: bold;"
>*</
span
></
label
>
<
a
href
=
"{{route('download', ['file' =>
$evento->pdfEdital
])}}"
target
=
"_new"
style
=
"font-size: 20px; color: #114048ff;"
>
<
img
class
=
""
src
=
"
{
{asset('img/icons/file-download-solid.svg')}
}
"
style
=
"width:20px"
>
</
a
>
@
if
(
$evento
->
pdfEdital
!=
null
)
<
a
href
=
"{{route('download', ['file' =>
$evento->pdfEdital
])}}"
target
=
"_new"
style
=
"font-size: 20px; color: #114048ff;"
>
<
img
class
=
""
src
=
"
{
{asset('img/icons/file-download-solid.svg')}
}
"
style
=
"width:20px"
>
</
a
>
@
else
<
a
>
<
i
class
=
"fas fa-times-circle fa-2x"
style
=
"color:red; font-size:25px"
></
i
>
</
a
>
@
endif
<
input
type
=
"file"
class
=
"form-control-file @error('pdfEdital') is-invalid @enderror"
name
=
"pdfEdital"
value
=
"{{ old('pdfEdital') }}"
id
=
"pdfEdital"
>
<
small
>
O
arquivo
selecionado
deve
ser
no
formato
PDF
de
até
2
mb
.
</
small
>
@
error
(
'pdfEdital'
)
...
...
@@ -416,9 +658,15 @@
<
div
class
=
"col-sm-6"
>
<
div
class
=
"form-group"
>
<
label
for
=
"modeloDocumento"
>
Arquivo
com
os
modelos
de
documentos
do
edital
:</
label
>
<
a
href
=
"{{route('download', ['file' =>
$evento->modeloDocumento
])}}"
target
=
"_new"
style
=
"font-size: 20px; color: #114048ff;"
>
<
img
class
=
""
src
=
"
{
{asset('img/icons/file-download-solid.svg')}
}
"
style
=
"width:20px"
>
</
a
>
@
if
(
$evento
->
modeloDocumento
!=
null
)
<
a
href
=
"{{route('download', ['file' =>
$evento->modeloDocumento
])}}"
target
=
"_new"
style
=
"font-size: 20px; color: #114048ff;"
>
<
img
class
=
""
src
=
"
{
{asset('img/icons/file-download-solid.svg')}
}
"
style
=
"width:20px"
>
</
a
>
@
else
<
a
>
<
i
class
=
"fas fa-times-circle fa-2x"
style
=
"color:red; font-size:25px"
></
i
>
</
a
>
@
endif
<
input
type
=
"file"
class
=
"form-control-file @error('modeloDocumento') is-invalid @enderror"
name
=
"modeloDocumento"
value
=
"{{ old('modeloDocumento') }}"
id
=
"modeloDocumento"
>
<
small
>
O
arquivo
selecionado
deve
ter
até
2
mb
.
</
small
>
@
error
(
'modeloDocumento'
)
...
...
@@ -429,41 +677,12 @@
</
div
>
</
div
>
<
div
class
=
"col-sm-6"
>
<
div
class
=
"form-group"
>
<
label
for
=
"pdfEdital"
>
Formulário
para
avaliador
<
i
>
ad
hoc
</
i
>:<
span
style
=
"color: red; font-weight: bold;"
>*</
span
></
label
>
<
a
href
=
"{{route('download', ['file' =>
$evento->formAvaliacaoExterno
])}}"
target
=
"_new"
style
=
"font-size: 20px; color: #114048ff;"
>
<
img
class
=
""
src
=
"
{
{asset('img/icons/file-download-solid.svg')}
}
"
style
=
"width:20px"
>
</
a
>
<
input
type
=
"file"
accept
=
".pdf,.doc,.docx,.xlsx,.xls,.csv,.zip"
class
=
"form-control-file @error('pdfFormAvalExterno') is-invalid @enderror"
name
=
"pdfFormAvalExterno"
value
=
"{{ old('pdfFormAvalExterno') }}"
id
=
"pdfFormAvalExterno"
>
<
small
>
O
arquivo
selecionado
deve
ter
até
2
mb
.
</
small
>
@
error
(
'pdfFormAvalExterno'
)
<
span
class
=
"invalid-feedback"
role
=
"alert"
>
<
strong
>
{{
$message
}}
</
strong
>
</
span
>
@
enderror
</
div
>
</
div
>
<
div
class
=
"col-sm-6"
>
<
div
class
=
"form-group"
>
<
label
for
=
"pdfEdital"
>
Formulário
de
avaliação
do
relatório
:</
label
>
<
a
href
=
"{{route('download', ['file' =>
$evento->formAvaliacaoRelatorio
])}}"
target
=
"_new"
style
=
"font-size: 20px; color: #114048ff;"
>
<
img
class
=
""
src
=
"
{
{asset('img/icons/file-download-solid.svg')}
}
"
style
=
"width:20px"
>
</
a
>
<
input
type
=
"file"
class
=
"form-control-file @error('pdfFormAvalRelatorio') is-invalid @enderror"
name
=
"pdfFormAvalRelatorio"
value
=
"{{ old('pdfFormAvalRelatorio') }}"
id
=
"pdfFormAvalRelatorio"
>
<
small
>
O
arquivo
selecionado
deve
ser
no
formato
PDF
de
até
2
mb
.
</
small
>
@
error
(
'pdfFormAvalRelatorio'
)
<
span
class
=
"invalid-feedback"
role
=
"alert"
>
<
strong
>
{{
$message
}}
</
strong
>
</
span
>
@
enderror
</
div
>
</
div
>
<
div
class
=
"col-sm-12"
>
<
div
class
=
"form-group"
>
<
label
for
=
"pdfEdital"
>
Documento
auxiliar
para
Avaliador
:</
label
>
@
if
(
$evento
->
docTu
tori
al
!=
null
)
<
a
href
=
"{{route('download', ['file' =>
$evento->
docTu
tori
al
])}}"
target
=
"_new"
style
=
"font-size: 20px; color: #114048ff;"
>
<
label
for
=
"pdfEdital"
>
Formulário
de
avaliação
do
relatório
:</
label
>
@
if
(
$evento
->
formAvaliacaoRela
tori
o
!=
null
)
<
a
href
=
"{{route('download', ['file' =>
$evento->
formAvaliacaoRela
tori
o
])}}"
target
=
"_new"
style
=
"font-size: 20px; color: #114048ff;"
>
<
img
class
=
""
src
=
"
{
{asset('img/icons/file-download-solid.svg')}
}
"
style
=
"width:20px"
>
</
a
>
@
else
...
...
@@ -471,15 +690,17 @@
<
i
class
=
"fas fa-times-circle fa-2x"
style
=
"color:red; font-size:25px"
></
i
>
</
a
>
@
endif
<
input
type
=
"file"
class
=
"form-control-file @error('docTutorial') is-invalid @enderror"
name
=
"docTutorial"
value
=
"{{ old('docTutorial') }}"
id
=
"docTutorial"
>
<
input
type
=
"file"
class
=
"form-control-file @error('pdfFormAvalRelatorio') is-invalid @enderror"
name
=
"pdfFormAvalRelatorio"
value
=
"{{ old('pdfFormAvalRelatorio') }}"
id
=
"pdfFormAvalRelatorio"
>
<
small
>
O
arquivo
selecionado
deve
ser
no
formato
PDF
de
até
2
mb
.
</
small
>
@
error
(
'
docTu
tori
al
'
)
@
error
(
'
pdfFormAvalRela
tori
o
'
)
<
span
class
=
"invalid-feedback"
role
=
"alert"
>
<
strong
>
{{
$message
}}
</
strong
>
</
span
>
<
strong
>
{{
$message
}}
</
strong
>
</
span
>
@
enderror
</
div
>
</
div
>
</
div
>
<
div
class
=
"row justify-content-center"
style
=
"margin: 20px 0 20px 0"
>
...
...
@@ -501,6 +722,159 @@
@
endsection
@
section
(
'javascript'
)
<
script
type
=
"text/javascript"
>
var
i
=
"
{
{$i}
}
"
;
var
numCampos
=
"
{
{$numCampos}
}
"
;
var
currentOptions
=
{
'0'
:
''
}
$
(
document
)
.
ready
(
function
()
{
displayTipoAvaliacao
(
"{{ old('tipoAvaliacao') == null ?
$evento->tipoAvaliacao
: old('tipoAvaliacao')}}"
)
if
(
numCampos
>
1
)
{
for
(
let
y
=
1
;
y
<
(
numCampos
);
y
++
)
{
$
(
"#displayCampos"
)
.
append
(
'<input type="checkbox" id="checkB['
+
y
+
']" checked name="campos[]" value="'
+
y
+
'" hidden>'
);
addOrdemPrioridade
();
}
}
z
=
0
@
foreach
(
$camposAvaliacao
as
$campoAvaliacao
)
selectId
=
z
newOption
=
"
{
{$campoAvaliacao->prioridade}
}
"
displayPrioridades
(
selectId
,
newOption
)
++
z
@
endforeach
});
// Adiciona campo de avaliação
$
(
"#dynamic-ar"
)
.
click
(
function
()
{
++
i
;
++
numCampos
;
$
(
"#dynamicAddRemove"
)
.
append
(
'<tr><td><input type="text" name="inputField['
+
i
+
'][nome]" class="form-control nome @error("inputField.*.nome") is-invalid @enderror" /></td><td><input type="text" name="inputField['
+
i
+
'][descricao]" class="form-control descricao @error("inputField.*.descricao") is-invalid @enderror"/></td><td><input type="number" min="1" step="1" name="inputField['
+
i
+
'][nota_maxima]" class="form-control nota_maxima @error("inputField.*.nota_maxima") is-invalid @enderror" /></td><td><select name="inputField['
+
i
+
'][prioridade]" class="form-control prioridade @error("inputField.*.prioridade") is-invalid @enderror"><option value="" selected>-- ORDEM --</option><option value="1" class="ordem_option">1</option></select></td><td><button type="button" class="btn btn-outline-danger remove-input-field" name="removeButton['
+
i
+
']">Remover</button></td></tr>'
);
$
(
"#displayCampos"
)
.
append
(
'<input type="checkbox" id="checkB['
+
i
+
']" checked name="campos[]" value="'
+
i
+
'" hidden>'
);
addOrdemPrioridade
();
});
function
addOrdemPrioridade
()
{
$
(
".prioridade"
)
.
children
()
.
remove
(
".dynamic"
);
// Exibe opções caso estejam ocultas
$
(
'.ordem_option'
)
.
show
();
$
(
".prioridade"
)
.
each
(
function
()
{
// Resetando os valores selecionados
$
(
this
)
.
val
(
""
)
.
change
();
selectId
=
$
(
this
)
.
attr
(
'name'
)
.
replace
(
/
\
D
/
g
,
""
)
.
toString
();
currentOptions
[
selectId
]
=
''
;
for
(
let
x
=
2
;
x
<=
numCampos
;
x
++
)
{
$
(
this
)
.
append
(
'<option value="'
+
x
+
'" class="ordem_option dynamic">'
+
x
+
'</option>'
)
}
})
}
// Exclui campo de avaliação
$
(
document
)
.
on
(
'click'
,
'.remove-input-field'
,
function
()
{
$
(
this
)
.
parents
(
'tr'
)
.
remove
();
selectId
=
$
(
this
)
.
attr
(
'name'
)
.
replace
(
/
\
D
/
g
,
""
)
.
toString
();
currentOption
=
currentOptions
[
selectId
];
document
.
getElementById
(
'checkB['
+
selectId
+
']'
)
.
remove
();
$
(
'.ordem_option[value|="'
+
currentOption
+
'"]'
)
.
show
();
delete
currentOptions
[
selectId
];
$
(
'.dynamic[value|="'
+
numCampos
+
'"]'
)
.
remove
();
--
numCampos
;
});
function
displayPrioridades
(
id
,
newOption
)
{
currentOption
=
currentOptions
[
id
];
$
(
'.ordem_option[value|="'
+
currentOption
+
'"]'
)
.
show
();
$
(
'.ordem_option[value|="'
+
newOption
+
'"]'
)
.
hide
();
$
(
'select[name="inputField['
+
id
+
'][prioridade]"]'
)
.
val
(
newOption
);
currentOptions
[
id
]
=
newOption
;
}
$
(
"#dynamicAddRemove"
)
.
on
(
'change'
,
'.prioridade'
,
function
()
{
selectId
=
$
(
this
)
.
attr
(
'name'
)
.
replace
(
/
\
D
/
g
,
""
)
.
toString
();
newOption
=
$
(
this
)
.
val
();
displayPrioridades
(
selectId
,
newOption
);
});
$
(
"#dynamicAddRemove"
)
.
on
(
'input'
,
'.nota_maxima'
,
function
()
{
somaNotas
=
0
;
$
(
".nota_maxima"
)
.
each
(
function
()
{
valor
=
Number
(
$
(
this
)
.
val
());
if
(
valor
!=
0
)
{
somaNotas
+=
valor
;
}
});
$
(
'#somaNotas'
)
.
val
(
somaNotas
);
if
(
somaNotas
>
10
)
{
$
(
'.nota_maxima'
)
.
css
(
'border'
,
'1px solid red'
);
document
.
getElementById
(
"nota_maxima_invalida"
)
.
style
.
display
=
""
;
}
else
{
$
(
'.nota_maxima'
)
.
css
(
'border'
,
''
);
document
.
getElementById
(
"nota_maxima_invalida"
)
.
style
.
display
=
"none"
;
}
});
// Tipo de avaliação
function
displayTipoAvaliacao
(
valor
){
if
(
valor
==
"form"
){
document
.
getElementById
(
"radioForm"
)
.
checked
=
true
;
document
.
getElementById
(
"radioCampos"
)
.
checked
=
false
;
document
.
getElementById
(
"radioLink"
)
.
checked
=
false
;
document
.
getElementById
(
"displayForm"
)
.
style
.
display
=
""
;
document
.
getElementById
(
"displayCampos"
)
.
style
.
display
=
"none"
;
document
.
getElementById
(
"displayLink"
)
.
style
.
display
=
"none"
;
}
else
if
(
valor
==
"campos"
){
document
.
getElementById
(
"radioForm"
)
.
checked
=
false
;
document
.
getElementById
(
"radioCampos"
)
.
checked
=
true
;
document
.
getElementById
(
"radioLink"
)
.
checked
=
false
;
document
.
getElementById
(
"displayForm"
)
.
style
.
display
=
"none"
;
document
.
getElementById
(
"displayCampos"
)
.
style
.
display
=
"inline"
;
document
.
getElementById
(
"displayLink"
)
.
style
.
display
=
"none"
;
}
else
if
(
valor
==
"link"
)
{
document
.
getElementById
(
"radioForm"
)
.
checked
=
false
;
document
.
getElementById
(
"radioCampos"
)
.
checked
=
false
;
document
.
getElementById
(
"radioLink"
)
.
checked
=
true
;
document
.
getElementById
(
"displayForm"
)
.
style
.
display
=
"none"
;
document
.
getElementById
(
"displayCampos"
)
.
style
.
display
=
"none"
;
document
.
getElementById
(
"displayLink"
)
.
style
.
display
=
""
;
}
}
function
defCoord
(
data
,
data2
){
document
.
getElementById
(
'coordenador_id'
)
.
value
=
data
;
document
.
getElementById
(
'coordenador_name'
)
.
value
=
data2
;
...
...
@@ -523,4 +897,12 @@
window
.
onload
=
showDocumentoExtra
();
</
script
>
@
if
(
$errors
->
has
(
'somaNotas'
))
<
script
>
$
(
'.nota_maxima'
)
.
css
(
'border'
,
'1px solid red'
);
document
.
getElementById
(
"nota_maxima_invalida"
)
.
style
.
display
=
""
;
</
script
>
@
endif
@
endsection
\ No newline at end of file
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