From ea34a2f2663d05b24fb6385457ccbf171233809b Mon Sep 17 00:00:00 2001 From: Visman Date: Mon, 15 Nov 2021 21:35:48 +0700 Subject: [PATCH] Update PM\PBlock page --- app/Models/PM/PBlock.php | 23 ++++++++++++++++++++--- app/templates/pm/block.forkbb.php | 8 ++++---- public/style/ForkBB/style.css | 17 +++++++++++++++++ 3 files changed, 41 insertions(+), 7 deletions(-) diff --git a/app/Models/PM/PBlock.php b/app/Models/PM/PBlock.php index 3a7f0221..1c6e2cce 100644 --- a/app/Models/PM/PBlock.php +++ b/app/Models/PM/PBlock.php @@ -111,9 +111,26 @@ class PBlock extends Model */ protected function getlist(): array { - return isset($this->repository[$this->user->id]) - ? $this->c->users->loadByIds($this->repository[$this->user->id]) - : []; + if (empty($this->repository[$this->user->id])) { + return []; + } + + $list = $this->c->users->loadByIds($this->repository[$this->user->id]); + + foreach ($list as &$user) { + if ($user instanceof User) { + $user->linkPMUnblock = $this->c->Router->link( + 'PMAction', + [ + 'action' => Cnst::ACTION_BLOCK, + 'more1' => $user->id, + ] + ); + } + } + unset($user); + + return $list; } /** diff --git a/app/templates/pm/block.forkbb.php b/app/templates/pm/block.forkbb.php index 8fac45ec..5f9add2c 100644 --- a/app/templates/pm/block.forkbb.php +++ b/app/templates/pm/block.forkbb.php @@ -1,16 +1,16 @@ @extends ('layouts/pm') -
+

{!! __('Blocked users title') !!}

@if (empty($p->blockList) && $iswev = ['i' => ['No blocked users']]) @include ('layouts/iswev') @else
-
    +
      @foreach ($p->blockList as $user) -
    1. +
    2. {{ $user->username }} - {!! __('Unblock') !!} + {!! __('Unblock') !!}
    3. @endforeach
    diff --git a/public/style/ForkBB/style.css b/public/style/ForkBB/style.css index 38c92c66..1c2cefb1 100644 --- a/public/style/ForkBB/style.css +++ b/public/style/ForkBB/style.css @@ -2420,6 +2420,23 @@ body, width: auto; } +#forkpm #fork-pm-bl-ol { + padding-top: 0.3125rem; + display: flex; + flex-wrap: wrap; + gap: 0.3125rem; +} + +#forkpm .f-pm-bl-li { + display: flex; + flex-wrap: wrap; + padding: 0.3125rem 0.625rem 0.625rem; + justify-content: space-between; + align-items: center; + flex: 1 1 25rem; + border-bottom: 0.0625rem dotted; +} + @media screen and (min-width: 36rem) { #forkpm > .f-pmconfig-form dl { display: flex;