diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 73e05e3..a100cb3 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -35,7 +35,7 @@ class HomeController extends Controller $femalePersonList = User::where('gender_id', 2)->pluck('nickname', 'id'); return view('users.show', [ - 'currentUser' => $user, + 'user' => $user, 'usersMariageList' => $usersMariageList, 'malePersonList' => $malePersonList, 'femalePersonList' => $femalePersonList diff --git a/app/Http/Controllers/UsersController.php b/app/Http/Controllers/UsersController.php index 02c5d51..fe72886 100644 --- a/app/Http/Controllers/UsersController.php +++ b/app/Http/Controllers/UsersController.php @@ -52,7 +52,7 @@ class UsersController extends Controller $femalePersonList = User::where('gender_id', 2)->pluck('nickname', 'id'); return view('users.show', [ - 'currentUser' => $user, + 'user' => $user, 'usersMariageList' => $usersMariageList, 'malePersonList' => $malePersonList, 'femalePersonList' => $femalePersonList, @@ -85,6 +85,11 @@ class UsersController extends Controller return view('users.chart', compact('user', 'childs', 'father', 'mother', 'fatherGrandpa', 'fatherGrandma', 'motherGrandpa', 'motherGrandma', 'siblings', 'colspan')); } + /** + * Show user family tree + * @param User $user + * @return \Illuminate\Http\Response + */ public function tree(User $user) { return view('users.tree', compact('user')); diff --git a/resources/lang/en/app.php b/resources/lang/en/app.php index 3781f95..6d729ab 100644 --- a/resources/lang/en/app.php +++ b/resources/lang/en/app.php @@ -29,6 +29,7 @@ return [ 'show_profile' => 'Show Profile', 'show_family_chart' => 'Show Family Chart', 'show_family_tree' => 'Show Family Tree', + 'show_marriages' => 'Show Marriages', 'enter_new_name' => 'Enter new Name...', 'select_from_existing_males' => 'Select from Existing Males', 'select_from_existing_females' => 'Select from Existing Females', diff --git a/resources/lang/id/app.php b/resources/lang/id/app.php index fadf826..1f5a2f2 100644 --- a/resources/lang/id/app.php +++ b/resources/lang/id/app.php @@ -29,6 +29,7 @@ return [ 'show_profile' => 'Lihat Profil', 'show_family_chart' => 'Lihat Bagan Keluarga', 'show_family_tree' => 'Lihat Pohon Keluarga', + 'show_marriages' => 'Lihat Pernikahan', 'enter_new_name' => 'Input Nama Baru...', 'select_from_existing_males' => 'Pilih dari Pria terdaftar', 'select_from_existing_females' => 'Pilih dari Wanita terdaftar', diff --git a/resources/views/layouts/user-profile-wide.blade.php b/resources/views/layouts/user-profile-wide.blade.php new file mode 100644 index 0000000..dbc6a87 --- /dev/null +++ b/resources/views/layouts/user-profile-wide.blade.php @@ -0,0 +1,11 @@ +@extends('layouts.app') + +@section('content') + +
| {{ trans('user.father') }} | - @can ('edit', $currentUser) + @can ('edit', $user) @if (request('action') == 'set_father') {{ Form::open(['route' => ['family-actions.set-father', $user->id]]) }} {!! FormField::select('set_father_id', $malePersonList, ['label' => false, 'value' => $user->father_id, 'placeholder' => trans('app.select_from_existing_males')]) !!} @@ -32,7 +32,7 @@ | ||||||
|---|---|---|---|---|---|---|---|
| {{ trans('user.mother') }} | - @can ('edit', $currentUser) + @can ('edit', $user) @if (request('action') == 'set_mother') {{ Form::open(['route' => ['family-actions.set-mother', $user->id]]) }} {!! FormField::select('set_mother_id', $femalePersonList, ['label' => false, 'value' => $user->mother_id, 'placeholder' => trans('app.select_from_existing_females')]) !!} @@ -59,7 +59,7 @@ | {{ trans('user.parent') }} |
- @can ('edit', $currentUser)
+ @can ('edit', $user)
@if (request('action') == 'set_parent')
{{ link_to_route('users.show', 'Batal', [$user->id], ['class' => 'btn btn-default btn-xs']) }}
@@ -73,7 +73,7 @@
{{ $user->parent->husband->name }} & {{ $user->parent->wife->name }}
@endif
- @can('edit', $currentUser)
+ @can('edit', $user)
@if (request('action') == 'set_parent')
{{ Form::open(['route' => ['family-actions.set-parent', $user->id]]) }}
{!! FormField::select('set_parent_id', $allMariageList, ['label' => false, 'value' => $user->parent_id, 'placeholder' => trans('app.select_from_existing_couples')]) !!}
@@ -87,7 +87,7 @@
{{ trans('user.wife') }} |
- @can ('edit', $currentUser)
+ @can ('edit', $user)
|
@if (request('action') == 'add_spouse')
{{ link_to_route('users.show', 'Batal', [$user->id], ['class' => 'btn btn-default btn-xs']) }}
@@ -104,7 +104,7 @@
@endforeach
@endif
- @can('edit', $currentUser)
+ @can('edit', $user)
@if (request('action') == 'add_spouse')
{{ Form::open(['route' => ['family-actions.add-wife', $user->id]]) }}
@@ -125,7 +125,7 @@
{{ trans('user.husband') }} |
- @can ('edit', $currentUser)
+ @can ('edit', $user)
|
@if (request('action') == 'add_spouse')
{{ link_to_route('users.show', 'Batal', [$user->id], ['class' => 'btn btn-default btn-xs']) }}
@@ -141,7 +141,7 @@
@endforeach
@endif
- @can('edit', $currentUser)
+ @can('edit', $user)
@if (request('action') == 'add_spouse')
{{ Form::open(['route' => ['family-actions.add-husband', $user->id]]) }}
diff --git a/resources/views/users/show.blade.php b/resources/views/users/show.blade.php
index 967f420..2e3a0f3 100644
--- a/resources/views/users/show.blade.php
+++ b/resources/views/users/show.blade.php
@@ -1,18 +1,16 @@
-@extends('layouts.app')
+@extends('layouts.user-profile')
-@section('content')
-
-- @include('users.partials.action-buttons', ['user' => $currentUser]) - {{ $currentUser->name }} {{ trans('user.profile') }} -+@section('subtitle', trans('user.profile')) + +@section('user-content')
- @include('users.partials.profile', ['user' => $currentUser])
- @include('users.partials.siblings', ['user' => $currentUser])
+ @include('users.partials.profile')
+ @include('users.partials.siblings')
- @include('users.partials.parent-spouse', ['user' => $currentUser])
- @include('users.partials.childs', ['user' => $currentUser])
+ @include('users.partials.parent-spouse')
+ @include('users.partials.childs')
- - @include('users.partials.action-buttons') - {{ $user->name }} {{ trans('app.family_tree') }} --
-
-
+@section('subtitle', trans('app.family_tree'))
+
+@section('user-content')
|