From 076e7d5d0d0ab42d74151ad27eb5e3adbac43c50 Mon Sep 17 00:00:00 2001 From: shibafu Date: Sun, 25 Oct 2020 17:22:04 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E5=80=8B=E5=88=A5=E3=83=9A=E3=83=BC=E3=82=B8=E3=81=AE?= =?UTF-8?q?=E3=83=A6=E3=83=BC=E3=82=B6=E3=83=BC=E3=83=97=E3=83=AD=E3=83=95?= =?UTF-8?q?=E3=82=A3=E3=83=BC=E3=83=AB=E3=81=8C=E5=8D=8A=E5=88=86=E6=B6=88?= =?UTF-8?q?=E3=81=88=E3=81=A6=E3=81=84=E3=82=8B=E3=81=AE=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/components/profile-bio.blade.php | 20 +++++++++ resources/views/components/profile.blade.php | 43 +++++++++++-------- resources/views/user/base.blade.php | 4 -- resources/views/user/profile.blade.php | 2 + 4 files changed, 48 insertions(+), 21 deletions(-) create mode 100644 resources/views/components/profile-bio.blade.php diff --git a/resources/views/components/profile-bio.blade.php b/resources/views/components/profile-bio.blade.php new file mode 100644 index 0000000..93e77a8 --- /dev/null +++ b/resources/views/components/profile-bio.blade.php @@ -0,0 +1,20 @@ +@if (!empty($user->bio) || !empty($user->url)) +
+
+ {{-- Bio --}} + @if (!empty($user->bio)) +

+ {!! Formatter::linkify(nl2br(e($user->bio))) !!} +

+ @endif + + {{-- URL --}} + @if (!empty($user->url)) +

+ + {{ preg_replace('~\Ahttps?://~', '', $user->url) }} +

+ @endif +
+
+@endif diff --git a/resources/views/components/profile.blade.php b/resources/views/components/profile.blade.php index 6bfa60c..0e6d62c 100644 --- a/resources/views/components/profile.blade.php +++ b/resources/views/components/profile.blade.php @@ -1,23 +1,32 @@ -@if (!empty($user->bio) || !empty($user->url)) -
-
- {{-- Bio --}} - @if (!empty($user->bio)) -

- {!! Formatter::linkify(nl2br(e($user->bio))) !!} -

+
+
+ +

+ {{ $user->display_name }} +

+
+ @{{ $user->name }} + @if ($user->is_protected) + @endif +
- {{-- URL --}} - @if (!empty($user->url)) -

- - {{ preg_replace('~\Ahttps?://~', '', $user->url) }} -

- @endif -
+ {{-- Bio --}} + @if (!empty($user->bio)) +

+ {!! Formatter::linkify(nl2br(e($user->bio))) !!} +

+ @endif + + {{-- URL --}} + @if (!empty($user->url)) +

+ + {{ preg_replace('~\Ahttps?://~', '', $user->url) }} +

+ @endif
-@endif +
@if (!$user->is_protected || $user->isMe())
diff --git a/resources/views/user/base.blade.php b/resources/views/user/base.blade.php index a5d0a7e..a770c10 100644 --- a/resources/views/user/base.blade.php +++ b/resources/views/user/base.blade.php @@ -34,10 +34,6 @@
- @if (Route::currentRouteName() === 'user.profile') - @component('components.profile', ['user' => $user]) - @endcomponent - @endif @section('sidebar') @show
diff --git a/resources/views/user/profile.blade.php b/resources/views/user/profile.blade.php index 823f7b2..f774e50 100644 --- a/resources/views/user/profile.blade.php +++ b/resources/views/user/profile.blade.php @@ -11,6 +11,8 @@ @section('sidebar') {{-- TODO: タイムラインとオカズのテンプレを分けたら条件外す --}} @if (Route::currentRouteName() === 'user.profile') + @component('components.profile-bio', ['user' => $user]) + @endcomponent @if (!empty($tags) && (!$user->is_protected || $user->isMe()))