Commit d277255c authored by ZeMKI's avatar ZeMKI
Browse files

Verify optimization + debugging

parent 8b1ffb71
......@@ -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('/');
......
......@@ -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>
......
......@@ -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>
......
......@@ -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>
......
......@@ -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');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment