1
0
Fork 0
forked from mirror/pixelfed

Merge pull request #481 from pixelfed/frontend-ui-refactor

Frontend ui refactor
This commit is contained in:
daniel 2018-09-22 21:21:23 -06:00 committed by GitHub
commit b113d67f4a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 8 deletions

View file

@ -27,10 +27,12 @@ class DiscoverController extends Controller
$pid = Auth::user()->profile->id;
$following = Cache::remember('feature:discover:following:'.$pid, 15, function() use($pid) {
$following = Follower::whereProfileId($pid)
->pluck('following_id');
$filtered = UserFilter::whereUserId($pid)
$following = Cache::remember('feature:discover:following:'.$pid, 720, function() use($pid) {
$following = Follower::select('following_id')
->whereProfileId($pid)
->pluck('following_id');
$filtered = UserFilter::select('filterable_id')
->whereUserId($pid)
->whereFilterableType('App\Profile')
->whereIn('filter_type', ['mute', 'block'])
->pluck('filterable_id');
@ -43,7 +45,7 @@ class DiscoverController extends Controller
});
$people = Cache::remember('feature:discover:people:'.$pid, 15, function() use($following) {
return Profile::inRandomOrder()
return Profile::select('id', 'name', 'username')->inRandomOrder()
->whereHas('statuses')
->whereNull('domain')
->whereNotIn('id', $following)
@ -52,13 +54,14 @@ class DiscoverController extends Controller
->get();
});
$posts = Status::whereHas('media')
$posts = Status::select('id', 'caption', 'profile_id')
->whereHas('media')
->whereHas('profile', function($q) {
$q->where('is_private', false);
})
->whereIsNsfw(false)
->whereVisibility('public')
->where('profile_id', '!=', $pid)
->where('profile_id', '<>', $pid)
->whereNotIn('profile_id', $following)
->withCount(['comments', 'likes'])
->orderBy('created_at', 'desc')

View file

@ -43,7 +43,14 @@
<p>Please scan the QR code and then enter the 6 digit code in the form below. Keep in mind the code changes every 30 seconds, and is only good for 1 minute.</p>
<div class="card">
<div class="card-body text-center">
<img src="{{$qrcode}}">
<div class="pb-3">
<p class="font-weight-bold">QR Code</p>
<img src="{{$qrcode}}" class="img-fluid" width="200px">
</div>
<div>
<p class="font-weight-bold">OTP Secret</p>
<input type="text" class="form-control" value="{{ $user->{'2fa_secret'} }}" disabled>
</div>
</div>
<div class="card-body">
<form id="confirm-code">