1
0
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:
Chaoyi Zha 2015-11-13 23:54:32 -05:00
parent 6cf7f3d828
commit 61c65c9cc1
2 changed files with 8 additions and 3 deletions

View File

@ -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,

View File

@ -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') ;
}