Templates: use php/endphp + if(empty()) to empty()

This commit is contained in:
Visman 2023-10-30 12:42:03 +07:00
parent 4bde2ad136
commit c0bb06dc13
7 changed files with 26 additions and 18 deletions

View file

@ -38,7 +38,8 @@
<section id="fork-uploads-files" class="f-admin">
<h2>{!! __('File list head') !!}</h2>
<div class="f-fdiv">
@if (null !== $p->badPage && $iswev = [FORK_MESS_ERR => [['Page %s missing', $p->badPage]]])
@if (null !== $p->badPage)
@php $iswev = [FORK_MESS_ERR => [['Page %s missing', $p->badPage]]]; @endphp
@include ('layouts/iswev')
@elseif ($form = $p->formFileList)
@include ('layouts/form')

View file

@ -87,7 +87,8 @@
<div class="f-hcell f-clast">{!! __('Last post') !!}</div>
</li>
@foreach ($p->topics as $id => $topic)
@if (empty($topic->id) && $iswev = [FORK_MESS_ERR => [['Topic %s was not found in the database', $id]]])
@if (empty($topic->id))
@php $iswev = [FORK_MESS_ERR => [['Topic %s was not found in the database', $id]]]; @endphp
<li id="topic-{{ $id }}" class="f-row">
@include ('layouts/iswev')
</li>

View file

@ -1,20 +1,21 @@
@extends ('layouts/pm')
<section id="fork-pm-bl" class="f-pm f-pm-bl-list @empty ($p->blockList) f-pm-bl-empty @endempty">
<h2>{!! __('Blocked users title') !!}</h2>
@if (empty($p->blockList) && $iswev = [FORK_MESS_INFO => ['No blocked users']])
@include ('layouts/iswev')
@empty ($p->blockList)
@php $iswev = [FORK_MESS_INFO => ['No blocked users']]; @endphp
@include ('layouts/iswev')
@else
<div>
<fieldset>
<ol id="fork-pm-bl-ol">
@foreach ($p->blockList as $user)
@foreach ($p->blockList as $user)
<li class="f-pm-bl-li">
<a href="{{ $user->link }}">{{ $user->username }}</a>
<a class="f-btn" href="{{ $user->linkPMUnblock }}" title="{{ __(['Unblock user %s', $user->username]) }}">{!! __('Unblock') !!}</a>
</li>
@endforeach
@endforeach
</ol>
</fieldset>
</div>
@endif
@endempty
</section>

View file

@ -41,7 +41,8 @@
<section id="fork-topic" class="f-pm f-pmtopic">
<h2>{{ $p->model->name }}</h2>
@foreach ($p->posts as $id => $post)
@if (empty($post->id) && $iswev = [FORK_MESS_ERR => [['Message %s was not found in the database', $id]]])
@if (empty($post->id))
@php $iswev = [FORK_MESS_ERR => [['Message %s was not found in the database', $id]]]; @endphp
@include ('layouts/iswev')
@else
<article id="p{{ $post->id }}" class="f-post @if (FORK_GEN_MAN == $post->user->gender) f-user-male @elseif (FORK_GEN_FEM == $post->user->gender) f-user-female @endif @if ($post->user->online) f-user-online @endif @if (1 === $post->postNumber) f-post-first @endif">

View file

@ -29,8 +29,9 @@
@endif
<section id="fork-forum" class="f-pm f-pmview @empty ($p->pmList) f-pm-empty @endempty">
<h2>{!! __($p->title) !!}</h2>
@if (empty($p->pmList) && $iswev = [FORK_MESS_INFO => ['Info zero']])
@include ('layouts/iswev')
@empty ($p->pmList)
@php $iswev = [FORK_MESS_INFO => ['Info zero']]; @endphp
@include ('layouts/iswev')
@else
<div class="f-ftlist">
<ol class="f-table">
@ -40,9 +41,10 @@
<div class="f-hcell f-clast">{!! __('Last post') !!}</div>
</li>
@foreach ($p->pmList as $id => $topic)
@if (empty($topic->id) && $iswev = [FORK_MESS_ERR => [['Dialogue %s was not found in the database', $id]]])
@empty ($topic->id)
@php $iswev = [FORK_MESS_ERR => [['Dialogue %s was not found in the database', $id]]]; @endphp
<li id="ptopic-{{ $id }}" class="f-row">
@include ('layouts/iswev')
@include ('layouts/iswev')
</li>
@else
<li id="ptopic-{{ $topic->id }}" class="f-row @if ($topic->hasNew) f-fnew @endif @if ($topic->closed) f-fclosed @endif">
@ -85,11 +87,11 @@
<span class="f-clposter">{!! __(['by %s', $topic->last_poster]) !!}</span>
</div>
</li>
@endif
@endempty
@endforeach
</ol>
</div>
@endif
@endempty
</section>
@if ($p->pagination || $p->form)
<div class="f-pm f-nav-links">

View file

@ -54,7 +54,8 @@
<section id="fork-topic" class="f-main">
<h2>{!! __('Post list') !!}</h2>
@foreach ($p->posts as $id => $post)
@if (empty($post->id) && $iswev = [FORK_MESS_ERR => [['Message %s was not found in the database', $id]]])
@empty ($post->id))
@php $iswev = [FORK_MESS_ERR => [['Message %s was not found in the database', $id]]]; @endphp
@include ('layouts/iswev')
@else
<article id="p{{ $post->id }}" class="f-post @if (FORK_GEN_MAN == $post->user->gender) f-user-male @elseif (FORK_GEN_FEM == $post->user->gender) f-user-female @endif @if ($post->user->online) f-user-online @endif @if (1 === $post->postNumber) f-post-first @endif">
@ -169,7 +170,7 @@
@endif
</div>
</article>
@endif
@endempty
@endforeach
</section>
<!-- PRE mainAfter -->

View file

@ -41,7 +41,8 @@
<section id="fork-topic-ins" class="f-main">
<h2>{!! __('Post list') !!}</h2>
@foreach ($p->posts as $id => $post)
@if (empty($post->id) && $iswev = [FORK_MESS_ERR => [['Message %s was not found in the database', $id]]])
@empty ($post->id))
@php $iswev = [FORK_MESS_ERR => [['Message %s was not found in the database', $id]]]; @endphp
@include ('layouts/iswev')
@else
<article id="p{{ $post->id }}" class="f-post f-post-search @if (FORK_GEN_MAN == $post->user->gender) f-user-male @elseif (FORK_GEN_FEM == $post->user->gender) f-user-female @endif @if ($post->user->online) f-user-online @endif">
@ -98,7 +99,7 @@
</aside>
</div>
</article>
@endif
@endempty
@endforeach
</section>
<!-- PRE mainAfter -->