Procházet zdrojové kódy

Update user navigation menu to display the number of new PM on narrow screens

Visman před 4 roky
rodič
revize
bdffcdbb3b

+ 2 - 0
app/Models/Page.php

@@ -216,6 +216,8 @@ abstract class Page extends Model
                     $r->link('PM'),
                     $r->link('PM'),
                     $this->user->u_pm_num_new > 0 ? ['PM %s', $this->user->u_pm_num_new] : 'PM',
                     $this->user->u_pm_num_new > 0 ? ['PM %s', $this->user->u_pm_num_new] : 'PM',
                     'Private messages',
                     'Private messages',
+                    null,
+                    $this->user->u_pm_num_new > 0 ? 'newpm' : null,
                 ];
                 ];
             }
             }
 
 

+ 1 - 1
app/lang/en/common.po

@@ -321,7 +321,7 @@ msgid "PM"
 msgstr "PM"
 msgstr "PM"
 
 
 msgid "PM %s"
 msgid "PM %s"
-msgstr "PM <b>(%s)</b>"
+msgstr "<span class="f-spantxtpm">PM </span><b>(%s)</b>"
 
 
 msgid "Private messages"
 msgid "Private messages"
 msgstr "Private messages"
 msgstr "Private messages"

+ 1 - 1
app/lang/ru/common.po

@@ -323,7 +323,7 @@ msgid "PM"
 msgstr "ЛС"
 msgstr "ЛС"
 
 
 msgid "PM %s"
 msgid "PM %s"
-msgstr "ЛС <b>(%s)</b>"
+msgstr "<span class="f-spantxtpm">ЛС </span><b>(%s)</b>"
 
 
 msgid "Private messages"
 msgid "Private messages"
 msgstr "Личные сообщения"
 msgstr "Личные сообщения"

+ 1 - 1
app/templates/layouts/main.forkbb.php

@@ -52,7 +52,7 @@
     @if ($p->fNavigationUser)
     @if ($p->fNavigationUser)
         <ul class="f-menu-user-items">
         <ul class="f-menu-user-items">
         @foreach ($p->fNavigationUser as $key => $val)
         @foreach ($p->fNavigationUser as $key => $val)
-          <li id="fork-nav-{{ $key }}" class="f-menu-item"><!-- inline -->
+          <li id="fork-nav-{{ $key }}" class="f-menu-item @if ($val[4]) f-mi-{{ $val[4] }} @endif"><!-- inline -->
             <a class="f-menu-a @if ($key == $p->fIndex) active @endif" href="{{ $val[0] }}" @if ($val[2]) title="{{ __($val[2]) }}" @endif>
             <a class="f-menu-a @if ($key == $p->fIndex) active @endif" href="{{ $val[0] }}" @if ($val[2]) title="{{ __($val[2]) }}" @endif>
               <span class="f-menu-span">{!! __($val[1]) !!}</span>
               <span class="f-menu-span">{!! __($val[1]) !!}</span>
             </a>
             </a>

+ 6 - 1
public/style/ForkBB/style.css

@@ -487,9 +487,14 @@ html[lang="ru"] #fork details[open] > summary::after {
 }
 }
 
 
 @media screen and (max-width: 34rem) {
 @media screen and (max-width: 34rem) {
-  #fork-nav-profile ~ .f-menu-item .f-menu-span {
+  #fork .f-spantxtpm,
+  #fork-nav-profile ~ .f-menu-item:not(.f-mi-newpm) .f-menu-span {
     display: none;
     display: none;
   }
   }
+
+  #fork-nav-profile ~ .f-menu-item:not(.f-mi-newpm) .f-menu-a:before {
+    padding: 0;
+  }
 }
 }
 
 
 @media screen and (min-width: 50rem) {
 @media screen and (min-width: 50rem) {