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-07-03 10:31:20 +0100
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Commit
565033e0d4d929148db434d42c64bf569e3608de
565033e0
1 parent
c25ef189
Fixed bug which hid entities and fixed new chapter priority
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
app/Http/Controllers/ChapterController.php
app/Repos/BookRepo.php
app/Http/Controllers/ChapterController.php
View file @
565033e
...
...
@@ -59,7 +59,7 @@ class ChapterController extends Controller
$input
=
$request
->
all
();
$input
[
'priority'
]
=
$this
->
bookRepo
->
getNewPriority
(
$book
);
$chapter
=
$this
->
chapterRepo
->
createFromInput
(
$
request
->
all
()
,
$book
);
$chapter
=
$this
->
chapterRepo
->
createFromInput
(
$
input
,
$book
);
Activity
::
add
(
$chapter
,
'chapter_create'
,
$book
->
id
);
return
redirect
(
$chapter
->
getUrl
());
}
...
...
@@ -171,6 +171,14 @@ class ChapterController extends Controller
]);
}
/**
* Perform the move action for a chapter.
* @param $bookSlug
* @param $chapterSlug
* @param Request $request
* @return mixed
* @throws \BookStack\Exceptions\NotFoundException
*/
public
function
move
(
$bookSlug
,
$chapterSlug
,
Request
$request
)
{
$book
=
$this
->
bookRepo
->
getBySlug
(
$bookSlug
);
$chapter
=
$this
->
chapterRepo
->
getBySlug
(
$chapterSlug
,
$book
->
id
);
...
...
app/Repos/BookRepo.php
View file @
565033e
...
...
@@ -251,7 +251,10 @@ class BookRepo extends EntityRepo
}]);
$chapterQuery
=
$this
->
permissionService
->
enforceChapterRestrictions
(
$chapterQuery
,
'view'
);
$chapters
=
$chapterQuery
->
get
();
$children
=
$pages
->
merge
(
$chapters
);
$children
=
$pages
->
values
();
foreach
(
$chapters
as
$chapter
)
{
$children
->
push
(
$chapter
);
}
$bookSlug
=
$book
->
slug
;
$children
->
each
(
function
(
$child
)
use
(
$bookSlug
)
{
...
...
Please
register
or
sign in
to post a comment