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
5da05a73
Unverified
Commit
5da05a73
authored
Jun 12, 2020
by
Aline Tenório
Committed by
GitHub
Jun 12, 2020
Browse files
Merge pull request #25 from lmts-ufape/carlos
Carlos
parents
5af65369
56f62ac9
Changes
13
Hide whitespace changes
Inline
Side-by-side
app/GrandeArea.php
View file @
5da05a73
...
...
@@ -6,5 +6,7 @@ use Illuminate\Database\Eloquent\Model;
class
GrandeArea
extends
Model
{
//
public
function
areas
()
{
return
$this
->
hasMany
(
'App\Area'
);
}
}
app/Http/Controllers/AreaController.php
View file @
5da05a73
...
...
@@ -117,4 +117,9 @@ class AreaController extends Controller
$grandeArea
=
GrandeArea
::
find
(
$id
);
return
redirect
(
route
(
'grandearea.show'
,
[
'id'
=>
$id
])
)
->
with
([
'grandeArea'
=>
$grandeArea
,
'mensagem'
=>
'Área deletada com sucesso'
]);
}
public
function
consulta
(
$id
)
{
$areas
=
Area
::
where
(
'grande_area_id'
,
$id
)
->
orderBy
(
'nome'
)
->
get
();
return
$areas
->
toJson
();
}
}
app/Http/Controllers/ArquivoController.php
View file @
5da05a73
...
...
@@ -86,6 +86,10 @@ class ArquivoController extends Controller
public
function
baixarPlano
(
$id
)
{
$arquivo
=
Arquivo
::
find
(
$id
);
return
Storage
::
download
(
$arquivo
->
nome
);
if
(
Storage
::
disk
()
->
exists
(
$arquivo
->
nome
))
{
return
Storage
::
download
(
$arquivo
->
nome
);
}
return
abort
(
404
);
}
}
app/Http/Controllers/SubAreaController.php
View file @
5da05a73
...
...
@@ -106,4 +106,9 @@ class SubAreaController extends Controller
return
redirect
(
route
(
'area.show'
,
[
'id'
=>
$areaId
])
)
->
with
([
'mensagem'
=>
'Subárea deletada com sucesso'
]);
}
public
function
consulta
(
$id
)
{
$subAreas
=
SubArea
::
where
(
'area_id'
,
$id
)
->
orderBy
(
'nome'
)
->
get
();
return
$subAreas
->
toJson
();
}
}
app/Http/Controllers/TrabalhoController.php
View file @
5da05a73
...
...
@@ -40,15 +40,11 @@ class TrabalhoController extends Controller
public
function
index
(
$id
)
{
$edital
=
Evento
::
find
(
$id
);
$grandeAreas
=
GrandeArea
::
all
();
$areas
=
Area
::
all
();
$subAreas
=
SubArea
::
all
();
$grandeAreas
=
GrandeArea
::
orderBy
(
'nome'
)
->
get
();
$funcaoParticipantes
=
FuncaoParticipantes
::
all
();
return
view
(
'evento.submeterTrabalho'
,[
'edital'
=>
$edital
,
'grandeAreas'
=>
$grandeAreas
,
'areas'
=>
$areas
,
'subAreas'
=>
$subAreas
,
'funcaoParticipantes'
=>
$funcaoParticipantes
]);
...
...
@@ -690,27 +686,46 @@ class TrabalhoController extends Controller
public
function
baixarAnexoProjeto
(
$id
)
{
$projeto
=
Trabalho
::
find
(
$id
);
return
Storage
::
download
(
$projeto
->
anexoProjeto
);
if
(
Storage
::
disk
()
->
exists
(
$projeto
->
anexoProjeto
))
{
return
Storage
::
download
(
$projeto
->
anexoProjeto
);
}
return
abort
(
404
);
}
public
function
baixarAnexoConsu
(
$id
)
{
$projeto
=
Trabalho
::
find
(
$id
);
return
Storage
::
download
(
$projeto
->
anexoDecisaoCONSU
);
if
(
Storage
::
disk
()
->
exists
(
$projeto
->
anexoDecisaoCONSU
))
{
return
Storage
::
download
(
$projeto
->
anexoDecisaoCONSU
);
}
return
abort
(
404
);
}
public
function
baixarAnexoComite
(
$id
)
{
$projeto
=
Trabalho
::
find
(
$id
);
return
Storage
::
download
(
$projeto
->
anexoAutorizacaoComiteEtica
);
if
(
Storage
::
disk
()
->
exists
(
$projeto
->
anexoAutorizacaoComiteEtica
))
{
return
Storage
::
download
(
$projeto
->
anexoAutorizacaoComiteEtica
);
}
return
abort
(
404
);
}
public
function
baixarAnexoLattes
(
$id
)
{
$projeto
=
Trabalho
::
find
(
$id
);
return
Storage
::
download
(
$projeto
->
anexoLattesCoordenador
);
if
(
Storage
::
disk
()
->
exists
(
$projeto
->
anexoLattesCoordenador
))
{
return
Storage
::
download
(
$projeto
->
anexoLattesCoordenador
);
}
return
abort
(
404
);
}
public
function
baixarAnexoPlanilha
(
$id
)
{
$projeto
=
Trabalho
::
find
(
$id
);
return
Storage
::
download
(
$projeto
->
anexoPlanilhaPontuacao
);
if
(
Storage
::
disk
()
->
exists
(
$projeto
->
anexoPlanilhaPontuacao
))
{
return
Storage
::
download
(
$projeto
->
anexoPlanilhaPontuacao
);
}
return
abort
(
404
);
}
public
function
baixarAnexoJustificativa
(
$id
)
{
...
...
resources/views/evento/submeterTrabalho.blade.php
View file @
5da05a73
...
...
@@ -31,10 +31,10 @@
<
div
class
=
"row justify-content-center"
>
<
div
class
=
"col-sm-4"
>
<
label
for
=
"grandeArea"
class
=
"col-form-label"
>
{{
__
(
'Grande Área*:'
)
}}
</
label
>
<
select
class
=
"form-control @error('grandeArea') is-invalid @enderror"
id
=
"grandeArea"
name
=
"grandeArea"
>
<
select
class
=
"form-control @error('grandeArea') is-invalid @enderror"
id
=
"grandeArea"
name
=
"grandeArea"
onchange
=
"areas()"
>
<
option
value
=
""
disabled
selected
hidden
>--
Grande
Área
--</
option
>
@
foreach
(
$grandeAreas
as
$grandeArea
)
<
option
value
=
"
{
{$grandeArea->id}}">{{$grandeArea->nome}
}
</option>
<
option
value
=
"
{
{$grandeArea->id}}">{{$grandeArea->nome}
}
</option>
@endforeach
</select>
...
...
@@ -46,11 +46,11 @@
</div>
<div class="
col
-
sm
-
4
">
<label for="
area
" class="
col
-
form
-
label
">{{ __('Área*:') }}</label>
<select class="
form
-
control
@
error
(
'area'
)
is
-
invalid
@
enderror
" id="
area
" name="
area
">
<select class="
form
-
control
@
error
(
'area'
)
is
-
invalid
@
enderror
" id="
area
" name="
area
"
onchange="
subareas
()
"
>
<option value="" disabled selected hidden>-- Área --</option>
@foreach(
$areas
as
$area
)
<option value="
{{
$area
->
id
}}
">
{
{$area->nome}
}
</option>
@endforeach
{{--
@foreach(
$areas
as
$area
)
<option value="
{{
$area
->
id
}}
">
{
{$area->nome}
}
</option>
@endforeach
--}}
</select>
@error('area')
...
...
@@ -63,9 +63,9 @@
<label for="
subArea
" class="
col
-
form
-
label
">{{ __('Sub Área*:') }}</label>
<select class="
form
-
control
@
error
(
'subArea'
)
is
-
invalid
@
enderror
" id="
subArea
" name="
subArea
">
<option value="" disabled selected hidden>-- Sub Área --</option>
@foreach(
$subAreas
as
$subArea
)
<option value="
{{
$subArea
->
id
}}
">
{
{$subArea->nome}
}
</option>
@endforeach
{{--
@foreach(
$subAreas
as
$subArea
)
<option value="
{{
$subArea
->
id
}}
">
{
{$subArea->nome}
}
</option>
@endforeach
--}}
</select>
@error('subArea')
...
...
@@ -339,7 +339,7 @@
</div>
<div class="
col
-
sm
-
1
">
<a class="
delete
">
<img src="
/
img
/
icons
/
user
-
times
-
solid
.
svg
" style="
width
:
25
px
;
margin
-
top
:
35
px
">
<img src="
{{
asset
(
'
/img/icons/user-times-solid.svg
'
)
}}
" style="
width
:
25
px
;
margin
-
top
:
35
px
">
</a>
</div>
</div>
...
...
@@ -396,11 +396,11 @@
}
});
// Exibir modalidade de acordo com a área
$
(
"#area"
)
.
change
(
function
()
{
console
.
log
(
$
(
this
)
.
val
());
addModalidade
(
$
(
this
)
.
val
());
});
//
//
Exibir modalidade de acordo com a área
//
$("#area").change(function() {
//
console.log($(this).val());
//
addModalidade($(this).val());
//
});
$
(
document
)
.
on
(
'click'
,
'.delete'
,
function
()
{
if
(
qtdParticipantes
>
2
)
{
qtdParticipantes
--
;
...
...
@@ -459,16 +459,16 @@
}
// Remover Coautor
function
addModalidade
(
areaId
)
{
console
.
log
(
modalidades
)
$
(
"#modalidade"
)
.
empty
();
for
(
let
i
=
0
;
i
<
modalidades
.
length
;
i
++
)
{
if
(
modalidades
[
i
]
.
areaId
==
areaId
)
{
console
.
log
(
modalidades
[
i
]);
$
(
"#modalidade"
)
.
append
(
"<option value="
+
modalidades
[
i
]
.
modalidadeId
+
">"
+
modalidades
[
i
]
.
modalidadeNome
+
"</option>"
)
}
}
}
//
function addModalidade(areaId) {
//
console.log(modalidades)
//
$("#modalidade").empty();
//
for (let i = 0; i < modalidades.length; i++) {
//
if (modalidades[i].areaId == areaId) {
//
console.log(modalidades[i]);
//
$("#modalidade").append("<option value=" + modalidades[i].modalidadeId + ">" + modalidades[i].modalidadeNome + "</option>")
//
}
//
}
//
}
function
montarLinhaInput
()
{
...
...
@@ -579,5 +579,37 @@
// "</div>"+
// "</div>";
// }
function
areas
()
{
var
grandeArea
=
$
(
'#grandeArea'
)
.
val
();
$
.
getJSON
(
"{{ config('app.url') }}/naturezas/areas/"
+
grandeArea
,
function
(
dados
){
if
(
dados
.
length
>
0
){
var
option
=
'<option>-- Área --</option>'
;
$
.
each
(
dados
,
function
(
i
,
obj
){
option
+=
'<option value="'
+
obj
.
id
+
'">'
+
obj
.
nome
+
'</option>'
;
})
}
else
{
var
option
=
"<option>-- Área --</option>"
;
}
$
(
'#area'
)
.
html
(
option
)
.
show
();
})
}
function
subareas
()
{
var
area
=
$
(
'#area'
)
.
val
();
$
.
getJSON
(
"{{ config('app.url') }}/naturezas/subarea/"
+
area
,
function
(
dados
){
if
(
dados
.
length
>
0
){
var
option
=
'<option>-- Sub Área --</option>'
;
$
.
each
(
dados
,
function
(
i
,
obj
){
option
+=
'<option value="'
+
obj
.
id
+
'">'
+
obj
.
nome
+
'</option>'
;
})
}
else
{
var
option
=
"<option>-- Sub Área --</option>"
;
}
$
(
'#subArea'
)
.
html
(
option
)
.
show
();
})
}
</
script
>
@
endsection
\ No newline at end of file
resources/views/naturezas/area/detalhes.blade.php
View file @
5da05a73
...
...
@@ -15,7 +15,7 @@
<
h2
style
=
"margin-top: 100px; "
>
{{
__
(
'Subáreas de '
)
.
$area
->
nome
}}
</
h2
>
</
div
>
<
div
class
=
"col-sm-3"
>
<
a
href
=
"{{ route('subarea.criar', ['id' =>
$area->id
]) }}"
class
=
"btn btn-primary"
style
=
"position:relative;top:100px;"
>
{{
__
(
'Criar subárea'
)
}}
</
a
>
<
a
href
=
"{{ route('subarea.criar', ['id' =>
$area->id
]) }}"
class
=
"btn btn-primary"
style
=
"position:relative;top:100px;
float: right;
"
>
{{
__
(
'Criar subárea'
)
}}
</
a
>
</
div
>
</
div
>
...
...
resources/views/naturezas/grandeArea/detalhes.blade.php
View file @
5da05a73
...
...
@@ -15,7 +15,7 @@
<
h2
style
=
"margin-top: 100px; "
>
{{
__
(
'Áreas de '
)
.
$grandeArea
->
nome
}}
</
h2
>
</
div
>
<
div
class
=
"col-sm-3"
>
<
a
href
=
"{{route('area.criar', ['id' =>
$grandeArea->id
] )}}"
class
=
"btn btn-primary"
style
=
"position:relative;top:100px;"
>
{{
__
(
'Criar Área'
)
}}
</
a
>
<
a
href
=
"{{route('area.criar', ['id' =>
$grandeArea->id
] )}}"
class
=
"btn btn-primary"
style
=
"position:relative;top:100px;
float: right;
"
>
{{
__
(
'Criar Área'
)
}}
</
a
>
</
div
>
</
div
>
...
...
resources/views/naturezas/grandeArea/index.blade.php
View file @
5da05a73
...
...
@@ -15,7 +15,7 @@
<
h2
style
=
"margin-top: 100px; "
>
{{
__
(
'Grandes áreas'
)
}}
</
h2
>
</
div
>
<
div
class
=
"col-sm-3"
>
<
a
href
=
"
{
{route('grandearea.criar')}
}
"
class
=
"btn btn-primary"
style
=
"position:relative;top:100px;"
>
{{
__
(
'Criar grande área'
)
}}
</
a
>
<
a
href
=
"
{
{route('grandearea.criar')}
}
"
class
=
"btn btn-primary"
style
=
"position:relative;top:100px;
float: right;
"
>
{{
__
(
'Criar grande área'
)
}}
</
a
>
</
div
>
</
div
>
...
...
resources/views/naturezas/index.blade.php
View file @
5da05a73
...
...
@@ -43,7 +43,7 @@
<
h2
style
=
"margin-top: 100px; "
>
{{
__
(
'Naturezas'
)
}}
</
h2
>
</
div
>
<
div
class
=
"col-sm-3"
>
<
a
href
=
""
class
=
"btn btn-primary"
style
=
"position:relative;top:100px;"
data
-
toggle
=
"modal"
data
-
target
=
"#modalNewCenter"
>
{{
__
(
'Criar natureza'
)
}}
</
a
>
<
a
href
=
""
class
=
"btn btn-primary"
style
=
"position:relative;top:100px;
float: right;
"
data
-
toggle
=
"modal"
data
-
target
=
"#modalNewCenter"
>
{{
__
(
'Criar natureza'
)
}}
</
a
>
</
div
>
</
div
>
...
...
resources/views/projeto/editar.blade.php
View file @
5da05a73
...
...
@@ -31,7 +31,7 @@
<
div
class
=
"row justify-content-center"
>
<
div
class
=
"col-sm-4"
>
<
label
for
=
"grandeArea"
class
=
"col-form-label"
>
{{
__
(
'Grande Área:'
)
}}
</
label
>
<
select
class
=
"form-control @error('grandeArea') is-invalid @enderror"
id
=
"grandeArea"
name
=
"grandeArea"
>
<
select
class
=
"form-control @error('grandeArea') is-invalid @enderror"
id
=
"grandeArea"
name
=
"grandeArea"
onchange
=
"areas()"
>
<
option
value
=
""
disabled
selected
hidden
>--
Grande
Área
--</
option
>
@
foreach
(
$grandeAreas
as
$grandeArea
)
@
if
(
$grandeArea
->
id
===
$projeto
->
grande_area_id
)
...
...
@@ -50,7 +50,7 @@
</div>
<div class="
col
-
sm
-
4
">
<label for="
area
" class="
col
-
form
-
label
">{{ __('Área:') }}</label>
<select class="
form
-
control
@
error
(
'area'
)
is
-
invalid
@
enderror
" id="
area
" name="
area
">
<select class="
form
-
control
@
error
(
'area'
)
is
-
invalid
@
enderror
" id="
area
" name="
area
"
onchange="
subareas
()
"
>
<option value="" disabled selected hidden>-- Área --</option>
@foreach(
$areas
as
$area
)
@if(
$area->id
===
$projeto->area_id
)
...
...
@@ -418,10 +418,10 @@
});
// Exibir modalidade de acordo com a área
$
(
"#area"
)
.
change
(
function
()
{
console
.
log
(
$
(
this
)
.
val
());
addModalidade
(
$
(
this
)
.
val
());
});
//
$("#area").change(function() {
//
console.log($(this).val());
//
addModalidade($(this).val());
//
});
$
(
document
)
.
on
(
'click'
,
'.delete'
,
function
()
{
if
(
qtdParticipantes
>
1
)
{
qtdParticipantes
--
;
...
...
@@ -457,16 +457,16 @@
});
// Remover Coautor
function
addModalidade
(
areaId
)
{
console
.
log
(
modalidades
)
$
(
"#modalidade"
)
.
empty
();
for
(
let
i
=
0
;
i
<
modalidades
.
length
;
i
++
)
{
if
(
modalidades
[
i
]
.
areaId
==
areaId
)
{
console
.
log
(
modalidades
[
i
]);
$
(
"#modalidade"
)
.
append
(
"<option value="
+
modalidades
[
i
]
.
modalidadeId
+
">"
+
modalidades
[
i
]
.
modalidadeNome
+
"</option>"
)
}
}
}
//
function addModalidade(areaId) {
//
console.log(modalidades)
//
$("#modalidade").empty();
//
for (let i = 0; i < modalidades.length; i++) {
//
if (modalidades[i].areaId == areaId) {
//
console.log(modalidades[i]);
//
$("#modalidade").append("<option value=" + modalidades[i].modalidadeId + ">" + modalidades[i].modalidadeNome + "</option>")
//
}
//
}
//
}
function
montarLinhaInput
()
{
...
...
@@ -577,5 +577,37 @@
// "</div>"+
// "</div>";
// }
function
areas
()
{
var
grandeArea
=
$
(
'#grandeArea'
)
.
val
();
$
.
getJSON
(
"{{ config('app.url') }}/naturezas/areas/"
+
grandeArea
,
function
(
dados
){
if
(
dados
.
length
>
0
){
var
option
=
"<option>-- Área --</option>"
;
$
.
each
(
dados
,
function
(
i
,
obj
){
option
+=
'<option value="'
+
obj
.
id
+
'">'
+
obj
.
nome
+
'</option>'
;
})
}
else
{
var
option
=
"<option>-- Área --</option>"
;
}
$
(
'#area'
)
.
html
(
option
)
.
show
();
})
}
function
subareas
()
{
var
area
=
$
(
'#area'
)
.
val
();
$
.
getJSON
(
"{{ config('app.url') }}/naturezas/subarea/"
+
area
,
function
(
dados
){
if
(
dados
.
length
>
0
){
var
option
=
"<option>-- Sub Área --</option>"
;
$
.
each
(
dados
,
function
(
i
,
obj
){
option
+=
'<option value="'
+
obj
.
id
+
'">'
+
obj
.
nome
+
'</option>'
;
})
}
else
{
var
option
=
"<option>-- Sub Área --</option>"
;
}
$
(
'#subArea'
)
.
html
(
option
)
.
show
();
})
}
</
script
>
@
endsection
\ No newline at end of file
resources/views/projeto/index.blade.php
View file @
5da05a73
...
...
@@ -50,9 +50,9 @@
<
a
href
=
"{{ route('trabalho.editar', ['id' =>
$projeto->id
]) }}"
class
=
"dropdown-item"
style
=
"text-align: center;"
>
Editar
projeto
</
a
>
{{
--
<
a
href
=
""
class
=
"dropdown-item"
style
=
"text-align: center"
>
Adicionar
participantes
</
a
>
--
}}
<
a
href
=
"
{{ route('trabalho.show', ['id' =>
$projeto->id
]) }}
"
class
=
"dropdown-item"
style
=
"text-align: center"
>
Visualizar
projeto
</
a
>
<
a
href
=
""
class
=
"dropdown-item"
style
=
"text-align: center"
>
Recorrer
</
a
>
...
...
routes/web.php
View file @
5da05a73
...
...
@@ -93,6 +93,7 @@ Route::group(['middleware' => ['isTemp', 'auth', 'verified']], function(){
Route
::
post
(
'/trabalho/novaVersao'
,
'TrabalhoController@novaVersao'
)
->
name
(
'trabalho.novaVersao'
);
Route
::
post
(
'/trabalho/criar'
,
'TrabalhoController@store'
)
->
name
(
'trabalho.store'
);
Route
::
get
(
'/edital/{id}/projetos'
,
'TrabalhoController@projetosDoEdital'
)
->
name
(
'projetos.edital'
);
Route
::
get
(
'/projeto/{id}/visualizar'
,
'TrabalhoController@show'
)
->
name
(
'trabalho.show'
);
Route
::
get
(
'/projeto/{id}/editar'
,
'TrabalhoController@edit'
)
->
name
(
'trabalho.editar'
);
Route
::
post
(
'/projeto/{id}/atualizar'
,
'TrabalhoController@update'
)
->
name
(
'trabalho.update'
);
Route
::
get
(
'/projeto/{id}/excluir'
,
'TrabalhoController@destroy'
)
->
name
(
'trabalho.destroy'
);
...
...
@@ -171,6 +172,7 @@ Route::prefix('naturezas')->group(function(){
Route
::
get
(
'/area/editar/{id}'
,
'AreaController@edit'
)
->
name
(
'area.editar'
)
->
middleware
(
'checkAdministrador'
);
Route
::
post
(
'/area/atualizar/{id}'
,
'AreaController@update'
)
->
name
(
'area.atualizar'
)
->
middleware
(
'checkAdministrador'
);
Route
::
post
(
'/area/excluir/{id}'
,
'AreaController@destroy'
)
->
name
(
'area.deletar'
)
->
middleware
(
'checkAdministrador'
);
Route
::
get
(
'/areas/{id}'
,
'AreaController@consulta'
)
->
name
(
'area.consulta'
);
//### Rotas das subareas, id's de nova e salvar são os ids da área a qual a nova subárea pertence #####
Route
::
get
(
'/subareas'
,
'SubAreaController@index'
)
->
name
(
'subarea.index'
)
->
middleware
(
'checkAdministrador'
);
...
...
@@ -180,6 +182,7 @@ Route::prefix('naturezas')->group(function(){
Route
::
get
(
'/subarea/editar/{id}'
,
'SubAreaController@edit'
)
->
name
(
'subarea.editar'
)
->
middleware
(
'checkAdministrador'
);
Route
::
post
(
'/subarea/atualizar/{id}'
,
'SubAreaController@update'
)
->
name
(
'subarea.atualizar'
)
->
middleware
(
'checkAdministrador'
);
Route
::
post
(
'/subarea/excluir/{id}'
,
'SubAreaController@destroy'
)
->
name
(
'subarea.deletar'
)
->
middleware
(
'checkAdministrador'
);
Route
::
get
(
'/subarea/{id}'
,
'SubAreaController@consulta'
)
->
name
(
'subarea.consulta'
);
});
...
...
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