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
3a3fbf80
Commit
3a3fbf80
authored
May 12, 2021
by
Carlos André
Browse files
crud função participante
parent
015d3c6b
Changes
11
Hide whitespace changes
Inline
Side-by-side
app/FuncaoParticipantes.php
View file @
3a3fbf80
...
...
@@ -6,5 +6,7 @@ use Illuminate\Database\Eloquent\Model;
class
FuncaoParticipantes
extends
Model
{
//
public
function
participantes
()
{
return
$this
->
hasMany
(
"\App\Participante"
,
'funcao_participante_id'
);
}
}
app/Http/Controllers/AdministradorController.php
View file @
3a3fbf80
...
...
@@ -29,7 +29,8 @@ class AdministradorController extends Controller
}
public
function
naturezas
(){
$naturezas
=
Natureza
::
orderBy
(
'nome'
)
->
get
();
return
view
(
'naturezas.index'
)
->
with
([
'naturezas'
=>
$naturezas
]);
$funcoesParticipante
=
FuncaoParticipantes
::
orderBy
(
'nome'
)
->
get
();
return
view
(
'naturezas.index'
)
->
with
([
'naturezas'
=>
$naturezas
,
'funcoes'
=>
$funcoesParticipante
]);
}
public
function
usuarios
(){
$users
=
User
::
orderBy
(
'name'
)
->
get
();
...
...
app/Http/Controllers/ParticipanteController.php
View file @
3a3fbf80
...
...
@@ -6,6 +6,7 @@ use Illuminate\Http\Request;
use
App\Evento
;
use
App\Trabalho
;
use
App\Participante
;
use
App\FuncaoParticipantes
;
use
Auth
;
class
ParticipanteController
extends
Controller
...
...
@@ -33,4 +34,45 @@ class ParticipanteController extends Controller
return
view
(
'participante.projetos'
)
->
with
([
'edital'
=>
$edital
,
'projetos'
=>
$projetos
]);
}
public
function
storeFuncao
(
Request
$request
)
{
$validated
=
$request
->
validate
([
'newFuncao'
=>
'required'
,
'nome_da_função'
=>
'required'
,
]);
$funcao
=
new
FuncaoParticipantes
();
$funcao
->
nome
=
$request
->
input
(
'nome_da_função'
);
$funcao
->
save
();
return
redirect
()
->
back
()
->
with
([
'mensagem'
=>
'Função de participante cadastrada com sucesso!'
]);
}
public
function
updateFuncao
(
Request
$request
,
$id
)
{
$validated
=
$request
->
validate
([
'editFuncao'
=>
'required'
,
'nome_da_função'
.
$id
=>
'required'
,
]);
$funcao
=
FuncaoParticipantes
::
find
(
$id
);
if
(
$funcao
->
participantes
->
count
()
>
0
)
{
return
redirect
()
->
back
()
->
with
([
'error'
=>
'Essa função não pode ser editada pois participantes estão vinculados a ela!'
]);
}
$funcao
->
nome
=
$request
->
input
(
'nome_da_função'
.
$id
);
$funcao
->
update
();
return
redirect
()
->
back
()
->
with
([
'mensagem'
=>
'Função de participante salva com sucesso!'
]);
}
public
function
destroyFuncao
(
$id
)
{
$funcao
=
FuncaoParticipantes
::
find
(
$id
);
if
(
$funcao
->
participantes
->
count
()
>
0
)
{
return
redirect
()
->
back
()
->
with
([
'error'
=>
'Essa função não pode ser excluída pois participantes estão vinculados a ela!'
]);
}
$funcao
->
delete
();
return
redirect
()
->
back
()
->
with
([
'mensagem'
=>
'Função de participante deletada com sucesso!'
]);
}
}
resources/views/administrador/usersAdmin.blade.php
View file @
3a3fbf80
...
...
@@ -2,26 +2,31 @@
@
section
(
'content'
)
<
div
class
=
"container"
style
=
"margin-top:
10
0px;"
>
<
div
class
=
"container"
style
=
"margin-top:
3
0px;"
>
<
div
class
=
"container"
>
<
div
class
=
"row"
>
<
div
class
=
"col-sm-10"
>
<
h3
>
Usuários
</
h3
>
</
div
>
<
div
class
=
"col-sm-2"
>
<
a
href
=
"
{
{route('admin.user.create')}
}
"
class
=
"btn btn-info"
style
=
"float: right;"
>
{{
__
(
'Criar usuário'
)
}}
</
a
>
</
div
>
</
div
>
<
div
class
=
"row"
>
@
if
(
session
(
'mensagem'
))
<
div
class
=
"col-md-12"
style
=
"margin-top:
10
0px;"
>
<
div
class
=
"col-md-12"
style
=
"margin-top:
3
0px;"
>
<
div
class
=
"alert alert-success"
>
<
p
>
{{
session
(
'mensagem'
)}}
</
p
>
</
div
>
</
div
>
@
endif
</
div
>
<
div
class
=
"row"
>
<
div
class
=
"col-sm-1"
>
<
a
href
=
"{{ route('admin.index') }}"
class
=
"btn btn-secondary"
>
Voltar
</
a
>
</
div
>
<
div
class
=
"col-sm-9"
style
=
"text-align: center;"
>
<
h3
class
=
"titulo-table"
>
Usuários
</
h3
>
</
div
>
<
div
class
=
"col-sm-2"
>
<
a
href
=
"
{
{route('admin.user.create')}
}
"
class
=
"btn btn-info"
style
=
"float: right;"
>
{{
__
(
'Criar usuário'
)
}}
</
a
>
</
div
>
</
div
>
</
div
>
<
hr
>
<
table
class
=
"table table-bordered"
>
...
...
@@ -49,14 +54,14 @@
<
img
src
=
"
{
{asset('img/icons/ellipsis-v-solid.svg')}
}
"
style
=
"width:8px"
>
</
a
>
<
div
class
=
"dropdown-menu"
>
<
a
href
=
"{{route('admin.user.edit',
$user->id
)}}"
class
=
"dropdown-item"
>
<
img
src
=
"
{
{asset('img/icons/edit-regular.svg')}
}
"
class
=
"icon-card"
alt
=
""
>
<
a
href
=
"{{route('admin.user.edit',
$user->id
)}}"
class
=
"dropdown-item text-center"
>
Editar
</
a
>
<
hr
class
=
"dropdown-hr"
>
<
form
method
=
"POST"
action
=
"{{route('admin.user.destroy',
$user->id
)}}"
>
{{
csrf_field
()
}}
<
button
type
=
"submit"
class
=
"dropdown-item"
>
<
img
src
=
"
{
{asset('img/icons/
trash-alt-regular.svg')}
}
"
class
=
"icon-card
"
alt
=
""
>
<
button
type
=
"submit"
class
=
"dropdown-item
dropdown-item-delete text-center
"
>
<
img
src
=
"
{
{asset('img/icons/
logo_lixeira.png')}
}
"
alt
=
""
>
Deletar
</
button
>
...
...
@@ -79,14 +84,14 @@
<
img
src
=
"
{
{asset('img/icons/ellipsis-v-solid.svg')}
}
"
style
=
"width:8px"
>
</
a
>
<
div
class
=
"dropdown-menu"
>
<
a
href
=
"{{route('admin.user.edit',
$user->id
)}}"
class
=
"dropdown-item"
>
<
img
src
=
"
{
{asset('img/icons/edit-regular.svg')}
}
"
class
=
"icon-card"
alt
=
""
>
<
a
href
=
"{{route('admin.user.edit',
$user->id
)}}"
class
=
"dropdown-item text-center"
>
Editar
</
a
>
<
hr
class
=
"dropdown-hr"
>
<
form
method
=
"POST"
action
=
"{{route('admin.user.destroy',
$user->id
)}}"
>
{{
csrf_field
()
}}
<
button
type
=
"submit"
class
=
"dropdown-item"
>
<
img
src
=
"
{
{asset('img/icons/
trash-alt-regular.svg')}
}
"
class
=
"icon-card
"
alt
=
""
>
<
button
type
=
"submit"
class
=
"dropdown-item
dropdown-item-delete text-center
"
>
<
img
src
=
"
{
{asset('img/icons/
logo_lixeira.png')}
}
"
alt
=
""
>
Deletar
</
button
>
...
...
resources/views/naturezas/area/detalhes.blade.php
View file @
3a3fbf80
...
...
@@ -50,6 +50,7 @@
<
a
href
=
"{{ route('subarea.editar', ['id' =>
$subArea->id
]) }}"
class
=
"dropdown-item text-center"
>
Editar
</
a
>
<
hr
class
=
"dropdown-hr"
>
<
form
method
=
"POST"
action
=
"{{ route('subarea.deletar', ['id' =>
$subArea->id
]) }}"
>
{{
csrf_field
()
}}
<
button
type
=
"submit"
class
=
"dropdown-item dropdown-item-delete text-center"
>
...
...
resources/views/naturezas/area/index.blade.php
View file @
3a3fbf80
...
...
@@ -37,10 +37,12 @@
<
img
src
=
"
{
{asset('img/icons/eye-regular.svg')}
}
"
class
=
"icon-card"
alt
=
""
>
Detalhes
</
a
>
<
hr
class
=
"dropdown-hr"
>
<
a
href
=
"{{ route('area.editar', ['id' =>
$area->id
]) }}"
class
=
"dropdown-item text-center"
>
<
img
src
=
"
{
{asset('img/icons/edit-regular.svg')}
}
"
class
=
"icon-card"
alt
=
""
>
Editar
</
a
>
<
hr
class
=
"dropdown-hr"
>
<
form
method
=
"POST"
action
=
"{{ route('area.deletar', ['id' =>
$area->id
]) }}"
>
{{
csrf_field
()
}}
<
button
type
=
"submit"
class
=
"dropdown-item dropdown-item-delete text-center"
>
...
...
resources/views/naturezas/grandeArea/detalhes.blade.php
View file @
3a3fbf80
...
...
@@ -50,9 +50,11 @@
<
a
href
=
"{{ route('area.show', ['id' =>
$area->id
]) }}"
class
=
"dropdown-item text-center"
>
Detalhes
</
a
>
<
hr
class
=
"dropdown-hr"
>
<
a
href
=
"{{ route('area.editar', ['id' =>
$area->id
]) }}"
class
=
"dropdown-item text-center"
>
Editar
</
a
>
<
hr
class
=
"dropdown-hr"
>
<
form
method
=
"POST"
action
=
"{{ route('area.deletar', ['id' =>
$area->id
]) }}"
>
{{
csrf_field
()
}}
<
button
type
=
"submit"
class
=
"dropdown-item dropdown-item-delete text-center"
>
...
...
resources/views/naturezas/grandeArea/index.blade.php
View file @
3a3fbf80
...
...
@@ -50,9 +50,11 @@
<
a
href
=
"{{ route('grandearea.show', ['id' =>
$grandeArea->id
]) }}"
class
=
"dropdown-item text-center"
>
Detalhes
</
a
>
<
hr
class
=
"dropdown-hr"
>
<
a
href
=
"{{ route('grandearea.editar', ['id' =>
$grandeArea->id
]) }}"
class
=
"dropdown-item text-center"
>
Editar
</
a
>
<
hr
class
=
"dropdown-hr"
>
<
form
method
=
"POST"
action
=
"{{ route('grandearea.deletar', ['id' =>
$grandeArea->id
]) }}"
>
{{
csrf_field
()
}}
<
button
type
=
"submit"
class
=
"dropdown-item dropdown-item-delete text-center"
>
...
...
resources/views/naturezas/index.blade.php
View file @
3a3fbf80
...
...
@@ -31,6 +31,35 @@
</
div
>
</
div
>
</
div
>
<
div
class
=
"modal fade"
id
=
"modalNewFuncao"
tabindex
=
"-1"
role
=
"dialog"
aria
-
labelledby
=
"modalNewFuncaoTitle"
aria
-
hidden
=
"true"
>
<
div
class
=
"modal-dialog modal-dialog-centered"
role
=
"document"
>
<
div
class
=
"modal-content modal-submeta"
>
<
div
class
=
"modal-header modal-header-submeta"
>
<
h5
class
=
"modal-title titulo-table"
id
=
"modalNewFuncaoTitle"
>
{{
__
(
'Nova função de participante'
)}}
</
h5
>
<
button
type
=
"button"
class
=
"close"
data
-
dismiss
=
"modal"
aria
-
label
=
"Close"
>
<
span
aria
-
hidden
=
"true"
>&
times
;
</
span
>
</
button
>
</
div
>
<
div
class
=
"modal-body"
>
<
form
id
=
"formNewFuncao"
method
=
"POST"
action
=
"{{ route('funcao_participante.store') }}"
class
=
"labels-blue"
>
@
csrf
<
label
for
=
""
>
Nome
da
função
do
participante
<
span
style
=
"color: red;"
>*</
span
></
label
>
<
input
name
=
"nome_da_função"
type
=
"text"
required
class
=
"form-control @error('nome_da_função') is-invalid @enderror"
placeholder
=
"Nome da função do participante"
>
<
input
type
=
"hidden"
name
=
"newFuncao"
value
=
"0"
>
@
error
(
'nome_da_função'
)
<
span
class
=
"invalid-feedback"
role
=
"alert"
>
<
strong
>
{{
$message
}}
</
strong
>
</
span
>
@
enderror
</
form
>
</
div
>
<
div
class
=
"modal-footer"
>
<
button
type
=
"submit"
form
=
"formNewFuncao"
class
=
"btn btn-info"
style
=
"width: 100%;"
>
{{
__
(
'Salvar'
)}}
</
button
>
</
div
>
</
div
>
</
div
>
</
div
>
<
div
class
=
"row"
>
@
if
(
session
(
'mensagem'
))
<
div
class
=
"col-md-12"
style
=
"margin-top: 30px;"
>
...
...
@@ -39,6 +68,13 @@
</
div
>
</
div
>
@
endif
@
if
(
session
(
'error'
))
<
div
class
=
"col-md-12"
style
=
"margin-top: 30px;"
>
<
div
class
=
"alert alert-danger"
>
<
p
>
{{
session
(
'mensagem'
)}}
</
p
>
</
div
>
</
div
>
@
endif
</
div
>
<
div
class
=
"row"
style
=
"margin-top: 30px;"
>
<
div
class
=
"col-md-1"
>
...
...
@@ -55,97 +91,208 @@
</
div
>
</
div
>
<
hr
>
<
table
class
=
"table table-bordered"
>
<
thead
>
<
tr
>
<
th
scope
=
"col"
>
Nome
</
th
>
<
th
scope
=
"col"
>
Data
de
criação
</
th
>
<
th
scope
=
"col"
>
Opção
</
th
>
</
tr
>
</
thead
>
<
tbody
>
@
foreach
(
$naturezas
as
$natureza
)
<!--
Modal
Editar
-->
<
div
class
=
"modal fade"
id
=
"modalEditCenter
{
{$natureza->id}
}
"
tabindex
=
"-1"
role
=
"dialog"
aria
-
labelledby
=
"modalCenterTitle"
aria
-
hidden
=
"true"
>
<
div
class
=
"modal-dialog modal-dialog-centered"
role
=
"document"
>
<
div
class
=
"modal-content"
>
<
div
class
=
"modal-header"
>
<
h5
class
=
"modal-title"
id
=
"exampleModalLongTitle"
>
{{
__
(
'Editar natureza'
)}}
</
h5
>
<
button
type
=
"button"
class
=
"close"
data
-
dismiss
=
"modal"
aria
-
label
=
"Close"
>
<
span
aria
-
hidden
=
"true"
>&
times
;
</
span
>
</
button
>
</
div
>
<
div
class
=
"modal-body"
>
<
form
id
=
"formEdit{{
$natureza->id
}}"
action
=
"{{ route('natureza.atualizar', ['id' =>
$natureza->id
]) }}"
>
@
csrf
<
input
form
=
"formEdit{{
$natureza->id
}}"
type
=
"text"
value
=
"{{
$natureza->nome
}}"
class
=
"form-control @error('nomeEditavel') is-invalid @enderror"
name
=
"nomeEditavel"
required
autocomplete
=
"nome"
autofocus
>
@
error
(
'nomeEditavel'
)
<
span
class
=
"invalid-feedback"
role
=
"alert"
>
<
strong
>
{{
$message
}}
</
strong
>
</
span
>
@
enderror
</
form
>
</
div
>
<
div
class
=
"modal-footer"
>
<
button
type
=
"button"
class
=
"btn btn-secondary"
data
-
dismiss
=
"modal"
>
{{
__
(
'Cancelar'
)}}
</
button
>
<
button
type
=
"button"
onclick
=
"submeterFormEdit('{{
$natureza->id
}}')"
class
=
"btn btn-primary"
>
{{
__
(
'Salvar'
)}}
</
button
>
</
div
>
</
div
>
</
div
>
</
div
>
<!--
Modal
Excluir
-->
<
div
class
=
"modal fade"
id
=
"modalDelCenter
{
{$natureza->id}
}
"
tabindex
=
"-1"
role
=
"dialog"
aria
-
labelledby
=
"modalCenterTitle"
aria
-
hidden
=
"true"
>
<
div
class
=
"modal-dialog modal-dialog-centered"
role
=
"document"
>
<
div
class
=
"modal-content"
>
<
div
class
=
"modal-header"
>
<
h5
class
=
"modal-title"
id
=
"exampleModalLongTitle"
>
{{
__
(
'Deletar natureza'
)}}
</
h5
>
<
button
type
=
"button"
class
=
"close"
data
-
dismiss
=
"modal"
aria
-
label
=
"Close"
>
<
span
aria
-
hidden
=
"true"
>&
times
;
</
span
>
</
button
>
</
div
>
<
div
class
=
"modal-body"
>
{{
__
(
'Tem certeza que deseja deletar essa natureza?'
)}}
</
div
>
<
div
class
=
"modal-footer"
>
<
button
type
=
"button"
class
=
"btn btn-secondary"
data
-
dismiss
=
"modal"
>
{{
__
(
'Não'
)}}
</
button
>
<
a
href
=
"{{ route('natureza.deletar', ['id' =>
$natureza->id
]) }}"
type
=
"button"
onclick
=
"submeterFormDel('{{
$natureza->id
}}')"
class
=
"btn btn-primary"
>
{{
__
(
'Sim'
)}}
</
a
>
</
div
>
</
div
>
</
div
>
</
div
>
<
tr
>
<
td
>
{{
$natureza
->
nome
}}
</
td
>
<
td
>
{{
$natureza
->
creat_at
}}
</
td
>
<
td
>
@
if
(
is_null
(
$natureza
->
projetos
->
first
()))
<
div
class
=
"btn-group dropright dropdown-options"
>
<
a
id
=
"options"
class
=
"dropdown-toggle "
data
-
toggle
=
"dropdown"
aria
-
haspopup
=
"true"
aria
-
expanded
=
"false"
>
<
img
src
=
"
{
{asset('img/icons/ellipsis-v-solid.svg')}
}
"
style
=
"width:8px"
>
</
a
>
<
div
class
=
"dropdown-menu"
>
<
a
data
-
toggle
=
"modal"
data
-
target
=
"#modalEditCenter
{
{$natureza->id}
}
"
class
=
"dropdown-item text-center"
style
=
"color: rgb(0, 140, 255);"
>
{{
__
(
'Editar'
)}}
</
a
>
<
hr
class
=
"dropdown-hr"
>
<
a
data
-
toggle
=
"modal"
data
-
target
=
"#modalDelCenter
{
{$natureza->id}
}
"
class
=
"dropdown-item dropdown-item-delete text-center"
style
=
"color: white;"
>
<
img
src
=
"
{
{asset('img/icons/logo_lixeira.png')}
}
"
alt
=
""
>
{{
__
(
'Deletar'
)}}
</
a
>
</
div
>
</
div
>
@
else
<
div
style
=
"float: right;"
>
Fixada
em
um
edital
</
div
>
@
endif
</
td
>
</
tr
>
@
endforeach
</
tbody
>
</
table
>
<
div
class
=
"row"
>
<
div
class
=
"col-md-12"
>
<
table
class
=
"table table-bordered"
>
<
thead
>
<
tr
>
<
th
scope
=
"col"
>
Nome
</
th
>
<
th
scope
=
"col"
>
Data
de
criação
</
th
>
<
th
scope
=
"col"
>
Opção
</
th
>
</
tr
>
</
thead
>
<
tbody
>
@
foreach
(
$naturezas
as
$natureza
)
<!--
Modal
Editar
-->
<
div
class
=
"modal fade"
id
=
"modalEditCenter
{
{$natureza->id}
}
"
tabindex
=
"-1"
role
=
"dialog"
aria
-
labelledby
=
"modalCenterTitle"
aria
-
hidden
=
"true"
>
<
div
class
=
"modal-dialog modal-dialog-centered"
role
=
"document"
>
<
div
class
=
"modal-content modal-submeta"
>
<
div
class
=
"modal-header modal-header-submeta"
>
<
h5
class
=
"modal-title titulo-table"
id
=
"exampleModalLongTitle"
>
{{
__
(
'Editar natureza'
)}}
</
h5
>
<
button
type
=
"button"
class
=
"close"
data
-
dismiss
=
"modal"
aria
-
label
=
"Close"
>
<
span
aria
-
hidden
=
"true"
>&
times
;
</
span
>
</
button
>
</
div
>
<
div
class
=
"modal-body labels-blue"
>
<
form
id
=
"formEdit{{
$natureza->id
}}"
action
=
"{{ route('natureza.atualizar', ['id' =>
$natureza->id
]) }}"
>
@
csrf
<
label
for
=
""
>
Nome
da
natureza
<
span
style
=
"color: red;"
>*</
span
></
label
>
<
input
form
=
"formEdit{{
$natureza->id
}}"
type
=
"text"
value
=
"{{
$natureza->nome
}}"
class
=
"form-control @error('nomeEditavel') is-invalid @enderror"
name
=
"nomeEditavel"
required
autocomplete
=
"nome"
autofocus
>
@
error
(
'nomeEditavel'
)
<
span
class
=
"invalid-feedback"
role
=
"alert"
>
<
strong
>
{{
$message
}}
</
strong
>
</
span
>
@
enderror
</
form
>
</
div
>
<
div
class
=
"modal-footer"
>
<
button
type
=
"button"
onclick
=
"submeterFormEdit('{{
$natureza->id
}}')"
class
=
"btn btn-info"
style
=
"width: 100%"
>
{{
__
(
'Salvar'
)}}
</
button
>
</
div
>
</
div
>
</
div
>
</
div
>
<!--
Modal
Excluir
-->
<
div
class
=
"modal fade"
id
=
"modalDelCenter
{
{$natureza->id}
}
"
tabindex
=
"-1"
role
=
"dialog"
aria
-
labelledby
=
"modalCenterTitle"
aria
-
hidden
=
"true"
>
<
div
class
=
"modal-dialog modal-dialog-centered"
role
=
"document"
>
<
div
class
=
"modal-content"
>
<
div
class
=
"modal-header"
>
<
h5
class
=
"modal-title"
id
=
"exampleModalLongTitle"
>
{{
__
(
'Deletar natureza'
)}}
</
h5
>
<
button
type
=
"button"
class
=
"close"
data
-
dismiss
=
"modal"
aria
-
label
=
"Close"
>
<
span
aria
-
hidden
=
"true"
>&
times
;
</
span
>
</
button
>
</
div
>
<
div
class
=
"modal-body"
>
{{
__
(
'Tem certeza que deseja deletar essa natureza?'
)}}
</
div
>
<
div
class
=
"modal-footer"
>
<
button
type
=
"button"
class
=
"btn btn-secondary"
data
-
dismiss
=
"modal"
>
{{
__
(
'Não'
)}}
</
button
>
<
a
href
=
"{{ route('natureza.deletar', ['id' =>
$natureza->id
]) }}"
type
=
"button"
onclick
=
"submeterFormDel('{{
$natureza->id
}}')"
class
=
"btn btn-danger"
>
{{
__
(
'Sim'
)}}
</
a
>
</
div
>
</
div
>
</
div
>
</
div
>
<
tr
>
<
td
>
{{
$natureza
->
nome
}}
</
td
>
<
td
>
{{
$natureza
->
creat_at
}}
</
td
>
<
td
>
@
if
(
is_null
(
$natureza
->
projetos
->
first
()))
<
div
class
=
"btn-group dropright dropdown-options"
>
<
a
id
=
"options"
class
=
"dropdown-toggle "
data
-
toggle
=
"dropdown"
aria
-
haspopup
=
"true"
aria
-
expanded
=
"false"
>
<
img
src
=
"
{
{asset('img/icons/ellipsis-v-solid.svg')}
}
"
style
=
"width:8px"
>
</
a
>
<
div
class
=
"dropdown-menu"
>
<
a
data
-
toggle
=
"modal"
data
-
target
=
"#modalEditCenter
{
{$natureza->id}
}
"
class
=
"dropdown-item text-center"
style
=
"color: rgb(0, 140, 255);"
>
{{
__
(
'Editar'
)}}
</
a
>
<
hr
class
=
"dropdown-hr"
>
<
a
data
-
toggle
=
"modal"
data
-
target
=
"#modalDelCenter
{
{$natureza->id}
}
"
class
=
"dropdown-item dropdown-item-delete text-center"
style
=
"color: white;"
>
<
img
src
=
"
{
{asset('img/icons/logo_lixeira.png')}
}
"
alt
=
""
>
{{
__
(
'Deletar'
)}}
</
a
>
</
div
>
</
div
>
@
else
<
div
style
=
"float: right;"
>
Fixada
em
um
edital
</
div
>
@
endif
</
td
>
</
tr
>
@
endforeach
</
tbody
>
</
table
>
</
div
>
</
div
>
<
div
class
=
"row"
style
=
"margin-top: 30px; margin-bottom: 30px; text-align: center;"
>
<
div
class
=
"col-md-2"
>
</
div
>
<
div
class
=
"col-md-7"
>
<
h3
class
=
"titulo-table"
>
{{
__
(
'Funções de participante'
)
}}
</
h3
>
</
div
>
<
div
class
=
"col-md-3"
>
<!--
Button
trigger
modal
-->
<
a
href
=
""
class
=
"btn btn-info"
style
=
"float: right;"
data
-
toggle
=
"modal"
data
-
target
=
"#modalNewFuncao"
>
{{
__
(
'Criar função de participante'
)
}}
</
a
>
</
div
>
</
div
>
<
div
class
=
"row"
>
<
div
class
=
"col-md-12"
>
<
table
class
=
"table table-bordered"
>
<
thead
>
<
tr
>
<
th
scope
=
"col"
>
Nome
</
th
>
<
th
scope
=
"col"
>
Data
de
criação
</
th
>
<
th
scope
=
"col"
>
Opção
</
th
>
</
tr
>
</
thead
>
<
tbody
>
@
foreach
(
$funcoes
as
$funcao
)
<!--
Modal
Editar
-->
<
div
class
=
"modal fade"
id
=
"modalEditFuncao
{
{$funcao->id}
}
"
tabindex
=
"-1"
role
=
"dialog"
aria
-
labelledby
=
"modalCenterTitle"
aria
-
hidden
=
"true"
>
<
div
class
=
"modal-dialog modal-dialog-centered"
role
=
"document"
>
<
div
class
=
"modal-content modal-submeta"
>
<
div
class
=
"modal-header modal-header-submeta"
>
<
h5
class
=
"modal-title titulo-table"
id
=
"exampleModalLongTitle"
>
{{
__
(
'Editar função participante'
)}}
</
h5
>
<
button
type
=
"button"
class
=
"close"
data
-
dismiss
=
"modal"
aria
-
label
=
"Close"
>
<
span
aria
-
hidden
=
"true"
>&
times
;
</
span
>
</
button
>
</
div
>
<
div
class
=
"modal-body labels-blue"
>
<
form
method
=
"POST"
id
=
"formEditFuncao
{
{$funcao->id}
}
"
action
=
"{{ route('funcao_participante.update', ['id' =>
$funcao->id
]) }}"
>
@
csrf
<
label
for
=
""
>
Nome
da
função
do
participante
<
span
style
=
"color: red;"
>*</
span
></
label
>
<
input
type
=
"text"
value
=
"
{
{$funcao->nome}
}
"
class
=
"form-control @error('nome_da_função'.
$funcao->id
) is-invalid @enderror"
name
=
"nome_da_função
{
{$funcao->id}
}
"
required
>
<
input
type
=
"hidden"
name
=
"editFuncao"
value
=
"
{
{$funcao->id}
}
"
>
@
error
(
'nome_da_função'
.
$funcao
->
id
)
<
span
class
=
"invalid-feedback"
role
=
"alert"
>
<
strong
>
{{
$message
}}
</
strong
>
</
span
>
@
enderror
</
form
>
</
div
>
<
div
class
=
"modal-footer"
>
<
button
type
=
"submit"
form
=
"formEditFuncao
{
{$funcao->id}
}
"
class
=
"btn btn-info"
style
=
"width: 100%;"
>
{{
__
(
'Salvar'
)}}
</
button
>
</
div
>
</
div
>
</
div
>
</
div
>
<!--
Modal
Excluir
-->
<
div
class
=
"modal fade"
id
=
"modalDelFuncao
{
{$funcao->id}
}
"
tabindex
=
"-1"
role
=
"dialog"
aria
-
labelledby
=
"modalDelFuncaoTitle"
aria
-
hidden
=
"true"
>
<
div
class
=
"modal-dialog modal-dialog-centered"
role
=
"document"
>
<
div
class
=
"modal-content"
>
<
div
class
=
"modal-header"
>
<
h5
class
=
"modal-title"
id
=
"modalDelFuncaoTitle"
>
{{
__
(
'Deletar função de participante'
)}}
</
h5
>
<
button
type
=
"button"
class
=
"close"
data
-
dismiss
=
"modal"
aria
-
label
=
"Close"
>
<
span
aria
-
hidden
=
"true"
>&
times
;
</
span
>
</
button
>
</
div
>
<
div
class
=
"modal-body"
>
Tem
certeza
que
deseja
deletar
a
função
de
{{
$funcao
->
nome
}}
?
</
div
>
<
div
class
=
"modal-footer"
>
<
button
type
=
"button"
class
=
"btn btn-secondary"
data
-
dismiss
=
"modal"
>
{{
__
(
'Não'
)}}
</
button
>
<
a
href
=
"{{ route('funcao_participante.destroy', ['id' =>
$funcao->id
]) }}"
type
=
"button"
class
=
"btn btn-danger"
>
{{
__
(
'Sim'
)}}
</
a
>
</
div
>
</
div
>
</
div
>
</
div
>
<
tr
>
<
td
>
{{
$funcao
->
nome
}}
</
td
>
<
td
>
{{
$funcao
->
creat_at
}}
</
td
>
<
td
>
@
if
(
$funcao
->
participantes
->
count
()
<=
0
)
<
div
class
=
"btn-group dropright dropdown-options"
>
<
a
id
=
"options"
class
=
"dropdown-toggle "
data
-
toggle
=
"dropdown"
aria
-
haspopup
=
"true"
aria
-
expanded
=
"false"
>
<
img
src
=
"
{
{asset('img/icons/ellipsis-v-solid.svg')}
}
"
style
=
"width:8px"
>
</
a
>
<
div
class
=
"dropdown-menu"
>
<
a
data
-
toggle
=
"modal"
data
-
target
=
"#modalEditFuncao
{
{$funcao->id}
}
"
class
=
"dropdown-item text-center"
style
=
"color: rgb(0, 140, 255);"
>
{{
__
(
'Editar'
)}}
</
a
>
<
hr
class
=
"dropdown-hr"
>
<
a
data
-
toggle
=
"modal"
data
-
target
=
"#modalDelFuncao
{
{$funcao->id}
}
"
class
=
"dropdown-item dropdown-item-delete text-center"
style
=
"color: white;"
>
<
img
src
=
"
{
{asset('img/icons/logo_lixeira.png')}
}
"
alt
=
""
>
{{
__
(
'Deletar'
)}}
</
a
>
</
div
>
</
div
>
@
else
<
div
style
=
"float: right;"
>
Fixada
em
participantes
</
div
>
@
endif
</
td
>
</
tr
>
@
endforeach
</
tbody
>
</
table
>
</
div
>
</
div
>
</
div
>
@
endsection
...
...
@@ -161,4 +308,18 @@
form
.
submit
();
}
</
script
>
@
if
(
old
(
'newFuncao'
)
!=
null
)
<
script
>
$
(
document
)
.
ready
(
function
()
{
$
(
'#modalNewFuncao'
)
.
modal
(
'show'
);
});
</
script
>
@
endif
@
if
(
old
(
'editFuncao'
)
!=
null
)
<
script
>
$
(
document
)
.
ready
(
function
()
{
$
(
'#modalEditFuncao{{old('
editFuncao
')}}'
)
.
modal
(
'show'
);
});
</
script
>
@
endif
@
endsection
\ No newline at end of file
resources/views/naturezas/subArea/index.blade.php
View file @
3a3fbf80
...
...
@@ -42,6 +42,7 @@
<
img
src
=
"
{
{asset('img/icons/edit-regular.svg')}
}
"
class
=
"icon-card"
alt
=
""
>
Editar
</
a
>
<
hr
class
=
"dropdown-hr"
>
<
form
method
=
"POST"
action
=
"{{ route('subarea.deletar', ['id' =>
$subArea->id
]) }}"
>
{{
csrf_field
()
}}
<
button
type
=
"submit"
class
=
"dropdown-item"
>
...
...
routes/web.php
View file @
3a3fbf80
...
...
@@ -196,6 +196,9 @@ Route::prefix('naturezas')->group(function(){
Route
::
post
(
'/subarea/excluir/{id}'
,
'SubAreaController@destroy'
)
->
name
(
'subarea.deletar'
)
->
middleware
(
'checkAdministrador'
);
Route
::
post
(
'/subarea/'
,
'SubAreaController@consulta'
)
->
name
(
'subarea.consulta'
);
Route
::
post
(
'/funcao-participante/store'
,
'ParticipanteController@storeFuncao'
)
->
name
(
'funcao_participante.store'
);
Route
::
post
(
'/funcao-participante/{id}/update'
,
'ParticipanteController@updateFuncao'
)
->
name
(
'funcao_participante.update'
);
Route
::
get
(
'/funcao-participante/{id}/destroy'
,
'ParticipanteController@destroyFuncao'
)
->
name
(
'funcao_participante.destroy'
);
});
//############ Evento ##############################################
...
...
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