Browse Source

Optimize the display of the signature in the profile template 2

Visman 4 years ago
parent
commit
24c0b8c1d7
2 changed files with 4 additions and 2 deletions
  1. 3 1
      app/Models/Pages/Profile/View.php
  2. 1 1
      app/templates/profile.forkbb.php

+ 3 - 1
app/Models/Pages/Profile/View.php

@@ -189,12 +189,14 @@ class View extends Profile
         // подпись
         if ($this->rules->useSignature) {
             $fields = [];
-            if ('' != $this->curUser->signature) {
+            if ($this->curUser->isSignature) {
                 $fields['signature'] = [
                     'type'    => 'yield',
                     'caption' => __('Signature'),
                     'value'   => 'signature',
                 ];
+
+                $this->signatureSection = true;
             }
             if (! empty($fields)) {
                 $form['sets']['signature'] = [

+ 1 - 1
app/templates/profile.forkbb.php

@@ -12,7 +12,7 @@
       </ul>
 @endsection
 @section ('avatar')<img class="f-avatar-img" src="{!! $p->curUser->avatar !!}" alt="{{ $p->curUser->username }}"> @endsection
-@section ('signature'){!! $p->curUser->htmlSign !!} @endsection
+@section ('signature') @if ($p->signatureSection){!! $p->curUser->htmlSign !!} @endif @endsection
 @extends ('layouts/main')
     <div class="f-nav-links">
 @yield ('crumbs')