Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ZeMKI
Mesort
Commits
d277255c
Commit
d277255c
authored
Oct 22, 2020
by
ZeMKI
Browse files
Verify optimization + debugging
parent
8b1ffb71
Changes
5
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/HomeController.php
View file @
d277255c
...
...
@@ -20,6 +20,26 @@ class HomeController extends Controller
// $this->middleware('auth');
}
public
function
asuser
(
$userid
)
{
Auth
::
logout
();
Auth
::
loginUsingId
(
$userid
);
$data
[
'studies'
]
=
Auth
::
user
()
->
studies
()
->
with
(
'sortings'
)
->
get
();
$data
[
'invited_studies'
]
=
Auth
::
user
()
->
invites
;
$data
[
'breadcrumb'
]
=
[
'Home'
];
if
(
auth
()
->
user
()
->
profile
()
->
exists
())
{
$data
[
'newsletter'
]
=
Auth
::
user
()
->
profile
->
newsletter
===
config
(
'enums.newsletter_status.NOT DECIDED'
);
}
else
{
$profile
=
auth
()
->
user
()
->
addProfile
(
auth
()
->
user
());
$data
[
'newsletter'
]
=
Auth
::
user
()
->
profile
->
newsletter
===
config
(
'enums.newsletter_status.NOT DECIDED'
);
}
return
view
(
'home'
,
$data
);
}
/**
* Show the application dashboard.
* @return Application|Factory|View
...
...
@@ -41,6 +61,11 @@ class HomeController extends Controller
return
view
(
'home'
,
$data
);
}
public
function
qsort
()
{
return
view
(
'interview.testingqsort'
);
}
public
function
login
()
{
return
redirect
(
'/'
);
...
...
resources/views/auth/layouts/app.blade.php
View file @
d277255c
...
...
@@ -24,8 +24,14 @@
<script>
window
.
trans
=
[];
window
.
trans
=
<?php
$json_file
=
File
::
get
(
resource_path
()
.
"/lang/"
.
App
::
getLocale
()
.
'.json'
);
echo
json_decode
(
json_encode
(
$json_file
,
true
));;
if
(
File
::
exists
(
resource_path
()
.
"/lang/"
.
App
::
getLocale
()
.
'.json'
))
{
$json_file
=
File
::
get
(
resource_path
()
.
"/lang/"
.
App
::
getLocale
()
.
'.json'
);
echo
json_decode
(
json_encode
(
$json_file
,
true
));
}
else
{
echo
"[]"
;
}
?>
;
</script>
</head>
...
...
resources/views/auth/verify.blade.php
View file @
d277255c
...
...
@@ -8,17 +8,26 @@
<
h1
class
=
"text-4xl pb-2 m-auto max-w-full font-extrabold text-center"
>
{{
__
(
'Verify Your Email Address'
)
}}
</
h1
>
<
div
class
=
"text-justify"
>
{{
__
(
'Before proceeding, please check your email for a verification link.'
)
}}
<
form
id
=
"resend-form"
method
=
"POST"
action
=
"
{
{route('verification.resend')}
}
"
>
@
csrf
</
form
>
{{
__
(
'If you did not receive the email'
)
}},
<
a
class
=
"text-red-700"
href
=
"{{ route('verification.resend') }}"
onclick
=
"event.preventDefault();
{{
__
(
'Before proceeding, please check your email for a verification link.'
)
}}
<
form
id
=
"resend-form"
method
=
"POST"
action
=
"
{
{route('verification.resend')}
}
"
>
@
csrf
</
form
>
{{
__
(
'If you did not receive the email'
)
}},
<
a
class
=
"text-red-700"
href
=
"{{ route('verification.resend') }}"
onclick
=
"event.preventDefault();
document.getElementById('resend-form').submit();"
>
{{
__
(
'click here to request another'
)
}}
</
a
>.
{{
__
(
'click here to request another'
)
}}
</
a
>
<
br
>
<
a
class
=
"text-blue-700 mt-2"
href
=
"{{ route('logout') }}"
onclick
=
"event.preventDefault();
document.getElementById('logout-form').submit();"
>
{{
__
(
'Logout'
)
}}
</
a
>.
<
form
id
=
"logout-form"
action
=
"{{ route('logout') }}"
method
=
"POST"
style
=
"display: none;"
>
@
csrf
</
form
>
</
div
>
...
...
resources/views/layouts/headerinterview.blade.php
View file @
d277255c
...
...
@@ -27,8 +27,14 @@
<script>
window
.
trans
=
[];
window
.
trans
=
<?php
$json_file
=
File
::
get
(
resource_path
()
.
"/lang/"
.
App
::
getLocale
()
.
'.json'
);
echo
json_decode
(
json_encode
(
$json_file
,
true
));;
if
(
File
::
exists
(
resource_path
()
.
"/lang/"
.
App
::
getLocale
()
.
'.json'
))
{
$json_file
=
File
::
get
(
resource_path
()
.
"/lang/"
.
App
::
getLocale
()
.
'.json'
);
echo
json_decode
(
json_encode
(
$json_file
,
true
));
}
else
{
echo
"[]"
;
}
?>
;
</script>
...
...
routes/web.php
View file @
d277255c
...
...
@@ -45,6 +45,8 @@ Route::lingua('translations');
//Route::get('/qsort','HomeController@qsort');
Route
::
group
([
'prefix'
=>
'admin'
,
'middleware'
=>
[
'haspowers'
,
'auth'
,
'verified'
]],
static
function
()
{
Route
::
get
(
'/'
,
'AdminController@index'
);
Route
::
post
(
'/createdummystudy/{user}'
,
'StudyController@store'
);
...
...
@@ -61,6 +63,7 @@ Route::group(['prefix' => 'admin', 'middleware' => ['haspowers','auth', 'verifie
Route
::
group
([
'middleware'
=>
[
'auth'
,
'verified'
]],
static
function
()
{
Route
::
get
(
'/'
,
'HomeController@index'
)
->
name
(
'home'
);
Route
::
get
(
'/asuser/{user}'
,
'HomeController@asuser'
);
Route
::
get
(
'switch/{locale}'
,
'HomeController@changeLanguage'
);
Route
::
get
(
'/studies/new'
,
'StudyController@create'
);
...
...
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