From f942d45e33b4b13f9a6e9fadc4930677b9bb5933 Mon Sep 17 00:00:00 2001 From: Visman Date: Wed, 25 Apr 2018 15:42:41 +0700 Subject: [PATCH] 2018-04-25 --- app/Models/Pages/Admin/Users.php | 36 +++++++----- public/style/ForkBB/style.css | 99 +++++++++++++++++++++++++------- 2 files changed, 100 insertions(+), 35 deletions(-) diff --git a/app/Models/Pages/Admin/Users.php b/app/Models/Pages/Admin/Users.php index e4c0745a..0cb2a19f 100644 --- a/app/Models/Pages/Admin/Users.php +++ b/app/Models/Pages/Admin/Users.php @@ -504,20 +504,24 @@ class Users extends Admin ], ]; + \array_unshift($users, $this->c->users->create(['id' => -1])); + foreach ($users as $user) { - ++$number; $fields = []; $fields["l{$number}-wrap1"] = [ 'class' => 'main-result', 'type' => 'wrap', ]; + $fields["l{$number}-wrap2"] = [ + 'class' => 'user-result', + 'type' => 'wrap', + ]; $fields["l{$number}-username"] = [ 'class' => ['result', 'username'], - 'type' => 'link', + 'type' => $user->isGuest ? 'str' : 'link', 'caption' => \ForkBB\__('Results username head'), 'value' => $user->username, 'href' => $user->link, -# 'title' => \ForkBB\__('Show posts'), ]; $fields["l{$number}-email"] = [ 'class' => ['result', 'email'], @@ -525,19 +529,21 @@ class Users extends Admin 'caption' => \ForkBB\__('Results e-mail head'), 'value' => $user->email, 'href' => 'mailto:' . $user->email, -# 'title' => \ForkBB\__('Show posts'), + ]; + $fields[] = [ + 'type' => 'endwrap', ]; $fields["l{$number}-title"] = [ 'class' => ['result', 'title'], 'type' => 'str', 'caption' => \ForkBB\__('Results title head'), - 'value' => $user->title(), + 'value' => -1 === $user->id ? null : $user->title(), ]; $fields["l{$number}-posts"] = [ 'class' => ['result', 'posts'], 'type' => $user->num_posts ? 'link' : 'str', 'caption' => \ForkBB\__('Results posts head'), - 'value' => \ForkBB\num($user->num_posts), + 'value' => $user->num_posts ? \ForkBB\num($user->num_posts) : null, 'href' => $this->c->Router->link('SearchAction', ['action' => 'posts', 'uid' => $user->id]), 'title' => \ForkBB\__('Results show posts link'), ]; @@ -551,29 +557,31 @@ class Users extends Admin if ($this->user->isAdmin) { $fields["l{$number}-view-ip"] = [ 'class' => ['result', 'view-ip'], - 'type' => 'link', -# 'caption' => \ForkBB\__('Results posts head'), - 'value' => \ForkBB\__('Results view IP link'), + 'type' => $user->isGuest ? 'str' : 'link', + 'caption' => \ForkBB\__('Results action head'), + 'value' => $user->isGuest ? null : \ForkBB\__('Results view IP link'), 'href' => '', -# 'title' => \ForkBB\__('Results show posts link'), ]; } $fields[] = [ 'type' => 'endwrap', ]; - $fields["users[{$user->id}]"] = [ + $key = $user->isGuest ? "guest{$number}" : "users[{$user->id}]"; + $fields[$key] = [ 'class' => ['result', 'check'], 'caption' => \ForkBB\__('Select'), - 'type' => 'checkbox', - 'value' => $user->id, + 'type' => $user->isGuest ? 'str' : 'checkbox', + 'value' => $user->isGuest ? null : $user->id, 'checked' => false, ]; $form['sets']["l{$number}"] = [ 'class' => 'result', - 'legend' => $number, + 'legend' => -1 === $user->id ? null : $number, 'fields' => $fields, ]; + + ++$number; } return $form; diff --git a/public/style/ForkBB/style.css b/public/style/ForkBB/style.css index 6d04aacc..5c91a27a 100644 --- a/public/style/ForkBB/style.css +++ b/public/style/ForkBB/style.css @@ -2294,6 +2294,10 @@ select { padding-bottom: 0.3125rem; } +.f-fs-result:first-of-type { + display: none; +} + .f-fs-result > legend { display: none; } @@ -2326,7 +2330,7 @@ select { content: ": "; } -.f-field-result.f-field-check { +.f-fs-result .f-field-check { width: 3rem; overflow: hidden; text-align: center; @@ -2335,21 +2339,17 @@ select { flex-direction: column; } -.f-field-result.f-field-check > dt { +.f-fs-result .f-field-check > dt { display: none; } -.f-field-result.f-field-check > dd { +.f-fs-result .f-field-check > dd { display: flex; align-items: center; height: 100%; width: 100% } -.f-field-result.f-field-view-ip { - text-align: right; -} - @media screen and (min-width: 36rem) { .f-wrap-main-result .f-field-result > dt, .f-wrap-main-result .f-field-result > dd { @@ -2366,20 +2366,77 @@ select { } } -/* -.f-fs-result .f-field-result { - display: flex; - flex-direction: column; -} +@media screen and (min-width: 50rem) { + .f-wrap-main-result { + display: flex; + } -.f-fs-result .f-field-result > dt { - display: block; - margin: 0; - width: 100%; -} + .f-fs-result .f-field-result, + .f-fs-result .f-wrap-user-result { + display: flex; + flex-direction: column; + justify-content: center; + } -.f-fs-result .f-field-result > dd { - width: 100%; -} -*/ + .f-fs-result .f-field-result > dt { + display: block; + margin: 0; + width: 100%; + } + .f-fs-result .f-field-result > dd { + margin: 0; + width: 100%; + } + + .f-fs-result:first-of-type { + display: flex; + text-align: center; + } + + .f-fs-result:not(:first-of-type) .f-field-result > dt, + .f-fs-result:first-of-type .f-field-result > dd { + display: none; + } + + .f-fs-result .f-field-result .f-child1 { + font-weight: bold; + } + + .f-fs-result .f-wrap-user-result { + width: 33%; + } + + .f-fs-result .f-field-username { + width: 100%; + } + + .f-fs-result .f-field-email { + width: 100%; + } + + .f-fs-result .f-field-title { + width: 16%; + border-left: 0.0625rem dotted #AA7939; + } + + .f-fs-result .f-field-posts { + width: 15%; + border-left: 0.0625rem dotted #AA7939; + } + + .f-fs-result .f-field-posts > dd { + text-align: right; + } + + .f-fs-result .f-field-note { + width: 20%; + border-left: 0.0625rem dotted #AA7939; + } + + .f-fs-result .f-field-view-ip { + width: 16%; + border-left: 0.0625rem dotted #AA7939; + } + +}