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
b09fb79e
Commit
b09fb79e
authored
May 22, 2020
by
Gabriel-31415
Browse files
criação da tela inicil de administrador
parent
c9f2b30f
Changes
11
Show whitespace changes
Inline
Side-by-side
app/Http/Controllers/EventoController.php
View file @
b09fb79e
...
...
@@ -36,6 +36,17 @@ class EventoController extends Controller
}
public
function
listar
()
{
//
$eventos
=
Evento
::
all
();
// $comissaoEvento = ComissaoEvento::all();
// $eventos = Evento::where('coordenadorId', Auth::user()->id)->get();
return
view
(
'evento.listarEvento'
,[
'eventos'
=>
$eventos
]);
}
/**
* Show the form for creating a new resource.
*
...
...
app/Http/Controllers/HomeController.php
View file @
b09fb79e
...
...
@@ -3,6 +3,7 @@
namespace
App\Http\Controllers
;
use
Illuminate\Http\Request
;
use
Auth
;
class
HomeController
extends
Controller
{
...
...
@@ -23,6 +24,21 @@ class HomeController extends Controller
*/
public
function
index
()
{
if
(
Auth
::
check
()){
if
(
Auth
::
user
()
->
tipo
==
'administrador'
){
return
view
(
'administrador.index'
);
}
else
if
(
Auth
::
user
()
->
tipo
==
'administradorResponsavel'
)
{
return
view
(
'administradorResponsavel.index'
);
}
else
if
(
Auth
::
user
()
->
tipo
==
'proponente'
)
{
return
view
(
'proponente.index'
);
}
else
if
(
Auth
::
user
()
->
tipo
==
'participante'
)
{
return
view
(
'participante.index'
);
}
}
//
return
view
(
'home'
);
}
...
...
app/Http/Controllers/UserController.php
View file @
b09fb79e
...
...
@@ -13,6 +13,13 @@ use App\Coautor;
class
UserController
extends
Controller
{
//
public
function
index
(){
if
(
Auth
::
user
()){
return
redirect
()
->
route
(
'home'
);
}
}
function
perfil
(){
$user
=
User
::
find
(
Auth
::
user
()
->
id
);
$end
=
$user
->
endereco
;
...
...
resources/views/administrador/index.blade.php
View file @
b09fb79e
...
...
@@ -4,102 +4,42 @@
<
div
class
=
"container"
>
{{
--
titulo
da
página
--
}}
<
div
class
=
"row justify-content-center titulo"
>
<
div
class
=
"col-sm-12"
>
<
div
class
=
"row"
>
<
div
class
=
"col-sm-8"
>
<
h1
>
Eventos
</
h1
>
<
h2
style
=
"margin-top: 100px; "
>
Administrador
</
h2
>
<
div
class
=
"row justify-content-center d-flex align-items-center"
>
<
div
class
=
"col-sm-4 d-flex justify-content-center "
>
<
a
href
=
"
{
{route('evento.listar')}
}
"
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"
>
Editais
</
h2
>
</
div
>
<
div
class
=
"col-sm-2"
>
<
a
href
=
"
{
{route('comissoes')}
}
"
class
=
"btn btn-primary"
>
Comissões
</
a
>
</
div
>
@
if
(
Auth
::
check
())
@
if
(
Auth
::
user
()
->
tipo
==
'administrador'
)
<!--
Carrega
component
contendo
navbar
do
administrador
-->
<
div
class
=
"col-sm-2"
>
<
a
href
=
"
{
{route('evento.criar')}
}
"
class
=
"btn btn-primary"
>
Novo
Evento
</
a
>
</
a
>
</
div
>
@
endif
@
endif
<
div
class
=
"col-sm-4 d-flex justify-content-center"
>
<
a
href
=
"#"
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"
>
Natureza
</
h2
>
</
div
>
</
div
>
</
div
>
<
div
class
=
"row"
>
@
foreach
(
$eventos
as
$evento
)
<
div
class
=
"card"
style
=
"width: 18rem;"
>
@
if
(
isset
(
$evento
->
fotoEvento
))
<
img
src
=
"
{
{asset('storage/eventos/'.$evento->id.'/logo.png')}
}
"
class
=
"card-img-top"
alt
=
"..."
>
@
else
<
img
src
=
"
{
{asset('img/colorscheme.png')}
}
"
class
=
"card-img-top"
alt
=
"..."
>
@
endif
<
div
class
=
"card-body"
>
<
div
class
=
"row"
>
<
div
class
=
"col-sm-12"
>
<
h4
class
=
"card-title"
>
<
div
class
=
"row justify-content-center"
>
<
div
class
=
"col-sm-12"
>
{{
$evento
->
nome
}}
@
can
(
'isCoordenador'
,
$evento
)
<
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
href
=
"{{ route('coord.detalhesEvento', ['eventoId' =>
$evento->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"
>
<
img
src
=
"
{
{asset('img/icons/edit-regular.svg')}
}
"
class
=
"icon-card"
alt
=
""
>
Editar
</
a
>
<
form
method
=
"POST"
action
=
"
{
{route('evento.deletar',$evento->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
</
button
>
</
form
>
</
div
>
<
div
class
=
"col-sm-4 d-flex justify-content-center"
>
<
a
href
=
"#"
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"
>
Usuários
</
h2
>
</
div
>
@
endcan
</
div
>
</
div
>
</
h4
>
</
a
>
</
div
>
</
div
>
<
p
class
=
"card-text"
>
<
strong
>
Realização
:</
strong
>
{{
date
(
'd/m/Y'
,
strtotime
(
$evento
->
dataInicio
))}}
-
{{
date
(
'd/m/Y'
,
strtotime
(
$evento
->
dataFim
))}}
<
br
>
<
strong
>
Submissão
:</
strong
>
{{
date
(
'd/m/Y'
,
strtotime
(
$evento
->
inicioSubmissao
))}}
-
{{
date
(
'd/m/Y'
,
strtotime
(
$evento
->
fimSubmissao
))}}
<
br
>
<
strong
>
Revisão
:</
strong
>
{{
date
(
'd/m/Y'
,
strtotime
(
$evento
->
inicioRevisao
))}}
-
{{
date
(
'd/m/Y'
,
strtotime
(
$evento
->
fimRevisao
))}}
<
br
>
</
p
>
<
p
>
<
div
class
=
"row justify-content-center"
>
<
div
class
=
"col-sm-12"
>
<
img
src
=
"
{
{asset('img/icons/map-marker-alt-solid.svg')}
}
"
alt
=
""
style
=
"width:15px"
>
{{
$evento
->
endereco
->
rua
}},
{{
$evento
->
endereco
->
numero
}}
-
{{
$evento
->
endereco
->
cidade
}}
/
{{
$evento
->
endereco
->
uf
}}
.
</
div
>
</
div
>
</
p
>
<
p
>
<
a
href
=
"{{ route('evento.visualizar',['id'=>
$evento->id
]) }}"
class
=
"visualizarEvento"
>
Visualizar
Evento
</
a
>
</
p
>
</
div
>
</
div
>
@
endforeach
</
div
>
</
div
>
...
...
resources/views/administradorResponsavel/index.blade.php
0 → 100644
View file @
b09fb79e
@
extends
(
'layouts.app'
)
@
section
(
'content'
)
<
div
class
=
"container"
>
<
h2
style
=
"margin-top: 100px;"
>
Administrador
Responsavel
</
h2
>
</
div
>
@
endsection
resources/views/componentes/navBarAdministrador.blade.php
0 → 100644
View file @
b09fb79e
resources/views/evento/listarEvento.blade.php
0 → 100644
View file @
b09fb79e
@
extends
(
'layouts.app'
)
@
section
(
'content'
)
<
div
class
=
"container"
style
=
"margin-top: 100px;"
>
<
h3
class
=
"text-center"
>
Editais
</
h3
>
<
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"
>
Opção
</
th
>
</
tr
>
</
thead
>
<
tbody
>
@
foreach
(
$eventos
as
$evento
)
<
tr
>
<
td
>
<
a
href
=
"{{ route('evento.visualizar',['id'=>
$evento->id
]) }}"
class
=
"visualizarEvento"
>
{{
$evento
->
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"
>
{{
--
<
img
src
=
"
{
{asset('img/icons/ellipsis-v-solid.svg')}
}
"
style
=
"width:8px"
>
--
}}
</
a
>
<
div
class
=
"dropdown-menu"
>
<
a
href
=
"{{ route('coord.detalhesEvento', ['eventoId' =>
$evento->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"
>
<
img
src
=
"
{
{asset('img/icons/edit-regular.svg')}
}
"
class
=
"icon-card"
alt
=
""
>
Editar
</
a
>
<
form
method
=
"POST"
action
=
"
{
{route('evento.deletar',$evento->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
</
button
>
</
form
>
</
div
>
</
div
>
</
td
>
</
tr
>
@
endforeach
</
tbody
>
</
table
>
</
div
>
@
endsection
@
section
(
'javascript'
)
<
script
>
</
script
>
@
endsection
resources/views/layouts/app.blade.php
View file @
b09fb79e
...
...
@@ -58,56 +58,84 @@
@else
<!-- Se o usuário for um aluno -->
@if(Auth::user()->tipo == 'administrador')
<!-- carrega o componente contendo Navbar do aluno -->
{{-- @component('componentes.navbarAluno')
@endcomponent --}}
<li
class=
"nav-item"
>
<a
class=
"nav-link"
href=
"#"
>
Naturezas
</a>
</li>
<li
class=
"nav-item"
>
<a
class=
"nav-link"
href=
"{{route('evento.listar')}}"
>
Editais
</a>
</li>
<li
class=
"nav-item"
>
<a
class=
"nav-link"
href=
"#"
>
Usuários
</a>
</li>
<li
class=
"nav-item"
>
<a
class=
"nav-link"
href=
"#"
>
Meus Dados
</a>
</li>
<li
class=
"nav-item"
>
<a
class=
"nav-link"
href=
"{{ route('logout') }}"
onclick=
"event.preventDefault();
document.getElementById('logout-form').submit();"
>
Sair
</a>
<form
id=
"logout-form"
action=
"{{ route('logout') }}"
method=
"POST"
style=
"display: none;"
>
@csrf
</form>
</li>
@endif
<!-- Se o usuário for um servidor -->
@if(Auth::user()->tipo == 'reitor')
<!-- Carrega component contendo navbar do servidor -->
{{-- @component('componentes.navbarServidor')
@endcomponent --}}
@if(Auth::user()->tipo == 'administradorResponsavel')
<li
class=
"nav-item"
>
<a
class=
"nav-link"
href=
"{{ route('logout') }}"
onclick=
"event.preventDefault();
document.getElementById('logout-form').submit();"
>
Sair
</a>
<form
id=
"logout-form"
action=
"{{ route('logout') }}"
method=
"POST"
style=
"display: none;"
>
@csrf
</form>
</li>
@endif
@if(Auth::user()->tipo == 'proponente')
<!-- Carrega component contendo navbar do administrador -->
{{-- @component('componentes.navbarAdministrador')
@endcomponent --}}
<li
class=
"nav-item"
>
<a
class=
"nav-link"
href=
"{{ route('logout') }}"
onclick=
"event.preventDefault();
document.getElementById('logout-form').submit();"
>
Sair
</a>
<form
id=
"logout-form"
action=
"{{ route('logout') }}"
method=
"POST"
style=
"display: none;"
>
@csrf
</form>
</li>
@endif
<li
class=
"nav-item dropdown"
>
{{--
<li
class=
"nav-item dropdown"
>
<a
id=
"navbarDropdown"
class=
"nav-link dropdown-toggle"
href=
"#"
role=
"button"
data-toggle=
"dropdown"
aria-haspopup=
"true"
aria-expanded=
"false"
v-pre
>
{{ Auth::user()->name }}
<span
class=
"caret"
></span>
</a>
<div
class=
"dropdown-menu dropdown-menu-right"
aria-labelledby=
"navbarDropdown"
>
{{-- Link Perfil --}}
<a
class=
"dropdown-item"
href=
"{{ route('perfil') }}"
>
<img
src=
"{{asset('img/icons/perfil.svg')}}"
alt=
""
>
{{ __('Minha Conta') }}
</a>
{{-- Link Trabalhos --}}
{{--
<a
class=
"dropdown-item"
href=
"{{ route('user.meusTrabalhos') }}"
>
--}}
<a
class=
"dropdown-item"
href=
"{{ route('user.meusTrabalhos') }}"
>
<img
src=
"{{asset('img/icons/file-alt-regular-black.svg')}}"
alt=
""
>
{{ __('Participante') }}
</a>
{{-- Comissão --}}
{{-- @foreach ($comissaoEvento as $comissao)
@if($comissaoEvento->userId == Auth()->user()->id)
<a
class=
"dropdown-item"
href=
"{{ route('area.comissao') }}"
>
<img
src=
"{{asset('img/icons/file-alt-regular-black.svg')}}"
alt=
""
>
{{ __('Comissão') }}
</a>
@endif
@endforeach --}}
{{-- Link Logout --}}
<a
class=
"dropdown-item"
href=
"{{ route('logout') }}"
onclick=
"event.preventDefault();
document.getElementById('logout-form').submit();"
>
...
...
@@ -120,7 +148,7 @@
@csrf
</form>
</div>
</li>
</li>
--}}
@endguest
</ul>
</div>
...
...
resources/views/layouts/teste.blade.php
0 → 100644
View file @
b09fb79e
<nav
class=
"navbar navbar-expand-lg navbar-dark "
>
<div
class=
"container"
>
<a
class=
"navbar-brand"
href=
"{{route('cancelarCadastro')}}"
>
{{ config('app.name', 'Laravel') }}
</a>
<button
class=
"navbar-toggler"
type=
"button"
data-toggle=
"collapse"
data-target=
"#navbarSupportedContent"
aria-controls=
"navbarSupportedContent"
aria-expanded=
"false"
aria-label=
"{{ __('Toggle navigation') }}"
>
<span
class=
"navbar-toggler-icon"
></span>
</button>
<div
class=
"collapse navbar-collapse"
id=
"navbarSupportedContent"
>
<!-- Left Side Of Navbar -->
<ul
class=
"navbar-nav mr-auto"
>
</ul>
<!-- Right Side Of Navbar -->
<ul
class=
"navbar-nav ml-auto"
>
<!-- Authentication Links -->
@guest
<li
class=
"nav-item"
>
<a
class=
"nav-link"
href=
"{{ route('login') }}"
>
{{ __('Login') }}
</a>
{{--
<a
class=
"nav-link"
data-toggle=
"modal"
data-target=
"#modalLogin"
>
{{ __('Login') }}
</a>
--}}
</li>
@if (Route::has('register'))
<li
class=
"nav-item"
>
<a
class=
"nav-link"
href=
"{{ route('register') }}"
>
{{ __('Cadastro') }}
</a>
{{--
<a
class=
"nav-link"
data-toggle=
"modal"
data-target=
"#modalCadastro"
>
{{ __('Cadastro') }}
</a>
--}}
</li>
@endif
@else
<!-- Se o usuário for um aluno -->
@if(Auth::user()->tipo == 'administrador')
<li
class=
"nav-item"
>
<a
class=
"nav-link"
href=
"{{ route('login') }}"
>
Naturezas
</a>
</li>
<li
class=
"nav-item"
>
<a
class=
"nav-link"
href=
"{{ route('login') }}"
>
Editais
</a>
</li>
<li
class=
"nav-item"
>
<a
class=
"nav-link"
href=
"{{ route('login') }}"
>
Usuários
</a>
</li>
<li
class=
"nav-item"
>
<a
class=
"nav-link"
href=
"{{ route('login') }}"
>
Meus dados
</a>
</li>
<li
class=
"nav-item"
>
<a
class=
"nav-link"
href=
"{{ route('login') }}"
>
Meus dados
</a>
</li>
<li
class=
"nav-item"
>
<a
class=
"nav-link btn btn-outline-success"
href=
"{{ route('logout') }}"
onclick=
"event.preventDefault();
document.getElementById('logout-form').submit();"
>
Sair
</a>
<form
id=
"logout-form"
action=
"{{ route('logout') }}"
method=
"POST"
style=
"display: none;"
>
@csrf
</form>
</li>
@endif
<!-- Se o usuário for um servidor -->
@if(Auth::user()->tipo == 'administradorResponsavel')
<!-- Carrega component contendo navbar do servidor -->
{{-- @component('componentes.navbarServidor')
@endcomponent --}}
@endif
@if(Auth::user()->tipo == 'proponente')
<!-- Carrega component contendo navbar do administrador -->
{{-- @component('componentes.navbarAdministrador')
@endcomponent --}}
@endif
{{--
<li
class=
"nav-item dropdown"
>
<a
id=
"navbarDropdown"
class=
"nav-link dropdown-toggle"
href=
"#"
role=
"button"
data-toggle=
"dropdown"
aria-haspopup=
"true"
aria-expanded=
"false"
v-pre
>
{{ Auth::user()->name }}
<span
class=
"caret"
></span>
</a>
<div
class=
"dropdown-menu dropdown-menu-right"
aria-labelledby=
"navbarDropdown"
>
<a
class=
"dropdown-item"
href=
"{{ route('perfil') }}"
>
<img
src=
"{{asset('img/icons/perfil.svg')}}"
alt=
""
>
{{ __('Minha Conta') }}
</a>
{
<a
class=
"dropdown-item"
href=
"{{ route('user.meusTrabalhos') }}"
>
<img
src=
"{{asset('img/icons/file-alt-regular-black.svg')}}"
alt=
""
>
{{ __('Participante') }}
</a>
</div>
</li>
--}}
<nav
class=
"navbar navbar-default"
role=
"navigation"
>
@endguest
</ul>
</div>
</div>
</nav>
\ No newline at end of file
resources/views/proponente/index.blade.php
0 → 100644
View file @
b09fb79e
@
extends
(
'layouts.app'
)
@
section
(
'content'
)
<
div
class
=
"container"
>
<
h2
style
=
"margin-top: 100px;"
>
Proponente
</
h2
>
</
div
>
@
endsection
routes/web.php
View file @
b09fb79e
...
...
@@ -11,6 +11,7 @@
|
*/
use
App\Evento
;
Route
::
get
(
'/'
,
function
()
{
if
(
Auth
::
check
()){
return
redirect
()
->
route
(
'home'
);
...
...
@@ -60,6 +61,7 @@ Route::group(['middleware' => ['isTemp', 'auth', 'verified']], function(){
Route
::
get
(
'/evento/criar'
,
'EventoController@create'
)
->
name
(
'evento.criar'
);
Route
::
post
(
'/evento/criar'
,
'EventoController@store'
)
->
name
(
'evento.criar'
);
Route
::
get
(
'/evento/visualizar/{id}'
,
'EventoController@show'
)
->
name
(
'evento.visualizar'
);
Route
::
get
(
'/evento/listar'
,
'EventoController@listar'
)
->
name
(
'evento.listar'
);
Route
::
delete
(
'/evento/excluir/{id}'
,
'EventoController@destroy'
)
->
name
(
'evento.deletar'
);
Route
::
get
(
'/evento/editar/{id}'
,
'EventoController@edit'
)
->
name
(
'evento.editar'
);
Route
::
post
(
'/evento/editar/{id}'
,
'EventoController@update'
)
->
name
(
'evento.update'
);
...
...
@@ -99,3 +101,5 @@ Route::group(['middleware' => ['isTemp', 'auth', 'verified']], function(){
Route
::
get
(
'/area/comissao'
,
'EventoController@listComissaoTrabalhos'
)
->
name
(
'area.comissao'
);
});
Route
::
get
(
'/home'
,
'HomeController@index'
)
->
name
(
'home'
)
->
middleware
(
'verified'
);
\ 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