1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Added ability to use templates

- Added replace, append and prepend actions for template content into
both the WYSIWYG editor and markdown editor.
- Added further testing to cover.
This commit is contained in:
Dan Brown
2019-08-11 20:04:43 +01:00
parent 2ebbc6b658
commit de3e9ab094
17 changed files with 368 additions and 16 deletions

View File

@ -110,11 +110,14 @@ class PageController extends Controller
$this->setPageTitle(trans('entities.pages_edit_draft'));
$draftsEnabled = $this->signedIn;
$templates = $this->pageRepo->getPageTemplates(10);
return view('pages.edit', [
'page' => $draft,
'book' => $draft->book,
'isDraft' => true,
'draftsEnabled' => $draftsEnabled
'draftsEnabled' => $draftsEnabled,
'templates' => $templates,
]);
}
@ -239,11 +242,14 @@ class PageController extends Controller
}
$draftsEnabled = $this->signedIn;
$templates = $this->pageRepo->getPageTemplates(10);
return view('pages.edit', [
'page' => $page,
'book' => $page->book,
'current' => $page,
'draftsEnabled' => $draftsEnabled
'draftsEnabled' => $draftsEnabled,
'templates' => $templates,
]);
}