From 1510389709ae80311599741c49be823ae6eb7d0f Mon Sep 17 00:00:00 2001 From: Wisp X Date: Fri, 18 Feb 2022 13:58:27 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E6=94=B9=E8=BF=9B=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/Admin/ImageController.php | 1 - app/Models/User.php | 2 + public/css/app.css | 8 ++ resources/views/admin/image/index.blade.php | 2 +- resources/views/admin/user/index.blade.php | 90 ++++++++++++++++++- 5 files changed, 100 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/Admin/ImageController.php b/app/Http/Controllers/Admin/ImageController.php index d56910dc..574d4577 100644 --- a/app/Http/Controllers/Admin/ImageController.php +++ b/app/Http/Controllers/Admin/ImageController.php @@ -20,7 +20,6 @@ class ImageController extends Controller }, 'album', 'group', 'strategy'])->latest()->paginate(40); $images->getCollection()->each(function (Image $image) { $image->append('url', 'pathname'); - $image->user->append('avatar'); $image->album?->setVisible(['name']); $image->group?->setVisible(['name']); $image->strategy?->setVisible(['name']); diff --git a/app/Models/User.php b/app/Models/User.php index 97599679..a7b8ff73 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -83,6 +83,8 @@ class User extends Authenticatable implements MustVerifyEmail 'email_verified_at' => 'datetime', ]; + protected $appends = ['avatar']; + protected static function booted() { static::creating(function (self $user) { diff --git a/public/css/app.css b/public/css/app.css index 6f8b80e2..b00cbff4 100644 --- a/public/css/app.css +++ b/public/css/app.css @@ -1789,6 +1789,10 @@ select { --tw-text-opacity: 1; color: rgb(71 85 105 / var(--tw-text-opacity)); } +.text-teal-600 { + --tw-text-opacity: 1; + color: rgb(13 148 136 / var(--tw-text-opacity)); +} .underline { -webkit-text-decoration-line: underline; text-decoration-line: underline; @@ -2008,6 +2012,10 @@ select { --tw-text-opacity: 1; color: rgb(99 102 241 / var(--tw-text-opacity)); } +.hover\:text-teal-900:hover { + --tw-text-opacity: 1; + color: rgb(19 78 74 / var(--tw-text-opacity)); +} .focus\:z-10:focus { z-index: 10; } diff --git a/resources/views/admin/image/index.blade.php b/resources/views/admin/image/index.blade.php index ffa6363e..3e1cf06d 100644 --- a/resources/views/admin/image/index.blade.php +++ b/resources/views/admin/image/index.blade.php @@ -5,7 +5,7 @@ @if($images->isNotEmpty())
@foreach($images as $image) -
+
@if($image->extension === 'gif') Gif @endif diff --git a/resources/views/admin/user/index.blade.php b/resources/views/admin/user/index.blade.php index 6e09dd6a..ff1d0ef0 100644 --- a/resources/views/admin/user/index.blade.php +++ b/resources/views/admin/user/index.blade.php @@ -15,7 +15,7 @@ @foreach($users as $user) - + {{ $user->id }} {{ $user->name }} {{ $user->email }} @@ -30,6 +30,7 @@ {{ $user->album_num }} {{ $user->status ? '正常' : '冻结' }} + 详细 编辑 @if(Auth::user()->id != $user->id) 删除 @@ -47,8 +48,95 @@ @endif
+ + + + + + @push('scripts')