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
381d10f5
Commit
381d10f5
authored
May 21, 2020
by
Gabriel-31415
Browse files
feature user administrador
parent
5de5a599
Changes
32
Show whitespace changes
Inline
Side-by-side
database/migrations/2020_05_20_211149_add_users_to_pro_reitors_table.php
0 → 100644
View file @
381d10f5
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
class
AddUsersToProReitorsTable
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
table
(
'pro_reitors'
,
function
(
Blueprint
$table
)
{
$table
->
unsignedBigInteger
(
'user_id'
);
$table
->
foreign
(
'user_id'
)
->
references
(
'id'
)
->
on
(
'users'
);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
table
(
'pro_reitors'
,
function
(
Blueprint
$table
)
{
$table
->
dropForeign
(
'pro_reitors_user_id_foreign'
);
$table
->
dropColumn
(
'user_id'
);
});
}
}
database/migrations/2020_05_20_211258_create_coordenador_comites_table.php
0 → 100644
View file @
381d10f5
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
class
CreateCoordenadorComitesTable
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
create
(
'coordenador_comites'
,
function
(
Blueprint
$table
)
{
$table
->
bigIncrements
(
'id'
);
$table
->
timestamps
();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
dropIfExists
(
'coordenador_comites'
);
}
}
database/migrations/2020_05_20_211333_add_users_to_coordenador_comites_table.php
0 → 100644
View file @
381d10f5
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
class
AddUsersToCoordenadorComitesTable
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
table
(
'coordenador_comites'
,
function
(
Blueprint
$table
)
{
$table
->
unsignedBigInteger
(
'user_id'
);
$table
->
foreign
(
'user_id'
)
->
references
(
'id'
)
->
on
(
'users'
);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
table
(
'coordenador_comites'
,
function
(
Blueprint
$table
)
{
$table
->
dropForeign
(
'coordenador_comites_user_id_foreign'
);
$table
->
dropColumn
(
'user_id'
);
});
}
}
database/migrations/2020_05_20_211421_create_proponentes_table.php
0 → 100644
View file @
381d10f5
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
class
CreateProponentesTable
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
create
(
'proponentes'
,
function
(
Blueprint
$table
)
{
$table
->
bigIncrements
(
'id'
);
$table
->
timestamps
();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
dropIfExists
(
'proponentes'
);
}
}
database/migrations/2020_05_20_211451_add_users_to_proponentes_table.php
0 → 100644
View file @
381d10f5
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
class
AddUsersToProponentesTable
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
table
(
'proponentes'
,
function
(
Blueprint
$table
)
{
$table
->
unsignedBigInteger
(
'user_id'
);
$table
->
foreign
(
'user_id'
)
->
references
(
'id'
)
->
on
(
'users'
);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
table
(
'proponentes'
,
function
(
Blueprint
$table
)
{
$table
->
dropForeign
(
'proponentes_user_id_foreign'
);
$table
->
dropColumn
(
'user_id'
);
});
}
}
database/seeds/AdministradorSeeder.php
0 → 100644
View file @
381d10f5
<?php
use
Illuminate\Database\Seeder
;
use
Illuminate\Support\Facades\DB
;
class
AdministradorSeeder
extends
Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public
function
run
()
{
$user_id
=
DB
::
table
(
'users'
)
->
where
(
'name'
,
'Administrador'
)
->
pluck
(
'id'
);
DB
::
table
(
'administradors'
)
->
insert
([
'matricula'
=>
'123456789'
,
'user_id'
=>
$user_id
[
0
],
]);
}
}
database/seeds/DatabaseSeeder.php
View file @
381d10f5
...
@@ -12,6 +12,7 @@ class DatabaseSeeder extends Seeder
...
@@ -12,6 +12,7 @@ class DatabaseSeeder extends Seeder
public
function
run
()
public
function
run
()
{
{
// $this->call(UsersTableSeeder::class);
// $this->call(UsersTableSeeder::class);
DB
::
table
(
'enderecos'
)
->
insert
([
// 1
DB
::
table
(
'enderecos'
)
->
insert
([
// 1
'rua'
=>
'a'
,
'rua'
=>
'a'
,
'numero'
=>
1
,
'numero'
=>
1
,
...
@@ -172,5 +173,8 @@ Os trabalhos deverão ser submetidos na forma de resumo simples com no máximo u
...
@@ -172,5 +173,8 @@ Os trabalhos deverão ser submetidos na forma de resumo simples com no máximo u
'email_verified_at'
=>
'2020-02-15'
,
'email_verified_at'
=>
'2020-02-15'
,
'enderecoId'
=>
1
,
'enderecoId'
=>
1
,
]);
]);
$this
->
call
(
UsuarioSeeder
::
class
);
$this
->
call
(
AdministradorSeeder
::
class
);
}
}
}
}
database/seeds/UsuarioSeeder.php
0 → 100644
View file @
381d10f5
<?php
use
Illuminate\Database\Seeder
;
use
Illuminate\Support\Facades\DB
;
use
Illuminate\Support\Facades\Hash
;
class
UsuarioSeeder
extends
Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public
function
run
()
{
DB
::
table
(
'users'
)
->
insert
([
'name'
=>
'Administrador'
,
'email'
=>
'admin@ufrpe.br'
,
'password'
=>
Hash
::
make
(
'123456'
),
'tipo'
=>
'administrador'
,
'email_verified_at'
=>
'2020-01-01'
]);
}
}
resources/views/administrador/index.blade.php
0 → 100644
View file @
381d10f5
@
extends
(
'layouts.app'
)
@
section
(
'content'
)
<
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
>
</
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
>
</
div
>
@
endif
@
endif
</
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
>
@
endcan
</
div
>
</
div
>
</
h4
>
</
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
>
@
endsection
resources/views/coordenador/home.blade.php
View file @
381d10f5
...
@@ -14,9 +14,15 @@
...
@@ -14,9 +14,15 @@
<
div
class
=
"col-sm-2"
>
<
div
class
=
"col-sm-2"
>
<
a
href
=
"
{
{route('comissoes')}
}
"
class
=
"btn btn-primary"
>
Comissões
</
a
>
<
a
href
=
"
{
{route('comissoes')}
}
"
class
=
"btn btn-primary"
>
Comissões
</
a
>
</
div
>
</
div
>
@
if
(
Auth
::
check
())
@
if
(
Auth
::
user
()
->
tipo
==
'administrador'
)
<!--
Carrega
component
contendo
navbar
do
administrador
-->
<
div
class
=
"col-sm-2"
>
<
div
class
=
"col-sm-2"
>
<
a
href
=
"
{
{route('evento.criar')}
}
"
class
=
"btn btn-primary"
>
Novo
Evento
</
a
>
<
a
href
=
"
{
{route('evento.criar')}
}
"
class
=
"btn btn-primary"
>
Novo
Evento
</
a
>
</
div
>
</
div
>
@
endif
@
endif
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
...
...
resources/views/layouts/app.blade.php
View file @
381d10f5
...
@@ -56,6 +56,36 @@
...
@@ -56,6 +56,36 @@
</li>
</li>
@endif
@endif
@else
@else
<!-- Se o usuário for um aluno -->
@if(Auth::user()->tipo == 'administrador')
<!-- carrega o componente contendo Navbar do aluno -->
{{-- @component('componentes.navbarAluno')
@endcomponent --}}
@endif
<!-- Se o usuário for um servidor -->
@if(Auth::user()->tipo == 'reitor')
<!-- Carrega component contendo navbar do servidor -->
{{-- @component('componentes.navbarServidor')
@endcomponent --}}
@endif
@if(Auth::user()->tipo == 'proReitor')
<!-- Carrega component contendo navbar do administrador -->
{{-- @component('componentes.navbarAdministrador')
@endcomponent --}}
@endif
@if(Auth::user()->tipo == 'proponente')
<!-- Carrega component contendo navbar do administrador -->
{{-- @component('componentes.navbarAdministrador')
@endcomponent --}}
@endif
@if(Auth::user()->tipo == 'coordenadorComite')
<!-- Carrega component contendo navbar do administrador -->
{{-- @component('componentes.navbarAdministrador')
@endcomponent --}}
@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
>
<a
id=
"navbarDropdown"
class=
"nav-link dropdown-toggle"
href=
"#"
role=
"button"
data-toggle=
"dropdown"
aria-haspopup=
"true"
aria-expanded=
"false"
v-pre
>
...
...
routes/web.php
View file @
381d10f5
...
@@ -36,6 +36,8 @@ Auth::routes(['verify' => true]);
...
@@ -36,6 +36,8 @@ Auth::routes(['verify' => true]);
Route
::
get
(
'/perfil'
,
'UserController@perfil'
)
->
name
(
'perfil'
)
->
middleware
([
'auth'
,
'verified'
]);
Route
::
get
(
'/perfil'
,
'UserController@perfil'
)
->
name
(
'perfil'
)
->
middleware
([
'auth'
,
'verified'
]);
Route
::
post
(
'/perfil'
,
'UserController@editarPerfil'
)
->
name
(
'perfil'
)
->
middleware
([
'auth'
,
'verified'
]);
Route
::
post
(
'/perfil'
,
'UserController@editarPerfil'
)
->
name
(
'perfil'
)
->
middleware
([
'auth'
,
'verified'
]);
// Rotas Administrador
Route
::
get
(
'/home-admin'
,
'AdministradorController@index'
)
->
middleware
(
'checkAdministrador'
)
->
name
(
'admin.index'
);
Route
::
group
([
'middleware'
=>
[
'isTemp'
,
'auth'
,
'verified'
]],
function
(){
Route
::
group
([
'middleware'
=>
[
'isTemp'
,
'auth'
,
'verified'
]],
function
(){
...
...
Prev
1
2
Next
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