Update Profile, fix unauthenticated private profiles
This commit is contained in:
parent
1a2e41b1e3
commit
9017f7c4e1
4 changed files with 115 additions and 123 deletions
|
@ -47,7 +47,8 @@ class ProfileController extends Controller
|
||||||
});
|
});
|
||||||
|
|
||||||
if ($user->is_private == true) {
|
if ($user->is_private == true) {
|
||||||
abort(404);
|
$profile = null;
|
||||||
|
return view('profile.private', compact('user'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$owner = false;
|
$owner = false;
|
||||||
|
|
|
@ -703,6 +703,11 @@
|
||||||
this.fetchProfile();
|
this.fetchProfile();
|
||||||
let u = new URLSearchParams(window.location.search);
|
let u = new URLSearchParams(window.location.search);
|
||||||
let forceMetro = localStorage.getItem('pf_metro_ui.exp.forceMetro') == 'true';
|
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') {
|
if(forceMetro == true || u.has('ui') && u.get('ui') == 'metro' && this.layout != 'metro') {
|
||||||
this.layout = 'metro';
|
this.layout = 'metro';
|
||||||
}
|
}
|
||||||
|
@ -739,10 +744,6 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if(window.outerWidth < 576) {
|
|
||||||
$('nav.navbar').hide();
|
|
||||||
this.isMobile = true;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
updated() {
|
updated() {
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
</form>
|
</form>
|
||||||
</span>
|
</span>
|
||||||
@endif
|
@endif
|
||||||
|
@auth
|
||||||
<span class="pl-4">
|
<span class="pl-4">
|
||||||
<i class="fas fa-cog fa-lg text-muted cursor-pointer" data-toggle="modal" data-target="#ctxProfileMenu"></i>
|
<i class="fas fa-cog fa-lg text-muted cursor-pointer" data-toggle="modal" data-target="#ctxProfileMenu"></i>
|
||||||
<div class="modal" tabindex="-1" role="dialog" id="ctxProfileMenu">
|
<div class="modal" tabindex="-1" role="dialog" id="ctxProfileMenu">
|
||||||
|
@ -59,21 +60,8 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</span>
|
</span>
|
||||||
|
@endauth
|
||||||
</div>
|
</div>
|
||||||
<div class="profile-stats pb-3 d-inline-flex lead">
|
|
||||||
<div class="font-weight-light pr-5">
|
|
||||||
<span class="font-weight-bold">{{$user->statuses()->whereNull('reblog_of_id')->whereNull('in_reply_to_id')->count()}}</span>
|
|
||||||
Posts
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<p class="lead mb-0">
|
|
||||||
<span class="font-weight-bold">{{$user->name}}</span>
|
|
||||||
@if($user->remote_url)
|
|
||||||
<span class="badge badge-info">REMOTE PROFILE</span>
|
|
||||||
@endif
|
|
||||||
</p>
|
|
||||||
<p class="mb-0 lead">{{$user->bio}}</p>
|
|
||||||
<p class="mb-0"><a href="{{$user->website}}" class="font-weight-bold" rel="me external nofollow noopener" target="_blank">{{str_limit($user->website, 30)}}</a></p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -81,6 +69,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@push('scripts')
|
@push('scripts')
|
||||||
|
@auth
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function muteProfile() {
|
function muteProfile() {
|
||||||
axios.post('/i/mute', {
|
axios.post('/i/mute', {
|
||||||
|
@ -104,4 +93,5 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
@endauth
|
||||||
@endpush
|
@endpush
|
|
@ -10,9 +10,9 @@
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="profile-timeline mt-2 mt-md-4">
|
<div class="profile-timeline mt-2 mt-md-4">
|
||||||
<div class="card">
|
<div class="">
|
||||||
<div class="card-body py-5">
|
<div class="py-5">
|
||||||
<p class="text-center lead font-weight-bold mb-0">
|
<p class="text-center lead font-weight-bold">
|
||||||
{{__('profile.privateProfileWarning')}}
|
{{__('profile.privateProfileWarning')}}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue