Browse Source

Added trans helper on user action views

pull/3/head
Nafies Luthfi 8 years ago
parent
commit
62b48da971
  1. 4
      resources/lang/en/app.php
  2. 1
      resources/lang/en/user.php
  3. 4
      resources/lang/id/app.php
  4. 1
      resources/lang/id/user.php
  5. 12
      resources/views/users/partials/childs.blade.php
  6. 30
      resources/views/users/partials/parent-spouse.blade.php
  7. 18
      resources/views/users/partials/profile.blade.php
  8. 2
      resources/views/users/partials/siblings.blade.php
  9. 2
      resources/views/users/show.blade.php

4
resources/lang/en/app.php

@ -15,4 +15,8 @@ return [
'show_profile' => 'Show Profile',
'show_family_chart' => 'Show Family Chart',
'show_family_tree' => 'Show Family Tree',
'enter_new_name' => 'Enter new Name...',
'select_from_existing_males' => 'Select from Existing Males',
'select_from_existing_females' => 'Select from Existing Females',
'select_from_existing_couples' => 'Select from Existing Couples',
];

1
resources/lang/en/user.php

@ -25,6 +25,7 @@ return [
'add_wife' => 'Add Wife',
'add_husband' => 'Add Husband',
'add_child' => 'Add Child',
'add_child_from_existing_couples' => 'Parent (select spouse of :name)',
// Attributes
'name' => 'Name',

4
resources/lang/id/app.php

@ -15,4 +15,8 @@ return [
'show_profile' => 'Lihat Profil',
'show_family_chart' => 'Lihat Bagan Keluarga',
'show_family_tree' => 'Lihat Pohon Keluarga',
'enter_new_name' => 'Input Nama Baru...',
'select_from_existing_males' => 'Pilih dari Pria terdaftar',
'select_from_existing_females' => 'Pilih dari Wanita terdaftar',
'select_from_existing_couples' => 'Pilih Pasangan Pernikahan',
];

1
resources/lang/id/user.php

@ -25,6 +25,7 @@ return [
'add_wife' => 'Tambah Isteri',
'add_husband' => 'Tambah Suami',
'add_child' => 'Tambah Anak',
'add_child_from_existing_couples' => 'Dari Pernikahan (pilih pasangan :name)',
// Attributes
'name' => 'Nama',

12
resources/views/users/partials/childs.blade.php

@ -2,10 +2,10 @@
<div class="panel-heading">
@can ('edit', $currentUser)
<div class="pull-right" style="margin: -3px -6px">
{{ link_to_route('users.show', 'Tambah Anak', [$user->id, 'action' => 'add_child'], ['class' => 'btn btn-success btn-xs']) }}
{{ link_to_route('users.show', trans('user.add_child'), [$user->id, 'action' => 'add_child'], ['class' => 'btn btn-success btn-xs']) }}
</div>
@endcan
<h3 class="panel-title">Anak-Anak ({{ $user->childs->count() }})</h3>
<h3 class="panel-title">{{ trans('user.childs') }} ({{ $user->childs->count() }})</h3>
</div>
<ul class="list-group">
@ -20,14 +20,14 @@
{{ Form::open(['route' => ['family-actions.add-child', $user->id]]) }}
<div class="row">
<div class="col-md-6">
{!! FormField::text('add_child_name', ['label' => 'Nama Anak']) !!}
{!! FormField::text('add_child_name', ['label' => trans('user.child_name')]) !!}
</div>
<div class="col-md-6">
{!! FormField::radios('add_child_gender_id', [1 => 'Laki-laki', 2 => 'Perempuan'], ['label' => 'Jenis Kelamin Anak']) !!}
{!! FormField::radios('add_child_gender_id', [1 => trans('app.male'), 2 => trans('app.female')], ['label' => trans('user.child_gender')]) !!}
</div>
</div>
{!! FormField::select('add_child_parent_id', $usersMariageList, ['label' => 'Dari Pernikahan (pilih pasangan '.$user->name.')', 'placeholder' => 'Tidak diketahui']) !!}
{{ Form::submit('Tambah Anak', ['class' => 'btn btn-success btn-sm']) }}
{!! FormField::select('add_child_parent_id', $usersMariageList, ['label' => trans('user.add_child_from_existing_couples', ['name' => $user->name]), 'placeholder' => trans('app.unknown')]) !!}
{{ Form::submit(trans('user.add_child'), ['class' => 'btn btn-success btn-sm']) }}
{{ link_to_route('users.show', 'Batal', [$user->id], ['class' => 'btn btn-default btn-sm']) }}
{{ Form::close() }}
</li>

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

@ -1,17 +1,17 @@
<div class="panel panel-default">
<div class="panel-heading"><h3 class="panel-title">Keluarga</h3></div>
<div class="panel-heading"><h3 class="panel-title">{{ trans('user.family') }}</h3></div>
<table class="table">
<tbody>
<tr>
<th class="col-sm-4">Ayah</th>
<th class="col-sm-4">{{ trans('user.father') }}</th>
<td class="col-sm-8">
@can ('edit', $currentUser)
@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' => 'Pilih dari Laki-laki Terdaftar']) !!}
{!! FormField::select('set_father_id', $malePersonList, ['label' => false, 'value' => $user->father_id, 'placeholder' => trans('app.select_from_existing_males')]) !!}
<div class="input-group">
{{ Form::text('set_father', null, ['class' => 'form-control input-sm', 'placeholder' => 'Input Nama Baru...']) }}
{{ Form::text('set_father', null, ['class' => 'form-control input-sm', 'placeholder' => trans('app.enter_new_name')]) }}
<span class="input-group-btn">
{{ Form::submit('update', ['class' => 'btn btn-info btn-sm', 'id' => 'set_father_button']) }}
{{ link_to_route('users.show', 'Batal', [$user->id], ['class' => 'btn btn-default btn-sm']) }}
@ -30,14 +30,14 @@
</td>
</tr>
<tr>
<th>Ibu</th>
<th>{{ trans('user.mother') }}</th>
<td>
@can ('edit', $currentUser)
@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' => 'Pilih dari Wanita Terdaftar']) !!}
{!! FormField::select('set_mother_id', $femalePersonList, ['label' => false, 'value' => $user->mother_id, 'placeholder' => trans('app.select_from_existing_females')]) !!}
<div class="input-group">
{{ Form::text('set_mother', null, ['class' => 'form-control input-sm', 'placeholder' => 'Input Nama Baru...']) }}
{{ Form::text('set_mother', null, ['class' => 'form-control input-sm', 'placeholder' => trans('app.enter_new_name')]) }}
<span class="input-group-btn">
{{ Form::submit('update', ['class' => 'btn btn-info btn-sm', 'id' => 'set_mother_button']) }}
{{ link_to_route('users.show', 'Batal', [$user->id], ['class' => 'btn btn-default btn-sm']) }}
@ -56,7 +56,7 @@
</td>
</tr>
<tr>
<th class="col-sm-4">Orang Tua</th>
<th class="col-sm-4">{{ trans('user.parent') }}</th>
<td class="col-sm-8">
@can ('edit', $currentUser)
@ -76,7 +76,7 @@
@can('edit', $currentUser)
@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' => 'Pilih Pasangan Pernikahan']) !!}
{!! 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
@ -85,7 +85,7 @@
</tr>
@if ($user->gender_id == 1)
<tr>
<th>Isteri</th>
<th>{{ trans('user.wife') }}</th>
<td>
@can ('edit', $currentUser)
<div class="pull-right">
@ -108,9 +108,9 @@
@if (request('action') == 'add_spouse')
<div>
{{ Form::open(['route' => ['family-actions.add-wife', $user->id]]) }}
{!! FormField::select('set_wife_id', $femalePersonList, ['label' => false, 'placeholder' => 'Pilih dari Wanita Terdaftar']) !!}
{!! FormField::select('set_wife_id', $femalePersonList, ['label' => false, 'placeholder' => trans('app.select_from_existing_females')]) !!}
<div class="input-group">
{{ Form::text('set_wife', null, ['class' => 'form-control input-sm', 'placeholder' => 'Input Nama Baru...']) }}
{{ Form::text('set_wife', null, ['class' => 'form-control input-sm', 'placeholder' => trans('app.enter_new_name')]) }}
<span class="input-group-btn">
{{ Form::submit('update', ['class' => 'btn btn-info btn-sm', 'id' => 'set_wife_button']) }}
</span>
@ -123,7 +123,7 @@
</tr>
@else
<tr>
<th>Suami</th>
<th>{{ trans('user.husband') }}</th>
<td>
@can ('edit', $currentUser)
<div class="pull-right">
@ -145,9 +145,9 @@
@if (request('action') == 'add_spouse')
<div>
{{ Form::open(['route' => ['family-actions.add-husband', $user->id]]) }}
{!! FormField::select('set_husband_id', $malePersonList, ['label' => false, 'placeholder' => 'Pilih dari Laki-Laki Terdaftar']) !!}
{!! FormField::select('set_husband_id', $malePersonList, ['label' => false, 'placeholder' => trans('app.select_from_existing_males')]) !!}
<div class="input-group">
{{ Form::text('set_husband', null, ['class' => 'form-control input-sm', 'placeholder' => 'Input Nama Baru...']) }}
{{ Form::text('set_husband', null, ['class' => 'form-control input-sm', 'placeholder' => trans('app.enter_new_name')]) }}
<span class="input-group-btn">
{{ Form::submit('update', ['class' => 'btn btn-info btn-sm', 'id' => 'set_husband_button']) }}
</span>

18
resources/views/users/partials/profile.blade.php

@ -1,43 +1,43 @@
<div class="panel panel-default">
<div class="panel-heading"><h3 class="panel-title">Profil</h3></div>
<div class="panel-heading"><h3 class="panel-title">{{ trans('user.profile') }}</h3></div>
<table class="table">
<tbody>
<tr>
<th class="col-sm-4">Nama</th>
<th class="col-sm-4">{{ trans('user.name') }}</th>
<td class="col-sm-8">
{{ $user->profileLink() }}
</td>
</tr>
<tr>
<th>Nama Panggilan</th>
<th>{{ trans('user.nickname') }}</th>
<td>{{ $user->nickname }}</td>
</tr>
<tr>
<th>Jenis Kelamin</th>
<th>{{ trans('user.gender') }}</th>
<td>{{ $user->gender }}</td>
</tr>
<tr>
<th>Tanggal Lahir</th>
<th>{{ trans('user.dob') }}</th>
<td>{{ $user->dob }}</td>
</tr>
@if ($user->dod)
<tr>
<th>Meninggal</th>
<th>{{ trans('user.dod') }}</th>
<td>{{ $user->dod }}</td>
</tr>
@endif
@if ($user->email)
<tr>
<th>Email</th>
<th>{{ trans('user.email') }}</th>
<td>{{ $user->email }}</td>
</tr>
@endif
<tr>
<th>Telp</th>
<th>{{ trans('user.phone') }}</th>
<td>{{ $user->phone }}</td>
</tr>
<tr>
<th>Alamat</th>
<th>{{ trans('user.address') }}</th>
<td>{!! nl2br($user->address) !!}</td>
</tr>
</tbody>

2
resources/views/users/partials/siblings.blade.php

@ -1,5 +1,5 @@
<div class="panel panel-default">
<div class="panel-heading"><h3 class="panel-title">Saudara Kandung</h3></div>
<div class="panel-heading"><h3 class="panel-title">{{ trans('user.siblings') }}</h3></div>
<table class="table">
<tbody>
@foreach($user->siblings() as $sibling)

2
resources/views/users/show.blade.php

@ -3,7 +3,7 @@
@section('content')
<h1 class="page-header">
@include('users.partials.action-buttons', ['user' => $currentUser])
{{ $currentUser->name }} <small>{{ trans('app.profile') }}</small>
{{ $currentUser->name }} <small>{{ trans('user.profile') }}</small>
</h1>
<div class="row">
<div class="col-md-6">

Loading…
Cancel
Save