From 9017f7c4e1dcb429d64d3a3e6df08d44ad509f5a Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Wed, 7 Jul 2021 00:40:01 -0600 Subject: [PATCH] Update Profile, fix unauthenticated private profiles --- app/Http/Controllers/ProfileController.php | 3 +- resources/assets/js/components/Profile.vue | 9 +- .../profile/partial/private-info.blade.php | 190 +++++++++--------- resources/views/profile/private.blade.php | 36 ++-- 4 files changed, 115 insertions(+), 123 deletions(-) diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index 4c38a2319..74e84f63e 100644 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -47,7 +47,8 @@ class ProfileController extends Controller }); if ($user->is_private == true) { - abort(404); + $profile = null; + return view('profile.private', compact('user')); } $owner = false; diff --git a/resources/assets/js/components/Profile.vue b/resources/assets/js/components/Profile.vue index d846dcaa3..c00e9676d 100644 --- a/resources/assets/js/components/Profile.vue +++ b/resources/assets/js/components/Profile.vue @@ -703,6 +703,11 @@ this.fetchProfile(); let u = new URLSearchParams(window.location.search); let forceMetro = localStorage.getItem('pf_metro_ui.exp.forceMetro') == 'true'; + + if(u.has('ui') && u.get('ui') == 'moment' && this.layout != 'moment') { + this.layout = 'moment'; + } + if(forceMetro == true || u.has('ui') && u.get('ui') == 'metro' && this.layout != 'metro') { this.layout = 'metro'; } @@ -739,10 +744,6 @@ } }); } - if(window.outerWidth < 576) { - $('nav.navbar').hide(); - this.isMobile = true; - } }, updated() { diff --git a/resources/views/profile/partial/private-info.blade.php b/resources/views/profile/partial/private-info.blade.php index 7965955f8..ae0862d18 100644 --- a/resources/views/profile/partial/private-info.blade.php +++ b/resources/views/profile/partial/private-info.blade.php @@ -1,107 +1,97 @@
-
-
-
-
- -
-
-
-
-
- {{$user->username}} - @if(Auth::check() && $is_following == true) - - - - @elseif(Auth::check() && $requested == true) - - - - @elseif(Auth::check() && $is_following == false) - - - - @endif - - - - -
-
-
- {{$user->statuses()->whereNull('reblog_of_id')->whereNull('in_reply_to_id')->count()}} - Posts -
-
-

- {{$user->name}} - @if($user->remote_url) - REMOTE PROFILE - @endif -

-

{{$user->bio}}

-

{{str_limit($user->website, 30)}}

-
-
-
-
+
+
+
+
+ +
+
+
+
+
+ {{$user->username}} + @if(Auth::check() && $is_following == true) + + + + @elseif(Auth::check() && $requested == true) + + + + @elseif(Auth::check() && $is_following == false) + + + + @endif + @auth + + + + + @endauth +
+
+
+
+
@push('scripts') +@auth -@endpush \ No newline at end of file +@endauth +@endpush diff --git a/resources/views/profile/private.blade.php b/resources/views/profile/private.blade.php index 891f535af..a738c6603 100644 --- a/resources/views/profile/private.blade.php +++ b/resources/views/profile/private.blade.php @@ -2,28 +2,28 @@ @section('content') @if (session('error')) -
- {{ session('error') }} -
+
+ {{ session('error') }} +
@endif @include('profile.partial.private-info')
-
-
-
-

- {{__('profile.privateProfileWarning')}} -

+
+
+
+

+ {{__('profile.privateProfileWarning')}} +

- @if(!Auth::check()) -

{{ __('profile.alreadyFollow', ['username'=>$user->username])}}

-

{{__('Log in')}}

-

{{__('profile.loginToSeeProfile')}}

- @endif -
-
-
+ @if(!Auth::check()) +

{{ __('profile.alreadyFollow', ['username'=>$user->username])}}

+

{{__('Log in')}}

+

{{__('profile.loginToSeeProfile')}}

+ @endif +
+
+
@endsection @@ -34,4 +34,4 @@ @if($user->remote_url) @endif -@endpush \ No newline at end of file +@endpush