From e42fc7d9f28cf09cbe27ec4effc72df4485786b4 Mon Sep 17 00:00:00 2001 From: Nafies Luthfi Date: Fri, 6 Oct 2017 10:02:18 +0800 Subject: [PATCH] Add info text if user's or couple's childs were not recorded yet --- resources/lang/en/app.php | 1 + resources/lang/id/app.php | 1 + resources/views/couples/show.blade.php | 36 ++++++++++++++----------- resources/views/users/partials/childs.blade.php | 6 +++-- 4 files changed, 26 insertions(+), 18 deletions(-) diff --git a/resources/lang/en/app.php b/resources/lang/en/app.php index 6d729ab..48f17e1 100644 --- a/resources/lang/en/app.php +++ b/resources/lang/en/app.php @@ -22,6 +22,7 @@ return [ 'city' => 'City', 'phone' => 'Phone', 'login_account' => 'Login Account', + 'childs_were_not_recorded' => 'Childs were not recorded.', // Actions 'edit' => 'Edit', diff --git a/resources/lang/id/app.php b/resources/lang/id/app.php index 1f5a2f2..adb773a 100644 --- a/resources/lang/id/app.php +++ b/resources/lang/id/app.php @@ -22,6 +22,7 @@ return [ 'city' => 'Kota', 'phone' => 'Telp.', 'login_account' => 'Akun Login', + 'childs_were_not_recorded' => 'Anak-anak belum tercatat.', // Actions 'edit' => 'Edit', diff --git a/resources/views/couples/show.blade.php b/resources/views/couples/show.blade.php index a6615f1..8edd6c7 100644 --- a/resources/views/couples/show.blade.php +++ b/resources/views/couples/show.blade.php @@ -8,22 +8,26 @@ @include('couples.partials.stat')
- -@foreach($couple->childs->chunk(4) as $chunkedChild) -
- @foreach($chunkedChild as $child) -
-

{{ ++$no }}. {{ $child->profileLink() }} ({{ $child->gender }})

-
    - @foreach($child->childs as $grand) -
  • {{ $grand->profileLink() }} ({{ $grand->gender }})
  • - @endforeach -
+@if ($couple->childs->isEmpty()) + {{ trans('app.childs_were_not_recorded') }} +@else + + @foreach($couple->childs->chunk(4) as $chunkedChild) +
+ @foreach($chunkedChild as $child) +
+

{{ ++$no }}. {{ $child->profileLink() }} ({{ $child->gender }})

+
    + @foreach($child->childs as $grand) +
  • {{ $grand->profileLink() }} ({{ $grand->gender }})
  • + @endforeach +
+
+ @endforeach + @if (! $loop->last) +

+ @endif
@endforeach - @if (! $loop->last) -

- @endif -
-@endforeach +@endif @endsection diff --git a/resources/views/users/partials/childs.blade.php b/resources/views/users/partials/childs.blade.php index 48bd2fe..1f19ca0 100644 --- a/resources/views/users/partials/childs.blade.php +++ b/resources/views/users/partials/childs.blade.php @@ -9,11 +9,13 @@