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
09428058
Commit
09428058
authored
Nov 09, 2022
by
S-Nathalia
Browse files
adicao da escolha de cursos em que o proponente ensina para criacao de usuario
parent
5e58d581
Changes
4
Show whitespace changes
Inline
Side-by-side
app/Http/Controllers/Auth/RegisterController.php
View file @
09428058
...
@@ -13,6 +13,7 @@ use App\User;
...
@@ -13,6 +13,7 @@ use App\User;
use
App\Participante
;
use
App\Participante
;
use
App\Proponente
;
use
App\Proponente
;
use
App\Rules\UrlValidacao
;
use
App\Rules\UrlValidacao
;
use
App\Curso
;
class
RegisterController
extends
Controller
class
RegisterController
extends
Controller
{
{
...
@@ -91,7 +92,7 @@ class RegisterController extends Controller
...
@@ -91,7 +92,7 @@ class RegisterController extends Controller
*/
*/
protected
function
create
(
array
$data
)
protected
function
create
(
array
$data
)
{
{
//dd($data);
//
dd($data);
$user
=
new
User
();
$user
=
new
User
();
$user
->
name
=
$data
[
'name'
];
$user
->
name
=
$data
[
'name'
];
$user
->
email
=
$data
[
'email'
];
$user
->
email
=
$data
[
'email'
];
...
@@ -136,6 +137,7 @@ class RegisterController extends Controller
...
@@ -136,6 +137,7 @@ class RegisterController extends Controller
$proponente
->
linkLattes
=
$data
[
'linkLattes'
];
$proponente
->
linkLattes
=
$data
[
'linkLattes'
];
$user
->
proponentes
()
->
save
(
$proponente
);
$user
->
proponentes
()
->
save
(
$proponente
);
$proponente
->
cursos
()
->
sync
(
$data
[
'curso'
]);
}
}
return
$user
;
return
$user
;
...
@@ -143,6 +145,7 @@ class RegisterController extends Controller
...
@@ -143,6 +145,7 @@ class RegisterController extends Controller
public
function
showRegistrationForm
()
public
function
showRegistrationForm
()
{
{
return
view
(
'auth.register'
);
$cursos
=
Curso
::
orderBy
(
'nome'
)
->
get
();
return
view
(
'auth.register'
,
compact
(
'cursos'
));
}
}
}
}
app/Http/Controllers/ProponenteController.php
View file @
09428058
...
@@ -23,7 +23,7 @@ class ProponenteController extends Controller
...
@@ -23,7 +23,7 @@ class ProponenteController extends Controller
{
{
public
function
index
(){
public
function
index
(){
$cursos
=
Curso
::
orderBy
(
'nome'
)
->
get
();
$cursos
=
Curso
::
orderBy
(
'nome'
)
->
get
();
return
view
(
'proponente.index'
);
return
view
(
'proponente.index'
,
compact
(
'cursos'
)
);
}
}
public
function
create
(){
public
function
create
(){
...
@@ -72,6 +72,7 @@ class ProponenteController extends Controller
...
@@ -72,6 +72,7 @@ class ProponenteController extends Controller
$proponente
->
bolsistaProdutividade
=
$request
->
bolsistaProdutividade
;
$proponente
->
bolsistaProdutividade
=
$request
->
bolsistaProdutividade
;
$proponente
->
nivel
=
$request
->
nivel
;
$proponente
->
nivel
=
$request
->
nivel
;
$proponente
->
linkLattes
=
$request
->
linkLattes
;
$proponente
->
linkLattes
=
$request
->
linkLattes
;
// dd($request);
$proponente
->
user_id
=
Auth
::
user
()
->
id
;
$proponente
->
user_id
=
Auth
::
user
()
->
id
;
$proponente
->
save
();
$proponente
->
save
();
...
@@ -83,6 +84,7 @@ class ProponenteController extends Controller
...
@@ -83,6 +84,7 @@ class ProponenteController extends Controller
return
redirect
(
route
(
'home'
))
->
with
([
'mensagem'
=>
'Cadastro feito com sucesso! Você já pode criar projetos'
]);
return
redirect
(
route
(
'home'
))
->
with
([
'mensagem'
=>
'Cadastro feito com sucesso! Você já pode criar projetos'
]);
}
}
}
else
{
}
else
{
// dd($request);
return
redirect
(
route
(
'proponente.create'
))
->
with
([
'mensagem'
=>
'Você já é proponente!'
]);
return
redirect
(
route
(
'proponente.create'
))
->
with
([
'mensagem'
=>
'Você já é proponente!'
]);
}
}
...
...
resources/views/auth/register.blade.php
View file @
09428058
...
@@ -124,7 +124,7 @@
...
@@ -124,7 +124,7 @@
</
div
>
</
div
>
</
div
>
</
div
>
{{
--
<
div
style
=
"display:none"
id
=
"cursos"
class
=
"col-md-12 mb-2"
>
<
div
style
=
"display:none"
id
=
"cursos"
class
=
"col-md-12 mb-2"
>
<
label
for
=
"curso"
class
=
"col-form-label"
>
{{
__
(
'Cursos'
)
}}
<
span
style
=
"color: red; font-weight:bold;"
>*</
span
></
label
>
<
label
for
=
"curso"
class
=
"col-form-label"
>
{{
__
(
'Cursos'
)
}}
<
span
style
=
"color: red; font-weight:bold;"
>*</
span
></
label
>
<
br
>
<
br
>
<
div
class
=
"row col-md-12"
>
<
div
class
=
"row col-md-12"
>
...
@@ -137,7 +137,7 @@
...
@@ -137,7 +137,7 @@
</
div
>
</
div
>
@
endforeach
@
endforeach
</
div
>
</
div
>
</
div
>
--
}}
</
div
>
<
div
class
=
"col-md-12"
>
<
div
class
=
"col-md-12"
>
<
div
class
=
"form-group"
style
=
"display: block;"
id
=
"divOutro"
>
<
div
class
=
"form-group"
style
=
"display: block;"
id
=
"divOutro"
>
...
@@ -328,7 +328,7 @@
...
@@ -328,7 +328,7 @@
var
divProponente
=
document
.
getElementById
(
'proponente'
);
var
divProponente
=
document
.
getElementById
(
'proponente'
);
var
comboBoxCargo
=
document
.
getElementById
(
'cargo'
);
var
comboBoxCargo
=
document
.
getElementById
(
'cargo'
);
var
comboBoxVinculo
=
document
.
getElementById
(
'vinculo'
);
var
comboBoxVinculo
=
document
.
getElementById
(
'vinculo'
);
//
let cursos = document.getElementById('cursos');
let
cursos
=
document
.
getElementById
(
'cursos'
);
if
(
comboBoxCargo
.
value
===
"Estudante"
&&
comboBoxVinculo
.
value
!==
"Pós-doutorando"
)
{
if
(
comboBoxCargo
.
value
===
"Estudante"
&&
comboBoxVinculo
.
value
!==
"Pós-doutorando"
)
{
divProponente
.
style
.
display
=
"none"
;
divProponente
.
style
.
display
=
"none"
;
...
@@ -337,11 +337,11 @@
...
@@ -337,11 +337,11 @@
divProponente
.
style
.
display
=
"block"
;
divProponente
.
style
.
display
=
"block"
;
}
}
//
if (comboBoxCargo.value === "Professor") {
if
(
comboBoxCargo
.
value
===
"Professor"
)
{
//
cursos.style.display = "block";
cursos
.
style
.
display
=
"block"
;
//
} else {
}
else
{
//
cursos.style.display = "none";
cursos
.
style
.
display
=
"none"
;
//
}
}
outroVinculo
();
outroVinculo
();
}
}
...
...
resources/views/user/perfilUser.blade.php
View file @
09428058
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