Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Зуев Егор
/
wiki.dev
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Authored by
Dan Brown
2016-02-22 21:28:20 +0000
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Commit
3ab09ef70871320ba59f24dd65b56cdcd3402123
3ab09ef7
1 parent
c86a122d
Fixed issue with the book sort not showing all books in sidebar
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
app/Http/Controllers/BookController.php
app/Repos/BookRepo.php
app/Http/Controllers/BookController.php
View file @
3ab09ef
...
...
@@ -157,7 +157,7 @@ class BookController extends Controller
$this
->
checkPermission
(
'book-update'
);
$book
=
$this
->
bookRepo
->
getBySlug
(
$bookSlug
);
$bookChildren
=
$this
->
bookRepo
->
getChildren
(
$book
);
$books
=
$this
->
bookRepo
->
getAll
();
$books
=
$this
->
bookRepo
->
getAll
(
false
);
$this
->
setPageTitle
(
'Sort Book '
.
$book
->
getShortName
());
return
view
(
'books/sort'
,
[
'book'
=>
$book
,
'current'
=>
$book
,
'books'
=>
$books
,
'bookChildren'
=>
$bookChildren
]);
}
...
...
app/Repos/BookRepo.php
View file @
3ab09ef
...
...
@@ -14,8 +14,8 @@ class BookRepo
/**
* BookRepo constructor.
* @param Book
$book
* @param PageRepo
$pageRepo
* @param Book $book
* @param PageRepo $pageRepo
* @param ChapterRepo $chapterRepo
*/
public
function
__construct
(
Book
$book
,
PageRepo
$pageRepo
,
ChapterRepo
$chapterRepo
)
...
...
@@ -42,7 +42,9 @@ class BookRepo
*/
public
function
getAll
(
$count
=
10
)
{
return
$this
->
book
->
orderBy
(
'name'
,
'asc'
)
->
take
(
$count
)
->
get
();
$bookQuery
=
$this
->
book
->
orderBy
(
'name'
,
'asc'
);
if
(
!
$count
)
return
$bookQuery
->
get
();
return
$bookQuery
->
take
(
$count
)
->
get
();
}
/**
...
...
@@ -159,7 +161,7 @@ class BookRepo
}
/**
* @param string
$slug
* @param string $slug
* @param bool|false $currentId
* @return bool
*/
...
...
@@ -175,7 +177,7 @@ class BookRepo
/**
* Provides a suitable slug for the given book name.
* Ensures the returned slug is unique in the system.
* @param string
$name
* @param string $name
* @param bool|false $currentId
* @return string
*/
...
...
Please
register
or
sign in
to post a comment