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
2081ccfc
Commit
2081ccfc
authored
Jun 05, 2020
by
alinetenorio
Browse files
Ao criar projeto, checa se usuário tem perfil de proponente
parent
e2c7dea5
Changes
5
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/ProponenteController.php
View file @
2081ccfc
...
...
@@ -3,6 +3,11 @@
namespace
App\Http\Controllers
;
use
Illuminate\Http\Request
;
use
Auth
;
use
App\User
;
use
App\Proponente
;
use
App\GrandeArea
;
use
App\Evento
;
class
ProponenteController
extends
Controller
{
...
...
@@ -10,4 +15,51 @@ class ProponenteController extends Controller
return
view
(
'proponente.index'
);
}
public
function
create
(){
$grandesAreas
=
GrandeArea
::
orderBy
(
'nome'
)
->
get
();
return
view
(
'proponente.cadastro'
)
->
with
([
'grandeAreas'
=>
$grandesAreas
]);;
}
public
function
store
(
Request
$request
){
if
(
Auth
::
user
()
->
proponentes
==
null
)
{
$validated
=
$request
->
validate
([
'senha'
=>
'required'
,
'cargo'
=>
'required'
,
'titulacaoMaxima'
=>
'required'
,
'anoTitulacao'
=>
'required'
,
'areaFormacao'
=>
'required'
,
'area'
=>
'required'
,
'bolsistaProdutividade'
=>
'required'
,
'nivel'
=>
'required'
,
'linkLattes'
=>
'required'
,
]);
$proponente
=
new
Proponente
();
$proponente
->
SIAPE
=
$request
->
SIAPE
;
$proponente
->
cargo
=
$request
->
cargo
;
$proponente
->
vinculo
=
$request
->
vinculo
;
$proponente
->
titulacaoMaxima
=
$request
->
titulacaoMaxima
;
$proponente
->
anoTitulacao
=
$request
->
anoTitulacao
;
$proponente
->
areaFormacao
=
$request
->
areaFormacao
;
$proponente
->
grandeArea
=
$request
->
area
;
$proponente
->
area
=
"teste"
;
$proponente
->
subArea
=
"teste"
;
$proponente
->
bolsistaProdutividade
=
$request
->
bolsistaProdutividade
;
$proponente
->
nivel
=
$request
->
nivel
;
$proponente
->
linkLattes
=
$request
->
linkLattes
;
$proponente
->
user_id
=
Auth
::
user
()
->
id
;
$proponente
->
save
();
$user
=
User
::
find
(
Auth
()
->
user
()
->
id
);
$user
->
tipo
=
"proponente"
;
$user
->
save
();
}
$eventos
=
Evento
::
all
();
return
redirect
(
route
(
'admin.editais'
,
[
'eventos'
=>
$eventos
]))
->
with
([
'mensagem'
=>
'Usuário cadastrado com sucesso'
]);
}
}
resources/views/participante/index.blade.php
View file @
2081ccfc
...
...
@@ -8,7 +8,7 @@
<
div
class
=
"row justify-content-center d-flex align-items-center"
>
<
div
class
=
"col-sm-4 d-flex justify-content-center "
>
<
a
href
=
"
#
"
style
=
"text-decoration:none; color: inherit;"
>
<
a
href
=
"
{
{route('admin.editais')}
}
"
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
>
...
...
resources/views/projeto/index.blade.php
View file @
2081ccfc
...
...
@@ -10,7 +10,12 @@
<
h6
style
=
"color: rgb(4, 78, 4);"
>
Submissão
irá
até
o
dia
{{
date
(
'd-m-Y'
,
strtotime
(
$edital
->
fimSubmissao
))
}}
</
h6
>
</
div
>
<
div
class
=
"col-sm-2"
>
<
a
href
=
"{{route('trabalho.index', ['id' =>
$edital->id
] )}}"
class
=
"btn btn-primary"
>
Criar
projeto
</
a
>
<!--
Se
usuário
não
é
proponente
,
redirecionar
para
view
de
cadastro
-->
@
if
(
Auth
::
user
()
->
proponentes
==
null
)
<
a
href
=
"{{ route('proponente.create' )}}"
class
=
"btn btn-primary"
>
Criar
projeto
</
a
>
@
else
<
a
href
=
"{{ route('trabalho.index', ['id' =>
$edital->id
] )}}"
class
=
"btn btn-primary"
>
Criar
projeto
</
a
>
@
endif
</
div
>
</
div
>
</
div
>
...
...
resources/views/proponente/cadastro.blade.php
0 → 100644
View file @
2081ccfc
@
extends
(
'layouts.app'
)
@
section
(
'content'
)
<
div
class
=
"container"
>
<
div
class
=
"row"
>
<
div
class
=
"col-sm-12"
>
<
h2
style
=
"margin-top: 100px; "
>
{{
__
(
'Criar perfil de proponente'
)
}}
</
h2
>
</
div
>
</
div
>
<
br
>
<
form
method
=
"POST"
action
=
"{{ route('proponente.store') }}"
>
@
csrf
<
div
class
=
"col-sm-11"
>
<
div
id
=
"proponente"
>
<
div
>
<
h4
>
Dados
do
proponente
</
h4
>
</
div
>
<
div
>
<
label
for
=
"SIAPE"
class
=
"col-form-label"
>
{{
__
(
'SIAPE'
)
}}
</
label
>
<
input
id
=
"SIAPE"
type
=
"text"
class
=
"form-control @error('SIAPE') is-invalid @enderror"
name
=
"SIAPE"
value
=
""
autocomplete
=
"nome"
>
@
error
(
'SIAPE'
)
<
span
class
=
"invalid-feedback"
role
=
"alert"
>
<
strong
>
{{
$message
}}
</
strong
>
</
span
>
@
enderror
<
label
for
=
"cargo"
class
=
"col-form-label"
>
{{
__
(
'Cargo'
)
}}
</
label
>
<
input
id
=
"cargo"
type
=
"text"
class
=
"form-control @error('cargo') is-invalid @enderror"
name
=
"cargo"
value
=
""
autocomplete
=
"nome"
>
@
error
(
'cargo'
)
<
span
class
=
"invalid-feedback"
role
=
"alert"
>
<
strong
>
{{
$message
}}
</
strong
>
</
span
>
@
enderror
<
div
>
<
label
for
=
"vinculo"
class
=
"col-form-label"
>
{{
__
(
'Vinculo'
)
}}
</
label
>
<
select
name
=
"vinculo"
id
=
""
>
<
option
value
=
"Servidor na ativa"
>
Servidor
na
ativa
</
option
>
<
option
value
=
"Servidor aposentado"
>
Servidor
aposentado
</
option
>
<
option
value
=
"Professor visitante"
>
Professor
visitante
</
option
>
<
option
value
=
"Pós-doutorando"
>
Pós
-
doutorando
</
option
>
</
select
>
</
div
>
<
label
for
=
"titulacaoMaxima"
class
=
"col-form-label"
>
{{
__
(
'Titulação Maxima'
)
}}
</
label
>
<
input
id
=
"titulacaoMaxima"
type
=
"text"
class
=
"form-control @error('titulacaoMaxima') is-invalid @enderror"
name
=
"titulacaoMaxima"
value
=
""
autocomplete
=
"nome"
>
@
error
(
'titulacaoMaxima'
)
<
span
class
=
"invalid-feedback"
role
=
"alert"
>
<
strong
>
{{
$message
}}
</
strong
>
</
span
>
@
enderror
<
label
for
=
"anoTitulacao"
class
=
"col-form-label"
>
{{
__
(
'Ano da Titulação'
)
}}
</
label
>
<
input
id
=
"anoTitulacao"
type
=
"text"
class
=
"form-control @error('anoTitulacao') is-invalid @enderror"
name
=
"anoTitulacao"
value
=
""
autocomplete
=
"nome"
>
@
error
(
'anoTitulacao'
)
<
span
class
=
"invalid-feedback"
role
=
"alert"
>
<
strong
>
{{
$message
}}
</
strong
>
</
span
>
@
enderror
<
label
for
=
"areaFormacao"
class
=
"col-form-label"
>
{{
__
(
'Area de Formação'
)
}}
</
label
>
<
input
id
=
"areaFormacao"
type
=
"text"
class
=
"form-control @error('areaFormacao') is-invalid @enderror"
name
=
"areaFormacao"
value
=
""
autocomplete
=
"nome"
>
@
error
(
'areaFormacao'
)
<
span
class
=
"invalid-feedback"
role
=
"alert"
>
<
strong
>
{{
$message
}}
</
strong
>
</
span
>
@
enderror
<
div
>
<
label
for
=
"area"
class
=
"col-form-label"
>
{{
__
(
'Área'
)
}}
</
label
>
<
select
name
=
"area"
id
=
""
>
@
foreach
(
$grandeAreas
as
$area
)
<
option
value
=
"
{
{$area->nome}}">{{$area->nome}
}
</option>
@endforeach
</select>
</div>
<div>
<label for="
bolsistaProdutividade
" class="
col
-
form
-
label
">{{ __('Bolsista de Produtividade') }}</label><br>
<select name="
bolsistaProdutividade
" id="">
<option value="
sim
">Sim</option>
<option value="
nao
">Não</option>
</select>
</div>
<div>
<label for="
nivel
" class="
col
-
form
-
label
">{{ __('Nivel') }}</label>
<select name="
nivel
" id="">
<option value="
2
">2</option>
<option value="
1
D
">1D</option>
<option value="
1
D
">1B</option>
<option value="
1
D
">1C</option>
<option value="
1
D
">1A</option>
</select>
</div>
<label for="
linkLattes
" class="
col
-
form
-
label
">{{ __('Link do curriculum lattes') }}</label>
<input id="
linkLattes
" type="
text
" class="
form
-
control
@
error
(
'linkLattes'
)
is
-
invalid
@
enderror
" name="
linkLattes
" value="" autocomplete="
nome
">
@error('linkLattes')
<span class="
invalid
-
feedback
" role="
alert
">
<strong>{{
$message
}}</strong>
</span>
@enderror
<label for="
passworld
" class="
col
-
form
-
label
">{{ __('Senha') }}</label>
<input id="
passworld
" type="
text
" class="
form
-
control
@
error
(
'senha'
)
is
-
invalid
@
enderror
" name="
senha
" value="" autocomplete="
nome
">
@error('senha')
<span class="
invalid
-
feedback
" role="
alert
">
<strong>{{
$message
}}</strong>
</span>
@enderror
</div>
</div>
<button type="
submit
" class="
btn
btn
-
primary
" style="
position
:
relative
;
top
:
10
px
;
">{{ __('Salvar') }}</button>
</div>
</form>
</div>
@endsection
routes/web.php
View file @
2081ccfc
...
...
@@ -30,6 +30,8 @@ Route::prefix('avaliador')->name('avaliador.')->group(function(){
//######### Proponente ########################################
Route
::
get
(
'/proponente/index'
,
'ProponenteController@index'
)
->
name
(
'proponente.index'
);
Route
::
get
(
'/proponente/cadastro'
,
'ProponenteController@create'
)
->
name
(
'proponente.create'
);
Route
::
post
(
'/proponente/cadastro'
,
'ProponenteController@store'
)
->
name
(
'proponente.store'
);
//######### Participante ########################################
Route
::
get
(
'/participante/index'
,
'ParticipanteController@index'
)
->
name
(
'participante.index'
);
...
...
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