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

Frontend ui refactor
This commit is contained in:
daniel 2019-02-14 12:08:40 -07:00 committed by GitHub
commit a0f15adcca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 13 deletions

View file

@ -207,11 +207,11 @@ class AdminController extends Controller
$order = $request->input('order') ?? 'desc';
$limit = $request->input('limit') ?? 12;
if($search) {
$profiles = Profile::where('username','like', "%$search%")->orderBy('id','desc')->paginate($limit);
$profiles = Profile::select('id','username')->where('username','like', "%$search%")->orderBy('id','desc')->paginate($limit);
} else if($filter && $order) {
$profiles = Profile::withCount(['likes','statuses','followers'])->orderBy($filter, $order)->paginate($limit);
$profiles = Profile::select('id','username')->withCount(['likes','statuses','followers'])->orderBy($filter, $order)->paginate($limit);
} else {
$profiles = Profile::orderBy('id','desc')->paginate($limit);
$profiles = Profile::select('id','username')->orderBy('id','desc')->paginate($limit);
}
return view('admin.profiles.home', compact('profiles'));

View file

@ -102,21 +102,11 @@
<th scope="col" class="border-0" width="20%">
<span>
Followers
@if(request()->filter && request()->filter == 'followers_count' && request()->order == 'asc')
<a href="#" class="col-ord" data-col="followers_count" data-dir="desc"><i class="fas fa-chevron-down"></i></a>
@else
<a href="#" class="col-ord" data-col="followers_count" data-dir="asc"><i class="fas fa-chevron-up"></i></a>
@endif
</span>
</th>
<th scope="col" class="border-0" width="20%">
<span>
Likes
@if(request()->filter && request()->filter == 'likes_count' && request()->order == 'asc')
<a href="#" class="col-ord" data-col="likes_count" data-dir="desc"><i class="fas fa-chevron-down"></i></a>
@else
<a href="#" class="col-ord" data-col="likes_count" data-dir="asc"><i class="fas fa-chevron-up"></i></a>
@endif
</span>
</th>
<th scope="col" class="border-0" width="20%">