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
b82be112
Commit
b82be112
authored
Jul 14, 2021
by
Gabriel-31415
Browse files
add separacao de editar no user admin
parent
f22ae55f
Changes
3
Show whitespace changes
Inline
Side-by-side
app/Http/Controllers/AdministradorController.php
View file @
b82be112
...
...
@@ -67,11 +67,10 @@ class AdministradorController extends Controller
public
function
showProjetos
(
Request
$request
){
$evento
=
Evento
::
where
(
'id'
,
$request
->
evento_id
)
->
first
();
$editais
=
Evento
::
with
(
'trabalhos'
)
->
get
();
$projetos
=
Trabalho
::
all
();
return
view
(
'administrador.listaProjetos'
)
->
with
([
'projetos'
=>
$projetos
,
'evento'
=>
$evento
]);
return
view
(
'administrador.listaProjetos'
,
compact
(
'projetos'
,
'evento'
,
'editais'
));
}
public
function
visualizarParecer
(
Request
$request
){
...
...
app/Http/Controllers/TrabalhoController.php
View file @
b82be112
...
...
@@ -321,15 +321,16 @@ class TrabalhoController extends Controller
public
function
show
(
$id
)
{
$projeto
=
Auth
::
user
()
->
proponentes
->
trabalhos
()
->
where
(
'id'
,
$id
)
->
first
();
if
(
Auth
::
user
()
->
tipo
==
'administrador'
){
$projeto
=
Trabalho
::
find
(
$id
);
}
if
(
!
$projeto
){
// $projeto = Auth::user()->coordenadorComissao->trabalho()->where('id', $id)->first();
//
$projeto = Auth::user()->proponentes->trabalhos()->where('id', $id)->first();
//
if(Auth::user()->tipo == 'administrador'){
//
$projeto = Trabalho::find($id);
//
}
//
if(!$projeto){
//
// $projeto = Auth::user()->coordenadorComissao->trabalho()->where('id', $id)->first();
return
back
()
->
withErrors
([
'Proposta não encontrada!'
]);
}
// return back()->withErrors(['Proposta não encontrada!']);
// }
$projeto
=
Trabalho
::
find
(
$id
);
$edital
=
Evento
::
find
(
$projeto
->
evento_id
);
$grandeAreas
=
GrandeArea
::
all
();
$areas
=
Area
::
all
();
...
...
resources/views/administrador/listaProjetos.blade.php
View file @
b82be112
...
...
@@ -19,7 +19,23 @@
</
div
>
@
endif
<
div
class
=
"row"
>
<
div
class
=
"col-md-12"
>
@
foreach
(
$editais
as
$edital
)
<
div
class
=
"accordion"
id
=
"accordionExample"
>
<
div
class
=
"card"
>
<
div
class
=
"card-header"
id
=
"headingOne"
>
<
h2
class
=
"mb-0"
>
<
button
class
=
"btn btn-link btn-block text-left"
type
=
"button"
data
-
toggle
=
"collapse"
data
-
target
=
"#collapse{{
$edital->id
}}"
aria
-
expanded
=
"true"
aria
-
controls
=
"collapse{{
$edital->id
}}"
>
{{
$edital
->
nome
}}
</
button
>
</
h2
>
</
div
>
<
div
id
=
"collapse{{
$edital->id
}}"
class
=
"collapse "
aria
-
labelledby
=
"headingOne"
data
-
parent
=
"#accordionExample"
>
<
div
class
=
"card-body"
>
<
table
class
=
"table table-bordered"
>
<
thead
>
<
tr
>
...
...
@@ -32,7 +48,8 @@
</
tr
>
</
thead
>
<
tbody
id
=
"eventos"
>
@
foreach
(
$projetos
as
$projeto
)
@
foreach
(
$edital
->
trabalhos
as
$projeto
)
<
tr
>
<
td
>
<
a
href
=
"{{ route('trabalho.show',['id'=>
$projeto->id
]) }}"
class
=
"visualizarEvento"
>
...
...
@@ -52,6 +69,17 @@
@
endforeach
</
tbody
>
</
table
>
</
div
>
</
div
>
</
div
>
</
div
>
@
endforeach
</
div
>
<
div
class
=
"col-md-12"
>
</
div
>
</
div
>
@
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