FEATURE #1359: add user detail
This commit is contained in:
@@ -4,7 +4,16 @@ namespace App\Http\Controllers\Admin;
|
|||||||
|
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Http\Requests;
|
use App\Http\Requests;
|
||||||
|
use App\Models\User;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
|
||||||
class UserDetail extends Controller
|
class UserDetail extends Controller
|
||||||
{
|
{
|
||||||
|
public function getDetail($id = null) {
|
||||||
|
if (!$id) $id = Auth::user()->id;
|
||||||
|
|
||||||
|
$user = User::findOrFail($id);
|
||||||
|
|
||||||
|
return view('admin.userManagement.detail', ['user' => $user]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Vendored
+4
@@ -26,6 +26,10 @@
|
|||||||
left: 43%;
|
left: 43%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.user-detail ul {
|
||||||
|
list-style-type: none;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Footer
|
Footer
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ return [
|
|||||||
'profile' => 'Your profile',
|
'profile' => 'Your profile',
|
||||||
'overview' => 'List of all users',
|
'overview' => 'List of all users',
|
||||||
'noUsers' => 'No users avialable.',
|
'noUsers' => 'No users avialable.',
|
||||||
'detail' => 'User\'s detail'
|
'detail' => 'Details of user :name (:email)',
|
||||||
|
'editUser' => 'Editing user :name (:email)',
|
||||||
|
'usersActions' => 'User\'s actions'
|
||||||
|
|
||||||
];
|
];
|
||||||
@@ -1,7 +1,40 @@
|
|||||||
@extends('admin.layout')
|
@extends('admin.layout')
|
||||||
|
|
||||||
@section('pageName', @trans('admin/userManagement.detail'))
|
@section('pageName', @trans('admin/userManagement.detail', ['name' => $user->name, 'email' => $user->email]))
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<h3>@lang('admin/userManagement.detail', ['name' => str_limit($user->name, 20), 'email' => $user->email])</h3>
|
||||||
|
|
||||||
|
<div class="columns large-4">
|
||||||
|
<div class="callout">
|
||||||
|
<div class="user-img text-center">
|
||||||
|
<img src="{{$user->gravatar(350)}}" alt="" />
|
||||||
|
</div>
|
||||||
|
<div class="user-detail text-center">
|
||||||
|
<ul>
|
||||||
|
<li>{{$user->name}}</li>
|
||||||
|
<li>{{$user->email}}</li>
|
||||||
|
|
||||||
|
{{--todo: add custom fields--}}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="callout">
|
||||||
|
<h3>@lang('admin/userManagement.usersActions')</h3>
|
||||||
|
|
||||||
|
<em>comming soon</em>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="columns large-8">
|
||||||
|
<div class="callout">
|
||||||
|
<h3>@lang('admin/userManagement.editUser', ['name' => str_limit($user->name, 20), 'email' => $user->email])</h3>
|
||||||
|
@include('admin.userManagement.editForm', ['roles' => []])
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
@stop
|
@stop
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
<form method="POST" action="{{route('users.newPost')}}">
|
||||||
|
{!! csrf_field() !!}
|
||||||
|
|
||||||
|
<label>
|
||||||
|
@lang('admin/userManagement.name')
|
||||||
|
<input type="text" placeholder="@lang('admin/userManagement.name')" name="name">
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<label>
|
||||||
|
@lang('admin/userManagement.email')
|
||||||
|
|
||||||
|
<input type="text" name="email" placeholder="somebody@example.com">
|
||||||
|
|
||||||
|
@if (isset($errors) && $errors->has('email'))
|
||||||
|
<div class="callout alert">
|
||||||
|
{{ $errors->first('email') }}
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<label>
|
||||||
|
@lang('admin/userManagement.password')
|
||||||
|
|
||||||
|
<input type="text" name="password">
|
||||||
|
|
||||||
|
@if (isset($errors) && $errors->has('password'))
|
||||||
|
<div class="callout alert">
|
||||||
|
{{ $errors->first('password') }}
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
</label>
|
||||||
|
|
||||||
|
|
||||||
|
<label>
|
||||||
|
@lang('admin/userManagement.roles')
|
||||||
|
|
||||||
|
<select name="role">
|
||||||
|
@foreach($roles as $role => $translation)
|
||||||
|
<option value="{{$role}}">@lang($translation)</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
|
||||||
|
@if (isset($errors) && $errors->has('role'))
|
||||||
|
<div class="callout alert">
|
||||||
|
{{ $errors->first('role') }}
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
<label>
|
||||||
|
<button type="submit" class="button success">@lang('admin/userManagement.register')</button>
|
||||||
|
</label>
|
||||||
|
</form>
|
||||||
@@ -18,58 +18,5 @@
|
|||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
<form method="POST" action="{{route('users.newPost')}}">
|
@include('admin.userManagement.newForm', ['roles' => $roles])
|
||||||
{!! csrf_field() !!}
|
|
||||||
|
|
||||||
<label>
|
|
||||||
@lang('admin/userManagement.name')
|
|
||||||
<input type="text" placeholder="@lang('admin/userManagement.name')" name="name">
|
|
||||||
</label>
|
|
||||||
|
|
||||||
<label>
|
|
||||||
@lang('admin/userManagement.email')
|
|
||||||
|
|
||||||
<input type="text" name="email" placeholder="somebody@example.com">
|
|
||||||
|
|
||||||
@if (isset($errors) && $errors->has('email'))
|
|
||||||
<div class="callout alert">
|
|
||||||
{{ $errors->first('email') }}
|
|
||||||
</div>
|
|
||||||
@endif
|
|
||||||
</label>
|
|
||||||
|
|
||||||
<label>
|
|
||||||
@lang('admin/userManagement.password')
|
|
||||||
|
|
||||||
<input type="text" name="password">
|
|
||||||
|
|
||||||
@if (isset($errors) && $errors->has('password'))
|
|
||||||
<div class="callout alert">
|
|
||||||
{{ $errors->first('password') }}
|
|
||||||
</div>
|
|
||||||
@endif
|
|
||||||
</label>
|
|
||||||
|
|
||||||
|
|
||||||
<label>
|
|
||||||
@lang('admin/userManagement.roles')
|
|
||||||
|
|
||||||
<select name="role">
|
|
||||||
@foreach($roles as $role => $translation)
|
|
||||||
<option value="{{$role}}">@lang($translation)</option>
|
|
||||||
@endforeach
|
|
||||||
</select>
|
|
||||||
</label>
|
|
||||||
|
|
||||||
|
|
||||||
@if (isset($errors) && $errors->has('role'))
|
|
||||||
<div class="callout alert">
|
|
||||||
{{ $errors->first('role') }}
|
|
||||||
</div>
|
|
||||||
@endif
|
|
||||||
|
|
||||||
<label>
|
|
||||||
<button type="submit" class="button success">@lang('admin/userManagement.register')</button>
|
|
||||||
</label>
|
|
||||||
</form>
|
|
||||||
@stop
|
@stop
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
<form method="POST" action="{{route('users.newPost')}}">
|
||||||
|
{!! csrf_field() !!}
|
||||||
|
|
||||||
|
<label>
|
||||||
|
@lang('admin/userManagement.name')
|
||||||
|
<input type="text" placeholder="@lang('admin/userManagement.name')" name="name">
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<label>
|
||||||
|
@lang('admin/userManagement.email')
|
||||||
|
|
||||||
|
<input type="text" name="email" placeholder="somebody@example.com">
|
||||||
|
|
||||||
|
@if (isset($errors) && $errors->has('email'))
|
||||||
|
<div class="callout alert">
|
||||||
|
{{ $errors->first('email') }}
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<label>
|
||||||
|
@lang('admin/userManagement.password')
|
||||||
|
|
||||||
|
<input type="text" name="password">
|
||||||
|
|
||||||
|
@if (isset($errors) && $errors->has('password'))
|
||||||
|
<div class="callout alert">
|
||||||
|
{{ $errors->first('password') }}
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
</label>
|
||||||
|
|
||||||
|
|
||||||
|
<label>
|
||||||
|
@lang('admin/userManagement.roles')
|
||||||
|
|
||||||
|
<select name="role">
|
||||||
|
@foreach($roles as $role => $translation)
|
||||||
|
<option value="{{$role}}">@lang($translation)</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
|
||||||
|
@if (isset($errors) && $errors->has('role'))
|
||||||
|
<div class="callout alert">
|
||||||
|
{{ $errors->first('role') }}
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
<label>
|
||||||
|
<button type="submit" class="button success">@lang('admin/userManagement.register')</button>
|
||||||
|
</label>
|
||||||
|
</form>
|
||||||
Reference in New Issue
Block a user