Browse Source

Update lang feature on parent-spouse view

pull/21/head
Nafies Luthfi 7 years ago
parent
commit
305f258a1d
  1. 132
      resources/views/users/partials/parent-spouse.blade.php

132
resources/views/users/partials/parent-spouse.blade.php

@ -1,27 +1,27 @@
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"><h3 class="panel-title">{{ trans('user.family') }}</h3></div>
<div class="panel-heading"><h3 class="panel-title">{{ __('user.family') }}</h3></div>
<table class="table"> <table class="table">
<tbody> <tbody>
<tr> <tr>
<th class="col-sm-4">{{ trans('user.father') }}</th>
<th class="col-sm-4">{{ __('user.father') }}</th>
<td class="col-sm-8"> <td class="col-sm-8">
@can ('edit', $user) @can ('edit', $user)
@if (request('action') == 'set_father') @if (request('action') == 'set_father')
{{ Form::open(['route' => ['family-actions.set-father', $user->id]]) }} {{ 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')]) !!}
{!! FormField::select('set_father_id', $malePersonList, ['label' => false, 'value' => $user->father_id, 'placeholder' => __('app.select_from_existing_males')]) !!}
<div class="input-group"> <div class="input-group">
{{ Form::text('set_father', null, ['class' => 'form-control input-sm', 'placeholder' => trans('app.enter_new_name')]) }}
{{ Form::text('set_father', null, ['class' => 'form-control input-sm', 'placeholder' => __('app.enter_new_name')]) }}
<span class="input-group-btn"> <span class="input-group-btn">
{{ Form::submit('update', ['class' => 'btn btn-info btn-sm', 'id' => 'set_father_button']) }}
{{ link_to_route('users.show', trans('app.cancel'), [$user->id], ['class' => 'btn btn-default btn-sm']) }}
{{ Form::submit(__('app.update'), ['class' => 'btn btn-info btn-sm', 'id' => 'set_father_button']) }}
{{ link_to_route('users.show', __('app.cancel'), [$user->id], ['class' => 'btn btn-default btn-sm']) }}
</span> </span>
</div> </div>
{{ Form::close() }} {{ Form::close() }}
@else @else
{{ $user->fatherLink() }} {{ $user->fatherLink() }}
<div class="pull-right"> <div class="pull-right">
{{ link_to_route('users.show', trans('user.set_father'), [$user->id, 'action' => 'set_father'], ['class' => 'btn btn-link btn-xs']) }}
{{ link_to_route('users.show', __('user.set_father'), [$user->id, 'action' => 'set_father'], ['class' => 'btn btn-link btn-xs']) }}
</div> </div>
@endif @endif
@else @else
@ -30,24 +30,24 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<th>{{ trans('user.mother') }}</th>
<th>{{ __('user.mother') }}</th>
<td> <td>
@can ('edit', $user) @can ('edit', $user)
@if (request('action') == 'set_mother') @if (request('action') == 'set_mother')
{{ Form::open(['route' => ['family-actions.set-mother', $user->id]]) }} {{ 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')]) !!}
{!! FormField::select('set_mother_id', $femalePersonList, ['label' => false, 'value' => $user->mother_id, 'placeholder' => __('app.select_from_existing_females')]) !!}
<div class="input-group"> <div class="input-group">
{{ Form::text('set_mother', null, ['class' => 'form-control input-sm', 'placeholder' => trans('app.enter_new_name')]) }}
{{ Form::text('set_mother', null, ['class' => 'form-control input-sm', 'placeholder' => __('app.enter_new_name')]) }}
<span class="input-group-btn"> <span class="input-group-btn">
{{ Form::submit('update', ['class' => 'btn btn-info btn-sm', 'id' => 'set_mother_button']) }}
{{ link_to_route('users.show', trans('app.cancel'), [$user->id], ['class' => 'btn btn-default btn-sm']) }}
{{ Form::submit(__('app.update'), ['class' => 'btn btn-info btn-sm', 'id' => 'set_mother_button']) }}
{{ link_to_route('users.show', __('app.cancel'), [$user->id], ['class' => 'btn btn-default btn-sm']) }}
</span> </span>
</div> </div>
{{ Form::close() }} {{ Form::close() }}
@else @else
{{ $user->motherLink() }} {{ $user->motherLink() }}
<div class="pull-right"> <div class="pull-right">
{{ link_to_route('users.show', trans('user.set_mother'), [$user->id, 'action' => 'set_mother'], ['class' => 'btn btn-link btn-xs']) }}
{{ link_to_route('users.show', __('user.set_mother'), [$user->id, 'action' => 'set_mother'], ['class' => 'btn btn-link btn-xs']) }}
</div> </div>
@endif @endif
@else @else
@ -56,16 +56,13 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<th class="col-sm-4">{{ trans('user.parent') }}</th>
<th class="col-sm-4">{{ __('user.parent') }}</th>
<td class="col-sm-8"> <td class="col-sm-8">
@can ('edit', $user) @can ('edit', $user)
<div class="pull-right"> <div class="pull-right">
@if (request('action') == 'set_parent')
{{ link_to_route('users.show', trans('app.cancel'), [$user->id], ['class' => 'btn btn-default btn-xs']) }}
@else
{{ link_to_route('users.show', trans('user.set_parent'), [$user->id, 'action' => 'set_parent'], ['class' => 'btn btn-link btn-xs']) }}
@endif
@unless (request('action') == 'set_parent')
{{ link_to_route('users.show', __('user.set_parent'), [$user->id, 'action' => 'set_parent'], ['class' => 'btn btn-link btn-xs']) }}
@endunless
</div> </div>
@endcan @endcan
@ -74,26 +71,25 @@
@endif @endif
@can('edit', $user) @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')]) !!}
{{ Form::submit('update', ['class' => 'btn btn-info btn-sm', 'id' => 'set_parent_button']) }}
{{ Form::close() }}
@endif
@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' => __('app.select_from_existing_couples')]) !!}
{{ Form::submit(__('app.update'), ['class' => 'btn btn-info btn-sm', 'id' => 'set_parent_button']) }}
{{ link_to_route('users.show', __('app.cancel'), $user, ['class' => 'btn btn-default btn-sm']) }}
{{ Form::close() }}
@endif
@endcan @endcan
</td> </td>
</tr> </tr>
@if ($user->gender_id == 1) @if ($user->gender_id == 1)
<tr> <tr>
<th>{{ trans('user.wife') }}</th>
<th>{{ __('user.wife') }}</th>
<td> <td>
@can ('edit', $user) @can ('edit', $user)
<div class="pull-right"> <div class="pull-right">
@if (request('action') == 'add_spouse')
{{ link_to_route('users.show', trans('app.cancel'), [$user->id], ['class' => 'btn btn-default btn-xs']) }}
@else
{{ link_to_route('users.show', trans('user.add_wife'), [$user->id, 'action' => 'add_spouse'], ['class' => 'btn btn-link btn-xs']) }}
@endif
@unless (request('action') == 'add_spouse')
{{ link_to_route('users.show', __('user.add_wife'), [$user->id, 'action' => 'add_spouse'], ['class' => 'btn btn-link btn-xs']) }}
@endunless
</div> </div>
@endcan @endcan
@ -105,38 +101,37 @@
</ul> </ul>
@endif @endif
@can('edit', $user) @can('edit', $user)
@if (request('action') == 'add_spouse')
<div>
{{ Form::open(['route' => ['family-actions.add-wife', $user->id]]) }}
{!! FormField::select('set_wife_id', $femalePersonList, ['label' => false, 'placeholder' => trans('app.select_from_existing_females')]) !!}
<div class="form-group">
<div class="row">
<div class="col-md-7">
{{ Form::text('set_wife', null, ['class' => 'form-control input-sm', 'placeholder' => trans('app.enter_new_name')]) }}
</div>
<div class="col-md-5">
{{ Form::text('marriage_date', null, ['class' => 'form-control input-sm', 'placeholder' => trans('couple.marriage_date')]) }}
@if (request('action') == 'add_spouse')
<div>
{{ Form::open(['route' => ['family-actions.add-wife', $user->id]]) }}
{!! FormField::select('set_wife_id', $femalePersonList, ['label' => false, 'placeholder' => __('app.select_from_existing_females')]) !!}
<div class="form-group">
<div class="row">
<div class="col-md-7">
{{ Form::text('set_wife', null, ['class' => 'form-control input-sm', 'placeholder' => __('app.enter_new_name')]) }}
</div>
<div class="col-md-5">
{{ Form::text('marriage_date', null, ['class' => 'form-control input-sm', 'placeholder' => __('couple.marriage_date')]) }}
</div>
</div> </div>
</div> </div>
{{ Form::submit(__('app.update'), ['class' => 'btn btn-info btn-sm', 'id' => 'set_wife_button']) }}
{{ link_to_route('users.show', __('app.cancel'), $user, ['class' => 'btn btn-default btn-sm']) }}
{{ Form::close() }}
</div> </div>
{{ Form::submit('update', ['class' => 'btn btn-info btn-sm', 'id' => 'set_wife_button']) }}
{{ Form::close() }}
</div>
@endif
@endif
@endcan @endcan
</td> </td>
</tr> </tr>
@else @else
<tr> <tr>
<th>{{ trans('user.husband') }}</th>
<th>{{ __('user.husband') }}</th>
<td> <td>
@can ('edit', $user) @can ('edit', $user)
<div class="pull-right"> <div class="pull-right">
@if (request('action') == 'add_spouse')
{{ link_to_route('users.show', trans('app.cancel'), [$user->id], ['class' => 'btn btn-default btn-xs']) }}
@else
{{ link_to_route('users.show', trans('user.add_husband'), [$user->id, 'action' => 'add_spouse'], ['class' => 'btn btn-link btn-xs']) }}
@endif
@unless (request('action') == 'add_spouse')
{{ link_to_route('users.show', __('user.add_husband'), [$user->id, 'action' => 'add_spouse'], ['class' => 'btn btn-link btn-xs']) }}
@endunless
</div> </div>
@endcan @endcan
@if ($user->husbands->isEmpty() == false) @if ($user->husbands->isEmpty() == false)
@ -147,24 +142,25 @@
</ul> </ul>
@endif @endif
@can('edit', $user) @can('edit', $user)
@if (request('action') == 'add_spouse')
<div>
{{ Form::open(['route' => ['family-actions.add-husband', $user->id]]) }}
{!! FormField::select('set_husband_id', $malePersonList, ['label' => false, 'placeholder' => trans('app.select_from_existing_males')]) !!}
<div class="form-group">
<div class="row">
<div class="col-md-7">
{{ Form::text('set_husband', null, ['class' => 'form-control input-sm', 'placeholder' => trans('app.enter_new_name')]) }}
</div>
<div class="col-md-5">
{{ Form::text('marriage_date', null, ['class' => 'form-control input-sm', 'placeholder' => trans('couple.marriage_date')]) }}
@if (request('action') == 'add_spouse')
<div>
{{ Form::open(['route' => ['family-actions.add-husband', $user->id]]) }}
{!! FormField::select('set_husband_id', $malePersonList, ['label' => false, 'placeholder' => __('app.select_from_existing_males')]) !!}
<div class="form-group">
<div class="row">
<div class="col-md-7">
{{ Form::text('set_husband', null, ['class' => 'form-control input-sm', 'placeholder' => __('app.enter_new_name')]) }}
</div>
<div class="col-md-5">
{{ Form::text('marriage_date', null, ['class' => 'form-control input-sm', 'placeholder' => __('couple.marriage_date')]) }}
</div>
</div> </div>
</div> </div>
{{ Form::submit(__('app.update'), ['class' => 'btn btn-info btn-sm', 'id' => 'set_husband_button']) }}
{{ link_to_route('users.show', __('app.cancel'), [$user->id], ['class' => 'btn btn-default btn-sm']) }}
{{ Form::close() }}
</div> </div>
{{ Form::submit('update', ['class' => 'btn btn-info btn-sm', 'id' => 'set_husband_button']) }}
{{ Form::close() }}
</div>
@endif
@endif
@endcan @endcan
</td> </td>
</tr> </tr>

Loading…
Cancel
Save