$this->checkOwnablePermission('attachment-create', $attachment);
if (intval($pageId) !== intval($attachment->uploaded_to)) {
- return $this->jsonError('Page mismatch during attached file update');
+ return $this->jsonError(trans('errors.attachment_page_mismatch'));
}
$uploadedFile = $request->file('file');
$this->checkOwnablePermission('attachment-create', $attachment);
if (intval($pageId) !== intval($attachment->uploaded_to)) {
- return $this->jsonError('Page mismatch during attachment update');
+ return $this->jsonError(trans('errors.attachment_page_mismatch'));
}
$attachment = $this->attachmentService->updateFile($attachment, $request->all());
$attachments = $request->get('files');
$this->attachmentService->updateFileOrderWithinPage($attachments, $pageId);
- return response()->json(['message' => 'Attachment order updated']);
+ return response()->json(['message' => trans('entities.attachments_order_updated')]);
}
/**
$attachment = $this->attachment->findOrFail($attachmentId);
$this->checkOwnablePermission('attachment-delete', $attachment);
$this->attachmentService->deleteFile($attachment);
- return response()->json(['message' => 'Attachment deleted']);
+ return response()->json(['message' => trans('entities.attachments_deleted')]);
}
}
);
if ($response === Password::RESET_LINK_SENT) {
- $message = 'A password reset link has been sent to ' . $request->get('email') . '.';
+ $message = trans('auth.reset_password_sent_success', ['email' => $request->get('email')]);
session()->flash('success', $message);
return back()->with('status', trans($response));
}
namespace BookStack\Http\Controllers\Auth;
+use BookStack\Exceptions\AuthException;
use BookStack\Http\Controllers\Controller;
use BookStack\Repos\UserRepo;
use BookStack\Services\SocialAuthService;
// Check for users with same email already
$alreadyUser = $user->newQuery()->where('email', '=', $user->email)->count() > 0;
if ($alreadyUser) {
- throw new AuthException('A user with the email ' . $user->email . ' already exists but with different credentials.');
+ throw new AuthException(trans('errors.error_user_exists_different_creds', ['email' => $user->email]));
}
$user->save();
namespace BookStack\Http\Controllers\Auth;
use BookStack\Exceptions\ConfirmationEmailException;
+use BookStack\Exceptions\SocialSignInException;
use BookStack\Exceptions\UserRegistrationException;
use BookStack\Repos\UserRepo;
use BookStack\Services\EmailConfirmationService;
protected function checkRegistrationAllowed()
{
if (!setting('registration-enabled')) {
- throw new UserRegistrationException('Registrations are currently disabled.', '/login');
+ throw new UserRegistrationException(trans('auth.registrations_disabled'), '/login');
}
}
$restrictedEmailDomains = explode(',', str_replace(' ', '', setting('registration-restrict')));
$userEmailDomain = $domain = substr(strrchr($userData['email'], "@"), 1);
if (!in_array($userEmailDomain, $restrictedEmailDomains)) {
- throw new UserRegistrationException('That email domain does not have access to this application', '/register');
+ throw new UserRegistrationException(trans('auth.registration_email_domain_invalid'), '/register');
}
}
}
auth()->login($newUser);
- session()->flash('success', 'Thanks for signing up! You are now registered and signed in.');
+ session()->flash('success', trans('auth.register_success'));
return redirect($this->redirectPath());
}
return $this->socialRegisterCallback($socialDriver);
}
} else {
- throw new SocialSignInException('No action defined', '/login');
+ throw new SocialSignInException(trans('errors.social_no_action_defined'), '/login');
}
return redirect()->back();
}
*/
protected function sendResetResponse($response)
{
- $message = 'Your password has been successfully reset.';
+ $message = trans('auth.reset_password_success');
session()->flash('success', $message);
return redirect($this->redirectPath())
->with('status', trans($response));
use BookStack\Repos\BookRepo;
use BookStack\Repos\ChapterRepo;
use BookStack\Repos\PageRepo;
+use Illuminate\Http\Response;
use Views;
class BookController extends Controller
public function create()
{
$this->checkPermission('book-create-all');
- $this->setPageTitle('Create New Book');
+ $this->setPageTitle(trans('entities.books_create'));
return view('books/create');
}
{
$book = $this->bookRepo->getBySlug($slug);
$this->checkOwnablePermission('book-update', $book);
- $this->setPageTitle('Edit Book ' . $book->getShortName());
+ $this->setPageTitle(trans('entities.books_edit_named',['bookName'=>$book->getShortName()]));
return view('books/edit', ['book' => $book, 'current' => $book]);
}
{
$book = $this->bookRepo->getBySlug($bookSlug);
$this->checkOwnablePermission('book-delete', $book);
- $this->setPageTitle('Delete Book ' . $book->getShortName());
+ $this->setPageTitle(trans('entities.books_delete_named', ['bookName'=>$book->getShortName()]));
return view('books/delete', ['book' => $book, 'current' => $book]);
}
$this->checkOwnablePermission('book-update', $book);
$bookChildren = $this->bookRepo->getChildren($book, true);
$books = $this->bookRepo->getAll(false);
- $this->setPageTitle('Sort Book ' . $book->getShortName());
+ $this->setPageTitle(trans('entities.books_sort_named', ['bookName'=>$book->getShortName()]));
return view('books/sort', ['book' => $book, 'current' => $book, 'books' => $books, 'bookChildren' => $bookChildren]);
}
$book = $this->bookRepo->getBySlug($bookSlug);
$this->checkOwnablePermission('restrictions-manage', $book);
$this->bookRepo->updateEntityPermissionsFromRequest($request, $book);
- session()->flash('success', 'Book Restrictions Updated');
+ session()->flash('success', trans('entities.books_permissions_updated'));
return redirect($book->getUrl());
}
}
use Activity;
use BookStack\Repos\UserRepo;
use Illuminate\Http\Request;
-use BookStack\Http\Requests;
use BookStack\Repos\BookRepo;
use BookStack\Repos\ChapterRepo;
+use Illuminate\Http\Response;
use Views;
class ChapterController extends Controller
{
$book = $this->bookRepo->getBySlug($bookSlug);
$this->checkOwnablePermission('chapter-create', $book);
- $this->setPageTitle('Create New Chapter');
+ $this->setPageTitle(trans('entities.chapters_create'));
return view('chapters/create', ['book' => $book, 'current' => $book]);
}
$book = $this->bookRepo->getBySlug($bookSlug);
$chapter = $this->chapterRepo->getBySlug($chapterSlug, $book->id);
$this->checkOwnablePermission('chapter-update', $chapter);
- $this->setPageTitle('Edit Chapter' . $chapter->getShortName());
+ $this->setPageTitle(trans('entities.chapters_edit_named', ['chapterName' => $chapter->getShortName()]));
return view('chapters/edit', ['book' => $book, 'chapter' => $chapter, 'current' => $chapter]);
}
$book = $this->bookRepo->getBySlug($bookSlug);
$chapter = $this->chapterRepo->getBySlug($chapterSlug, $book->id);
$this->checkOwnablePermission('chapter-delete', $chapter);
- $this->setPageTitle('Delete Chapter' . $chapter->getShortName());
+ $this->setPageTitle(trans('entities.chapters_delete_named', ['chapterName' => $chapter->getShortName()]));
return view('chapters/delete', ['book' => $book, 'chapter' => $chapter, 'current' => $chapter]);
}
public function showMove($bookSlug, $chapterSlug) {
$book = $this->bookRepo->getBySlug($bookSlug);
$chapter = $this->chapterRepo->getBySlug($chapterSlug, $book->id);
+ $this->setPageTitle(trans('entities.chapters_move_named', ['chapterName' => $chapter->getShortName()]));
$this->checkOwnablePermission('chapter-update', $chapter);
return view('chapters/move', [
'chapter' => $chapter,
}
if ($parent === false || $parent === null) {
- session()->flash('The selected Book was not found');
+ session()->flash('error', trans('errors.selected_book_not_found'));
return redirect()->back();
}
$this->chapterRepo->changeBook($parent->id, $chapter, true);
Activity::add($chapter, 'chapter_move', $chapter->book->id);
- session()->flash('success', sprintf('Chapter moved to "%s"', $parent->name));
+ session()->flash('success', trans('entities.chapter_move_success', ['bookName' => $parent->name]));
return redirect($chapter->getUrl());
}
$chapter = $this->chapterRepo->getBySlug($chapterSlug, $book->id);
$this->checkOwnablePermission('restrictions-manage', $chapter);
$this->chapterRepo->updateEntityPermissionsFromRequest($request, $chapter);
- session()->flash('success', 'Chapter Restrictions Updated');
+ session()->flash('success', trans('entities.chapters_permissions_success'));
return redirect($chapter->getUrl());
}
}
* @param $filter
* @param int $page
* @param Request $request
+ * @return \Illuminate\Contracts\Routing\ResponseFactory|\Illuminate\Http\JsonResponse|\Symfony\Component\HttpFoundation\Response
*/
public function getGalleryFiltered($filter, $page = 0, Request $request)
{
}
$this->imageRepo->destroyImage($image);
- return response()->json('Image Deleted');
+ return response()->json(trans('components.images_deleted'));
}
use BookStack\Repos\BookRepo;
use BookStack\Repos\ChapterRepo;
use BookStack\Repos\PageRepo;
+use Illuminate\Http\Response;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Views;
use GatherContent\Htmldiff\Htmldiff;
}
// Otherwise show edit view
- $this->setPageTitle('Create New Page');
+ $this->setPageTitle(trans('entities.pages_new'));
return view('pages/guest-create', ['parent' => $parent]);
}
$book = $this->bookRepo->getBySlug($bookSlug);
$draft = $this->pageRepo->getById($pageId, true);
$this->checkOwnablePermission('page-create', $book);
- $this->setPageTitle('Edit Page Draft');
+ $this->setPageTitle(trans('entities.pages_edit_draft'));
$draftsEnabled = $this->signedIn;
return view('pages/edit', [
* Store a new page by changing a draft into a page.
* @param Request $request
* @param string $bookSlug
+ * @param int $pageId
* @return Response
*/
public function store(Request $request, $bookSlug, $pageId)
$book = $this->bookRepo->getBySlug($bookSlug);
$page = $this->pageRepo->getBySlug($pageSlug, $book->id);
$this->checkOwnablePermission('page-update', $page);
- $this->setPageTitle('Editing Page ' . $page->getShortName());
+ $this->setPageTitle(trans('entities.pages_editing_named', ['pageName'=>$page->getShortName()]));
$page->isDraft = false;
// Check for active editing
if (!$this->signedIn) {
return response()->json([
'status' => 'error',
- 'message' => 'Guests cannot save drafts',
+ 'message' => trans('errors.guests_cannot_save_drafts'),
], 500);
}
$utcUpdateTimestamp = $updateTime + Carbon::createFromTimestamp(0)->offset;
return response()->json([
'status' => 'success',
- 'message' => 'Draft saved at ',
+ 'message' => trans('entities.pages_edit_draft_save_at'),
'timestamp' => $utcUpdateTimestamp
]);
}
$book = $this->bookRepo->getBySlug($bookSlug);
$page = $this->pageRepo->getBySlug($pageSlug, $book->id);
$this->checkOwnablePermission('page-delete', $page);
- $this->setPageTitle('Delete Page ' . $page->getShortName());
+ $this->setPageTitle(trans('entities.pages_delete_named', ['pageName'=>$page->getShortName()]));
return view('pages/delete', ['book' => $book, 'page' => $page, 'current' => $page]);
}
$book = $this->bookRepo->getBySlug($bookSlug);
$page = $this->pageRepo->getById($pageId, true);
$this->checkOwnablePermission('page-update', $page);
- $this->setPageTitle('Delete Draft Page ' . $page->getShortName());
+ $this->setPageTitle(trans('entities.pages_delete_draft_named', ['pageName'=>$page->getShortName()]));
return view('pages/delete', ['book' => $book, 'page' => $page, 'current' => $page]);
}
$page = $this->pageRepo->getBySlug($pageSlug, $book->id);
$this->checkOwnablePermission('page-delete', $page);
Activity::addMessage('page_delete', $book->id, $page->name);
- session()->flash('success', 'Page deleted');
+ session()->flash('success', trans('entities.pages_delete_success'));
$this->pageRepo->destroy($page);
return redirect($book->getUrl());
}
$book = $this->bookRepo->getBySlug($bookSlug);
$page = $this->pageRepo->getById($pageId, true);
$this->checkOwnablePermission('page-update', $page);
- session()->flash('success', 'Draft deleted');
+ session()->flash('success', trans('entities.pages_delete_draft_success'));
$this->pageRepo->destroy($page);
return redirect($book->getUrl());
}
{
$book = $this->bookRepo->getBySlug($bookSlug);
$page = $this->pageRepo->getBySlug($pageSlug, $book->id);
- $this->setPageTitle('Revisions For ' . $page->getShortName());
+ $this->setPageTitle(trans('entities.pages_revisions_named', ['pageName'=>$page->getShortName()]));
return view('pages/revisions', ['page' => $page, 'book' => $book, 'current' => $page]);
}
$revision = $this->pageRepo->getRevisionById($revisionId);
$page->fill($revision->toArray());
- $this->setPageTitle('Page Revision For ' . $page->getShortName());
+ $this->setPageTitle(trans('entities.pages_revision_named', ['pageName'=>$page->getShortName()]));
return view('pages/revision', [
'page' => $page,
$diff = (new Htmldiff)->diff($prevContent, $revision->html);
$page->fill($revision->toArray());
- $this->setPageTitle('Page Revision For ' . $page->getShortName());
+ $this->setPageTitle(trans('entities.pages_revision_named', ['pageName'=>$page->getShortName()]));
return view('pages/revision', [
'page' => $page,
{
$pages = $this->pageRepo->getRecentlyCreatedPaginated(20)->setPath(baseUrl('/pages/recently-created'));
return view('pages/detailed-listing', [
- 'title' => 'Recently Created Pages',
+ 'title' => trans('entities.recently_created_pages'),
'pages' => $pages
]);
}
{
$pages = $this->pageRepo->getRecentlyUpdatedPaginated(20)->setPath(baseUrl('/pages/recently-updated'));
return view('pages/detailed-listing', [
- 'title' => 'Recently Updated Pages',
+ 'title' => trans('entities.recently_updated_pages'),
'pages' => $pages
]);
}
}
if ($parent === false || $parent === null) {
- session()->flash('The selected Book or Chapter was not found');
+ session()->flash(trans('entities.selected_book_chapter_not_found'));
return redirect()->back();
}
$this->pageRepo->changePageParent($page, $parent);
Activity::add($page, 'page_move', $page->book->id);
- session()->flash('success', sprintf('Page moved to "%s"', $parent->name));
+ session()->flash('success', trans('entities.pages_move_success', ['parentName' => $parent->name]));
return redirect($page->getUrl());
}
$page = $this->pageRepo->getBySlug($pageSlug, $book->id);
$this->checkOwnablePermission('restrictions-manage', $page);
$this->pageRepo->updateEntityPermissionsFromRequest($request, $page);
- session()->flash('success', 'Page Permissions Updated');
+ session()->flash('success', trans('entities.pages_permissions_success'));
return redirect($page->getUrl());
}
use BookStack\Exceptions\PermissionsException;
use BookStack\Repos\PermissionsRepo;
-use BookStack\Services\PermissionService;
use Illuminate\Http\Request;
-use BookStack\Http\Requests;
class PermissionController extends Controller
{
]);
$this->permissionsRepo->saveNewRole($request->all());
- session()->flash('success', 'Role successfully created');
+ session()->flash('success', trans('settings.role_create_success'));
return redirect('/settings/roles');
}
{
$this->checkPermission('user-roles-manage');
$role = $this->permissionsRepo->getRoleById($id);
- if ($role->hidden) throw new PermissionsException('This role cannot be edited');
+ if ($role->hidden) throw new PermissionsException(trans('errors.role_cannot_be_edited'));
return view('settings/roles/edit', ['role' => $role]);
}
]);
$this->permissionsRepo->updateRole($id, $request->all());
- session()->flash('success', 'Role successfully updated');
+ session()->flash('success', trans('settings.role_update_success'));
return redirect('/settings/roles');
}
$this->checkPermission('user-roles-manage');
$role = $this->permissionsRepo->getRoleById($id);
$roles = $this->permissionsRepo->getAllRolesExcept($role);
- $blankRole = $role->newInstance(['display_name' => 'Don\'t migrate users']);
+ $blankRole = $role->newInstance(['display_name' => trans('settings.role_delete_no_migration')]);
$roles->prepend($blankRole);
return view('settings/roles/delete', ['role' => $role, 'roles' => $roles]);
}
return redirect()->back();
}
- session()->flash('success', 'Role successfully deleted');
+ session()->flash('success', trans('settings.role_delete_success'));
return redirect('/settings/roles');
}
}
-<?php
-
-namespace BookStack\Http\Controllers;
+<?php namespace BookStack\Http\Controllers;
use BookStack\Services\ViewService;
use Illuminate\Http\Request;
-
-use BookStack\Http\Requests;
use BookStack\Repos\BookRepo;
use BookStack\Repos\ChapterRepo;
use BookStack\Repos\PageRepo;
$pages = $this->pageRepo->getBySearch($searchTerm, [], 20, $paginationAppends);
$books = $this->bookRepo->getBySearch($searchTerm, 10, $paginationAppends);
$chapters = $this->chapterRepo->getBySearch($searchTerm, [], 10, $paginationAppends);
- $this->setPageTitle('Search For ' . $searchTerm);
+ $this->setPageTitle(trans('entities.search_for_term', ['term' => $searchTerm]));
return view('search/all', [
'pages' => $pages,
'books' => $books,
$searchTerm = $request->get('term');
$paginationAppends = $request->only('term');
$pages = $this->pageRepo->getBySearch($searchTerm, [], 20, $paginationAppends);
- $this->setPageTitle('Page Search For ' . $searchTerm);
+ $this->setPageTitle(trans('entities.search_page_for_term', ['term' => $searchTerm]));
return view('search/entity-search-list', [
'entities' => $pages,
- 'title' => 'Page Search Results',
+ 'title' => trans('entities.search_results_page'),
'searchTerm' => $searchTerm
]);
}
$searchTerm = $request->get('term');
$paginationAppends = $request->only('term');
$chapters = $this->chapterRepo->getBySearch($searchTerm, [], 20, $paginationAppends);
- $this->setPageTitle('Chapter Search For ' . $searchTerm);
+ $this->setPageTitle(trans('entities.search_chapter_for_term', ['term' => $searchTerm]));
return view('search/entity-search-list', [
'entities' => $chapters,
- 'title' => 'Chapter Search Results',
+ 'title' => trans('entities.search_results_chapter'),
'searchTerm' => $searchTerm
]);
}
$searchTerm = $request->get('term');
$paginationAppends = $request->only('term');
$books = $this->bookRepo->getBySearch($searchTerm, 20, $paginationAppends);
- $this->setPageTitle('Book Search For ' . $searchTerm);
+ $this->setPageTitle(trans('entities.search_book_for_term', ['term' => $searchTerm]));
return view('search/entity-search-list', [
'entities' => $books,
- 'title' => 'Book Search Results',
+ 'title' => trans('entities.search_results_book'),
'searchTerm' => $searchTerm
]);
}
<?php namespace BookStack\Http\Controllers;
use Illuminate\Http\Request;
-
-use BookStack\Http\Requests;
+use Illuminate\Http\Response;
use Setting;
class SettingController extends Controller
Setting::put($key, $value);
}
- session()->flash('success', 'Settings Saved');
+ session()->flash('success', trans('settings.settings_save_success'));
return redirect('/settings');
}
use BookStack\Repos\TagRepo;
use Illuminate\Http\Request;
-use BookStack\Http\Requests;
class TagController extends Controller
{
public function __construct(TagRepo $tagRepo)
{
$this->tagRepo = $tagRepo;
+ parent::__construct();
}
/**
* Get all the Tags for a particular entity
* @param $entityType
* @param $entityId
+ * @return \Illuminate\Http\JsonResponse
*/
public function getForEntity($entityType, $entityId)
{
return response()->json($tags);
}
- /**
- * Update the tags for a particular entity.
- * @param $entityType
- * @param $entityId
- * @param Request $request
- * @return mixed
- */
- public function updateForEntity($entityType, $entityId, Request $request)
- {
- $entity = $this->tagRepo->getEntity($entityType, $entityId, 'update');
- if ($entity === null) return $this->jsonError("Entity not found", 404);
-
- $inputTags = $request->input('tags');
- $tags = $this->tagRepo->saveTagsToEntity($entity, $inputTags);
- return response()->json([
- 'tags' => $tags,
- 'message' => 'Tags successfully updated'
- ]);
- }
-
/**
* Get tag name suggestions from a given search term.
* @param Request $request
+ * @return \Illuminate\Http\JsonResponse
*/
public function getNameSuggestions(Request $request)
{
/**
* Get tag value suggestions from a given search term.
* @param Request $request
+ * @return \Illuminate\Http\JsonResponse
*/
public function getValueSuggestions(Request $request)
{
'sort' => $request->has('sort') ? $request->get('sort') : 'name',
];
$users = $this->userRepo->getAllUsersPaginatedAndSorted(20, $listDetails);
- $this->setPageTitle('Users');
+ $this->setPageTitle(trans('settings.users'));
$users->appends($listDetails);
return view('users/index', ['users' => $users, 'listDetails' => $listDetails]);
}
}
$this->validate($request, $validationRules);
-
$user = $this->user->fill($request->all());
if ($authMethod === 'standard') {
$authMethod = ($user->system_name) ? 'system' : config('auth.method');
$activeSocialDrivers = $socialAuthService->getActiveDrivers();
- $this->setPageTitle('User Profile');
+ $this->setPageTitle(trans('settings.user_profile'));
$roles = $this->userRepo->getAllRoles();
return view('users/edit', ['user' => $user, 'activeSocialDrivers' => $activeSocialDrivers, 'authMethod' => $authMethod, 'roles' => $roles]);
}
'email' => 'min:2|email|unique:users,email,' . $id,
'password' => 'min:5|required_with:password_confirm',
'password-confirm' => 'same:password|required_with:password'
- ], [
- 'password-confirm.required_with' => 'Password confirmation required'
]);
$user = $this->user->findOrFail($id);
}
$user->save();
- session()->flash('success', 'User successfully updated');
+ session()->flash('success', trans('settings.users_edit_success'));
$redirectUrl = userCan('users-manage') ? '/settings/users' : '/settings/users/' . $user->id;
return redirect($redirectUrl);
});
$user = $this->user->findOrFail($id);
- $this->setPageTitle('Delete User ' . $user->name);
+ $this->setPageTitle(trans('settings.users_delete_named', ['userName' => $user->name]));
return view('users/delete', ['user' => $user]);
}
$user = $this->userRepo->getById($id);
if ($this->userRepo->isOnlyAdmin($user)) {
- session()->flash('error', 'You cannot delete the only admin');
+ session()->flash('error', trans('errors.users_cannot_delete_only_admin'));
return redirect($user->getEditUrl());
}
if ($user->system_name === 'public') {
- session()->flash('error', 'You cannot delete the guest user');
+ session()->flash('error', trans('errors.users_cannot_delete_guest'));
return redirect($user->getEditUrl());
}
$this->userRepo->destroy($user);
- session()->flash('success', 'User successfully removed');
+ session()->flash('success', trans('settings.users_delete_success'));
return redirect('/settings/users');
}
public function getBySlug($slug)
{
$book = $this->bookQuery()->where('slug', '=', $slug)->first();
- if ($book === null) throw new NotFoundException('Book not found');
+ if ($book === null) throw new NotFoundException(trans('errors.book_not_found'));
return $book;
}
public function getBySlug($slug, $bookId)
{
$chapter = $this->chapterQuery()->where('slug', '=', $slug)->where('book_id', '=', $bookId)->first();
- if ($chapter === null) throw new NotFoundException('Chapter not found');
+ if ($chapter === null) throw new NotFoundException(trans('errors.chapter_not_found'));
return $chapter;
}
public function getBySlug($slug, $bookId)
{
$page = $this->pageQuery()->where('slug', '=', $slug)->where('book_id', '=', $bookId)->first();
- if ($page === null) throw new NotFoundException('Page not found');
+ if ($page === null) throw new NotFoundException(trans('errors.page_not_found'));
return $page;
}
$draftPage->draft = false;
$draftPage->save();
- $this->saveRevision($draftPage, 'Initial Publish');
+ $this->saveRevision($draftPage, trans('entities.pages_initial_revision'));
return $draftPage;
}
* Get a new draft page instance.
* @param Book $book
* @param Chapter|bool $chapter
- * @return static
+ * @return Page
*/
public function getDraftPage(Book $book, $chapter = false)
{
$page = $this->page->newInstance();
- $page->name = 'New Page';
+ $page->name = trans('entities.pages_initial_name');
$page->created_by = user()->id;
$page->updated_by = user()->id;
$page->draft = true;
*/
public function getUserPageDraftMessage(PageRevision $draft)
{
- $message = 'You are currently editing a draft that was last saved ' . $draft->updated_at->diffForHumans() . '.';
- if ($draft->page->updated_at->timestamp > $draft->updated_at->timestamp) {
- $message .= "\n This page has been updated by since that time. It is recommended that you discard this draft.";
- }
- return $message;
+ $message = trans('entities.pages_editing_draft_notification', ['timeDiff' => $draft->updated_at->diffForHumans()]);
+ if ($draft->page->updated_at->timestamp <= $draft->updated_at->timestamp) return $message;
+ return $message . "\n" . trans('entities.pages_draft_edited_notification');
}
/**
public function getPageEditingActiveMessage(Page $page, $minRange = null)
{
$pageDraftEdits = $this->activePageEditingQuery($page, $minRange)->get();
- $userMessage = $pageDraftEdits->count() > 1 ? $pageDraftEdits->count() . ' users have' : $pageDraftEdits->first()->createdBy->name . ' has';
- $timeMessage = $minRange === null ? 'since the page was last updated' : 'in the last ' . $minRange . ' minutes';
- $message = '%s started editing this page %s. Take care not to overwrite each other\'s updates!';
- return sprintf($message, $userMessage, $timeMessage);
+
+ $userMessage = $pageDraftEdits->count() > 1 ? trans('entities.pages_draft_edit_active.start_a', ['count' => $pageDraftEdits->count()]): trans('entities.pages_draft_edit_active.start_b', ['userName' => $pageDraftEdits->first()->createdBy->name]);
+ $timeMessage = $minRange === null ? trans('entities.pages_draft_edit_active.time_a') : trans('entities.pages_draft_edit_active.time_b', ['minCount'=>$minRange]);
+ return trans('entities.pages_draft_edit_active.message', ['start' => $userMessage, 'time' => $timeMessage]);
}
/**
// Prevent deleting admin role or default registration role.
if ($role->system_name && in_array($role->system_name, $this->systemRoles)) {
- throw new PermissionsException('This role is a system role and cannot be deleted');
+ throw new PermissionsException(trans('errors.role_system_cannot_be_deleted'));
} else if ($role->id == setting('registration-role')) {
- throw new PermissionsException('This role cannot be deleted while set as the default registration role.');
+ throw new PermissionsException(trans('errors.role_registration_default_cannot_delete'));
}
if ($migrateRoleId) {
/**
* Create a new Tag instance from user input.
* @param $input
- * @return static
+ * @return Tag
*/
protected function newInstanceFromInput($input)
{
use BookStack\Role;
use BookStack\User;
use Exception;
-use Setting;
class UserRepo
{
try {
$storage->put($attachmentStoragePath, $attachmentData);
} catch (Exception $e) {
- throw new FileUploadException('File path ' . $attachmentStoragePath . ' could not be uploaded to. Ensure it is writable to the server.');
+ throw new FileUploadException(trans('errors.path_not_writable', ['filePath' => $attachmentStoragePath]));
}
return $attachmentPath;
}
public function sendConfirmation(User $user)
{
if ($user->email_confirmed) {
- throw new ConfirmationEmailException('Email has already been confirmed, Try logging in.', '/login');
+ throw new ConfirmationEmailException(trans('errors.email_already_confirmed'), '/login');
}
$this->deleteConfirmationsByUser($user);
* Gets an email confirmation by looking up the token,
* Ensures the token has not expired.
* @param string $token
- * @return EmailConfirmation
+ * @return array|null|\stdClass
* @throws UserRegistrationException
*/
public function getEmailConfirmationFromToken($token)
// If not found show error
if ($emailConfirmation === null) {
- throw new UserRegistrationException('This confirmation token is not valid or has already been used, Please try registering again.', '/register');
+ throw new UserRegistrationException(trans('errors.email_confirmation_invalid'), '/register');
}
// If more than a day old
if (Carbon::now()->subDay()->gt(new Carbon($emailConfirmation->created_at))) {
$user = $this->users->getById($emailConfirmation->user_id);
$this->sendConfirmation($user);
- throw new UserRegistrationException('The confirmation token has expired, A new confirmation email has been sent.', '/register/confirm');
+ throw new UserRegistrationException(trans('errors.email_confirmation_expired'), '/register/confirm');
}
$emailConfirmation->user = $this->users->getById($emailConfirmation->user_id);
{
$imageName = $imageName ? $imageName : basename($url);
$imageData = file_get_contents($url);
- if($imageData === false) throw new \Exception('Cannot get image from ' . $url);
+ if($imageData === false) throw new \Exception(trans('errors.cannot_get_image_from_url', ['url' => $url]));
return $this->saveNew($imageName, $imageData, $type);
}
$storage->put($fullPath, $imageData);
$storage->setVisibility($fullPath, 'public');
} catch (Exception $e) {
- throw new ImageUploadException('Image Path ' . $fullPath . ' is not writable by the server.');
+ throw new ImageUploadException(trans('errors.path_not_writable', ['filePath' => $fullPath]));
}
if ($this->isLocal()) $fullPath = str_replace_first('/public', '', $fullPath);
$thumb = $this->imageTool->make($storage->get($imagePath));
} catch (Exception $e) {
if ($e instanceof \ErrorException || $e instanceof NotSupportedException) {
- throw new ImageUploadException('The server cannot create thumbnails. Please check you have the GD PHP extension installed.');
+ throw new ImageUploadException(trans('errors.cannot_create_thumbs'));
} else {
throw $e;
}
$ldapBind = $this->ldap->bind($connection, $ldapDn, $ldapPass);
}
- if (!$ldapBind) throw new LdapException('LDAP access failed using ' . ($isAnonymous ? ' anonymous bind.' : ' given dn & pass details'));
+ if (!$ldapBind) throw new LdapException(($isAnonymous ? trans('errors.ldap_fail_anonymous') : trans('errors.ldap_fail_authed')));
}
/**
// Check LDAP extension in installed
if (!function_exists('ldap_connect') && config('app.env') !== 'testing') {
- throw new LdapException('LDAP PHP extension not installed');
+ throw new LdapException(trans('errors.ldap_extension_not_installed'));
}
// Get port from server string if specified.
$ldapConnection = $this->ldap->connect($ldapServer[0], count($ldapServer) > 1 ? $ldapServer[1] : 389);
if ($ldapConnection === false) {
- throw new LdapException('Cannot connect to ldap server, Initial connection failed');
+ throw new LdapException(trans('errors.ldap_cannot_connect'));
}
// Set any required options
// Check social account has not already been used
if ($this->socialAccount->where('driver_id', '=', $socialUser->getId())->exists()) {
- throw new UserRegistrationException('This ' . $socialDriver . ' account is already in use, Try logging in via the ' . $socialDriver . ' option.', '/login');
+ throw new UserRegistrationException(trans('errors.social_account_in_use', ['socialAccount'=>$socialDriver]), '/login');
}
if ($this->userRepo->getByEmail($socialUser->getEmail())) {
$email = $socialUser->getEmail();
- throw new UserRegistrationException('The email ' . $email . ' is already in use. If you already have an account you can connect your ' . $socialDriver . ' account from your profile settings.', '/login');
+ throw new UserRegistrationException(trans('errors.social_account_in_use', ['socialAccount'=>$socialDriver, 'email' => $email]), '/login');
}
return $socialUser;
if ($isLoggedIn && $socialAccount === null) {
$this->fillSocialAccount($socialDriver, $socialUser);
$currentUser->socialAccounts()->save($this->socialAccount);
- session()->flash('success', title_case($socialDriver) . ' account was successfully attached to your profile.');
+ session()->flash('success', trans('settings.users_social_connected', ['socialAccount' => title_case($socialDriver)]));
return redirect($currentUser->getEditUrl());
}
// When a user is logged in and the social account exists and is already linked to the current user.
if ($isLoggedIn && $socialAccount !== null && $socialAccount->user->id === $currentUser->id) {
- session()->flash('error', 'This ' . title_case($socialDriver) . ' account is already attached to your profile.');
+ session()->flash('error', trans('errors.social_account_existing', ['socialAccount' => title_case($socialDriver)]));
return redirect($currentUser->getEditUrl());
}
// When a user is logged in, A social account exists but the users do not match.
- // Change the user that the social account is assigned to.
if ($isLoggedIn && $socialAccount !== null && $socialAccount->user->id != $currentUser->id) {
- session()->flash('success', 'This ' . title_case($socialDriver) . ' account is already used by another user.');
+ session()->flash('error', trans('errors.social_account_already_used_existing', ['socialAccount' => title_case($socialDriver)]));
return redirect($currentUser->getEditUrl());
}
// Otherwise let the user know this social account is not used by anyone.
- $message = 'This ' . $socialDriver . ' account is not linked to any users. Please attach it in your profile settings';
+ $message = trans('errors.social_account_not_used', ['socialAccount' => title_case($socialDriver)]);
if (setting('registration-enabled')) {
- $message .= ' or, If you do not yet have an account, You can register an account using the ' . $socialDriver . ' option';
+ $message .= trans('errors.social_account_register_instructions', ['socialAccount' => title_case($socialDriver)]);
}
throw new SocialSignInException($message . '.', '/login');
{
$driver = trim(strtolower($socialDriver));
- if (!in_array($driver, $this->validSocialDrivers)) abort(404, 'Social Driver Not Found');
- if (!$this->checkDriverConfigured($driver)) throw new SocialDriverNotConfigured("Your {$driver} social settings are not configured correctly.");
+ if (!in_array($driver, $this->validSocialDrivers)) abort(404, trans('errors.social_driver_not_found'));
+ if (!$this->checkDriverConfigured($driver)) throw new SocialDriverNotConfigured(trans('errors.social_driver_not_configured', ['socialAccount' => title_case($socialDriver)]));
return $driver;
}
{
session();
user()->socialAccounts()->where('driver', '=', $socialDriver)->delete();
- session()->flash('success', title_case($socialDriver) . ' account successfully detached');
+ session()->flash('success', trans('settings.users_social_disconnected', ['socialAccount' => title_case($socialDriver)]));
return redirect(user()->getEditUrl());
}
}
};
- /**
- * Save the tags to the current page.
- */
- $scope.saveTags = function() {
- setTagOrder();
- let postData = {tags: $scope.tags};
- let url = window.baseUrl('/ajax/tags/update/page/' + pageId);
- $http.post(url, postData).then((responseData) => {
- $scope.tags = responseData.data.tags;
- addEmptyTag();
- events.emit('success', responseData.data.message);
- })
- };
-
/**
* Remove a tag from the current list.
* @param tag
'register_thanks' => 'Thanks for registering!',
'register_confirm' => 'Please check your email and click the confirmation button to access :appName.',
+ 'registrations_disabled' => 'Registrations are currently disabled',
+ 'registration_email_domain_invalid' => 'That email domain does not have access to this application',
+ 'register_success' => 'Thanks for signing up! You are now registered and signed in.',
+
/**
* Password Reset
'reset_password' => 'Reset Password',
'reset_password_send_instructions' => 'Enter your email below and you will be sent an email with a password reset link.',
'reset_password_send_button' => 'Send Reset Link',
+ 'reset_password_sent_success' => 'A password reset link has been sent to :email.',
+ 'reset_password_success' => 'Your password has been successfully reset.',
'email_reset_subject' => 'Reset your :appName password',
'email_reset_text' => 'You are receiving this email because we received a password reset request for your account.',
'email_reset_not_requested' => 'If you did not request a password reset, no further action is required.',
+
/**
* Email Confirmation
*/
'create' => 'Create',
'update' => 'Update',
'edit' => 'Edit',
+ 'sort' => 'Sort',
+ 'move' => 'Move',
'delete' => 'Delete',
'search' => 'Search',
'search_clear' => 'Clear Search',
'imagem_load_more' => 'Load More',
'imagem_image_name' => 'Image Name',
'imagem_delete_confirm' => 'This image is used in the pages below, Click delete again to confirm you want to delete this image.',
- 'imagem_select_image' => 'Select Image'
+ 'imagem_select_image' => 'Select Image',
+ 'images_deleted' => 'Images Deleted',
];
\ No newline at end of file
'recently_viewed' => 'Recently Viewed',
'recent_activity' => 'Recent Activity',
'create_now' => 'Create one now',
- 'edit' => 'Edit',
- 'sort' => 'Sort',
- 'move' => 'Move',
- 'delete' => 'Delete',
'revisions' => 'Revisions',
'meta_created' => 'Created :timeLength',
'meta_created_name' => 'Created :timeLength by :user',
* Search
*/
'search_results' => 'Search Results',
+ 'search_results_page' => 'Page Search Results',
+ 'search_results_chapter' => 'Chapter Search Results',
+ 'search_results_book' => 'Book Search Results',
'search_clear' => 'Clear Search',
'search_view_pages' => 'View all matches pages',
'search_view_chapters' => 'View all matches chapters',
'search_view_books' => 'View all matches books',
'search_no_pages' => 'No pages matched this search',
+ 'search_for_term' => 'Search for :term',
+ 'search_page_for_term' => 'Page search for :term',
+ 'search_chapter_for_term' => 'Chapter search for :term',
+ 'search_book_for_term' => 'Books search for :term',
/**
* Books
'books_popular_empty' => 'The most popular books will appear here.',
'books_create' => 'Create New Book',
'books_delete' => 'Delete Book',
+ 'books_delete_named' => 'Delete Book :bookName',
'books_delete_explain' => 'This will delete the book with the name \':bookName\', All pages and chapters will be removed.',
'books_delete_confirmation' => 'Are you sure you want to delete this book?',
'books_edit' => 'Edit Book',
+ 'books_edit_named' => 'Edit Book :bookName',
'books_form_book_name' => 'Book Name',
'books_save' => 'Save Book',
'books_permissions' => 'Book Permissions',
+ 'books_permissions_updated' => 'Book Permissions Updated',
'books_empty_contents' => 'No pages or chapters have been created for this book.',
'books_empty_create_page' => 'Create a new page',
'books_empty_or' => 'or',
'books_search_this' => 'Search this book',
'books_navigation' => 'Book Navigation',
'books_sort' => 'Sort Book Contents',
+ 'books_sort_named' => 'Sort Book :bookName',
'books_sort_show_other' => 'Show Other Books',
'books_sort_save' => 'Save New Order',
'chapters_new' => 'New Chapter',
'chapters_create' => 'Create New Chapter',
'chapters_delete' => 'Delete Chapter',
+ 'chapters_delete_named' => 'Delete Chapter :chapterName',
'chapters_delete_explain' => 'This will delete the chapter with the name \':chapterName\', All pages will be removed
and added directly to the parent book.',
'chapters_delete_confirm' => 'Are you sure you want to delete this chapter?',
'chapters_edit' => 'Edit Chapter',
+ 'chapters_edit_named' => 'Edit Chapter :chapterName',
'chapters_save' => 'Save Chapter',
'chapters_move' => 'Move Chapter',
+ 'chapters_move_named' => 'Move Chapter :chapterName',
+ 'chapter_move_success' => 'Chapter moved to :bookName',
'chapters_permissions' => 'Chapter Permissions',
'chapters_empty' => 'No pages are currently in this chapter.',
'chapters_permissions_active' => 'Chapter Permissions Active',
+ 'chapters_permissions_success' => 'Chapter Permissions Updated',
/**
* Pages
'pages_attachments' => 'Attachments',
'pages_navigation' => 'Page Navigation',
'pages_delete' => 'Delete Page',
+ 'pages_delete_named' => 'Delete Page :pageName',
+ 'pages_delete_draft_named' => 'Delete Draft Page :pageName',
'pages_delete_draft' => 'Delete Draft Page',
+ 'pages_delete_success' => 'Page deleted',
+ 'pages_delete_draft_success' => 'Draft page deleted',
'pages_delete_confirm' => 'Are you sure you want to delete this page?',
'pages_delete_draft_confirm' => 'Are you sure you want to delete this draft page?',
+ 'pages_editing_named' => 'Editing Page :pageName',
'pages_edit_toggle_header' => 'Toggle header',
'pages_edit_save_draft' => 'Save Draft',
+ 'pages_edit_draft' => 'Edit Page Draft',
+ 'pages_edit_draft_save_at' => 'Draft saved at ',
'pages_edit_delete_draft' => 'Delete Draft',
'pages_edit_discard_draft' => 'Discard Draft',
'pages_edit_set_changelog' => 'Set Changelog',
'pages_md_insert_link' => 'Insert Entity Link',
'pages_not_in_chapter' => 'Page is not in a chapter',
'pages_move' => 'Move Page',
+ 'pages_move_success' => 'Page moved to ":parentName"',
'pages_permissions' => 'Page Permissions',
+ 'pages_permissions_success' => 'Page permissions updated',
'pages_revisions' => 'Page Revisions',
+ 'pages_revisions_named' => 'Page Revisions for :pageName',
+ 'pages_revision_named' => 'Page Revision for :pageName',
'pages_revisions_created_by' => 'Created By',
'pages_revisions_date' => 'Revision Date',
'pages_revisions_changelog' => 'Changelog',
'pages_export_text' => 'Plain Text File',
'pages_copy_link' => 'Copy Link',
'pages_permissions_active' => 'Page Permissions Active',
+ 'pages_initial_revision' => 'Initial publish',
+ 'pages_initial_name' => 'New Page',
+ 'pages_editing_draft_notification' => 'You are currently editing a draft that was last saved :timeDiff.',
+ 'pages_draft_edited_notification' => 'This page has been updated by since that time. It is recommended that you discard this draft.',
+ 'pages_draft_edit_active' => [
+ 'start_a' => ':count users have started editing this page',
+ 'start_b' => ':userName has started editing this page',
+ 'time_a' => 'since the pages was last updated',
+ 'time_b' => 'in the last :minCount minutes',
+ 'message' => ':start :time. Take care not to overwrite each other\'s updates!',
+ ],
/**
* Editor sidebar
*/
'page_tags' => 'Page Tags',
'tag' => 'Tag',
+ 'tags' => '',
'tag_value' => 'Tag Value (Optional)',
'tags_explain' => "Add some tags to better categorise your content. \n You can assign a value to a tag for more in-depth organisation.",
'tags_add' => 'Add another tag',
'attachments_edit_file' => 'Edit File',
'attachments_edit_file_name' => 'File Name',
'attachments_edit_drop_upload' => 'Drop files or click here to upload and overwrite',
+ 'attachments_order_updated' => 'Attachment order updated',
+ 'attachments_deleted' => 'Attachment deleted',
/**
* Profile View
'permission' => 'You do not have permission to access the requested page.',
'permissionJson' => 'You do not have permission to perform the requested action.',
+ // Auth
+ 'error_user_exists_different_creds' => 'A user with the email :email already exists but with different credentials.',
+ 'email_already_confirmed' => 'Email has already been confirmed, Try logging in.',
+ 'email_confirmation_invalid' => 'This confirmation token is not valid or has already been used, Please try registering again.',
+ 'email_confirmation_expired' => 'The confirmation token has expired, A new confirmation email has been sent.',
+ 'ldap_fail_anonymous' => 'LDAP access failed using anonymous bind',
+ 'ldap_fail_authed' => 'LDAP access failed using given dn & password details',
+ 'ldap_extension_not_installed' => 'LDAP PHP extension not installed',
+ 'ldap_cannot_connect' => 'Cannot connect to ldap server, Initial connection failed',
+ 'social_no_action_defined' => 'No action defined',
+ 'social_account_in_use' => 'This :socialAccount account is already in use, Try logging in via the :socialAccount option.',
+ 'social_account_email_in_use' => 'The email :email is already in use. If you already have an account you can connect your :socialAccount account from your profile settings.',
+ 'social_account_existing' => 'This :socialAccount is already attached to your profile.',
+ 'social_account_already_used_existing' => 'This :socialAccount account is already used by another user.',
+ 'social_account_not_used' => 'This :socialAccount account is not linked to any users. Please attach it in your profile settings. ',
+ 'social_account_register_instructions' => 'If you do not yet have an account, You can register an account using the :socialAccount option.',
+ 'social_driver_not_found' => 'Social driver not found',
+ 'social_driver_not_configured' => 'Your :socialAccount social settings are not configured correctly.',
+
+ // System
+ 'path_not_writable' => 'File path :filePath could not be uploaded to. Ensure it is writable to the server.',
+ 'cannot_get_image_from_url' => 'Cannot get image from :url',
+ 'cannot_create_thumbs' => 'The server cannot create thumbnails. Please check you have the GD PHP extension installed.',
+
+ // Attachments
+ 'attachment_page_mismatch' => 'Page mismatch during attachment update',
+
+ // Entities
+ 'entity_not_found' => 'Entity not found',
+ 'book_not_found' => 'Book not found',
+ 'page_not_found' => 'Page not found',
+ 'chapter_not_found' => 'Chapter not found',
+ 'selected_book_not_found' => 'The selected book was not found',
+ 'selected_book_chapter_not_found' => 'The selected Book or Chapter was not found',
+ 'guests_cannot_save_drafts' => 'Guests cannot save drafts',
+
+ // Users
+ 'users_cannot_delete_only_admin' => 'You cannot delete the only admin',
+ 'users_cannot_delete_guest' => 'You cannot delete the guest user',
+
+ // Roles
+ 'role_cannot_be_edited' => 'This role cannot be edited',
+ 'role_system_cannot_be_deleted' => 'This role is a system role and cannot be deleted',
+ 'role_registration_default_cannot_delete' => 'This role cannot be deleted while set as the default registration role',
+
// Error pages
- 'page_not_found' => 'Page Not Found',
+ '404_page_not_found' => 'Page Not Found',
'sorry_page_not_found' => 'Sorry, The page you were looking for could not be found.',
'return_home' => 'Return to home',
'error_occurred' => 'An Error Occurred',
'settings' => 'Settings',
'settings_save' => 'Save Settings',
+ 'settings_save_success' => 'Settings saved',
/**
* App settings
'roles' => 'Roles',
'role_user_roles' => 'User Roles',
'role_create' => 'Create New Role',
+ 'role_create_success' => 'Role successfully created',
'role_delete' => 'Delete Role',
'role_delete_confirm' => 'This will delete the role with the name \':roleName\'.',
'role_delete_users_assigned' => 'This role has :userCount users assigned to it. If you would like to migrate the users from this role select a new role below.',
+ 'role_delete_no_migration' => "Don't migrate users",
'role_delete_sure' => 'Are you sure you want to delete this role?',
+ 'role_delete_success' => 'Role successfully deleted',
'role_edit' => 'Edit Role',
'role_details' => 'Role Details',
'role_name' => 'Role Name',
'role_own' => 'Own',
'role_controlled_by_asset' => 'Controlled by the asset they are uploaded to',
'role_save' => 'Save Role',
+ 'role_update_success' => 'Role successfully updated',
'role_users' => 'Users in this role',
'role_users_none' => 'No users are currently assigned to this role',
*/
'users' => 'Users',
+ 'user_profile' => 'User Profile',
'users_add_new' => 'Add New User',
'users_search' => 'Search Users',
'users_role' => 'User Roles',
'users_password_warning' => 'Only fill the below if you would like to change your password:',
'users_system_public' => 'This user represents any guest users that visit your instance. It cannot be used to log in but is assigned automatically.',
'users_delete' => 'Delete User',
+ 'users_delete_named' => 'Delete ser :userName',
'users_delete_warning' => 'This will fully delete this user with the name \':userName\' from the system.',
'users_delete_confirm' => 'Are you sure you want to delete this user?',
+ 'users_delete_success' => 'Users successfully removed',
'users_edit' => 'Edit User',
'users_edit_profile' => 'Edit Profile',
+ 'users_edit_success' => 'User successfully updated',
'users_avatar' => 'User Avatar',
'users_avatar_desc' => 'This image should be approx 256px square.',
'users_social_accounts' => 'Social Accounts',
'users_social_accounts_info' => 'Here you can connect your other accounts for quicker and easier login. Disconnecting an account here does not previously authorized access. Revoke access from your profile settings on the connected social account.',
'users_social_connect' => 'Connect Account',
'users_social_disconnect' => 'Disconnect Account',
+ 'users_social_connected' => ':socialAccount account was successfully attached to your profile.',
+ 'users_social_disconnected' => ':socialAccount account was successfully disconnected from your profile.',
];
*/
'custom' => [
- 'attribute-name' => [
- 'rule-name' => 'custom-message',
+ 'password-confirm' => [
+ 'required_with' => 'Password confirmation required',
],
],
<a href="{{ $book->getUrl('/chapter/create') }}" class="text-pos text-button"><i class="zmdi zmdi-plus"></i>{{ trans('entities.chapters_new') }}</a>
@endif
@if(userCan('book-update', $book))
- <a href="{{$book->getEditUrl()}}" class="text-primary text-button"><i class="zmdi zmdi-edit"></i>{{ trans('entities.edit') }}</a>
+ <a href="{{$book->getEditUrl()}}" class="text-primary text-button"><i class="zmdi zmdi-edit"></i>{{ trans('common.edit') }}</a>
@endif
@if(userCan('book-update', $book) || userCan('restrictions-manage', $book) || userCan('book-delete', $book))
<div dropdown class="dropdown-container">
<a dropdown-toggle class="text-primary text-button"><i class="zmdi zmdi-more-vert"></i></a>
<ul>
@if(userCan('book-update', $book))
- <li><a href="{{ $book->getUrl('/sort') }}" class="text-primary"><i class="zmdi zmdi-sort"></i>{{ trans('entities.sort') }}</a></li>
+ <li><a href="{{ $book->getUrl('/sort') }}" class="text-primary"><i class="zmdi zmdi-sort"></i>{{ trans('common.sort') }}</a></li>
@endif
@if(userCan('restrictions-manage', $book))
<li><a href="{{ $book->getUrl('/permissions') }}" class="text-primary"><i class="zmdi zmdi-lock-outline"></i>{{ trans('entities.permissions') }}</a></li>
@endif
@if(userCan('book-delete', $book))
- <li><a href="{{ $book->getUrl('/delete') }}" class="text-neg"><i class="zmdi zmdi-delete"></i>{{ trans('entities.delete') }}</a></li>
+ <li><a href="{{ $book->getUrl('/delete') }}" class="text-neg"><i class="zmdi zmdi-delete"></i>{{ trans('common.delete') }}</a></li>
@endif
</ul>
</div>
<a href="{{ $chapter->getUrl('/create-page') }}" class="text-pos text-button"><i class="zmdi zmdi-plus"></i>{{ trans('entities.pages_new') }}</a>
@endif
@if(userCan('chapter-update', $chapter))
- <a href="{{ $chapter->getUrl('/edit') }}" class="text-primary text-button"><i class="zmdi zmdi-edit"></i>{{ trans('entities.edit') }}</a>
+ <a href="{{ $chapter->getUrl('/edit') }}" class="text-primary text-button"><i class="zmdi zmdi-edit"></i>{{ trans('common.edit') }}</a>
@endif
@if(userCan('chapter-update', $chapter) || userCan('restrictions-manage', $chapter) || userCan('chapter-delete', $chapter))
<div dropdown class="dropdown-container">
<a dropdown-toggle class="text-primary text-button"><i class="zmdi zmdi-more-vert"></i></a>
<ul>
@if(userCan('chapter-update', $chapter))
- <li><a href="{{ $chapter->getUrl('/move') }}" class="text-primary"><i class="zmdi zmdi-folder"></i>{{ trans('entities.move') }}</a></li>
+ <li><a href="{{ $chapter->getUrl('/move') }}" class="text-primary"><i class="zmdi zmdi-folder"></i>{{ trans('common.move') }}</a></li>
@endif
@if(userCan('restrictions-manage', $chapter))
<li><a href="{{ $chapter->getUrl('/permissions') }}" class="text-primary"><i class="zmdi zmdi-lock-outline"></i>{{ trans('entities.permissions') }}</a></li>
@endif
@if(userCan('chapter-delete', $chapter))
- <li><a href="{{ $chapter->getUrl('/delete') }}" class="text-neg"><i class="zmdi zmdi-delete"></i>{{ trans('entities.delete') }}</a></li>
+ <li><a href="{{ $chapter->getUrl('/delete') }}" class="text-neg"><i class="zmdi zmdi-delete"></i>{{ trans('common.delete') }}</a></li>
@endif
</ul>
</div>
<div class="container">
- <h1>{{ $message or trans('errors.page_not_found') }}</h1>
+ <h1>{{ $message or trans('errors.404_page_not_found') }}</h1>
<p>{{ trans('errors.sorry_page_not_found') }}</p>
<p><a href="{{ baseUrl('/') }}" class="button">{{ trans('errors.return_home') }}</a></p>
</ul>
</span>
@if(userCan('page-update', $page))
- <a href="{{ $page->getUrl('/edit') }}" class="text-primary text-button" ><i class="zmdi zmdi-edit"></i>{{ trans('entities.edit') }}</a>
+ <a href="{{ $page->getUrl('/edit') }}" class="text-primary text-button" ><i class="zmdi zmdi-edit"></i>{{ trans('common.edit') }}</a>
@endif
@if(userCan('page-update', $page) || userCan('restrictions-manage', $page) || userCan('page-delete', $page))
<div dropdown class="dropdown-container">
<a dropdown-toggle class="text-primary text-button"><i class="zmdi zmdi-more-vert"></i></a>
<ul>
@if(userCan('page-update', $page))
- <li><a href="{{ $page->getUrl('/move') }}" class="text-primary" ><i class="zmdi zmdi-folder"></i>{{ trans('entities.move') }}</a></li>
+ <li><a href="{{ $page->getUrl('/move') }}" class="text-primary" ><i class="zmdi zmdi-folder"></i>{{ trans('common.move') }}</a></li>
<li><a href="{{ $page->getUrl('/revisions') }}" class="text-primary"><i class="zmdi zmdi-replay"></i>{{ trans('entities.revisions') }}</a></li>
@endif
@if(userCan('restrictions-manage', $page))
<li><a href="{{ $page->getUrl('/permissions') }}" class="text-primary"><i class="zmdi zmdi-lock-outline"></i>{{ trans('entities.permissions') }}</a></li>
@endif
@if(userCan('page-delete', $page))
- <li><a href="{{ $page->getUrl('/delete') }}" class="text-neg"><i class="zmdi zmdi-delete"></i>{{ trans('entities.delete') }}</a></li>
+ <li><a href="{{ $page->getUrl('/delete') }}" class="text-neg"><i class="zmdi zmdi-delete"></i>{{ trans('common.delete') }}</a></li>
@endif
</ul>
</div>
Route::get('/get/{entityType}/{entityId}', 'TagController@getForEntity');
Route::get('/suggest/names', 'TagController@getNameSuggestions');
Route::get('/suggest/values', 'TagController@getValueSuggestions');
- Route::post('/update/{entityType}/{entityId}', 'TagController@updateForEntity');
});
Route::get('/ajax/search/entities', 'SearchController@searchEntitiesAjax');