Commit 43b93c25 authored by ZeMKI's avatar ZeMKI
Browse files

Profile Page

parent bcd0ead4
......@@ -44,6 +44,16 @@ class UserController extends Controller
}
/**
*
*
*/
public function show()
{
return view('user.profile');
}
/**
* Register a user.
* @param User $user
......@@ -103,7 +113,9 @@ class UserController extends Controller
*/
public function destroy(User $user)
{
if(!auth()->user()->isAdmin())abort(401);
if (!auth()->user()->isAdmin()) {
abort(401);
}
//$user = User::where('id', $id)->first();
$user->delete();
return response('user deleted', 200);
......@@ -122,5 +134,4 @@ class UserController extends Controller
$user->save();
return response('Password is resetted for ' . $user->email . ' and an email was sent.');
}
}
......@@ -39,7 +39,7 @@
class="px-3 py-2 text-sm font-medium text-gray-200 rounded-md cursor-pointer pointer-events-none hover:text-gray-200">{{
Auth::user()->email }}</span>
</div>
<div class="relative flex-shrink-0 ml-4">
<div class="relative z-50 flex-shrink-0 ml-4">
<div>
<button ref="usermenu" @click="showdropdown('dropdownLogout')"
......@@ -50,19 +50,23 @@
<img class="w-8 h-8 rounded-full" src="{{\Gravatar::get(Auth::user()->email)}}" alt="">
</button>
</div>
<div id="dropdownLogout"
class="absolute right-0 hidden w-48 py-1 mt-2 origin-top-right bg-white rounded-md shadow-lg logoutdropdown-content ring-1 ring-black ring-opacity-5 focus:outline-none"
class="absolute right-0 hidden w-56 mt-2 origin-top-right bg-white rounded-md shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none"
role="menu" aria-orientation="vertical" aria-labelledby="user-menu-button" tabindex="-1">
<a title="User Profile" class="block px-4 py-2 text-sm text-gray-700" role="menuitem" tabindex="-2"
id="user-menu-item-1" href="{{ route('userprofile') }}">{{__('User Profile')}}</a>
<form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
@csrf
</form>
<a title="Logout" class="block px-4 py-2 text-sm text-gray-700" role="menuitem" tabindex="-1"
id="user-menu-item-1" href="{{ route('logout') }}" onclick="event.preventDefault();
document.getElementById('logout-form').submit();">Log out</a>
document.getElementById('logout-form').submit();">{{__('Log out')}}</a>
</div>
</div>
</div>
</div>
</div>
</div>
</nav>
\ No newline at end of file
</div>
</nav>
\ No newline at end of file
<div class="mx-auto mx-auto w-1/2">
<h1 class="text-4xl font-extrabold text-blue-600 break-words my-2">{{__('Studies where you\'ve been invited')}}</h1>
<div class="w-1/2 mx-auto">
<h1 class="my-2 text-4xl font-extrabold text-blue-600 break-words">{{__('Studies where you\'ve been invited')}}</h1>
</div>
<div class="w-2/3 overflow-y-auto mx-auto h-auto flex content-center flex-wrap align-top">
<div class="flex flex-wrap content-center w-2/3 h-auto mx-auto overflow-y-auto align-top">
@foreach ($invited_studies as $study)
<div class="w-1/4 border-solid border-l-2 border-b-2 border-t-2 border-r-2">
<div
class="w-full bg-gray-100 text-center sm:text-xs md:text-sm lg:text-xs xl:text-xl">
<div class="w-1/4 border-t-2 border-b-2 border-l-2 border-r-2 border-solid">
<div class="w-full text-center bg-gray-100 sm:text-xs md:text-sm lg:text-xs xl:text-xl">
<p class="text-2xl font-extrabold text-blue-400 break-words truncate px-2" title="{{$study->name}}">
{{$study->name}}
</p>
<p class="md:mt-2 lg:mt-2 md:p-2 lg:p-1 w-1/2 mx-auto rounded-full text-sm text-blue-200 bg-gray-700 break-words" title="{{$study->sortings[0]->name}}">
{{__($study->sortings[0]->name)}}
</p>
<p class="md:mt-2 lg:mt-2 md:p-2 lg:p-1 w-auto mx-auto text-sm text-blue-200 bg-gray-700 break-words" >
{{__('Invited by')}} {{$study->creator()->email}}
</p>
<div class="text-sm text-left my-2 px-2 h-32 break-words overflow-y-scroll">
<h5 class="font-bold text-center whitespace-normal break-words mb-2">{{ __('Responsible Researcher(s)') }}</h5>
<p>@text($study->author)</p>
</div>
<p class="px-2 text-2xl font-extrabold text-blue-400 break-words truncate" title="{{$study->name}}">
{{$study->name}}
</p>
<p class="w-1/2 mx-auto text-sm text-blue-200 break-words bg-gray-700 rounded-full md:mt-2 lg:mt-2 md:p-2 lg:p-1"
title="{{$study->sortings[0]->name}}">
{{__($study->sortings[0]->name)}}
</p>
<p class="w-auto mx-auto text-sm text-blue-200 break-words bg-gray-700 md:mt-2 lg:mt-2 md:p-2 lg:p-1">
{{__('Invited by')}} {{$study->creator()->email}}
</p>
<div class="h-32 px-2 my-2 overflow-y-scroll text-sm text-left break-words">
<h5 class="mb-2 font-bold text-center break-words whitespace-normal">{{ __('Responsible Researcher(s)')
}}</h5>
<p>@text($study->author)</p>
</div>
<div class="text-base h-32 break-words overflow-y-scroll bg-gray-300 p-2">
@text($study->description)
</div>
<div class="h-32 p-2 overflow-y-scroll text-base break-words bg-gray-300">
@text($study->description)
</div>
<a class="select-none text-black mt-2 inline min-w-full hover:no-underline uppercase text-2xl font-extrabold"
href="{{url('studies/'.$study->id)}}"
>
<div
class="min-w-full text-center bg-gray-400 hover:text-gray-800 hover:bg-gray-600">
<p class="justify-center align-middle items-center">
{{ __('Manage') }}
<svg class="fill-current inline w-6 h-8" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
<path fillRule="evenodd" d="M10.293 15.707a1 1 0 010-1.414L14.586 10l-4.293-4.293a1 1 0 111.414-1.414l5 5a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0z" clipRule="evenodd"/>
<path fillRule="evenodd" d="M4.293 15.707a1 1 0 010-1.414L8.586 10 4.293 5.707a1 1 0 011.414-1.414l5 5a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0z" clipRule="evenodd"/>
</svg>
</p>
</div>
<a class="inline min-w-full mt-2 text-2xl font-extrabold text-black uppercase select-none hover:no-underline"
href="{{url('studies/'.$study->id)}}">
<div class="min-w-full text-center bg-gray-400 hover:text-gray-800 hover:bg-gray-600">
<p class="items-center justify-center align-middle">
{{ __('Manage') }}
<svg class="inline w-6 h-8 fill-current" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"
fill="currentColor">
<path fillRule="evenodd"
d="M10.293 15.707a1 1 0 010-1.414L14.586 10l-4.293-4.293a1 1 0 111.414-1.414l5 5a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0z"
clipRule="evenodd" />
<path fillRule="evenodd"
d="M4.293 15.707a1 1 0 010-1.414L8.586 10 4.293 5.707a1 1 0 011.414-1.414l5 5a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0z"
clipRule="evenodd" />
</svg>
</p>
</div>
</a>
<a class="select-none text-white mt-2 inline min-w-full hover:no-underline"
href="{{url('interview/new').'?study='.$study->id}}"
@click.prevent="setinterviewdname({{$study->id}})">
<div
class="min-w-full text-center bg-green-600 hover:text-gray-300 hover:bg-green-900 text-2xl font-extrabold">
{{ __('New Interview') }}
</a>
<a class="inline min-w-full mt-2 text-white select-none hover:no-underline"
href="{{url('interview/new').'?study='.$study->id}}" @click.prevent="setinterviewdname({{$study->id}})">
<div
class="min-w-full text-2xl font-extrabold text-center bg-green-600 hover:text-gray-300 hover:bg-green-900">
{{ __('New Interview') }}
</div>
</a>
<a class="select-none text-white mt-2 inline min-w-full hover:no-underline"
href="#"
@click="toggleModal({{$study->id}})">
<div
class="min-w-full text-center bg-green-500 hover:text-gray-300 hover:bg-green-800 modal-open text-2xl font-extrabold">
{{ __('New Public Url') }}
</div>
</a>
<a class="inline min-w-full mt-2 text-white select-none hover:no-underline" href="#"
@click="toggleModal({{$study->id}})">
<div
class="min-w-full text-2xl font-extrabold text-center bg-green-500 hover:text-gray-300 hover:bg-green-800 modal-open">
{{ __('New Public Url') }}
</div>
</a>
<a class="select-none text-white mt-2 inline min-w-full hover:no-underline uppercase md:lowercase sm:lowercase sm:text-base md:text-xl lg:text-2xl font-extrabold"
href="#"
@click="confirmLeaveProject({{auth()->user()}},{{$study->id}})">
<div
class="min-w-full text-center bg-red-400 hover:text-gray-100 hover:bg-red-600">
</div>
</a>
<a class="inline min-w-full mt-2 font-extrabold text-white uppercase select-none hover:no-underline md:lowercase sm:lowercase sm:text-base md:text-xl lg:text-2xl"
href="#" @click="confirmLeaveProject({{auth()->user()}},{{$study->id}})">
<div class="min-w-full text-center bg-red-400 hover:text-gray-100 hover:bg-red-600">
{{__('Leave Study')}}
</div>
</a>
</div>
</a>
</div>
</div>
</div>
@endforeach
</div>
</div>
\ No newline at end of file
This diff is collapsed.
<?php
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| Web Routes
......@@ -38,12 +37,11 @@ Route::post('deploy', 'DeployController@deploy');
Route::group(['middleware' => ['interview']], static function () {
Route::get('/interviews/new', 'InterviewController@create');
Route::post('/interviews', 'InterviewController@store');
});
Route::lingua('translations');
Route::get('/qsort','HomeController@qsort');
Route::get('/qsort', 'HomeController@qsort');
......@@ -97,6 +95,7 @@ Route::group(['middleware' => ['auth', 'verified']], static function () {
Route::post('/users', 'UserController@store');
Route::get('/users', 'UserController@overview');
Route::get('/user/profile', 'UserController@show')->name('userprofile');
Route::get('/user/{user}', 'UserController@edit');
Route::patch('/users/{user}', 'UserController@update');
Route::delete('/users/{user}', 'UserController@destroy');
......
Supports Markdown
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