Browse Source

Add info text if user's or couple's childs were not recorded yet

pull/3/head
Nafies Luthfi 8 years ago
parent
commit
e42fc7d9f2
  1. 1
      resources/lang/en/app.php
  2. 1
      resources/lang/id/app.php
  3. 36
      resources/views/couples/show.blade.php
  4. 6
      resources/views/users/partials/childs.blade.php

1
resources/lang/en/app.php

@ -22,6 +22,7 @@ return [
'city' => 'City', 'city' => 'City',
'phone' => 'Phone', 'phone' => 'Phone',
'login_account' => 'Login Account', 'login_account' => 'Login Account',
'childs_were_not_recorded' => 'Childs were not recorded.',
// Actions // Actions
'edit' => 'Edit', 'edit' => 'Edit',

1
resources/lang/id/app.php

@ -22,6 +22,7 @@ return [
'city' => 'Kota', 'city' => 'Kota',
'phone' => 'Telp.', 'phone' => 'Telp.',
'login_account' => 'Akun Login', 'login_account' => 'Akun Login',
'childs_were_not_recorded' => 'Anak-anak belum tercatat.',
// Actions // Actions
'edit' => 'Edit', 'edit' => 'Edit',

36
resources/views/couples/show.blade.php

@ -8,22 +8,26 @@
@include('couples.partials.stat') @include('couples.partials.stat')
<br> <br>
<h4 class="page-header">{{ trans('user.childs') }} & {{ trans('user.grand_childs') }}</h4 class="page-header"> <h4 class="page-header">{{ trans('user.childs') }} & {{ trans('user.grand_childs') }}</h4 class="page-header">
<?php $no = 0; ?>
@foreach($couple->childs->chunk(4) as $chunkedChild)
<div class="">
@foreach($chunkedChild as $child)
<div class="col-md-3">
<h4><strong>{{ ++$no }}. {{ $child->profileLink() }} ({{ $child->gender }})</strong></h4>
<ul style="padding-left: 35px">
@foreach($child->childs as $grand)
<li>{{ $grand->profileLink() }} ({{ $grand->gender }})</li>
@endforeach
</ul>
@if ($couple->childs->isEmpty())
<i>{{ trans('app.childs_were_not_recorded') }}</i>
@else
<?php $no = 0; ?>
@foreach($couple->childs->chunk(4) as $chunkedChild)
<div class="row">
@foreach($chunkedChild as $child)
<div class="col-md-3">
<h4><strong>{{ ++$no }}. {{ $child->profileLink() }} ({{ $child->gender }})</strong></h4>
<ul style="padding-left: 35px">
@foreach($child->childs as $grand)
<li>{{ $grand->profileLink() }} ({{ $grand->gender }})</li>
@endforeach
</ul>
</div>
@endforeach
@if (! $loop->last)
<div class="clearfix"></div><hr>
@endif
</div> </div>
@endforeach @endforeach
@if (! $loop->last)
<div class="clearfix"></div><hr>
@endif
</div>
@endforeach
@endif
@endsection @endsection

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

@ -9,11 +9,13 @@
</div> </div>
<ul class="list-group"> <ul class="list-group">
@foreach($user->childs as $child)
@forelse($user->childs as $child)
<li class="list-group-item"> <li class="list-group-item">
{{ $child->profileLink() }} ({{ $child->gender }}) {{ $child->profileLink() }} ({{ $child->gender }})
</li> </li>
@endforeach
@empty
<li class="list-group-item"><i>{{ trans('app.childs_were_not_recorded') }}</i></li>
@endforelse
@can('edit', $user) @can('edit', $user)
@if (request('action') == 'add_child') @if (request('action') == 'add_child')
<li class="list-group-item"> <li class="list-group-item">

Loading…
Cancel
Save