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. 14
      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',
'phone' => 'Phone',
'login_account' => 'Login Account',
'childs_were_not_recorded' => 'Childs were not recorded.',
// Actions
'edit' => 'Edit',

1
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',

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

@ -8,9 +8,12 @@
@include('couples.partials.stat')
<br>
<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="">
@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>
@ -24,6 +27,7 @@
@if (! $loop->last)
<div class="clearfix"></div><hr>
@endif
</div>
@endforeach
</div>
@endforeach
@endif
@endsection

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

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

Loading…
Cancel
Save