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
20c75a31
Commit
20c75a31
authored
May 27, 2020
by
Gabriel-31415
Browse files
Merge branch 'carlos' of
https://github.com/lmts-ufape/submeta
into submeter
merge
parents
407861f5
c5c05b21
Changes
17
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/AreaController.php
View file @
20c75a31
...
...
@@ -3,6 +3,8 @@
namespace
App\Http\Controllers
;
use
App\Area
;
use
App\GrandeArea
;
use
App\SubArea
;
use
App\AreaModalidade
;
use
App\Pertence
;
use
App\Revisor
;
...
...
@@ -18,7 +20,8 @@ class AreaController extends Controller
*/
public
function
index
()
{
//
$areas
=
Area
::
orderBy
(
'nome'
)
->
get
();
return
view
(
'naturezas.area.index'
)
->
with
([
'areas'
=>
$areas
]);
}
/**
...
...
@@ -26,9 +29,9 @@ class AreaController extends Controller
*
* @return \Illuminate\Http\Response
*/
public
function
create
()
public
function
create
(
$grandeAreaid
)
{
//
return
view
(
'naturezas.area.nova_area'
)
->
with
([
'grandeAreaId'
=>
$grandeAreaid
]);
}
/**
...
...
@@ -37,18 +40,18 @@ class AreaController extends Controller
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public
function
store
(
Request
$request
)
public
function
store
(
Request
$request
,
$id
)
{
$validatedData
=
$request
->
validate
([
'nome'
=>
[
'required'
,
'string'
],
'nome'
=>
'required'
,
]);
A
rea
::
create
([
'nome'
=
>
$request
->
nome
,
'eventoId'
=>
$request
->
eventoId
,
]
);
$a
rea
=
new
Area
();
$area
->
nome
=
$request
->
nome
;
$area
->
grande_area_id
=
$id
;
$area
->
save
(
);
return
redirect
(
)
->
route
(
'
coord.detalhesEvento'
,
[
'eventoId'
=>
$request
->
eventoId
]);
return
redirect
(
route
(
'
grandearea.show'
,
[
'id'
=>
$id
])
)
->
with
([
'mensagem'
=>
'Nova área cadastrada com sucesso'
]);
}
/**
...
...
@@ -57,9 +60,12 @@ class AreaController extends Controller
* @param \App\Area $area
* @return \Illuminate\Http\Response
*/
public
function
show
(
Area
$area
)
public
function
show
(
$id
)
{
//
$area
=
Area
::
find
(
$id
);
$subAreas
=
SubArea
::
where
(
'area_id'
,
'='
,
$id
)
->
orderBy
(
'nome'
)
->
get
();
return
view
(
'naturezas.area.detalhes'
)
->
with
([
'area'
=>
$area
,
'subAreas'
=>
$subAreas
]);
}
/**
...
...
@@ -68,9 +74,10 @@ class AreaController extends Controller
* @param \App\Area $area
* @return \Illuminate\Http\Response
*/
public
function
edit
(
Area
$area
)
public
function
edit
(
$id
)
{
//
$area
=
Area
::
find
(
$id
);
return
view
(
'naturezas.area.editar_area'
)
->
with
([
'area'
=>
$area
]);
}
/**
...
...
@@ -80,9 +87,18 @@ class AreaController extends Controller
* @param \App\Area $area
* @return \Illuminate\Http\Response
*/
public
function
update
(
Request
$request
,
Area
$area
)
public
function
update
(
Request
$request
,
$id
)
{
//
$validated
=
$request
->
validate
([
'nome'
=>
'required'
,
]);
$area
=
Area
::
find
(
$id
);
$grandeArea
=
GrandeArea
::
find
(
$area
->
grande_area_id
);
$area
->
nome
=
$request
->
nome
;
$area
->
update
();
return
redirect
(
route
(
'grandearea.show'
,
[
'id'
=>
$area
->
grande_area_id
])
)
->
with
([
'grandeArea'
=>
$grandeArea
,
'mensagem'
=>
'Área atualizada com sucesso'
]);
}
/**
...
...
@@ -94,26 +110,11 @@ class AreaController extends Controller
public
function
destroy
(
$id
)
{
$area
=
Area
::
find
(
$id
);
$area_modalidade
=
AreaModalidade
::
where
(
'areaId'
,
$id
);
$pertence
=
Pertence
::
where
(
'areaId'
,
$id
);
$revisores
=
Revisor
::
where
(
'areaId'
,
$id
);
$trabalhos
=
Trabalho
::
where
(
'areaId'
,
$id
);
if
(
isset
(
$area_modalidade
)){
$area_modalidade
->
delete
();
}
if
(
isset
(
$pertence
)){
$pertence
->
delete
();
}
if
(
isset
(
$revisores
)){
$revisores
->
delete
();
}
if
(
isset
(
$trabalhos
)){
$trabalhos
->
delete
();
}
$id
=
$area
->
grande_area_id
;
$area
->
delete
();
//ver a questão de chave estrangeira para a tabela sub-áreas
return
redirect
()
->
back
();
$grandeArea
=
GrandeArea
::
find
(
$id
);
return
redirect
(
route
(
'grandearea.show'
,
[
'id'
=>
$id
])
)
->
with
([
'grandeArea'
=>
$grandeArea
,
'mensagem'
=>
'Área deletada com sucesso'
]);
}
}
app/Http/Controllers/GrandeAreaController.php
View file @
20c75a31
...
...
@@ -4,6 +4,7 @@ namespace App\Http\Controllers;
use
Illuminate\Http\Request
;
use
App\GrandeArea
;
use
App\Area
;
class
GrandeAreaController
extends
Controller
{
...
...
@@ -44,7 +45,7 @@ class GrandeAreaController extends Controller
$GrandeArea
->
nome
=
$request
->
nome
;
$GrandeArea
->
save
();
return
redirect
(
route
(
'grandearea.index'
)
)
->
with
([
'mensagem'
=>
'
Grande á
rea cadastrada com sucesso'
]);
return
redirect
(
route
(
'grandearea.index'
)
)
->
with
([
'mensagem'
=>
'
Á
rea cadastrada com sucesso'
]);
}
/**
...
...
@@ -55,7 +56,10 @@ class GrandeAreaController extends Controller
*/
public
function
show
(
$id
)
{
//
$grandeArea
=
GrandeArea
::
find
(
$id
);
$areas
=
Area
::
where
(
'grande_area_id'
,
'='
,
$id
)
->
orderBy
(
'nome'
)
->
get
();
return
view
(
'naturezas.grandeArea.detalhes'
)
->
with
([
'grandeArea'
=>
$grandeArea
,
'areas'
=>
$areas
]);
}
/**
...
...
@@ -83,7 +87,7 @@ class GrandeAreaController extends Controller
$grandeArea
->
nome
=
$request
->
nome
;
$grandeArea
->
update
();
return
redirect
(
route
(
'grandearea.index'
)
)
->
with
([
'mensagem'
=>
'
Grande á
rea editada com sucesso'
]);
return
redirect
(
route
(
'grandearea.index'
)
)
->
with
([
'mensagem'
=>
'
Á
rea editada com sucesso'
]);
}
/**
...
...
@@ -97,6 +101,6 @@ class GrandeAreaController extends Controller
$grandeArea
=
GrandeArea
::
find
(
$id
);
$grandeArea
->
delete
();
return
redirect
(
route
(
'grandearea.index'
)
)
->
with
([
'mensagem'
=>
'
Grande á
rea excluida com sucesso'
]);
return
redirect
(
route
(
'grandearea.index'
)
)
->
with
([
'mensagem'
=>
'
Á
rea excluida com sucesso'
]);
}
}
\ No newline at end of file
app/Http/Controllers/SubAreaController.php
0 → 100644
View file @
20c75a31
<?php
namespace
App\Http\Controllers
;
use
Illuminate\Http\Request
;
use
App\Area
;
use
App\SubArea
;
class
SubAreaController
extends
Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public
function
index
()
{
$subAreas
=
SubArea
::
orderBy
(
'nome'
)
->
get
();
return
view
(
'naturezas.subArea.index'
)
->
with
([
'subAreas'
=>
$subAreas
]);
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public
function
create
(
$areaId
)
{
return
view
(
'naturezas.subArea.nova_subarea'
)
->
with
([
'areaId'
=>
$areaId
]);
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public
function
store
(
Request
$request
,
$id
)
{
$validated
=
$request
->
validate
([
'nome'
=>
'required'
,
]);
$subarea
=
new
SubArea
();
$subarea
->
nome
=
$request
->
nome
;
$subarea
->
area_id
=
$id
;
$subarea
->
save
();
return
redirect
(
route
(
'area.show'
,
[
'id'
=>
$id
])
)
->
with
([
'mensagem'
=>
'Subárea cadastrada com sucesso'
]);
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public
function
show
(
$id
)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public
function
edit
(
$id
)
{
$subarea
=
SubArea
::
find
(
$id
);
return
view
(
'naturezas.subArea.editar_subarea'
)
->
with
([
'subarea'
=>
$subarea
]);
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public
function
update
(
Request
$request
,
$id
)
{
$validated
=
$request
->
validate
([
'nome'
=>
'required'
,
]);
$subarea
=
SubArea
::
find
(
$id
);
$subarea
->
nome
=
$request
->
nome
;
$subarea
->
update
();
return
redirect
(
route
(
'area.show'
,
[
'id'
=>
$subarea
->
area_id
])
)
->
with
([
'mensagem'
=>
'Subárea atualizada com sucesso'
]);
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public
function
destroy
(
$id
)
{
$subarea
=
SubArea
::
find
(
$id
);
$areaId
=
$subarea
->
area_id
;
$subarea
->
delete
();
return
redirect
(
route
(
'area.show'
,
[
'id'
=>
$areaId
])
)
->
with
([
'mensagem'
=>
'Subárea deletada com sucesso'
]);
}
}
resources/views/layouts/app.blade.php
View file @
20c75a31
...
...
@@ -66,7 +66,7 @@
</li>
<li
class=
"nav-item"
>
<a
class=
"nav-link"
href=
"{{ route('
admin.naturezas
') }}"
>
Naturezas
</a>
<a
class=
"nav-link"
href=
"{{ route('
grandearea.index
') }}"
>
Naturezas
</a>
</li>
<li
class=
"nav-item"
>
...
...
resources/views/naturezas/area/detalhes.blade.php
0 → 100644
View file @
20c75a31
@
extends
(
'layouts.app'
)
@
section
(
'content'
)
<
div
class
=
"container"
>
<
div
class
=
"row"
>
@
if
(
session
(
'mensagem'
))
<
div
class
=
"col-md-12"
style
=
"margin-top: 100px;"
>
<
div
class
=
"alert alert-success"
>
<
p
>
{{
session
(
'mensagem'
)}}
</
p
>
</
div
>
</
div
>
@
endif
<
div
class
=
"col-sm-9"
>
<
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
>
</
div
>
</
div
>
<
hr
>
<
table
class
=
"table table-bordered"
>
<
thead
>
<
tr
>
<
th
scope
=
"col"
>
Nome
</
th
>
<
th
scope
=
"col"
>
Opção
</
th
>
</
tr
>
</
thead
>
<
tbody
>
@
foreach
(
$subAreas
as
$subArea
)
<
tr
>
<
td
>
{{
$subArea
->
nome
}}
</
td
>
<
td
>
<
div
class
=
"btn-group dropright dropdown-options"
>
<
a
id
=
"options"
class
=
"dropdown-toggle "
data
-
toggle
=
"dropdown"
aria
-
haspopup
=
"true"
aria
-
expanded
=
"false"
>
</
a
>
<
div
class
=
"dropdown-menu"
>
<
a
href
=
"{{ route('subarea.editar', ['id' =>
$subArea->id
]) }}"
class
=
"dropdown-item"
>
<
img
src
=
"
{
{asset('img/icons/edit-regular.svg')}
}
"
class
=
"icon-card"
alt
=
""
>
Editar
</
a
>
<
form
method
=
"POST"
action
=
"{{ route('subarea.deletar', ['id' =>
$subArea->id
]) }}"
>
{{
csrf_field
()
}}
<
button
type
=
"submit"
class
=
"dropdown-item"
>
<
img
src
=
"
{
{asset('img/icons/trash-alt-regular.svg')}
}
"
class
=
"icon-card"
alt
=
""
>
Deletar
</
button
>
</
form
>
</
div
>
</
div
>
</
td
>
</
tr
>
@
endforeach
</
tbody
>
</
table
>
</
div
>
@
endsection
\ No newline at end of file
resources/views/naturezas/area/editar_area.blade.php
0 → 100644
View file @
20c75a31
@
extends
(
'layouts.app'
)
@
section
(
'content'
)
<
div
class
=
"container"
>
<
div
class
=
"row"
>
<
div
class
=
"col-sm-12"
>
<
h2
style
=
"margin-top: 100px; "
>
{{
__
(
'Editar uma área'
)
}}
</
h2
>
</
div
>
</
div
>
<
div
class
=
"row"
>
<
form
method
=
"POST"
action
=
"{{ route('area.atualizar', ['id' =>
$area->id
])}}"
>
@
csrf
<
div
class
=
"col-sm-12"
>
<
label
for
=
"nome"
class
=
"col-form-label"
>
{{
__
(
'Nome'
)
}}
</
label
>
<
input
id
=
"nome"
type
=
"text"
class
=
"form-control @error('nome') is-invalid @enderror"
name
=
"nome"
value
=
"{{
$area->nome
}}"
required
autocomplete
=
"nome"
autofocus
>
@
error
(
'nome'
)
<
span
class
=
"invalid-feedback"
role
=
"alert"
>
<
strong
>
{{
$message
}}
</
strong
>
</
span
>
@
enderror
<
button
type
=
"submit"
class
=
"btn btn-primary"
style
=
"position:relative;top:100px;"
>
{{
__
(
'Salvar'
)
}}
</
button
>
</
div
>
</
form
>
</
div
>
</
div
>
@
endsection
\ No newline at end of file
resources/views/naturezas/area/index.blade.php
View file @
20c75a31
...
...
@@ -7,10 +7,7 @@
<
div
class
=
"container"
>
<
div
class
=
"row"
>
<
div
class
=
"col-sm-10"
>
<
h3
>
Editais
</
h3
>
</
div
>
<
div
class
=
"col-sm-2"
>
<
a
href
=
"#"
class
=
"btn btn-primary"
>
Criar
Edital
</
a
>
<
h3
>
{{
__
(
'Áreas'
)
}}
</
h3
>
</
div
>
</
div
>
</
div
>
...
...
@@ -18,37 +15,33 @@
<
table
class
=
"table table-bordered"
>
<
thead
>
<
tr
>
<
th
scope
=
"col"
>
Nome
do
Edital
</
th
>
<
th
scope
=
"col"
>
Data
de
Criação
</
th
>
<
th
scope
=
"col"
>
Nome
</
th
>
<
th
scope
=
"col"
>
Opção
</
th
>
</
tr
>
</
thead
>
<
tbody
>
{{
--
@
foreach
(
$
eventos
as
$evento
)
@
foreach
(
$
areas
as
$area
)
<
tr
>
<
td
>
<
a
href
=
"{{
route('
evento.visualizar
',['id'=>
$evento
->id
])
}}"
class
=
"visualizarEvento"
>
{{
$
evento
->
nome
}}
<
a
href
=
"{{ route('
area.show
',
['id'
=>
$area
->id
]) }}"
class
=
"visualizarEvento"
>
{{
$
area
->
nome
}}
</
a
>
</
td
>
<
td
>
10
/
05
/
2020
</
td
>
<
td
>
<
div
class
=
"btn-group dropright dropdown-options"
>
<
a
id
=
"options"
class
=
"dropdown-toggle "
data
-
toggle
=
"dropdown"
aria
-
haspopup
=
"true"
aria
-
expanded
=
"false"
>
</
a
>
<
div
class
=
"dropdown-menu"
>
<
a
href
=
"{{ route('
coord.detalhesEvento', ['eventoI
d' =>
$
evento
->id
]) }}"
class
=
"dropdown-item"
>
<
a
href
=
"{{ route('
area.show', ['i
d' =>
$
area
->id
]) }}"
class
=
"dropdown-item"
>
<
img
src
=
"
{
{asset('img/icons/eye-regular.svg')}
}
"
class
=
"icon-card"
alt
=
""
>
Detalhes
</
a
>
<
a
href
=
"
{
{route('
evento
.editar',
$evento
->id
)
}
}
"
class
=
"dropdown-item"
>
<
a
href
=
"{{
route('
area
.editar',
['id' =>
$area
->id
])
}}"
class
=
"dropdown-item"
>
<
img
src
=
"
{
{asset('img/icons/edit-regular.svg')}
}
"
class
=
"icon-card"
alt
=
""
>
Editar
</
a
>
<
form
method
=
"POST"
action
=
"
{
{route('
evento
.deletar',
$evento
->id
)
}
}
"
>
<
form
method
=
"POST"
action
=
"{{
route('
area
.deletar',
['id' =>
$area
->id
])
}}"
>
{{
csrf_field
()
}}
{{
method_field
(
'DELETE'
)
}}
<
button
type
=
"submit"
class
=
"dropdown-item"
>
<
img
src
=
"
{
{asset('img/icons/trash-alt-regular.svg')}
}
"
class
=
"icon-card"
alt
=
""
>
Deletar
...
...
@@ -59,7 +52,7 @@
</
div
>
</
td
>
</
tr
>
@
endforeach
--
}}
@
endforeach
</
tbody
>
</
table
>
</
div
>
...
...
resources/views/naturezas/area/nova_area.blade.php
0 → 100644
View file @
20c75a31
@
extends
(
'layouts.app'
)
@
section
(
'content'
)
<
div
class
=
"container"
>
<
div
class
=
"row"
>
<
div
class
=
"col-sm-12"
>
<
h2
style
=
"margin-top: 100px; "
>
{{
__
(
'Criar uma nova área'
)
}}
</
h2
>
</
div
>
</
div
>
<
div
class
=
"row"
>
<
form
method
=
"POST"
action
=
"{{ route('area.salvar', ['id' =>
$grandeAreaId
])}}"
>
@
csrf
<
div
class
=
"col-sm-12"
>
<
label
for
=
"nome"
class
=
"col-form-label"
>
{{
__
(
'Nome'
)
}}
</
label
>
<
input
id
=
"nome"
type
=
"text"
class
=
"form-control @error('nome') is-invalid @enderror"
name
=
"nome"
value
=
"{{ old('nome') }}"
required
autocomplete
=
"nome"
autofocus
>
@
error
(
'nome'
)
<
span
class
=
"invalid-feedback"
role
=
"alert"
>
<
strong
>
{{
$message
}}
</
strong
>
</
span
>
@
enderror
<
button
type
=
"submit"
class
=
"btn btn-primary"
style
=
"position:relative;top:100px;"
>
{{
__
(
'Salvar'
)
}}
</
button
>
</
div
>
</
form
>
</
div
>
</
div
>
@
endsection
\ No newline at end of file
resources/views/naturezas/grandeArea/detalhes.blade.php
0 → 100644
View file @
20c75a31
@
extends
(
'layouts.app'
)
@
section
(
'content'
)
<
div
class
=
"container"
>
<
div
class
=
"row"
>
@
if
(
session
(
'mensagem'
))
<
div
class
=
"col-md-12"
style
=
"margin-top: 100px;"
>
<
div
class
=
"alert alert-success"
>
<
p
>
{{
session
(
'mensagem'
)}}
</
p
>
</
div
>
</
div
>
@
endif
<
div
class
=
"col-sm-9"
>
<
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
>
</
div
>
</
div
>
<
hr
>
<
table
class
=
"table table-bordered"
>
<
thead
>
<
tr
>
<
th
scope
=
"col"
>
Nome
</
th
>
<
th
scope
=
"col"
>
Opção
</
th
>
</
tr
>
</
thead
>
<
tbody
>
@
foreach
(
$areas
as
$area
)
<
tr
>
<
td
>
<
a
href
=
"{{ route('area.show', ['id' =>
$area->id
]) }}"
class
=
"visualizarEvento"
>
{{
$area
->
nome
}}
</
a
>
</
td
>
<
td
>
<
div
class
=
"btn-group dropright dropdown-options"
>
<
a
id
=
"options"
class
=
"dropdown-toggle "
data
-
toggle
=
"dropdown"
aria
-
haspopup
=
"true"
aria
-
expanded
=
"false"
>
</
a
>
<
div
class
=
"dropdown-menu"
>
<
a
href
=
"{{ route('area.show', ['id' =>
$area->id
]) }}"
class
=
"dropdown-item"
>
<
img
src
=
"
{
{asset('img/icons/eye-regular.svg')}
}
"
class
=
"icon-card"
alt
=
""
>
Detalhes
</
a
>
<
a
href
=
"{{ route('area.editar', ['id' =>
$area->id
]) }}"
class
=
"dropdown-item"
>
<
img
src
=
"
{
{asset('img/icons/edit-regular.svg')}
}
"
class
=
"icon-card"
alt
=
""
>
Editar
</
a
>
<
form
method
=
"POST"
action
=
"{{ route('area.deletar', ['id' =>
$area->id
]) }}"
>
{{
csrf_field
()
}}
<
button
type
=
"submit"
class
=
"dropdown-item"
>
<
img
src
=
"
{
{asset('img/icons/trash-alt-regular.svg')}
}
"
class
=
"icon-card"
alt
=
""
>
Deletar
</
button
>
</
form
>
</
div
>
</
div
>
</
td
>
</
tr
>
@
endforeach
</
tbody
>
</
table
>
</
div
>
@
endsection
\ No newline at end of file
resources/views/naturezas/grandeArea/editar_grande_area.blade.php
View file @
20c75a31
...
...
@@ -5,7 +5,7 @@
<
div
class
=
"container"
>
<
div
class
=
"row"
>
<
div
class
=
"col-sm-12"
>
<
h2
style
=
"margin-top: 100px; "
>
{{
__
(
'Editar uma
Grande
área'
)
}}
</
h2
>
<
h2
style
=
"margin-top: 100px; "
>
{{
__
(
'Editar uma área'
)
}}
</
h2
>
</
div
>
</
div
>
<
div
class
=
"row"
>
...
...
@@ -21,7 +21,7 @@
</
span
>
@
enderror
<
button
href
=
"
{
{route('evento.criar')}
}
"
class
=
"btn btn-primary"
style
=
"position:relative;top:100px;"
>
{{
__
(
'Salvar'
)
}}
</
button
>
<
button
type
=
"submit
"
class
=
"btn btn-primary"
style
=
"position:relative;top:100px;"
>
{{
__
(
'Salvar'
)
}}
</
button
>
</
div
>
</
form
>
</
div
>
...
...
resources/views/naturezas/grandeArea/index.blade.php
View file @
20c75a31
...
...
@@ -12,10 +12,10 @@
</
div
>
@
endif
<
div
class
=
"col-sm-9"
>
<
h2
style
=
"margin-top: 100px; "
>
{{
__
(
'
Grandes
Áreas'
)
}}
</
h2
>
<
h2
style
=
"margin-top: 100px; "
>
{{
__
(
'Á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;"
>
{{
__
(
'Criar
á
rea'
)
}}
</
a
>
</
div
>
</
div
>
...
...
@@ -31,15 +31,20 @@
@
foreach
(
$grandesAreas
as
$grandeArea
)
<
tr
>
<
td
>
<
a
href
=
""
class
=
"visualizarEvento"
>
{{
--
<
a
href
=
"
{{ route('grandearea.show', ['id' =>
$grandeArea->id
]) }}
"
class
=
"visualizarEvento"
>
{{
$grandeArea
->
nome
}}
</
a
>
</
a
>
--
}}
{{
$grandeArea
->
nome
}}
</
td
>
<
td
>
<
div
class
=
"btn-group dropright dropdown-options"
>
<
a
id
=
"options"
class
=
"dropdown-toggle "
data
-
toggle
=
"dropdown"
aria
-
haspopup
=
"true"
aria
-
expanded
=
"false"
>
</
a
>
<
div
class
=
"dropdown-menu"
>
{{
--
<
a
href
=
"{{ route('grandearea.show', ['id' =>
$grandeArea->id
]) }}"
class
=
"dropdown-item"
>
<
img
src
=
"
{
{asset('img/icons/eye-regular.svg')}
}
"
class
=
"icon-card"
alt
=
""
>
Detalhes
</
a
>
--
}}
<
a
href
=
"{{ route('grandearea.editar', ['id' =>
$grandeArea->id
]) }}"
class
=
"dropdown-item"
>
<
img
src
=
"
{
{asset('img/icons/edit-regular.svg')}
}
"
class
=
"icon-card"
alt
=
""
>
Editar
...
...
resources/views/naturezas/grandeArea/nova_grande_area.blade.php
View file @
20c75a31
...
...
@@ -5,7 +5,7 @@
<
div
class
=
"container"
>
<
div
class
=
"row"
>
<
div
class
=
"col-sm-12"
>
<
h2
style
=
"margin-top: 100px; "
>
{{
__
(
'Criar uma nova
Grande Á
rea'
)
}}
</
h2
>
<
h2
style
=
"margin-top: 100px; "
>
{{
__
(
'Criar uma nova
á
rea'
)
}}
</
h2
>
</
div
>
</
div
>
<
div
class
=
"row"
>
...
...
@@ -21,7 +21,7 @@
</
span
>
@
enderror
<
button
href
=
"
{
{route('evento.criar')}
}
"
class
=
"btn btn-primary"
style
=
"position:relative;top:100px;"
>
{{
__
(
'Salvar'
)
}}
</
button
>
<
button
type
=
"submit
"
class
=
"btn btn-primary"
style
=
"position:relative;top:100px;"
>
{{
__
(
'Salvar'
)
}}
</
button
>
</
div
>
</
form
>
</
div
>
...
...
resources/views/naturezas/index.blade.php
View file @
20c75a31
...
...
@@ -19,7 +19,7 @@
</
div
>
<
div
class
=
"col-sm-4 d-flex justify-content-center"
>
<
a
href
=
"
#
"
style
=
"text-decoration:none; color: inherit;"
>
<
a
href
=
"
{{ route('area.index') }}
"
style
=
"text-decoration:none; color: inherit;"
>
<
div
class
=
"card text-center "
style
=
"border-radius: 30px; width: 18rem;"
>
<
div
class
=
"card-body d-flex justify-content-center"
>
<
h2
style
=
"padding-top:15px"
>
Area
</
h2
>
...
...
@@ -28,7 +28,7 @@
</
a
>
</
div
>
<
div
class
=
"col-sm-4 d-flex justify-content-center"
>
<
a
href
=
"
#
"
style
=
"text-decoration:none; color: inherit;"
>
<
a
href
=
"
{{ route('subarea.index') }}
"
style
=
"text-decoration:none; color: inherit;"
>
<
div
class
=
"card text-center "
style
=
"border-radius: 30px; width: 18rem;"
>
<
div
class
=
"card-body d-flex justify-content-center"
>
<
h2
style
=
"padding-top:15px"
>
Subárea
</
h2
>
...
...
resources/views/naturezas/subArea/editar_subarea.blade.php
0 → 100644
View file @
20c75a31
@
extends
(
'layouts.app'
)
@
section
(
'content'
)
<
div
class
=
"container"
>
<
div
class
=
"row"
>
<
div
class
=
"col-sm-12"
>
<
h2
style
=
"margin-top: 100px; "
>
{{
__
(
'Editar uma subárea'
)
}}
</
h2
>
</
div
>
</
div
>
<
div
class
=
"row"
>
<
form
method
=
"POST"
action
=
"{{ route('subarea.atualizar', ['id' =>
$subarea->id
])}}"
>
@
csrf
<
div
class
=
"col-sm-12"
>
<
label
for
=
"nome"
class
=
"col-form-label"
>
{{
__
(
'Nome'
)
}}
</
label
>
<
input
id
=
"nome"
type
=
"text"
class
=
"form-control @error('nome') is-invalid @enderror"
name
=
"nome"
value
=
"{{
$subarea->nome
}}"
required
autocomplete
=
"nome"
autofocus
>
@
error
(
'nome'
)
<
span
class
=
"invalid-feedback"
role
=
"alert"
>
<
strong
>
{{
$message
}}
</
strong
>
</
span
>
@
enderror
<
button
type
=
"submit"
class
=
"btn btn-primary"
style
=
"position:relative;top:100px;"
>
{{
__
(
'Salvar'
)
}}
</
button
>
</
div
>
</
form
>
</
div
>
</
div
>
@
endsection
\ No newline at end of file
resources/views/naturezas/subArea/index.blade.php
View file @
20c75a31
...
...
@@ -2,8 +2,58 @@
@
section
(
'content'
)
<
div
class
=
"container"
>
<
div
class
=
"container"
>
<
div
class
=
"row"
>
@
if
(
session
(
'mensagem'
))
<
div
class
=
"col-md-12"
style
=
"margin-top: 100px;"
>
<
div
class
=
"alert alert-success"
>
<
p
>
{{
session
(
'mensagem'
)}}
</
p
>
</
div
>
</
div
>
@
endif
<
div
class
=
"col-sm-9"
>
<
h2
style
=
"margin-top: 100px; "
>
{{
__
(
'Subáreas'
)
}}
</
h2
>
</
div
>
</
div
>
<
hr
>
<
table
class
=
"table table-bordered"
>
<
thead
>
<
tr
>
<
th
scope
=
"col"
>
Nome
</
th
>
<
th
scope
=
"col"
>
Opção
</
th
>
</
tr
>
</
thead
>
<
tbody
>
@
foreach
(
$subAreas
as
$subArea
)
<
tr
>
<
td
>
{{
$subArea
->
nome
}}
</
td
>
<
td
>
<
div
class
=
"btn-group dropright dropdown-options"
>
<
a
id
=
"options"
class
=
"dropdown-toggle "
data
-
toggle
=
"dropdown"
aria
-
haspopup
=
"true"
aria
-
expanded
=
"false"
>
</
a
>
<
div
class
=
"dropdown-menu"
>
<
a
href
=
"{{ route('subarea.editar', ['id' =>
$subArea->id
]) }}"
class
=
"dropdown-item"
>
<
img
src
=
"
{
{asset('img/icons/edit-regular.svg')}
}
"
class
=
"icon-card"
alt
=
""
>
Editar
</
a
>
<
form
method
=
"POST"
action
=
"{{ route('subarea.deletar', ['id' =>
$subArea->id
]) }}"
>
{{
csrf_field
()
}}
<
button
type
=
"submit"
class
=
"dropdown-item"
>
<
img
src
=
"
{
{asset('img/icons/trash-alt-regular.svg')}
}
"
class
=
"icon-card"
alt
=
""
>
Deletar
</
button
>
</
form
>
</
div
>
</
div
>
</
td
>
</
tr
>
@
endforeach
</
tbody
>
</
table
>
</
div
>
@
endsection
\ No newline at end of file
resources/views/naturezas/subArea/nova_subarea.blade.php
0 → 100644
View file @
20c75a31
@
extends
(
'layouts.app'
)
@
section
(
'content'
)
<
div
class
=
"container"
>
<
div
class
=
"row"
>
<
div
class
=
"col-sm-12"
>
<
h2
style
=
"margin-top: 100px; "
>
{{
__
(
'Criar uma nova subárea'
)
}}
</
h2
>
</
div
>
</
div
>
<
div
class
=
"row"
>
<
form
method
=
"POST"
action
=
"{{ route('subarea.salvar', ['id' =>
$areaId
])}}"
>
@
csrf
<
div
class
=
"col-sm-12"
>
<
label
for
=
"nome"
class
=
"col-form-label"
>
{{
__
(
'Nome'
)
}}
</
label
>
<
input
id
=
"nome"
type
=
"text"
class
=
"form-control @error('nome') is-invalid @enderror"
name
=
"nome"
value
=
"{{ old('nome') }}"
required
autocomplete
=
"nome"
autofocus
>
@
error
(
'nome'
)
<
span
class
=
"invalid-feedback"
role
=
"alert"
>
<
strong
>
{{
$message
}}
</
strong
>
</
span
>
@
enderror
<
button
type
=
"submit"
class
=
"btn btn-primary"
style
=
"position:relative;top:100px;"
>
{{
__
(
'Salvar'
)
}}
</
button
>
</
div
>
</
form
>
</
div
>
</
div
>
@
endsection
\ No newline at end of file
routes/web.php
View file @
20c75a31
...
...
@@ -53,13 +53,31 @@ Route::post('adminResp/atribuir', 'AdministradorResponsavelController@atribuirPe
Route
::
post
(
'adminResp/verPermissao'
,
'AdministradorResponsavelController@verPermissao'
)
->
name
(
'adminResp.verPermissao'
);
//Rotas das naturezas
//Rotas das grandes areas
Route
::
get
(
'/naturezas'
,
'AdministradorController@naturezas'
)
->
middleware
(
'checkAdministrador'
)
->
name
(
'admin.naturezas'
);
Route
::
get
(
'/naturezas/grande-area'
,
'GrandeAreaController@index'
)
->
middleware
(
'checkAdministrador'
)
->
name
(
'grandearea.index'
);
Route
::
get
(
'/naturezas/grande-area/nova'
,
'GrandeAreaController@create'
)
->
middleware
(
'checkAdministrador'
)
->
name
(
'grandearea.criar'
);
Route
::
post
(
'/naturezas/grande-area/salvar'
,
'GrandeAreaController@store'
)
->
middleware
(
'checkAdministrador'
)
->
name
(
'grandearea.salvar'
);
Route
::
get
(
'/naturezas/grande-area/detalhes/{id}'
,
'GrandeAreaController@show'
)
->
middleware
(
'checkAdministrador'
)
->
name
(
'grandearea.show'
);
Route
::
get
(
'/naturezas/grande-area/editar/{id}'
,
'GrandeAreaController@edit'
)
->
middleware
(
'checkAdministrador'
)
->
name
(
'grandearea.editar'
);
Route
::
post
(
'/naturezas/grande-area/atualizar/{id}'
,
'GrandeAreaController@update'
)
->
middleware
(
'checkAdministrador'
)
->
name
(
'grandearea.atualizar'
);
Route
::
post
(
'/naturezas/grande-area/excluir/{id}'
,
'GrandeAreaController@destroy'
)
->
middleware
(
'checkAdministrador'
)
->
name
(
'grandearea.deletar'
);
//Rotas das areas, id's de nova e salvar são os ids da grande área a qual a nova área pertence
Route
::
get
(
'/naturezas/areas'
,
'AreaController@index'
)
->
middleware
(
'checkAdministrador'
)
->
name
(
'area.index'
);
Route
::
get
(
'/naturezas/{id}/area/nova'
,
'AreaController@create'
)
->
middleware
(
'checkAdministrador'
)
->
name
(
'area.criar'
);
Route
::
post
(
'/naturezas/{id}/area/salvar'
,
'AreaController@store'
)
->
middleware
(
'checkAdministrador'
)
->
name
(
'area.salvar'
);
Route
::
get
(
'/naturezas/area/detalhes/{id}'
,
'AreaController@show'
)
->
middleware
(
'checkAdministrador'
)
->
name
(
'area.show'
);
Route
::
get
(
'/naturezas/area/editar/{id}'
,
'AreaController@edit'
)
->
middleware
(
'checkAdministrador'
)
->
name
(
'area.editar'
);
Route
::
post
(
'/naturezas/area/atualizar/{id}'
,
'AreaController@update'
)
->
middleware
(
'checkAdministrador'
)
->
name
(
'area.atualizar'
);
Route
::
post
(
'/naturezas/area/excluir/{id}'
,
'AreaController@destroy'
)
->
middleware
(
'checkAdministrador'
)
->
name
(
'area.deletar'
);
//Rotas das subareas, id's de nova e salvar são os ids da área a qual a nova subárea pertence
Route
::
get
(
'/naturezas/subareas'
,
'SubAreaController@index'
)
->
middleware
(
'checkAdministrador'
)
->
name
(
'subarea.index'
);
Route
::
get
(
'/naturezas/{id}/subarea/nova'
,
'SubAreaController@create'
)
->
middleware
(
'checkAdministrador'
)
->
name
(
'subarea.criar'
);
Route
::
post
(
'/naturezas/{id}/subarea/salvar'
,
'SubAreaController@store'
)
->
middleware
(
'checkAdministrador'
)
->
name
(
'subarea.salvar'
);
Route
::
get
(
'/naturezas/subarea/detalhes/{id}'
,
'SubAreaController@show'
)
->
middleware
(
'checkAdministrador'
)
->
name
(
'subarea.show'
);
Route
::
get
(
'/naturezas/subarea/editar/{id}'
,
'SubAreaController@edit'
)
->
middleware
(
'checkAdministrador'
)
->
name
(
'subarea.editar'
);
Route
::
post
(
'/naturezas/subarea/atualizar/{id}'
,
'SubAreaController@update'
)
->
middleware
(
'checkAdministrador'
)
->
name
(
'subarea.atualizar'
);
Route
::
post
(
'/naturezas/subarea/excluir/{id}'
,
'SubAreaController@destroy'
)
->
middleware
(
'checkAdministrador'
)
->
name
(
'subarea.deletar'
);
// Rotas Coordenador
...
...
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