mirror of
https://github.com/cydrobolt/polr.git
synced 2024-11-09 03:32:28 +01:00
Automatically switch to correct tab with pagination and reduce number of results per page
This commit is contained in:
parent
6cf7f3d828
commit
61c65c9cc1
@ -17,12 +17,12 @@ class AdminController extends Controller {
|
||||
$admin_users = null;
|
||||
$admin_links = null;
|
||||
if ($role == 'admin') {
|
||||
$admin_users = User::paginate(30);
|
||||
$admin_links = Link::paginate(30);
|
||||
$admin_users = User::paginate(15);
|
||||
$admin_links = Link::paginate(15);
|
||||
}
|
||||
|
||||
$user_links = Link::where('creator', $username)
|
||||
->paginate(30);
|
||||
->paginate(15);
|
||||
|
||||
return view('admin', [
|
||||
'role' => $role,
|
||||
|
@ -2,3 +2,8 @@ $('.admin-nav a').click(function (e) {
|
||||
e.preventDefault();
|
||||
$(this).tab('show');
|
||||
});
|
||||
|
||||
var url = document.location.toString();
|
||||
if (url.match('#')) {
|
||||
$('.admin-nav a[href=#'+url.split('#')[1]+']').tab('show') ;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user