Dan Brown

Extracted text from logic files

...@@ -77,7 +77,7 @@ class AttachmentController extends Controller ...@@ -77,7 +77,7 @@ class AttachmentController extends Controller
77 $this->checkOwnablePermission('attachment-create', $attachment); 77 $this->checkOwnablePermission('attachment-create', $attachment);
78 78
79 if (intval($pageId) !== intval($attachment->uploaded_to)) { 79 if (intval($pageId) !== intval($attachment->uploaded_to)) {
80 - return $this->jsonError('Page mismatch during attached file update'); 80 + return $this->jsonError(trans('errors.attachment_page_mismatch'));
81 } 81 }
82 82
83 $uploadedFile = $request->file('file'); 83 $uploadedFile = $request->file('file');
...@@ -113,7 +113,7 @@ class AttachmentController extends Controller ...@@ -113,7 +113,7 @@ class AttachmentController extends Controller
113 $this->checkOwnablePermission('attachment-create', $attachment); 113 $this->checkOwnablePermission('attachment-create', $attachment);
114 114
115 if (intval($pageId) !== intval($attachment->uploaded_to)) { 115 if (intval($pageId) !== intval($attachment->uploaded_to)) {
116 - return $this->jsonError('Page mismatch during attachment update'); 116 + return $this->jsonError(trans('errors.attachment_page_mismatch'));
117 } 117 }
118 118
119 $attachment = $this->attachmentService->updateFile($attachment, $request->all()); 119 $attachment = $this->attachmentService->updateFile($attachment, $request->all());
...@@ -175,7 +175,7 @@ class AttachmentController extends Controller ...@@ -175,7 +175,7 @@ class AttachmentController extends Controller
175 175
176 $attachments = $request->get('files'); 176 $attachments = $request->get('files');
177 $this->attachmentService->updateFileOrderWithinPage($attachments, $pageId); 177 $this->attachmentService->updateFileOrderWithinPage($attachments, $pageId);
178 - return response()->json(['message' => 'Attachment order updated']); 178 + return response()->json(['message' => trans('entities.attachments_order_updated')]);
179 } 179 }
180 180
181 /** 181 /**
...@@ -210,6 +210,6 @@ class AttachmentController extends Controller ...@@ -210,6 +210,6 @@ class AttachmentController extends Controller
210 $attachment = $this->attachment->findOrFail($attachmentId); 210 $attachment = $this->attachment->findOrFail($attachmentId);
211 $this->checkOwnablePermission('attachment-delete', $attachment); 211 $this->checkOwnablePermission('attachment-delete', $attachment);
212 $this->attachmentService->deleteFile($attachment); 212 $this->attachmentService->deleteFile($attachment);
213 - return response()->json(['message' => 'Attachment deleted']); 213 + return response()->json(['message' => trans('entities.attachments_deleted')]);
214 } 214 }
215 } 215 }
......
...@@ -52,7 +52,7 @@ class ForgotPasswordController extends Controller ...@@ -52,7 +52,7 @@ class ForgotPasswordController extends Controller
52 ); 52 );
53 53
54 if ($response === Password::RESET_LINK_SENT) { 54 if ($response === Password::RESET_LINK_SENT) {
55 - $message = 'A password reset link has been sent to ' . $request->get('email') . '.'; 55 + $message = trans('auth.reset_password_sent_success', ['email' => $request->get('email')]);
56 session()->flash('success', $message); 56 session()->flash('success', $message);
57 return back()->with('status', trans($response)); 57 return back()->with('status', trans($response));
58 } 58 }
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
2 2
3 namespace BookStack\Http\Controllers\Auth; 3 namespace BookStack\Http\Controllers\Auth;
4 4
5 +use BookStack\Exceptions\AuthException;
5 use BookStack\Http\Controllers\Controller; 6 use BookStack\Http\Controllers\Controller;
6 use BookStack\Repos\UserRepo; 7 use BookStack\Repos\UserRepo;
7 use BookStack\Services\SocialAuthService; 8 use BookStack\Services\SocialAuthService;
...@@ -86,7 +87,7 @@ class LoginController extends Controller ...@@ -86,7 +87,7 @@ class LoginController extends Controller
86 // Check for users with same email already 87 // Check for users with same email already
87 $alreadyUser = $user->newQuery()->where('email', '=', $user->email)->count() > 0; 88 $alreadyUser = $user->newQuery()->where('email', '=', $user->email)->count() > 0;
88 if ($alreadyUser) { 89 if ($alreadyUser) {
89 - throw new AuthException('A user with the email ' . $user->email . ' already exists but with different credentials.'); 90 + throw new AuthException(trans('errors.error_user_exists_different_creds', ['email' => $user->email]));
90 } 91 }
91 92
92 $user->save(); 93 $user->save();
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
3 namespace BookStack\Http\Controllers\Auth; 3 namespace BookStack\Http\Controllers\Auth;
4 4
5 use BookStack\Exceptions\ConfirmationEmailException; 5 use BookStack\Exceptions\ConfirmationEmailException;
6 +use BookStack\Exceptions\SocialSignInException;
6 use BookStack\Exceptions\UserRegistrationException; 7 use BookStack\Exceptions\UserRegistrationException;
7 use BookStack\Repos\UserRepo; 8 use BookStack\Repos\UserRepo;
8 use BookStack\Services\EmailConfirmationService; 9 use BookStack\Services\EmailConfirmationService;
...@@ -82,7 +83,7 @@ class RegisterController extends Controller ...@@ -82,7 +83,7 @@ class RegisterController extends Controller
82 protected function checkRegistrationAllowed() 83 protected function checkRegistrationAllowed()
83 { 84 {
84 if (!setting('registration-enabled')) { 85 if (!setting('registration-enabled')) {
85 - throw new UserRegistrationException('Registrations are currently disabled.', '/login'); 86 + throw new UserRegistrationException(trans('auth.registrations_disabled'), '/login');
86 } 87 }
87 } 88 }
88 89
...@@ -147,7 +148,7 @@ class RegisterController extends Controller ...@@ -147,7 +148,7 @@ class RegisterController extends Controller
147 $restrictedEmailDomains = explode(',', str_replace(' ', '', setting('registration-restrict'))); 148 $restrictedEmailDomains = explode(',', str_replace(' ', '', setting('registration-restrict')));
148 $userEmailDomain = $domain = substr(strrchr($userData['email'], "@"), 1); 149 $userEmailDomain = $domain = substr(strrchr($userData['email'], "@"), 1);
149 if (!in_array($userEmailDomain, $restrictedEmailDomains)) { 150 if (!in_array($userEmailDomain, $restrictedEmailDomains)) {
150 - throw new UserRegistrationException('That email domain does not have access to this application', '/register'); 151 + throw new UserRegistrationException(trans('auth.registration_email_domain_invalid'), '/register');
151 } 152 }
152 } 153 }
153 154
...@@ -169,7 +170,7 @@ class RegisterController extends Controller ...@@ -169,7 +170,7 @@ class RegisterController extends Controller
169 } 170 }
170 171
171 auth()->login($newUser); 172 auth()->login($newUser);
172 - session()->flash('success', 'Thanks for signing up! You are now registered and signed in.'); 173 + session()->flash('success', trans('auth.register_success'));
173 return redirect($this->redirectPath()); 174 return redirect($this->redirectPath());
174 } 175 }
175 176
...@@ -262,7 +263,7 @@ class RegisterController extends Controller ...@@ -262,7 +263,7 @@ class RegisterController extends Controller
262 return $this->socialRegisterCallback($socialDriver); 263 return $this->socialRegisterCallback($socialDriver);
263 } 264 }
264 } else { 265 } else {
265 - throw new SocialSignInException('No action defined', '/login'); 266 + throw new SocialSignInException(trans('errors.social_no_action_defined'), '/login');
266 } 267 }
267 return redirect()->back(); 268 return redirect()->back();
268 } 269 }
......
...@@ -41,7 +41,7 @@ class ResetPasswordController extends Controller ...@@ -41,7 +41,7 @@ class ResetPasswordController extends Controller
41 */ 41 */
42 protected function sendResetResponse($response) 42 protected function sendResetResponse($response)
43 { 43 {
44 - $message = 'Your password has been successfully reset.'; 44 + $message = trans('auth.reset_password_success');
45 session()->flash('success', $message); 45 session()->flash('success', $message);
46 return redirect($this->redirectPath()) 46 return redirect($this->redirectPath())
47 ->with('status', trans($response)); 47 ->with('status', trans($response));
......
...@@ -7,6 +7,7 @@ use BookStack\Http\Requests; ...@@ -7,6 +7,7 @@ use BookStack\Http\Requests;
7 use BookStack\Repos\BookRepo; 7 use BookStack\Repos\BookRepo;
8 use BookStack\Repos\ChapterRepo; 8 use BookStack\Repos\ChapterRepo;
9 use BookStack\Repos\PageRepo; 9 use BookStack\Repos\PageRepo;
10 +use Illuminate\Http\Response;
10 use Views; 11 use Views;
11 12
12 class BookController extends Controller 13 class BookController extends Controller
...@@ -53,7 +54,7 @@ class BookController extends Controller ...@@ -53,7 +54,7 @@ class BookController extends Controller
53 public function create() 54 public function create()
54 { 55 {
55 $this->checkPermission('book-create-all'); 56 $this->checkPermission('book-create-all');
56 - $this->setPageTitle('Create New Book'); 57 + $this->setPageTitle(trans('entities.books_create'));
57 return view('books/create'); 58 return view('books/create');
58 } 59 }
59 60
...@@ -99,7 +100,7 @@ class BookController extends Controller ...@@ -99,7 +100,7 @@ class BookController extends Controller
99 { 100 {
100 $book = $this->bookRepo->getBySlug($slug); 101 $book = $this->bookRepo->getBySlug($slug);
101 $this->checkOwnablePermission('book-update', $book); 102 $this->checkOwnablePermission('book-update', $book);
102 - $this->setPageTitle('Edit Book ' . $book->getShortName()); 103 + $this->setPageTitle(trans('entities.books_edit_named',['bookName'=>$book->getShortName()]));
103 return view('books/edit', ['book' => $book, 'current' => $book]); 104 return view('books/edit', ['book' => $book, 'current' => $book]);
104 } 105 }
105 106
...@@ -131,7 +132,7 @@ class BookController extends Controller ...@@ -131,7 +132,7 @@ class BookController extends Controller
131 { 132 {
132 $book = $this->bookRepo->getBySlug($bookSlug); 133 $book = $this->bookRepo->getBySlug($bookSlug);
133 $this->checkOwnablePermission('book-delete', $book); 134 $this->checkOwnablePermission('book-delete', $book);
134 - $this->setPageTitle('Delete Book ' . $book->getShortName()); 135 + $this->setPageTitle(trans('entities.books_delete_named', ['bookName'=>$book->getShortName()]));
135 return view('books/delete', ['book' => $book, 'current' => $book]); 136 return view('books/delete', ['book' => $book, 'current' => $book]);
136 } 137 }
137 138
...@@ -146,7 +147,7 @@ class BookController extends Controller ...@@ -146,7 +147,7 @@ class BookController extends Controller
146 $this->checkOwnablePermission('book-update', $book); 147 $this->checkOwnablePermission('book-update', $book);
147 $bookChildren = $this->bookRepo->getChildren($book, true); 148 $bookChildren = $this->bookRepo->getChildren($book, true);
148 $books = $this->bookRepo->getAll(false); 149 $books = $this->bookRepo->getAll(false);
149 - $this->setPageTitle('Sort Book ' . $book->getShortName()); 150 + $this->setPageTitle(trans('entities.books_sort_named', ['bookName'=>$book->getShortName()]));
150 return view('books/sort', ['book' => $book, 'current' => $book, 'books' => $books, 'bookChildren' => $bookChildren]); 151 return view('books/sort', ['book' => $book, 'current' => $book, 'books' => $books, 'bookChildren' => $bookChildren]);
151 } 152 }
152 153
...@@ -264,7 +265,7 @@ class BookController extends Controller ...@@ -264,7 +265,7 @@ class BookController extends Controller
264 $book = $this->bookRepo->getBySlug($bookSlug); 265 $book = $this->bookRepo->getBySlug($bookSlug);
265 $this->checkOwnablePermission('restrictions-manage', $book); 266 $this->checkOwnablePermission('restrictions-manage', $book);
266 $this->bookRepo->updateEntityPermissionsFromRequest($request, $book); 267 $this->bookRepo->updateEntityPermissionsFromRequest($request, $book);
267 - session()->flash('success', 'Book Restrictions Updated'); 268 + session()->flash('success', trans('entities.books_permissions_updated'));
268 return redirect($book->getUrl()); 269 return redirect($book->getUrl());
269 } 270 }
270 } 271 }
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
3 use Activity; 3 use Activity;
4 use BookStack\Repos\UserRepo; 4 use BookStack\Repos\UserRepo;
5 use Illuminate\Http\Request; 5 use Illuminate\Http\Request;
6 -use BookStack\Http\Requests;
7 use BookStack\Repos\BookRepo; 6 use BookStack\Repos\BookRepo;
8 use BookStack\Repos\ChapterRepo; 7 use BookStack\Repos\ChapterRepo;
8 +use Illuminate\Http\Response;
9 use Views; 9 use Views;
10 10
11 class ChapterController extends Controller 11 class ChapterController extends Controller
...@@ -38,7 +38,7 @@ class ChapterController extends Controller ...@@ -38,7 +38,7 @@ class ChapterController extends Controller
38 { 38 {
39 $book = $this->bookRepo->getBySlug($bookSlug); 39 $book = $this->bookRepo->getBySlug($bookSlug);
40 $this->checkOwnablePermission('chapter-create', $book); 40 $this->checkOwnablePermission('chapter-create', $book);
41 - $this->setPageTitle('Create New Chapter'); 41 + $this->setPageTitle(trans('entities.chapters_create'));
42 return view('chapters/create', ['book' => $book, 'current' => $book]); 42 return view('chapters/create', ['book' => $book, 'current' => $book]);
43 } 43 }
44 44
...@@ -99,7 +99,7 @@ class ChapterController extends Controller ...@@ -99,7 +99,7 @@ class ChapterController extends Controller
99 $book = $this->bookRepo->getBySlug($bookSlug); 99 $book = $this->bookRepo->getBySlug($bookSlug);
100 $chapter = $this->chapterRepo->getBySlug($chapterSlug, $book->id); 100 $chapter = $this->chapterRepo->getBySlug($chapterSlug, $book->id);
101 $this->checkOwnablePermission('chapter-update', $chapter); 101 $this->checkOwnablePermission('chapter-update', $chapter);
102 - $this->setPageTitle('Edit Chapter' . $chapter->getShortName()); 102 + $this->setPageTitle(trans('entities.chapters_edit_named', ['chapterName' => $chapter->getShortName()]));
103 return view('chapters/edit', ['book' => $book, 'chapter' => $chapter, 'current' => $chapter]); 103 return view('chapters/edit', ['book' => $book, 'chapter' => $chapter, 'current' => $chapter]);
104 } 104 }
105 105
...@@ -136,7 +136,7 @@ class ChapterController extends Controller ...@@ -136,7 +136,7 @@ class ChapterController extends Controller
136 $book = $this->bookRepo->getBySlug($bookSlug); 136 $book = $this->bookRepo->getBySlug($bookSlug);
137 $chapter = $this->chapterRepo->getBySlug($chapterSlug, $book->id); 137 $chapter = $this->chapterRepo->getBySlug($chapterSlug, $book->id);
138 $this->checkOwnablePermission('chapter-delete', $chapter); 138 $this->checkOwnablePermission('chapter-delete', $chapter);
139 - $this->setPageTitle('Delete Chapter' . $chapter->getShortName()); 139 + $this->setPageTitle(trans('entities.chapters_delete_named', ['chapterName' => $chapter->getShortName()]));
140 return view('chapters/delete', ['book' => $book, 'chapter' => $chapter, 'current' => $chapter]); 140 return view('chapters/delete', ['book' => $book, 'chapter' => $chapter, 'current' => $chapter]);
141 } 141 }
142 142
...@@ -166,6 +166,7 @@ class ChapterController extends Controller ...@@ -166,6 +166,7 @@ class ChapterController extends Controller
166 public function showMove($bookSlug, $chapterSlug) { 166 public function showMove($bookSlug, $chapterSlug) {
167 $book = $this->bookRepo->getBySlug($bookSlug); 167 $book = $this->bookRepo->getBySlug($bookSlug);
168 $chapter = $this->chapterRepo->getBySlug($chapterSlug, $book->id); 168 $chapter = $this->chapterRepo->getBySlug($chapterSlug, $book->id);
169 + $this->setPageTitle(trans('entities.chapters_move_named', ['chapterName' => $chapter->getShortName()]));
169 $this->checkOwnablePermission('chapter-update', $chapter); 170 $this->checkOwnablePermission('chapter-update', $chapter);
170 return view('chapters/move', [ 171 return view('chapters/move', [
171 'chapter' => $chapter, 172 'chapter' => $chapter,
...@@ -202,13 +203,13 @@ class ChapterController extends Controller ...@@ -202,13 +203,13 @@ class ChapterController extends Controller
202 } 203 }
203 204
204 if ($parent === false || $parent === null) { 205 if ($parent === false || $parent === null) {
205 - session()->flash('The selected Book was not found'); 206 + session()->flash('error', trans('errors.selected_book_not_found'));
206 return redirect()->back(); 207 return redirect()->back();
207 } 208 }
208 209
209 $this->chapterRepo->changeBook($parent->id, $chapter, true); 210 $this->chapterRepo->changeBook($parent->id, $chapter, true);
210 Activity::add($chapter, 'chapter_move', $chapter->book->id); 211 Activity::add($chapter, 'chapter_move', $chapter->book->id);
211 - session()->flash('success', sprintf('Chapter moved to "%s"', $parent->name)); 212 + session()->flash('success', trans('entities.chapter_move_success', ['bookName' => $parent->name]));
212 213
213 return redirect($chapter->getUrl()); 214 return redirect($chapter->getUrl());
214 } 215 }
...@@ -244,7 +245,7 @@ class ChapterController extends Controller ...@@ -244,7 +245,7 @@ class ChapterController extends Controller
244 $chapter = $this->chapterRepo->getBySlug($chapterSlug, $book->id); 245 $chapter = $this->chapterRepo->getBySlug($chapterSlug, $book->id);
245 $this->checkOwnablePermission('restrictions-manage', $chapter); 246 $this->checkOwnablePermission('restrictions-manage', $chapter);
246 $this->chapterRepo->updateEntityPermissionsFromRequest($request, $chapter); 247 $this->chapterRepo->updateEntityPermissionsFromRequest($request, $chapter);
247 - session()->flash('success', 'Chapter Restrictions Updated'); 248 + session()->flash('success', trans('entities.chapters_permissions_success'));
248 return redirect($chapter->getUrl()); 249 return redirect($chapter->getUrl());
249 } 250 }
250 } 251 }
......
...@@ -73,6 +73,7 @@ class ImageController extends Controller ...@@ -73,6 +73,7 @@ class ImageController extends Controller
73 * @param $filter 73 * @param $filter
74 * @param int $page 74 * @param int $page
75 * @param Request $request 75 * @param Request $request
76 + * @return \Illuminate\Contracts\Routing\ResponseFactory|\Illuminate\Http\JsonResponse|\Symfony\Component\HttpFoundation\Response
76 */ 77 */
77 public function getGalleryFiltered($filter, $page = 0, Request $request) 78 public function getGalleryFiltered($filter, $page = 0, Request $request)
78 { 79 {
...@@ -169,7 +170,7 @@ class ImageController extends Controller ...@@ -169,7 +170,7 @@ class ImageController extends Controller
169 } 170 }
170 171
171 $this->imageRepo->destroyImage($image); 172 $this->imageRepo->destroyImage($image);
172 - return response()->json('Image Deleted'); 173 + return response()->json(trans('components.images_deleted'));
173 } 174 }
174 175
175 176
......
...@@ -10,6 +10,7 @@ use BookStack\Http\Requests; ...@@ -10,6 +10,7 @@ use BookStack\Http\Requests;
10 use BookStack\Repos\BookRepo; 10 use BookStack\Repos\BookRepo;
11 use BookStack\Repos\ChapterRepo; 11 use BookStack\Repos\ChapterRepo;
12 use BookStack\Repos\PageRepo; 12 use BookStack\Repos\PageRepo;
13 +use Illuminate\Http\Response;
13 use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; 14 use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
14 use Views; 15 use Views;
15 use GatherContent\Htmldiff\Htmldiff; 16 use GatherContent\Htmldiff\Htmldiff;
...@@ -62,7 +63,7 @@ class PageController extends Controller ...@@ -62,7 +63,7 @@ class PageController extends Controller
62 } 63 }
63 64
64 // Otherwise show edit view 65 // Otherwise show edit view
65 - $this->setPageTitle('Create New Page'); 66 + $this->setPageTitle(trans('entities.pages_new'));
66 return view('pages/guest-create', ['parent' => $parent]); 67 return view('pages/guest-create', ['parent' => $parent]);
67 } 68 }
68 69
...@@ -104,7 +105,7 @@ class PageController extends Controller ...@@ -104,7 +105,7 @@ class PageController extends Controller
104 $book = $this->bookRepo->getBySlug($bookSlug); 105 $book = $this->bookRepo->getBySlug($bookSlug);
105 $draft = $this->pageRepo->getById($pageId, true); 106 $draft = $this->pageRepo->getById($pageId, true);
106 $this->checkOwnablePermission('page-create', $book); 107 $this->checkOwnablePermission('page-create', $book);
107 - $this->setPageTitle('Edit Page Draft'); 108 + $this->setPageTitle(trans('entities.pages_edit_draft'));
108 109
109 $draftsEnabled = $this->signedIn; 110 $draftsEnabled = $this->signedIn;
110 return view('pages/edit', [ 111 return view('pages/edit', [
...@@ -119,6 +120,7 @@ class PageController extends Controller ...@@ -119,6 +120,7 @@ class PageController extends Controller
119 * Store a new page by changing a draft into a page. 120 * Store a new page by changing a draft into a page.
120 * @param Request $request 121 * @param Request $request
121 * @param string $bookSlug 122 * @param string $bookSlug
123 + * @param int $pageId
122 * @return Response 124 * @return Response
123 */ 125 */
124 public function store(Request $request, $bookSlug, $pageId) 126 public function store(Request $request, $bookSlug, $pageId)
...@@ -201,7 +203,7 @@ class PageController extends Controller ...@@ -201,7 +203,7 @@ class PageController extends Controller
201 $book = $this->bookRepo->getBySlug($bookSlug); 203 $book = $this->bookRepo->getBySlug($bookSlug);
202 $page = $this->pageRepo->getBySlug($pageSlug, $book->id); 204 $page = $this->pageRepo->getBySlug($pageSlug, $book->id);
203 $this->checkOwnablePermission('page-update', $page); 205 $this->checkOwnablePermission('page-update', $page);
204 - $this->setPageTitle('Editing Page ' . $page->getShortName()); 206 + $this->setPageTitle(trans('entities.pages_editing_named', ['pageName'=>$page->getShortName()]));
205 $page->isDraft = false; 207 $page->isDraft = false;
206 208
207 // Check for active editing 209 // Check for active editing
...@@ -265,7 +267,7 @@ class PageController extends Controller ...@@ -265,7 +267,7 @@ class PageController extends Controller
265 if (!$this->signedIn) { 267 if (!$this->signedIn) {
266 return response()->json([ 268 return response()->json([
267 'status' => 'error', 269 'status' => 'error',
268 - 'message' => 'Guests cannot save drafts', 270 + 'message' => trans('errors.guests_cannot_save_drafts'),
269 ], 500); 271 ], 500);
270 } 272 }
271 273
...@@ -279,7 +281,7 @@ class PageController extends Controller ...@@ -279,7 +281,7 @@ class PageController extends Controller
279 $utcUpdateTimestamp = $updateTime + Carbon::createFromTimestamp(0)->offset; 281 $utcUpdateTimestamp = $updateTime + Carbon::createFromTimestamp(0)->offset;
280 return response()->json([ 282 return response()->json([
281 'status' => 'success', 283 'status' => 'success',
282 - 'message' => 'Draft saved at ', 284 + 'message' => trans('entities.pages_edit_draft_save_at'),
283 'timestamp' => $utcUpdateTimestamp 285 'timestamp' => $utcUpdateTimestamp
284 ]); 286 ]);
285 } 287 }
...@@ -307,7 +309,7 @@ class PageController extends Controller ...@@ -307,7 +309,7 @@ class PageController extends Controller
307 $book = $this->bookRepo->getBySlug($bookSlug); 309 $book = $this->bookRepo->getBySlug($bookSlug);
308 $page = $this->pageRepo->getBySlug($pageSlug, $book->id); 310 $page = $this->pageRepo->getBySlug($pageSlug, $book->id);
309 $this->checkOwnablePermission('page-delete', $page); 311 $this->checkOwnablePermission('page-delete', $page);
310 - $this->setPageTitle('Delete Page ' . $page->getShortName()); 312 + $this->setPageTitle(trans('entities.pages_delete_named', ['pageName'=>$page->getShortName()]));
311 return view('pages/delete', ['book' => $book, 'page' => $page, 'current' => $page]); 313 return view('pages/delete', ['book' => $book, 'page' => $page, 'current' => $page]);
312 } 314 }
313 315
...@@ -324,7 +326,7 @@ class PageController extends Controller ...@@ -324,7 +326,7 @@ class PageController extends Controller
324 $book = $this->bookRepo->getBySlug($bookSlug); 326 $book = $this->bookRepo->getBySlug($bookSlug);
325 $page = $this->pageRepo->getById($pageId, true); 327 $page = $this->pageRepo->getById($pageId, true);
326 $this->checkOwnablePermission('page-update', $page); 328 $this->checkOwnablePermission('page-update', $page);
327 - $this->setPageTitle('Delete Draft Page ' . $page->getShortName()); 329 + $this->setPageTitle(trans('entities.pages_delete_draft_named', ['pageName'=>$page->getShortName()]));
328 return view('pages/delete', ['book' => $book, 'page' => $page, 'current' => $page]); 330 return view('pages/delete', ['book' => $book, 'page' => $page, 'current' => $page]);
329 } 331 }
330 332
...@@ -341,7 +343,7 @@ class PageController extends Controller ...@@ -341,7 +343,7 @@ class PageController extends Controller
341 $page = $this->pageRepo->getBySlug($pageSlug, $book->id); 343 $page = $this->pageRepo->getBySlug($pageSlug, $book->id);
342 $this->checkOwnablePermission('page-delete', $page); 344 $this->checkOwnablePermission('page-delete', $page);
343 Activity::addMessage('page_delete', $book->id, $page->name); 345 Activity::addMessage('page_delete', $book->id, $page->name);
344 - session()->flash('success', 'Page deleted'); 346 + session()->flash('success', trans('entities.pages_delete_success'));
345 $this->pageRepo->destroy($page); 347 $this->pageRepo->destroy($page);
346 return redirect($book->getUrl()); 348 return redirect($book->getUrl());
347 } 349 }
...@@ -358,7 +360,7 @@ class PageController extends Controller ...@@ -358,7 +360,7 @@ class PageController extends Controller
358 $book = $this->bookRepo->getBySlug($bookSlug); 360 $book = $this->bookRepo->getBySlug($bookSlug);
359 $page = $this->pageRepo->getById($pageId, true); 361 $page = $this->pageRepo->getById($pageId, true);
360 $this->checkOwnablePermission('page-update', $page); 362 $this->checkOwnablePermission('page-update', $page);
361 - session()->flash('success', 'Draft deleted'); 363 + session()->flash('success', trans('entities.pages_delete_draft_success'));
362 $this->pageRepo->destroy($page); 364 $this->pageRepo->destroy($page);
363 return redirect($book->getUrl()); 365 return redirect($book->getUrl());
364 } 366 }
...@@ -373,7 +375,7 @@ class PageController extends Controller ...@@ -373,7 +375,7 @@ class PageController extends Controller
373 { 375 {
374 $book = $this->bookRepo->getBySlug($bookSlug); 376 $book = $this->bookRepo->getBySlug($bookSlug);
375 $page = $this->pageRepo->getBySlug($pageSlug, $book->id); 377 $page = $this->pageRepo->getBySlug($pageSlug, $book->id);
376 - $this->setPageTitle('Revisions For ' . $page->getShortName()); 378 + $this->setPageTitle(trans('entities.pages_revisions_named', ['pageName'=>$page->getShortName()]));
377 return view('pages/revisions', ['page' => $page, 'book' => $book, 'current' => $page]); 379 return view('pages/revisions', ['page' => $page, 'book' => $book, 'current' => $page]);
378 } 380 }
379 381
...@@ -391,7 +393,7 @@ class PageController extends Controller ...@@ -391,7 +393,7 @@ class PageController extends Controller
391 $revision = $this->pageRepo->getRevisionById($revisionId); 393 $revision = $this->pageRepo->getRevisionById($revisionId);
392 394
393 $page->fill($revision->toArray()); 395 $page->fill($revision->toArray());
394 - $this->setPageTitle('Page Revision For ' . $page->getShortName()); 396 + $this->setPageTitle(trans('entities.pages_revision_named', ['pageName'=>$page->getShortName()]));
395 397
396 return view('pages/revision', [ 398 return view('pages/revision', [
397 'page' => $page, 399 'page' => $page,
...@@ -417,7 +419,7 @@ class PageController extends Controller ...@@ -417,7 +419,7 @@ class PageController extends Controller
417 $diff = (new Htmldiff)->diff($prevContent, $revision->html); 419 $diff = (new Htmldiff)->diff($prevContent, $revision->html);
418 420
419 $page->fill($revision->toArray()); 421 $page->fill($revision->toArray());
420 - $this->setPageTitle('Page Revision For ' . $page->getShortName()); 422 + $this->setPageTitle(trans('entities.pages_revision_named', ['pageName'=>$page->getShortName()]));
421 423
422 return view('pages/revision', [ 424 return view('pages/revision', [
423 'page' => $page, 425 'page' => $page,
...@@ -503,7 +505,7 @@ class PageController extends Controller ...@@ -503,7 +505,7 @@ class PageController extends Controller
503 { 505 {
504 $pages = $this->pageRepo->getRecentlyCreatedPaginated(20)->setPath(baseUrl('/pages/recently-created')); 506 $pages = $this->pageRepo->getRecentlyCreatedPaginated(20)->setPath(baseUrl('/pages/recently-created'));
505 return view('pages/detailed-listing', [ 507 return view('pages/detailed-listing', [
506 - 'title' => 'Recently Created Pages', 508 + 'title' => trans('entities.recently_created_pages'),
507 'pages' => $pages 509 'pages' => $pages
508 ]); 510 ]);
509 } 511 }
...@@ -516,7 +518,7 @@ class PageController extends Controller ...@@ -516,7 +518,7 @@ class PageController extends Controller
516 { 518 {
517 $pages = $this->pageRepo->getRecentlyUpdatedPaginated(20)->setPath(baseUrl('/pages/recently-updated')); 519 $pages = $this->pageRepo->getRecentlyUpdatedPaginated(20)->setPath(baseUrl('/pages/recently-updated'));
518 return view('pages/detailed-listing', [ 520 return view('pages/detailed-listing', [
519 - 'title' => 'Recently Updated Pages', 521 + 'title' => trans('entities.recently_updated_pages'),
520 'pages' => $pages 522 'pages' => $pages
521 ]); 523 ]);
522 } 524 }
...@@ -589,13 +591,13 @@ class PageController extends Controller ...@@ -589,13 +591,13 @@ class PageController extends Controller
589 } 591 }
590 592
591 if ($parent === false || $parent === null) { 593 if ($parent === false || $parent === null) {
592 - session()->flash('The selected Book or Chapter was not found'); 594 + session()->flash(trans('entities.selected_book_chapter_not_found'));
593 return redirect()->back(); 595 return redirect()->back();
594 } 596 }
595 597
596 $this->pageRepo->changePageParent($page, $parent); 598 $this->pageRepo->changePageParent($page, $parent);
597 Activity::add($page, 'page_move', $page->book->id); 599 Activity::add($page, 'page_move', $page->book->id);
598 - session()->flash('success', sprintf('Page moved to "%s"', $parent->name)); 600 + session()->flash('success', trans('entities.pages_move_success', ['parentName' => $parent->name]));
599 601
600 return redirect($page->getUrl()); 602 return redirect($page->getUrl());
601 } 603 }
...@@ -613,7 +615,7 @@ class PageController extends Controller ...@@ -613,7 +615,7 @@ class PageController extends Controller
613 $page = $this->pageRepo->getBySlug($pageSlug, $book->id); 615 $page = $this->pageRepo->getBySlug($pageSlug, $book->id);
614 $this->checkOwnablePermission('restrictions-manage', $page); 616 $this->checkOwnablePermission('restrictions-manage', $page);
615 $this->pageRepo->updateEntityPermissionsFromRequest($request, $page); 617 $this->pageRepo->updateEntityPermissionsFromRequest($request, $page);
616 - session()->flash('success', 'Page Permissions Updated'); 618 + session()->flash('success', trans('entities.pages_permissions_success'));
617 return redirect($page->getUrl()); 619 return redirect($page->getUrl());
618 } 620 }
619 621
......
...@@ -2,9 +2,7 @@ ...@@ -2,9 +2,7 @@
2 2
3 use BookStack\Exceptions\PermissionsException; 3 use BookStack\Exceptions\PermissionsException;
4 use BookStack\Repos\PermissionsRepo; 4 use BookStack\Repos\PermissionsRepo;
5 -use BookStack\Services\PermissionService;
6 use Illuminate\Http\Request; 5 use Illuminate\Http\Request;
7 -use BookStack\Http\Requests;
8 6
9 class PermissionController extends Controller 7 class PermissionController extends Controller
10 { 8 {
...@@ -55,7 +53,7 @@ class PermissionController extends Controller ...@@ -55,7 +53,7 @@ class PermissionController extends Controller
55 ]); 53 ]);
56 54
57 $this->permissionsRepo->saveNewRole($request->all()); 55 $this->permissionsRepo->saveNewRole($request->all());
58 - session()->flash('success', 'Role successfully created'); 56 + session()->flash('success', trans('settings.role_create_success'));
59 return redirect('/settings/roles'); 57 return redirect('/settings/roles');
60 } 58 }
61 59
...@@ -69,7 +67,7 @@ class PermissionController extends Controller ...@@ -69,7 +67,7 @@ class PermissionController extends Controller
69 { 67 {
70 $this->checkPermission('user-roles-manage'); 68 $this->checkPermission('user-roles-manage');
71 $role = $this->permissionsRepo->getRoleById($id); 69 $role = $this->permissionsRepo->getRoleById($id);
72 - if ($role->hidden) throw new PermissionsException('This role cannot be edited'); 70 + if ($role->hidden) throw new PermissionsException(trans('errors.role_cannot_be_edited'));
73 return view('settings/roles/edit', ['role' => $role]); 71 return view('settings/roles/edit', ['role' => $role]);
74 } 72 }
75 73
...@@ -88,7 +86,7 @@ class PermissionController extends Controller ...@@ -88,7 +86,7 @@ class PermissionController extends Controller
88 ]); 86 ]);
89 87
90 $this->permissionsRepo->updateRole($id, $request->all()); 88 $this->permissionsRepo->updateRole($id, $request->all());
91 - session()->flash('success', 'Role successfully updated'); 89 + session()->flash('success', trans('settings.role_update_success'));
92 return redirect('/settings/roles'); 90 return redirect('/settings/roles');
93 } 91 }
94 92
...@@ -103,7 +101,7 @@ class PermissionController extends Controller ...@@ -103,7 +101,7 @@ class PermissionController extends Controller
103 $this->checkPermission('user-roles-manage'); 101 $this->checkPermission('user-roles-manage');
104 $role = $this->permissionsRepo->getRoleById($id); 102 $role = $this->permissionsRepo->getRoleById($id);
105 $roles = $this->permissionsRepo->getAllRolesExcept($role); 103 $roles = $this->permissionsRepo->getAllRolesExcept($role);
106 - $blankRole = $role->newInstance(['display_name' => 'Don\'t migrate users']); 104 + $blankRole = $role->newInstance(['display_name' => trans('settings.role_delete_no_migration')]);
107 $roles->prepend($blankRole); 105 $roles->prepend($blankRole);
108 return view('settings/roles/delete', ['role' => $role, 'roles' => $roles]); 106 return view('settings/roles/delete', ['role' => $role, 'roles' => $roles]);
109 } 107 }
...@@ -126,7 +124,7 @@ class PermissionController extends Controller ...@@ -126,7 +124,7 @@ class PermissionController extends Controller
126 return redirect()->back(); 124 return redirect()->back();
127 } 125 }
128 126
129 - session()->flash('success', 'Role successfully deleted'); 127 + session()->flash('success', trans('settings.role_delete_success'));
130 return redirect('/settings/roles'); 128 return redirect('/settings/roles');
131 } 129 }
132 } 130 }
......
1 -<?php 1 +<?php namespace BookStack\Http\Controllers;
2 -
3 -namespace BookStack\Http\Controllers;
4 2
5 use BookStack\Services\ViewService; 3 use BookStack\Services\ViewService;
6 use Illuminate\Http\Request; 4 use Illuminate\Http\Request;
7 -
8 -use BookStack\Http\Requests;
9 use BookStack\Repos\BookRepo; 5 use BookStack\Repos\BookRepo;
10 use BookStack\Repos\ChapterRepo; 6 use BookStack\Repos\ChapterRepo;
11 use BookStack\Repos\PageRepo; 7 use BookStack\Repos\PageRepo;
...@@ -49,7 +45,7 @@ class SearchController extends Controller ...@@ -49,7 +45,7 @@ class SearchController extends Controller
49 $pages = $this->pageRepo->getBySearch($searchTerm, [], 20, $paginationAppends); 45 $pages = $this->pageRepo->getBySearch($searchTerm, [], 20, $paginationAppends);
50 $books = $this->bookRepo->getBySearch($searchTerm, 10, $paginationAppends); 46 $books = $this->bookRepo->getBySearch($searchTerm, 10, $paginationAppends);
51 $chapters = $this->chapterRepo->getBySearch($searchTerm, [], 10, $paginationAppends); 47 $chapters = $this->chapterRepo->getBySearch($searchTerm, [], 10, $paginationAppends);
52 - $this->setPageTitle('Search For ' . $searchTerm); 48 + $this->setPageTitle(trans('entities.search_for_term', ['term' => $searchTerm]));
53 return view('search/all', [ 49 return view('search/all', [
54 'pages' => $pages, 50 'pages' => $pages,
55 'books' => $books, 51 'books' => $books,
...@@ -70,10 +66,10 @@ class SearchController extends Controller ...@@ -70,10 +66,10 @@ class SearchController extends Controller
70 $searchTerm = $request->get('term'); 66 $searchTerm = $request->get('term');
71 $paginationAppends = $request->only('term'); 67 $paginationAppends = $request->only('term');
72 $pages = $this->pageRepo->getBySearch($searchTerm, [], 20, $paginationAppends); 68 $pages = $this->pageRepo->getBySearch($searchTerm, [], 20, $paginationAppends);
73 - $this->setPageTitle('Page Search For ' . $searchTerm); 69 + $this->setPageTitle(trans('entities.search_page_for_term', ['term' => $searchTerm]));
74 return view('search/entity-search-list', [ 70 return view('search/entity-search-list', [
75 'entities' => $pages, 71 'entities' => $pages,
76 - 'title' => 'Page Search Results', 72 + 'title' => trans('entities.search_results_page'),
77 'searchTerm' => $searchTerm 73 'searchTerm' => $searchTerm
78 ]); 74 ]);
79 } 75 }
...@@ -90,10 +86,10 @@ class SearchController extends Controller ...@@ -90,10 +86,10 @@ class SearchController extends Controller
90 $searchTerm = $request->get('term'); 86 $searchTerm = $request->get('term');
91 $paginationAppends = $request->only('term'); 87 $paginationAppends = $request->only('term');
92 $chapters = $this->chapterRepo->getBySearch($searchTerm, [], 20, $paginationAppends); 88 $chapters = $this->chapterRepo->getBySearch($searchTerm, [], 20, $paginationAppends);
93 - $this->setPageTitle('Chapter Search For ' . $searchTerm); 89 + $this->setPageTitle(trans('entities.search_chapter_for_term', ['term' => $searchTerm]));
94 return view('search/entity-search-list', [ 90 return view('search/entity-search-list', [
95 'entities' => $chapters, 91 'entities' => $chapters,
96 - 'title' => 'Chapter Search Results', 92 + 'title' => trans('entities.search_results_chapter'),
97 'searchTerm' => $searchTerm 93 'searchTerm' => $searchTerm
98 ]); 94 ]);
99 } 95 }
...@@ -110,10 +106,10 @@ class SearchController extends Controller ...@@ -110,10 +106,10 @@ class SearchController extends Controller
110 $searchTerm = $request->get('term'); 106 $searchTerm = $request->get('term');
111 $paginationAppends = $request->only('term'); 107 $paginationAppends = $request->only('term');
112 $books = $this->bookRepo->getBySearch($searchTerm, 20, $paginationAppends); 108 $books = $this->bookRepo->getBySearch($searchTerm, 20, $paginationAppends);
113 - $this->setPageTitle('Book Search For ' . $searchTerm); 109 + $this->setPageTitle(trans('entities.search_book_for_term', ['term' => $searchTerm]));
114 return view('search/entity-search-list', [ 110 return view('search/entity-search-list', [
115 'entities' => $books, 111 'entities' => $books,
116 - 'title' => 'Book Search Results', 112 + 'title' => trans('entities.search_results_book'),
117 'searchTerm' => $searchTerm 113 'searchTerm' => $searchTerm
118 ]); 114 ]);
119 } 115 }
......
1 <?php namespace BookStack\Http\Controllers; 1 <?php namespace BookStack\Http\Controllers;
2 2
3 use Illuminate\Http\Request; 3 use Illuminate\Http\Request;
4 - 4 +use Illuminate\Http\Response;
5 -use BookStack\Http\Requests;
6 use Setting; 5 use Setting;
7 6
8 class SettingController extends Controller 7 class SettingController extends Controller
...@@ -39,7 +38,7 @@ class SettingController extends Controller ...@@ -39,7 +38,7 @@ class SettingController extends Controller
39 Setting::put($key, $value); 38 Setting::put($key, $value);
40 } 39 }
41 40
42 - session()->flash('success', 'Settings Saved'); 41 + session()->flash('success', trans('settings.settings_save_success'));
43 return redirect('/settings'); 42 return redirect('/settings');
44 } 43 }
45 44
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
2 2
3 use BookStack\Repos\TagRepo; 3 use BookStack\Repos\TagRepo;
4 use Illuminate\Http\Request; 4 use Illuminate\Http\Request;
5 -use BookStack\Http\Requests;
6 5
7 class TagController extends Controller 6 class TagController extends Controller
8 { 7 {
...@@ -16,12 +15,14 @@ class TagController extends Controller ...@@ -16,12 +15,14 @@ class TagController extends Controller
16 public function __construct(TagRepo $tagRepo) 15 public function __construct(TagRepo $tagRepo)
17 { 16 {
18 $this->tagRepo = $tagRepo; 17 $this->tagRepo = $tagRepo;
18 + parent::__construct();
19 } 19 }
20 20
21 /** 21 /**
22 * Get all the Tags for a particular entity 22 * Get all the Tags for a particular entity
23 * @param $entityType 23 * @param $entityType
24 * @param $entityId 24 * @param $entityId
25 + * @return \Illuminate\Http\JsonResponse
25 */ 26 */
26 public function getForEntity($entityType, $entityId) 27 public function getForEntity($entityType, $entityId)
27 { 28 {
...@@ -30,28 +31,9 @@ class TagController extends Controller ...@@ -30,28 +31,9 @@ class TagController extends Controller
30 } 31 }
31 32
32 /** 33 /**
33 - * Update the tags for a particular entity.
34 - * @param $entityType
35 - * @param $entityId
36 - * @param Request $request
37 - * @return mixed
38 - */
39 - public function updateForEntity($entityType, $entityId, Request $request)
40 - {
41 - $entity = $this->tagRepo->getEntity($entityType, $entityId, 'update');
42 - if ($entity === null) return $this->jsonError("Entity not found", 404);
43 -
44 - $inputTags = $request->input('tags');
45 - $tags = $this->tagRepo->saveTagsToEntity($entity, $inputTags);
46 - return response()->json([
47 - 'tags' => $tags,
48 - 'message' => 'Tags successfully updated'
49 - ]);
50 - }
51 -
52 - /**
53 * Get tag name suggestions from a given search term. 34 * Get tag name suggestions from a given search term.
54 * @param Request $request 35 * @param Request $request
36 + * @return \Illuminate\Http\JsonResponse
55 */ 37 */
56 public function getNameSuggestions(Request $request) 38 public function getNameSuggestions(Request $request)
57 { 39 {
...@@ -63,6 +45,7 @@ class TagController extends Controller ...@@ -63,6 +45,7 @@ class TagController extends Controller
63 /** 45 /**
64 * Get tag value suggestions from a given search term. 46 * Get tag value suggestions from a given search term.
65 * @param Request $request 47 * @param Request $request
48 + * @return \Illuminate\Http\JsonResponse
66 */ 49 */
67 public function getValueSuggestions(Request $request) 50 public function getValueSuggestions(Request $request)
68 { 51 {
......
...@@ -44,7 +44,7 @@ class UserController extends Controller ...@@ -44,7 +44,7 @@ class UserController extends Controller
44 'sort' => $request->has('sort') ? $request->get('sort') : 'name', 44 'sort' => $request->has('sort') ? $request->get('sort') : 'name',
45 ]; 45 ];
46 $users = $this->userRepo->getAllUsersPaginatedAndSorted(20, $listDetails); 46 $users = $this->userRepo->getAllUsersPaginatedAndSorted(20, $listDetails);
47 - $this->setPageTitle('Users'); 47 + $this->setPageTitle(trans('settings.users'));
48 $users->appends($listDetails); 48 $users->appends($listDetails);
49 return view('users/index', ['users' => $users, 'listDetails' => $listDetails]); 49 return view('users/index', ['users' => $users, 'listDetails' => $listDetails]);
50 } 50 }
...@@ -83,7 +83,6 @@ class UserController extends Controller ...@@ -83,7 +83,6 @@ class UserController extends Controller
83 } 83 }
84 $this->validate($request, $validationRules); 84 $this->validate($request, $validationRules);
85 85
86 -
87 $user = $this->user->fill($request->all()); 86 $user = $this->user->fill($request->all());
88 87
89 if ($authMethod === 'standard') { 88 if ($authMethod === 'standard') {
...@@ -131,7 +130,7 @@ class UserController extends Controller ...@@ -131,7 +130,7 @@ class UserController extends Controller
131 $authMethod = ($user->system_name) ? 'system' : config('auth.method'); 130 $authMethod = ($user->system_name) ? 'system' : config('auth.method');
132 131
133 $activeSocialDrivers = $socialAuthService->getActiveDrivers(); 132 $activeSocialDrivers = $socialAuthService->getActiveDrivers();
134 - $this->setPageTitle('User Profile'); 133 + $this->setPageTitle(trans('settings.user_profile'));
135 $roles = $this->userRepo->getAllRoles(); 134 $roles = $this->userRepo->getAllRoles();
136 return view('users/edit', ['user' => $user, 'activeSocialDrivers' => $activeSocialDrivers, 'authMethod' => $authMethod, 'roles' => $roles]); 135 return view('users/edit', ['user' => $user, 'activeSocialDrivers' => $activeSocialDrivers, 'authMethod' => $authMethod, 'roles' => $roles]);
137 } 136 }
...@@ -154,8 +153,6 @@ class UserController extends Controller ...@@ -154,8 +153,6 @@ class UserController extends Controller
154 'email' => 'min:2|email|unique:users,email,' . $id, 153 'email' => 'min:2|email|unique:users,email,' . $id,
155 'password' => 'min:5|required_with:password_confirm', 154 'password' => 'min:5|required_with:password_confirm',
156 'password-confirm' => 'same:password|required_with:password' 155 'password-confirm' => 'same:password|required_with:password'
157 - ], [
158 - 'password-confirm.required_with' => 'Password confirmation required'
159 ]); 156 ]);
160 157
161 $user = $this->user->findOrFail($id); 158 $user = $this->user->findOrFail($id);
...@@ -179,7 +176,7 @@ class UserController extends Controller ...@@ -179,7 +176,7 @@ class UserController extends Controller
179 } 176 }
180 177
181 $user->save(); 178 $user->save();
182 - session()->flash('success', 'User successfully updated'); 179 + session()->flash('success', trans('settings.users_edit_success'));
183 180
184 $redirectUrl = userCan('users-manage') ? '/settings/users' : '/settings/users/' . $user->id; 181 $redirectUrl = userCan('users-manage') ? '/settings/users' : '/settings/users/' . $user->id;
185 return redirect($redirectUrl); 182 return redirect($redirectUrl);
...@@ -197,7 +194,7 @@ class UserController extends Controller ...@@ -197,7 +194,7 @@ class UserController extends Controller
197 }); 194 });
198 195
199 $user = $this->user->findOrFail($id); 196 $user = $this->user->findOrFail($id);
200 - $this->setPageTitle('Delete User ' . $user->name); 197 + $this->setPageTitle(trans('settings.users_delete_named', ['userName' => $user->name]));
201 return view('users/delete', ['user' => $user]); 198 return view('users/delete', ['user' => $user]);
202 } 199 }
203 200
...@@ -216,17 +213,17 @@ class UserController extends Controller ...@@ -216,17 +213,17 @@ class UserController extends Controller
216 $user = $this->userRepo->getById($id); 213 $user = $this->userRepo->getById($id);
217 214
218 if ($this->userRepo->isOnlyAdmin($user)) { 215 if ($this->userRepo->isOnlyAdmin($user)) {
219 - session()->flash('error', 'You cannot delete the only admin'); 216 + session()->flash('error', trans('errors.users_cannot_delete_only_admin'));
220 return redirect($user->getEditUrl()); 217 return redirect($user->getEditUrl());
221 } 218 }
222 219
223 if ($user->system_name === 'public') { 220 if ($user->system_name === 'public') {
224 - session()->flash('error', 'You cannot delete the guest user'); 221 + session()->flash('error', trans('errors.users_cannot_delete_guest'));
225 return redirect($user->getEditUrl()); 222 return redirect($user->getEditUrl());
226 } 223 }
227 224
228 $this->userRepo->destroy($user); 225 $this->userRepo->destroy($user);
229 - session()->flash('success', 'User successfully removed'); 226 + session()->flash('success', trans('settings.users_delete_success'));
230 227
231 return redirect('/settings/users'); 228 return redirect('/settings/users');
232 } 229 }
......
...@@ -109,7 +109,7 @@ class BookRepo extends EntityRepo ...@@ -109,7 +109,7 @@ class BookRepo extends EntityRepo
109 public function getBySlug($slug) 109 public function getBySlug($slug)
110 { 110 {
111 $book = $this->bookQuery()->where('slug', '=', $slug)->first(); 111 $book = $this->bookQuery()->where('slug', '=', $slug)->first();
112 - if ($book === null) throw new NotFoundException('Book not found'); 112 + if ($book === null) throw new NotFoundException(trans('errors.book_not_found'));
113 return $book; 113 return $book;
114 } 114 }
115 115
......
...@@ -69,7 +69,7 @@ class ChapterRepo extends EntityRepo ...@@ -69,7 +69,7 @@ class ChapterRepo extends EntityRepo
69 public function getBySlug($slug, $bookId) 69 public function getBySlug($slug, $bookId)
70 { 70 {
71 $chapter = $this->chapterQuery()->where('slug', '=', $slug)->where('book_id', '=', $bookId)->first(); 71 $chapter = $this->chapterQuery()->where('slug', '=', $slug)->where('book_id', '=', $bookId)->first();
72 - if ($chapter === null) throw new NotFoundException('Chapter not found'); 72 + if ($chapter === null) throw new NotFoundException(trans('errors.chapter_not_found'));
73 return $chapter; 73 return $chapter;
74 } 74 }
75 75
......
...@@ -66,7 +66,7 @@ class PageRepo extends EntityRepo ...@@ -66,7 +66,7 @@ class PageRepo extends EntityRepo
66 public function getBySlug($slug, $bookId) 66 public function getBySlug($slug, $bookId)
67 { 67 {
68 $page = $this->pageQuery()->where('slug', '=', $slug)->where('book_id', '=', $bookId)->first(); 68 $page = $this->pageQuery()->where('slug', '=', $slug)->where('book_id', '=', $bookId)->first();
69 - if ($page === null) throw new NotFoundException('Page not found'); 69 + if ($page === null) throw new NotFoundException(trans('errors.page_not_found'));
70 return $page; 70 return $page;
71 } 71 }
72 72
...@@ -134,7 +134,7 @@ class PageRepo extends EntityRepo ...@@ -134,7 +134,7 @@ class PageRepo extends EntityRepo
134 $draftPage->draft = false; 134 $draftPage->draft = false;
135 135
136 $draftPage->save(); 136 $draftPage->save();
137 - $this->saveRevision($draftPage, 'Initial Publish'); 137 + $this->saveRevision($draftPage, trans('entities.pages_initial_revision'));
138 138
139 return $draftPage; 139 return $draftPage;
140 } 140 }
...@@ -143,12 +143,12 @@ class PageRepo extends EntityRepo ...@@ -143,12 +143,12 @@ class PageRepo extends EntityRepo
143 * Get a new draft page instance. 143 * Get a new draft page instance.
144 * @param Book $book 144 * @param Book $book
145 * @param Chapter|bool $chapter 145 * @param Chapter|bool $chapter
146 - * @return static 146 + * @return Page
147 */ 147 */
148 public function getDraftPage(Book $book, $chapter = false) 148 public function getDraftPage(Book $book, $chapter = false)
149 { 149 {
150 $page = $this->page->newInstance(); 150 $page = $this->page->newInstance();
151 - $page->name = 'New Page'; 151 + $page->name = trans('entities.pages_initial_name');
152 $page->created_by = user()->id; 152 $page->created_by = user()->id;
153 $page->updated_by = user()->id; 153 $page->updated_by = user()->id;
154 $page->draft = true; 154 $page->draft = true;
...@@ -487,11 +487,9 @@ class PageRepo extends EntityRepo ...@@ -487,11 +487,9 @@ class PageRepo extends EntityRepo
487 */ 487 */
488 public function getUserPageDraftMessage(PageRevision $draft) 488 public function getUserPageDraftMessage(PageRevision $draft)
489 { 489 {
490 - $message = 'You are currently editing a draft that was last saved ' . $draft->updated_at->diffForHumans() . '.'; 490 + $message = trans('entities.pages_editing_draft_notification', ['timeDiff' => $draft->updated_at->diffForHumans()]);
491 - if ($draft->page->updated_at->timestamp > $draft->updated_at->timestamp) { 491 + if ($draft->page->updated_at->timestamp <= $draft->updated_at->timestamp) return $message;
492 - $message .= "\n This page has been updated by since that time. It is recommended that you discard this draft."; 492 + return $message . "\n" . trans('entities.pages_draft_edited_notification');
493 - }
494 - return $message;
495 } 493 }
496 494
497 /** 495 /**
...@@ -519,10 +517,10 @@ class PageRepo extends EntityRepo ...@@ -519,10 +517,10 @@ class PageRepo extends EntityRepo
519 public function getPageEditingActiveMessage(Page $page, $minRange = null) 517 public function getPageEditingActiveMessage(Page $page, $minRange = null)
520 { 518 {
521 $pageDraftEdits = $this->activePageEditingQuery($page, $minRange)->get(); 519 $pageDraftEdits = $this->activePageEditingQuery($page, $minRange)->get();
522 - $userMessage = $pageDraftEdits->count() > 1 ? $pageDraftEdits->count() . ' users have' : $pageDraftEdits->first()->createdBy->name . ' has'; 520 +
523 - $timeMessage = $minRange === null ? 'since the page was last updated' : 'in the last ' . $minRange . ' minutes'; 521 + $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]);
524 - $message = '%s started editing this page %s. Take care not to overwrite each other\'s updates!'; 522 + $timeMessage = $minRange === null ? trans('entities.pages_draft_edit_active.time_a') : trans('entities.pages_draft_edit_active.time_b', ['minCount'=>$minRange]);
525 - return sprintf($message, $userMessage, $timeMessage); 523 + return trans('entities.pages_draft_edit_active.message', ['start' => $userMessage, 'time' => $timeMessage]);
526 } 524 }
527 525
528 /** 526 /**
......
...@@ -133,9 +133,9 @@ class PermissionsRepo ...@@ -133,9 +133,9 @@ class PermissionsRepo
133 133
134 // Prevent deleting admin role or default registration role. 134 // Prevent deleting admin role or default registration role.
135 if ($role->system_name && in_array($role->system_name, $this->systemRoles)) { 135 if ($role->system_name && in_array($role->system_name, $this->systemRoles)) {
136 - throw new PermissionsException('This role is a system role and cannot be deleted'); 136 + throw new PermissionsException(trans('errors.role_system_cannot_be_deleted'));
137 } else if ($role->id == setting('registration-role')) { 137 } else if ($role->id == setting('registration-role')) {
138 - throw new PermissionsException('This role cannot be deleted while set as the default registration role.'); 138 + throw new PermissionsException(trans('errors.role_registration_default_cannot_delete'));
139 } 139 }
140 140
141 if ($migrateRoleId) { 141 if ($migrateRoleId) {
......
...@@ -121,7 +121,7 @@ class TagRepo ...@@ -121,7 +121,7 @@ class TagRepo
121 /** 121 /**
122 * Create a new Tag instance from user input. 122 * Create a new Tag instance from user input.
123 * @param $input 123 * @param $input
124 - * @return static 124 + * @return Tag
125 */ 125 */
126 protected function newInstanceFromInput($input) 126 protected function newInstanceFromInput($input)
127 { 127 {
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
3 use BookStack\Role; 3 use BookStack\Role;
4 use BookStack\User; 4 use BookStack\User;
5 use Exception; 5 use Exception;
6 -use Setting;
7 6
8 class UserRepo 7 class UserRepo
9 { 8 {
......
...@@ -193,7 +193,7 @@ class AttachmentService extends UploadService ...@@ -193,7 +193,7 @@ class AttachmentService extends UploadService
193 try { 193 try {
194 $storage->put($attachmentStoragePath, $attachmentData); 194 $storage->put($attachmentStoragePath, $attachmentData);
195 } catch (Exception $e) { 195 } catch (Exception $e) {
196 - throw new FileUploadException('File path ' . $attachmentStoragePath . ' could not be uploaded to. Ensure it is writable to the server.'); 196 + throw new FileUploadException(trans('errors.path_not_writable', ['filePath' => $attachmentStoragePath]));
197 } 197 }
198 return $attachmentPath; 198 return $attachmentPath;
199 } 199 }
......
...@@ -33,7 +33,7 @@ class EmailConfirmationService ...@@ -33,7 +33,7 @@ class EmailConfirmationService
33 public function sendConfirmation(User $user) 33 public function sendConfirmation(User $user)
34 { 34 {
35 if ($user->email_confirmed) { 35 if ($user->email_confirmed) {
36 - throw new ConfirmationEmailException('Email has already been confirmed, Try logging in.', '/login'); 36 + throw new ConfirmationEmailException(trans('errors.email_already_confirmed'), '/login');
37 } 37 }
38 38
39 $this->deleteConfirmationsByUser($user); 39 $this->deleteConfirmationsByUser($user);
...@@ -63,7 +63,7 @@ class EmailConfirmationService ...@@ -63,7 +63,7 @@ class EmailConfirmationService
63 * Gets an email confirmation by looking up the token, 63 * Gets an email confirmation by looking up the token,
64 * Ensures the token has not expired. 64 * Ensures the token has not expired.
65 * @param string $token 65 * @param string $token
66 - * @return EmailConfirmation 66 + * @return array|null|\stdClass
67 * @throws UserRegistrationException 67 * @throws UserRegistrationException
68 */ 68 */
69 public function getEmailConfirmationFromToken($token) 69 public function getEmailConfirmationFromToken($token)
...@@ -72,14 +72,14 @@ class EmailConfirmationService ...@@ -72,14 +72,14 @@ class EmailConfirmationService
72 72
73 // If not found show error 73 // If not found show error
74 if ($emailConfirmation === null) { 74 if ($emailConfirmation === null) {
75 - throw new UserRegistrationException('This confirmation token is not valid or has already been used, Please try registering again.', '/register'); 75 + throw new UserRegistrationException(trans('errors.email_confirmation_invalid'), '/register');
76 } 76 }
77 77
78 // If more than a day old 78 // If more than a day old
79 if (Carbon::now()->subDay()->gt(new Carbon($emailConfirmation->created_at))) { 79 if (Carbon::now()->subDay()->gt(new Carbon($emailConfirmation->created_at))) {
80 $user = $this->users->getById($emailConfirmation->user_id); 80 $user = $this->users->getById($emailConfirmation->user_id);
81 $this->sendConfirmation($user); 81 $this->sendConfirmation($user);
82 - throw new UserRegistrationException('The confirmation token has expired, A new confirmation email has been sent.', '/register/confirm'); 82 + throw new UserRegistrationException(trans('errors.email_confirmation_expired'), '/register/confirm');
83 } 83 }
84 84
85 $emailConfirmation->user = $this->users->getById($emailConfirmation->user_id); 85 $emailConfirmation->user = $this->users->getById($emailConfirmation->user_id);
......
...@@ -59,7 +59,7 @@ class ImageService extends UploadService ...@@ -59,7 +59,7 @@ class ImageService extends UploadService
59 { 59 {
60 $imageName = $imageName ? $imageName : basename($url); 60 $imageName = $imageName ? $imageName : basename($url);
61 $imageData = file_get_contents($url); 61 $imageData = file_get_contents($url);
62 - if($imageData === false) throw new \Exception('Cannot get image from ' . $url); 62 + if($imageData === false) throw new \Exception(trans('errors.cannot_get_image_from_url', ['url' => $url]));
63 return $this->saveNew($imageName, $imageData, $type); 63 return $this->saveNew($imageName, $imageData, $type);
64 } 64 }
65 65
...@@ -93,7 +93,7 @@ class ImageService extends UploadService ...@@ -93,7 +93,7 @@ class ImageService extends UploadService
93 $storage->put($fullPath, $imageData); 93 $storage->put($fullPath, $imageData);
94 $storage->setVisibility($fullPath, 'public'); 94 $storage->setVisibility($fullPath, 'public');
95 } catch (Exception $e) { 95 } catch (Exception $e) {
96 - throw new ImageUploadException('Image Path ' . $fullPath . ' is not writable by the server.'); 96 + throw new ImageUploadException(trans('errors.path_not_writable', ['filePath' => $fullPath]));
97 } 97 }
98 98
99 if ($this->isLocal()) $fullPath = str_replace_first('/public', '', $fullPath); 99 if ($this->isLocal()) $fullPath = str_replace_first('/public', '', $fullPath);
...@@ -160,7 +160,7 @@ class ImageService extends UploadService ...@@ -160,7 +160,7 @@ class ImageService extends UploadService
160 $thumb = $this->imageTool->make($storage->get($imagePath)); 160 $thumb = $this->imageTool->make($storage->get($imagePath));
161 } catch (Exception $e) { 161 } catch (Exception $e) {
162 if ($e instanceof \ErrorException || $e instanceof NotSupportedException) { 162 if ($e instanceof \ErrorException || $e instanceof NotSupportedException) {
163 - throw new ImageUploadException('The server cannot create thumbnails. Please check you have the GD PHP extension installed.'); 163 + throw new ImageUploadException(trans('errors.cannot_create_thumbs'));
164 } else { 164 } else {
165 throw $e; 165 throw $e;
166 } 166 }
......
...@@ -94,7 +94,7 @@ class LdapService ...@@ -94,7 +94,7 @@ class LdapService
94 $ldapBind = $this->ldap->bind($connection, $ldapDn, $ldapPass); 94 $ldapBind = $this->ldap->bind($connection, $ldapDn, $ldapPass);
95 } 95 }
96 96
97 - if (!$ldapBind) throw new LdapException('LDAP access failed using ' . ($isAnonymous ? ' anonymous bind.' : ' given dn & pass details')); 97 + if (!$ldapBind) throw new LdapException(($isAnonymous ? trans('errors.ldap_fail_anonymous') : trans('errors.ldap_fail_authed')));
98 } 98 }
99 99
100 /** 100 /**
...@@ -109,7 +109,7 @@ class LdapService ...@@ -109,7 +109,7 @@ class LdapService
109 109
110 // Check LDAP extension in installed 110 // Check LDAP extension in installed
111 if (!function_exists('ldap_connect') && config('app.env') !== 'testing') { 111 if (!function_exists('ldap_connect') && config('app.env') !== 'testing') {
112 - throw new LdapException('LDAP PHP extension not installed'); 112 + throw new LdapException(trans('errors.ldap_extension_not_installed'));
113 } 113 }
114 114
115 // Get port from server string if specified. 115 // Get port from server string if specified.
...@@ -117,7 +117,7 @@ class LdapService ...@@ -117,7 +117,7 @@ class LdapService
117 $ldapConnection = $this->ldap->connect($ldapServer[0], count($ldapServer) > 1 ? $ldapServer[1] : 389); 117 $ldapConnection = $this->ldap->connect($ldapServer[0], count($ldapServer) > 1 ? $ldapServer[1] : 389);
118 118
119 if ($ldapConnection === false) { 119 if ($ldapConnection === false) {
120 - throw new LdapException('Cannot connect to ldap server, Initial connection failed'); 120 + throw new LdapException(trans('errors.ldap_cannot_connect'));
121 } 121 }
122 122
123 // Set any required options 123 // Set any required options
......
...@@ -70,12 +70,12 @@ class SocialAuthService ...@@ -70,12 +70,12 @@ class SocialAuthService
70 70
71 // Check social account has not already been used 71 // Check social account has not already been used
72 if ($this->socialAccount->where('driver_id', '=', $socialUser->getId())->exists()) { 72 if ($this->socialAccount->where('driver_id', '=', $socialUser->getId())->exists()) {
73 - throw new UserRegistrationException('This ' . $socialDriver . ' account is already in use, Try logging in via the ' . $socialDriver . ' option.', '/login'); 73 + throw new UserRegistrationException(trans('errors.social_account_in_use', ['socialAccount'=>$socialDriver]), '/login');
74 } 74 }
75 75
76 if ($this->userRepo->getByEmail($socialUser->getEmail())) { 76 if ($this->userRepo->getByEmail($socialUser->getEmail())) {
77 $email = $socialUser->getEmail(); 77 $email = $socialUser->getEmail();
78 - 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'); 78 + throw new UserRegistrationException(trans('errors.social_account_in_use', ['socialAccount'=>$socialDriver, 'email' => $email]), '/login');
79 } 79 }
80 80
81 return $socialUser; 81 return $socialUser;
...@@ -113,27 +113,26 @@ class SocialAuthService ...@@ -113,27 +113,26 @@ class SocialAuthService
113 if ($isLoggedIn && $socialAccount === null) { 113 if ($isLoggedIn && $socialAccount === null) {
114 $this->fillSocialAccount($socialDriver, $socialUser); 114 $this->fillSocialAccount($socialDriver, $socialUser);
115 $currentUser->socialAccounts()->save($this->socialAccount); 115 $currentUser->socialAccounts()->save($this->socialAccount);
116 - session()->flash('success', title_case($socialDriver) . ' account was successfully attached to your profile.'); 116 + session()->flash('success', trans('settings.users_social_connected', ['socialAccount' => title_case($socialDriver)]));
117 return redirect($currentUser->getEditUrl()); 117 return redirect($currentUser->getEditUrl());
118 } 118 }
119 119
120 // When a user is logged in and the social account exists and is already linked to the current user. 120 // When a user is logged in and the social account exists and is already linked to the current user.
121 if ($isLoggedIn && $socialAccount !== null && $socialAccount->user->id === $currentUser->id) { 121 if ($isLoggedIn && $socialAccount !== null && $socialAccount->user->id === $currentUser->id) {
122 - session()->flash('error', 'This ' . title_case($socialDriver) . ' account is already attached to your profile.'); 122 + session()->flash('error', trans('errors.social_account_existing', ['socialAccount' => title_case($socialDriver)]));
123 return redirect($currentUser->getEditUrl()); 123 return redirect($currentUser->getEditUrl());
124 } 124 }
125 125
126 // When a user is logged in, A social account exists but the users do not match. 126 // When a user is logged in, A social account exists but the users do not match.
127 - // Change the user that the social account is assigned to.
128 if ($isLoggedIn && $socialAccount !== null && $socialAccount->user->id != $currentUser->id) { 127 if ($isLoggedIn && $socialAccount !== null && $socialAccount->user->id != $currentUser->id) {
129 - session()->flash('success', 'This ' . title_case($socialDriver) . ' account is already used by another user.'); 128 + session()->flash('error', trans('errors.social_account_already_used_existing', ['socialAccount' => title_case($socialDriver)]));
130 return redirect($currentUser->getEditUrl()); 129 return redirect($currentUser->getEditUrl());
131 } 130 }
132 131
133 // Otherwise let the user know this social account is not used by anyone. 132 // Otherwise let the user know this social account is not used by anyone.
134 - $message = 'This ' . $socialDriver . ' account is not linked to any users. Please attach it in your profile settings'; 133 + $message = trans('errors.social_account_not_used', ['socialAccount' => title_case($socialDriver)]);
135 if (setting('registration-enabled')) { 134 if (setting('registration-enabled')) {
136 - $message .= ' or, If you do not yet have an account, You can register an account using the ' . $socialDriver . ' option'; 135 + $message .= trans('errors.social_account_register_instructions', ['socialAccount' => title_case($socialDriver)]);
137 } 136 }
138 137
139 throw new SocialSignInException($message . '.', '/login'); 138 throw new SocialSignInException($message . '.', '/login');
...@@ -157,8 +156,8 @@ class SocialAuthService ...@@ -157,8 +156,8 @@ class SocialAuthService
157 { 156 {
158 $driver = trim(strtolower($socialDriver)); 157 $driver = trim(strtolower($socialDriver));
159 158
160 - if (!in_array($driver, $this->validSocialDrivers)) abort(404, 'Social Driver Not Found'); 159 + if (!in_array($driver, $this->validSocialDrivers)) abort(404, trans('errors.social_driver_not_found'));
161 - if (!$this->checkDriverConfigured($driver)) throw new SocialDriverNotConfigured("Your {$driver} social settings are not configured correctly."); 160 + if (!$this->checkDriverConfigured($driver)) throw new SocialDriverNotConfigured(trans('errors.social_driver_not_configured', ['socialAccount' => title_case($socialDriver)]));
162 161
163 return $driver; 162 return $driver;
164 } 163 }
...@@ -215,7 +214,7 @@ class SocialAuthService ...@@ -215,7 +214,7 @@ class SocialAuthService
215 { 214 {
216 session(); 215 session();
217 user()->socialAccounts()->where('driver', '=', $socialDriver)->delete(); 216 user()->socialAccounts()->where('driver', '=', $socialDriver)->delete();
218 - session()->flash('success', title_case($socialDriver) . ' account successfully detached'); 217 + session()->flash('success', trans('settings.users_social_disconnected', ['socialAccount' => title_case($socialDriver)]));
219 return redirect(user()->getEditUrl()); 218 return redirect(user()->getEditUrl());
220 } 219 }
221 220
......
...@@ -506,20 +506,6 @@ export default function (ngApp, events) { ...@@ -506,20 +506,6 @@ export default function (ngApp, events) {
506 }; 506 };
507 507
508 /** 508 /**
509 - * Save the tags to the current page.
510 - */
511 - $scope.saveTags = function() {
512 - setTagOrder();
513 - let postData = {tags: $scope.tags};
514 - let url = window.baseUrl('/ajax/tags/update/page/' + pageId);
515 - $http.post(url, postData).then((responseData) => {
516 - $scope.tags = responseData.data.tags;
517 - addEmptyTag();
518 - events.emit('success', responseData.data.message);
519 - })
520 - };
521 -
522 - /**
523 * Remove a tag from the current list. 509 * Remove a tag from the current list.
524 * @param tag 510 * @param tag
525 */ 511 */
......
...@@ -36,6 +36,10 @@ return [ ...@@ -36,6 +36,10 @@ return [
36 36
37 'register_thanks' => 'Thanks for registering!', 37 'register_thanks' => 'Thanks for registering!',
38 'register_confirm' => 'Please check your email and click the confirmation button to access :appName.', 38 'register_confirm' => 'Please check your email and click the confirmation button to access :appName.',
39 + 'registrations_disabled' => 'Registrations are currently disabled',
40 + 'registration_email_domain_invalid' => 'That email domain does not have access to this application',
41 + 'register_success' => 'Thanks for signing up! You are now registered and signed in.',
42 +
39 43
40 /** 44 /**
41 * Password Reset 45 * Password Reset
...@@ -43,11 +47,14 @@ return [ ...@@ -43,11 +47,14 @@ return [
43 'reset_password' => 'Reset Password', 47 'reset_password' => 'Reset Password',
44 'reset_password_send_instructions' => 'Enter your email below and you will be sent an email with a password reset link.', 48 'reset_password_send_instructions' => 'Enter your email below and you will be sent an email with a password reset link.',
45 'reset_password_send_button' => 'Send Reset Link', 49 'reset_password_send_button' => 'Send Reset Link',
50 + 'reset_password_sent_success' => 'A password reset link has been sent to :email.',
51 + 'reset_password_success' => 'Your password has been successfully reset.',
46 52
47 'email_reset_subject' => 'Reset your :appName password', 53 'email_reset_subject' => 'Reset your :appName password',
48 'email_reset_text' => 'You are receiving this email because we received a password reset request for your account.', 54 'email_reset_text' => 'You are receiving this email because we received a password reset request for your account.',
49 'email_reset_not_requested' => 'If you did not request a password reset, no further action is required.', 55 'email_reset_not_requested' => 'If you did not request a password reset, no further action is required.',
50 56
57 +
51 /** 58 /**
52 * Email Confirmation 59 * Email Confirmation
53 */ 60 */
......
...@@ -26,6 +26,8 @@ return [ ...@@ -26,6 +26,8 @@ return [
26 'create' => 'Create', 26 'create' => 'Create',
27 'update' => 'Update', 27 'update' => 'Update',
28 'edit' => 'Edit', 28 'edit' => 'Edit',
29 + 'sort' => 'Sort',
30 + 'move' => 'Move',
29 'delete' => 'Delete', 31 'delete' => 'Delete',
30 'search' => 'Search', 32 'search' => 'Search',
31 'search_clear' => 'Clear Search', 33 'search_clear' => 'Clear Search',
......
...@@ -14,5 +14,6 @@ return [ ...@@ -14,5 +14,6 @@ return [
14 'imagem_load_more' => 'Load More', 14 'imagem_load_more' => 'Load More',
15 'imagem_image_name' => 'Image Name', 15 'imagem_image_name' => 'Image Name',
16 'imagem_delete_confirm' => 'This image is used in the pages below, Click delete again to confirm you want to delete this image.', 16 'imagem_delete_confirm' => 'This image is used in the pages below, Click delete again to confirm you want to delete this image.',
17 - 'imagem_select_image' => 'Select Image' 17 + 'imagem_select_image' => 'Select Image',
18 + 'images_deleted' => 'Images Deleted',
18 ]; 19 ];
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -13,10 +13,6 @@ return [ ...@@ -13,10 +13,6 @@ return [
13 'recently_viewed' => 'Recently Viewed', 13 'recently_viewed' => 'Recently Viewed',
14 'recent_activity' => 'Recent Activity', 14 'recent_activity' => 'Recent Activity',
15 'create_now' => 'Create one now', 15 'create_now' => 'Create one now',
16 - 'edit' => 'Edit',
17 - 'sort' => 'Sort',
18 - 'move' => 'Move',
19 - 'delete' => 'Delete',
20 'revisions' => 'Revisions', 16 'revisions' => 'Revisions',
21 'meta_created' => 'Created :timeLength', 17 'meta_created' => 'Created :timeLength',
22 'meta_created_name' => 'Created :timeLength by :user', 18 'meta_created_name' => 'Created :timeLength by :user',
...@@ -43,11 +39,18 @@ return [ ...@@ -43,11 +39,18 @@ return [
43 * Search 39 * Search
44 */ 40 */
45 'search_results' => 'Search Results', 41 'search_results' => 'Search Results',
42 + 'search_results_page' => 'Page Search Results',
43 + 'search_results_chapter' => 'Chapter Search Results',
44 + 'search_results_book' => 'Book Search Results',
46 'search_clear' => 'Clear Search', 45 'search_clear' => 'Clear Search',
47 'search_view_pages' => 'View all matches pages', 46 'search_view_pages' => 'View all matches pages',
48 'search_view_chapters' => 'View all matches chapters', 47 'search_view_chapters' => 'View all matches chapters',
49 'search_view_books' => 'View all matches books', 48 'search_view_books' => 'View all matches books',
50 'search_no_pages' => 'No pages matched this search', 49 'search_no_pages' => 'No pages matched this search',
50 + 'search_for_term' => 'Search for :term',
51 + 'search_page_for_term' => 'Page search for :term',
52 + 'search_chapter_for_term' => 'Chapter search for :term',
53 + 'search_book_for_term' => 'Books search for :term',
51 54
52 /** 55 /**
53 * Books 56 * Books
...@@ -60,12 +63,15 @@ return [ ...@@ -60,12 +63,15 @@ return [
60 'books_popular_empty' => 'The most popular books will appear here.', 63 'books_popular_empty' => 'The most popular books will appear here.',
61 'books_create' => 'Create New Book', 64 'books_create' => 'Create New Book',
62 'books_delete' => 'Delete Book', 65 'books_delete' => 'Delete Book',
66 + 'books_delete_named' => 'Delete Book :bookName',
63 'books_delete_explain' => 'This will delete the book with the name \':bookName\', All pages and chapters will be removed.', 67 'books_delete_explain' => 'This will delete the book with the name \':bookName\', All pages and chapters will be removed.',
64 'books_delete_confirmation' => 'Are you sure you want to delete this book?', 68 'books_delete_confirmation' => 'Are you sure you want to delete this book?',
65 'books_edit' => 'Edit Book', 69 'books_edit' => 'Edit Book',
70 + 'books_edit_named' => 'Edit Book :bookName',
66 'books_form_book_name' => 'Book Name', 71 'books_form_book_name' => 'Book Name',
67 'books_save' => 'Save Book', 72 'books_save' => 'Save Book',
68 'books_permissions' => 'Book Permissions', 73 'books_permissions' => 'Book Permissions',
74 + 'books_permissions_updated' => 'Book Permissions Updated',
69 'books_empty_contents' => 'No pages or chapters have been created for this book.', 75 'books_empty_contents' => 'No pages or chapters have been created for this book.',
70 'books_empty_create_page' => 'Create a new page', 76 'books_empty_create_page' => 'Create a new page',
71 'books_empty_or' => 'or', 77 'books_empty_or' => 'or',
...@@ -75,6 +81,7 @@ return [ ...@@ -75,6 +81,7 @@ return [
75 'books_search_this' => 'Search this book', 81 'books_search_this' => 'Search this book',
76 'books_navigation' => 'Book Navigation', 82 'books_navigation' => 'Book Navigation',
77 'books_sort' => 'Sort Book Contents', 83 'books_sort' => 'Sort Book Contents',
84 + 'books_sort_named' => 'Sort Book :bookName',
78 'books_sort_show_other' => 'Show Other Books', 85 'books_sort_show_other' => 'Show Other Books',
79 'books_sort_save' => 'Save New Order', 86 'books_sort_save' => 'Save New Order',
80 87
...@@ -86,15 +93,20 @@ return [ ...@@ -86,15 +93,20 @@ return [
86 'chapters_new' => 'New Chapter', 93 'chapters_new' => 'New Chapter',
87 'chapters_create' => 'Create New Chapter', 94 'chapters_create' => 'Create New Chapter',
88 'chapters_delete' => 'Delete Chapter', 95 'chapters_delete' => 'Delete Chapter',
96 + 'chapters_delete_named' => 'Delete Chapter :chapterName',
89 'chapters_delete_explain' => 'This will delete the chapter with the name \':chapterName\', All pages will be removed 97 'chapters_delete_explain' => 'This will delete the chapter with the name \':chapterName\', All pages will be removed
90 and added directly to the parent book.', 98 and added directly to the parent book.',
91 'chapters_delete_confirm' => 'Are you sure you want to delete this chapter?', 99 'chapters_delete_confirm' => 'Are you sure you want to delete this chapter?',
92 'chapters_edit' => 'Edit Chapter', 100 'chapters_edit' => 'Edit Chapter',
101 + 'chapters_edit_named' => 'Edit Chapter :chapterName',
93 'chapters_save' => 'Save Chapter', 102 'chapters_save' => 'Save Chapter',
94 'chapters_move' => 'Move Chapter', 103 'chapters_move' => 'Move Chapter',
104 + 'chapters_move_named' => 'Move Chapter :chapterName',
105 + 'chapter_move_success' => 'Chapter moved to :bookName',
95 'chapters_permissions' => 'Chapter Permissions', 106 'chapters_permissions' => 'Chapter Permissions',
96 'chapters_empty' => 'No pages are currently in this chapter.', 107 'chapters_empty' => 'No pages are currently in this chapter.',
97 'chapters_permissions_active' => 'Chapter Permissions Active', 108 'chapters_permissions_active' => 'Chapter Permissions Active',
109 + 'chapters_permissions_success' => 'Chapter Permissions Updated',
98 110
99 /** 111 /**
100 * Pages 112 * Pages
...@@ -106,11 +118,18 @@ return [ ...@@ -106,11 +118,18 @@ return [
106 'pages_attachments' => 'Attachments', 118 'pages_attachments' => 'Attachments',
107 'pages_navigation' => 'Page Navigation', 119 'pages_navigation' => 'Page Navigation',
108 'pages_delete' => 'Delete Page', 120 'pages_delete' => 'Delete Page',
121 + 'pages_delete_named' => 'Delete Page :pageName',
122 + 'pages_delete_draft_named' => 'Delete Draft Page :pageName',
109 'pages_delete_draft' => 'Delete Draft Page', 123 'pages_delete_draft' => 'Delete Draft Page',
124 + 'pages_delete_success' => 'Page deleted',
125 + 'pages_delete_draft_success' => 'Draft page deleted',
110 'pages_delete_confirm' => 'Are you sure you want to delete this page?', 126 'pages_delete_confirm' => 'Are you sure you want to delete this page?',
111 'pages_delete_draft_confirm' => 'Are you sure you want to delete this draft page?', 127 'pages_delete_draft_confirm' => 'Are you sure you want to delete this draft page?',
128 + 'pages_editing_named' => 'Editing Page :pageName',
112 'pages_edit_toggle_header' => 'Toggle header', 129 'pages_edit_toggle_header' => 'Toggle header',
113 'pages_edit_save_draft' => 'Save Draft', 130 'pages_edit_save_draft' => 'Save Draft',
131 + 'pages_edit_draft' => 'Edit Page Draft',
132 + 'pages_edit_draft_save_at' => 'Draft saved at ',
114 'pages_edit_delete_draft' => 'Delete Draft', 133 'pages_edit_delete_draft' => 'Delete Draft',
115 'pages_edit_discard_draft' => 'Discard Draft', 134 'pages_edit_discard_draft' => 'Discard Draft',
116 'pages_edit_set_changelog' => 'Set Changelog', 135 'pages_edit_set_changelog' => 'Set Changelog',
...@@ -125,8 +144,12 @@ return [ ...@@ -125,8 +144,12 @@ return [
125 'pages_md_insert_link' => 'Insert Entity Link', 144 'pages_md_insert_link' => 'Insert Entity Link',
126 'pages_not_in_chapter' => 'Page is not in a chapter', 145 'pages_not_in_chapter' => 'Page is not in a chapter',
127 'pages_move' => 'Move Page', 146 'pages_move' => 'Move Page',
147 + 'pages_move_success' => 'Page moved to ":parentName"',
128 'pages_permissions' => 'Page Permissions', 148 'pages_permissions' => 'Page Permissions',
149 + 'pages_permissions_success' => 'Page permissions updated',
129 'pages_revisions' => 'Page Revisions', 150 'pages_revisions' => 'Page Revisions',
151 + 'pages_revisions_named' => 'Page Revisions for :pageName',
152 + 'pages_revision_named' => 'Page Revision for :pageName',
130 'pages_revisions_created_by' => 'Created By', 153 'pages_revisions_created_by' => 'Created By',
131 'pages_revisions_date' => 'Revision Date', 154 'pages_revisions_date' => 'Revision Date',
132 'pages_revisions_changelog' => 'Changelog', 155 'pages_revisions_changelog' => 'Changelog',
...@@ -141,12 +164,24 @@ return [ ...@@ -141,12 +164,24 @@ return [
141 'pages_export_text' => 'Plain Text File', 164 'pages_export_text' => 'Plain Text File',
142 'pages_copy_link' => 'Copy Link', 165 'pages_copy_link' => 'Copy Link',
143 'pages_permissions_active' => 'Page Permissions Active', 166 'pages_permissions_active' => 'Page Permissions Active',
167 + 'pages_initial_revision' => 'Initial publish',
168 + 'pages_initial_name' => 'New Page',
169 + 'pages_editing_draft_notification' => 'You are currently editing a draft that was last saved :timeDiff.',
170 + 'pages_draft_edited_notification' => 'This page has been updated by since that time. It is recommended that you discard this draft.',
171 + 'pages_draft_edit_active' => [
172 + 'start_a' => ':count users have started editing this page',
173 + 'start_b' => ':userName has started editing this page',
174 + 'time_a' => 'since the pages was last updated',
175 + 'time_b' => 'in the last :minCount minutes',
176 + 'message' => ':start :time. Take care not to overwrite each other\'s updates!',
177 + ],
144 178
145 /** 179 /**
146 * Editor sidebar 180 * Editor sidebar
147 */ 181 */
148 'page_tags' => 'Page Tags', 182 'page_tags' => 'Page Tags',
149 'tag' => 'Tag', 183 'tag' => 'Tag',
184 + 'tags' => '',
150 'tag_value' => 'Tag Value (Optional)', 185 'tag_value' => 'Tag Value (Optional)',
151 'tags_explain' => "Add some tags to better categorise your content. \n You can assign a value to a tag for more in-depth organisation.", 186 'tags_explain' => "Add some tags to better categorise your content. \n You can assign a value to a tag for more in-depth organisation.",
152 'tags_add' => 'Add another tag', 187 'tags_add' => 'Add another tag',
...@@ -168,6 +203,8 @@ return [ ...@@ -168,6 +203,8 @@ return [
168 'attachments_edit_file' => 'Edit File', 203 'attachments_edit_file' => 'Edit File',
169 'attachments_edit_file_name' => 'File Name', 204 'attachments_edit_file_name' => 'File Name',
170 'attachments_edit_drop_upload' => 'Drop files or click here to upload and overwrite', 205 'attachments_edit_drop_upload' => 'Drop files or click here to upload and overwrite',
206 + 'attachments_order_updated' => 'Attachment order updated',
207 + 'attachments_deleted' => 'Attachment deleted',
171 208
172 /** 209 /**
173 * Profile View 210 * Profile View
......
...@@ -10,8 +10,53 @@ return [ ...@@ -10,8 +10,53 @@ return [
10 'permission' => 'You do not have permission to access the requested page.', 10 'permission' => 'You do not have permission to access the requested page.',
11 'permissionJson' => 'You do not have permission to perform the requested action.', 11 'permissionJson' => 'You do not have permission to perform the requested action.',
12 12
13 + // Auth
14 + 'error_user_exists_different_creds' => 'A user with the email :email already exists but with different credentials.',
15 + 'email_already_confirmed' => 'Email has already been confirmed, Try logging in.',
16 + 'email_confirmation_invalid' => 'This confirmation token is not valid or has already been used, Please try registering again.',
17 + 'email_confirmation_expired' => 'The confirmation token has expired, A new confirmation email has been sent.',
18 + 'ldap_fail_anonymous' => 'LDAP access failed using anonymous bind',
19 + 'ldap_fail_authed' => 'LDAP access failed using given dn & password details',
20 + 'ldap_extension_not_installed' => 'LDAP PHP extension not installed',
21 + 'ldap_cannot_connect' => 'Cannot connect to ldap server, Initial connection failed',
22 + 'social_no_action_defined' => 'No action defined',
23 + 'social_account_in_use' => 'This :socialAccount account is already in use, Try logging in via the :socialAccount option.',
24 + '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.',
25 + 'social_account_existing' => 'This :socialAccount is already attached to your profile.',
26 + 'social_account_already_used_existing' => 'This :socialAccount account is already used by another user.',
27 + 'social_account_not_used' => 'This :socialAccount account is not linked to any users. Please attach it in your profile settings. ',
28 + 'social_account_register_instructions' => 'If you do not yet have an account, You can register an account using the :socialAccount option.',
29 + 'social_driver_not_found' => 'Social driver not found',
30 + 'social_driver_not_configured' => 'Your :socialAccount social settings are not configured correctly.',
31 +
32 + // System
33 + 'path_not_writable' => 'File path :filePath could not be uploaded to. Ensure it is writable to the server.',
34 + 'cannot_get_image_from_url' => 'Cannot get image from :url',
35 + 'cannot_create_thumbs' => 'The server cannot create thumbnails. Please check you have the GD PHP extension installed.',
36 +
37 + // Attachments
38 + 'attachment_page_mismatch' => 'Page mismatch during attachment update',
39 +
40 + // Entities
41 + 'entity_not_found' => 'Entity not found',
42 + 'book_not_found' => 'Book not found',
43 + 'page_not_found' => 'Page not found',
44 + 'chapter_not_found' => 'Chapter not found',
45 + 'selected_book_not_found' => 'The selected book was not found',
46 + 'selected_book_chapter_not_found' => 'The selected Book or Chapter was not found',
47 + 'guests_cannot_save_drafts' => 'Guests cannot save drafts',
48 +
49 + // Users
50 + 'users_cannot_delete_only_admin' => 'You cannot delete the only admin',
51 + 'users_cannot_delete_guest' => 'You cannot delete the guest user',
52 +
53 + // Roles
54 + 'role_cannot_be_edited' => 'This role cannot be edited',
55 + 'role_system_cannot_be_deleted' => 'This role is a system role and cannot be deleted',
56 + 'role_registration_default_cannot_delete' => 'This role cannot be deleted while set as the default registration role',
57 +
13 // Error pages 58 // Error pages
14 - 'page_not_found' => 'Page Not Found', 59 + '404_page_not_found' => 'Page Not Found',
15 'sorry_page_not_found' => 'Sorry, The page you were looking for could not be found.', 60 'sorry_page_not_found' => 'Sorry, The page you were looking for could not be found.',
16 'return_home' => 'Return to home', 61 'return_home' => 'Return to home',
17 'error_occurred' => 'An Error Occurred', 62 'error_occurred' => 'An Error Occurred',
......
...@@ -10,6 +10,7 @@ return [ ...@@ -10,6 +10,7 @@ return [
10 10
11 'settings' => 'Settings', 11 'settings' => 'Settings',
12 'settings_save' => 'Save Settings', 12 'settings_save' => 'Save Settings',
13 + 'settings_save_success' => 'Settings saved',
13 14
14 /** 15 /**
15 * App settings 16 * App settings
...@@ -51,10 +52,13 @@ return [ ...@@ -51,10 +52,13 @@ return [
51 'roles' => 'Roles', 52 'roles' => 'Roles',
52 'role_user_roles' => 'User Roles', 53 'role_user_roles' => 'User Roles',
53 'role_create' => 'Create New Role', 54 'role_create' => 'Create New Role',
55 + 'role_create_success' => 'Role successfully created',
54 'role_delete' => 'Delete Role', 56 'role_delete' => 'Delete Role',
55 'role_delete_confirm' => 'This will delete the role with the name \':roleName\'.', 57 'role_delete_confirm' => 'This will delete the role with the name \':roleName\'.',
56 '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.', 58 '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.',
59 + 'role_delete_no_migration' => "Don't migrate users",
57 'role_delete_sure' => 'Are you sure you want to delete this role?', 60 'role_delete_sure' => 'Are you sure you want to delete this role?',
61 + 'role_delete_success' => 'Role successfully deleted',
58 'role_edit' => 'Edit Role', 62 'role_edit' => 'Edit Role',
59 'role_details' => 'Role Details', 63 'role_details' => 'Role Details',
60 'role_name' => 'Role Name', 64 'role_name' => 'Role Name',
...@@ -71,6 +75,7 @@ return [ ...@@ -71,6 +75,7 @@ return [
71 'role_own' => 'Own', 75 'role_own' => 'Own',
72 'role_controlled_by_asset' => 'Controlled by the asset they are uploaded to', 76 'role_controlled_by_asset' => 'Controlled by the asset they are uploaded to',
73 'role_save' => 'Save Role', 77 'role_save' => 'Save Role',
78 + 'role_update_success' => 'Role successfully updated',
74 'role_users' => 'Users in this role', 79 'role_users' => 'Users in this role',
75 'role_users_none' => 'No users are currently assigned to this role', 80 'role_users_none' => 'No users are currently assigned to this role',
76 81
...@@ -79,6 +84,7 @@ return [ ...@@ -79,6 +84,7 @@ return [
79 */ 84 */
80 85
81 'users' => 'Users', 86 'users' => 'Users',
87 + 'user_profile' => 'User Profile',
82 'users_add_new' => 'Add New User', 88 'users_add_new' => 'Add New User',
83 'users_search' => 'Search Users', 89 'users_search' => 'Search Users',
84 'users_role' => 'User Roles', 90 'users_role' => 'User Roles',
...@@ -86,16 +92,21 @@ return [ ...@@ -86,16 +92,21 @@ return [
86 'users_password_warning' => 'Only fill the below if you would like to change your password:', 92 'users_password_warning' => 'Only fill the below if you would like to change your password:',
87 'users_system_public' => 'This user represents any guest users that visit your instance. It cannot be used to log in but is assigned automatically.', 93 'users_system_public' => 'This user represents any guest users that visit your instance. It cannot be used to log in but is assigned automatically.',
88 'users_delete' => 'Delete User', 94 'users_delete' => 'Delete User',
95 + 'users_delete_named' => 'Delete ser :userName',
89 'users_delete_warning' => 'This will fully delete this user with the name \':userName\' from the system.', 96 'users_delete_warning' => 'This will fully delete this user with the name \':userName\' from the system.',
90 'users_delete_confirm' => 'Are you sure you want to delete this user?', 97 'users_delete_confirm' => 'Are you sure you want to delete this user?',
98 + 'users_delete_success' => 'Users successfully removed',
91 'users_edit' => 'Edit User', 99 'users_edit' => 'Edit User',
92 'users_edit_profile' => 'Edit Profile', 100 'users_edit_profile' => 'Edit Profile',
101 + 'users_edit_success' => 'User successfully updated',
93 'users_avatar' => 'User Avatar', 102 'users_avatar' => 'User Avatar',
94 'users_avatar_desc' => 'This image should be approx 256px square.', 103 'users_avatar_desc' => 'This image should be approx 256px square.',
95 'users_social_accounts' => 'Social Accounts', 104 'users_social_accounts' => 'Social Accounts',
96 '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.', 105 '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.',
97 'users_social_connect' => 'Connect Account', 106 'users_social_connect' => 'Connect Account',
98 'users_social_disconnect' => 'Disconnect Account', 107 'users_social_disconnect' => 'Disconnect Account',
108 + 'users_social_connected' => ':socialAccount account was successfully attached to your profile.',
109 + 'users_social_disconnected' => ':socialAccount account was successfully disconnected from your profile.',
99 ]; 110 ];
100 111
101 112
......
...@@ -87,8 +87,8 @@ return [ ...@@ -87,8 +87,8 @@ return [
87 */ 87 */
88 88
89 'custom' => [ 89 'custom' => [
90 - 'attribute-name' => [ 90 + 'password-confirm' => [
91 - 'rule-name' => 'custom-message', 91 + 'required_with' => 'Password confirmation required',
92 ], 92 ],
93 ], 93 ],
94 94
......
...@@ -17,20 +17,20 @@ ...@@ -17,20 +17,20 @@
17 <a href="{{ $book->getUrl('/chapter/create') }}" class="text-pos text-button"><i class="zmdi zmdi-plus"></i>{{ trans('entities.chapters_new') }}</a> 17 <a href="{{ $book->getUrl('/chapter/create') }}" class="text-pos text-button"><i class="zmdi zmdi-plus"></i>{{ trans('entities.chapters_new') }}</a>
18 @endif 18 @endif
19 @if(userCan('book-update', $book)) 19 @if(userCan('book-update', $book))
20 - <a href="{{$book->getEditUrl()}}" class="text-primary text-button"><i class="zmdi zmdi-edit"></i>{{ trans('entities.edit') }}</a> 20 + <a href="{{$book->getEditUrl()}}" class="text-primary text-button"><i class="zmdi zmdi-edit"></i>{{ trans('common.edit') }}</a>
21 @endif 21 @endif
22 @if(userCan('book-update', $book) || userCan('restrictions-manage', $book) || userCan('book-delete', $book)) 22 @if(userCan('book-update', $book) || userCan('restrictions-manage', $book) || userCan('book-delete', $book))
23 <div dropdown class="dropdown-container"> 23 <div dropdown class="dropdown-container">
24 <a dropdown-toggle class="text-primary text-button"><i class="zmdi zmdi-more-vert"></i></a> 24 <a dropdown-toggle class="text-primary text-button"><i class="zmdi zmdi-more-vert"></i></a>
25 <ul> 25 <ul>
26 @if(userCan('book-update', $book)) 26 @if(userCan('book-update', $book))
27 - <li><a href="{{ $book->getUrl('/sort') }}" class="text-primary"><i class="zmdi zmdi-sort"></i>{{ trans('entities.sort') }}</a></li> 27 + <li><a href="{{ $book->getUrl('/sort') }}" class="text-primary"><i class="zmdi zmdi-sort"></i>{{ trans('common.sort') }}</a></li>
28 @endif 28 @endif
29 @if(userCan('restrictions-manage', $book)) 29 @if(userCan('restrictions-manage', $book))
30 <li><a href="{{ $book->getUrl('/permissions') }}" class="text-primary"><i class="zmdi zmdi-lock-outline"></i>{{ trans('entities.permissions') }}</a></li> 30 <li><a href="{{ $book->getUrl('/permissions') }}" class="text-primary"><i class="zmdi zmdi-lock-outline"></i>{{ trans('entities.permissions') }}</a></li>
31 @endif 31 @endif
32 @if(userCan('book-delete', $book)) 32 @if(userCan('book-delete', $book))
33 - <li><a href="{{ $book->getUrl('/delete') }}" class="text-neg"><i class="zmdi zmdi-delete"></i>{{ trans('entities.delete') }}</a></li> 33 + <li><a href="{{ $book->getUrl('/delete') }}" class="text-neg"><i class="zmdi zmdi-delete"></i>{{ trans('common.delete') }}</a></li>
34 @endif 34 @endif
35 </ul> 35 </ul>
36 </div> 36 </div>
......
...@@ -14,20 +14,20 @@ ...@@ -14,20 +14,20 @@
14 <a href="{{ $chapter->getUrl('/create-page') }}" class="text-pos text-button"><i class="zmdi zmdi-plus"></i>{{ trans('entities.pages_new') }}</a> 14 <a href="{{ $chapter->getUrl('/create-page') }}" class="text-pos text-button"><i class="zmdi zmdi-plus"></i>{{ trans('entities.pages_new') }}</a>
15 @endif 15 @endif
16 @if(userCan('chapter-update', $chapter)) 16 @if(userCan('chapter-update', $chapter))
17 - <a href="{{ $chapter->getUrl('/edit') }}" class="text-primary text-button"><i class="zmdi zmdi-edit"></i>{{ trans('entities.edit') }}</a> 17 + <a href="{{ $chapter->getUrl('/edit') }}" class="text-primary text-button"><i class="zmdi zmdi-edit"></i>{{ trans('common.edit') }}</a>
18 @endif 18 @endif
19 @if(userCan('chapter-update', $chapter) || userCan('restrictions-manage', $chapter) || userCan('chapter-delete', $chapter)) 19 @if(userCan('chapter-update', $chapter) || userCan('restrictions-manage', $chapter) || userCan('chapter-delete', $chapter))
20 <div dropdown class="dropdown-container"> 20 <div dropdown class="dropdown-container">
21 <a dropdown-toggle class="text-primary text-button"><i class="zmdi zmdi-more-vert"></i></a> 21 <a dropdown-toggle class="text-primary text-button"><i class="zmdi zmdi-more-vert"></i></a>
22 <ul> 22 <ul>
23 @if(userCan('chapter-update', $chapter)) 23 @if(userCan('chapter-update', $chapter))
24 - <li><a href="{{ $chapter->getUrl('/move') }}" class="text-primary"><i class="zmdi zmdi-folder"></i>{{ trans('entities.move') }}</a></li> 24 + <li><a href="{{ $chapter->getUrl('/move') }}" class="text-primary"><i class="zmdi zmdi-folder"></i>{{ trans('common.move') }}</a></li>
25 @endif 25 @endif
26 @if(userCan('restrictions-manage', $chapter)) 26 @if(userCan('restrictions-manage', $chapter))
27 <li><a href="{{ $chapter->getUrl('/permissions') }}" class="text-primary"><i class="zmdi zmdi-lock-outline"></i>{{ trans('entities.permissions') }}</a></li> 27 <li><a href="{{ $chapter->getUrl('/permissions') }}" class="text-primary"><i class="zmdi zmdi-lock-outline"></i>{{ trans('entities.permissions') }}</a></li>
28 @endif 28 @endif
29 @if(userCan('chapter-delete', $chapter)) 29 @if(userCan('chapter-delete', $chapter))
30 - <li><a href="{{ $chapter->getUrl('/delete') }}" class="text-neg"><i class="zmdi zmdi-delete"></i>{{ trans('entities.delete') }}</a></li> 30 + <li><a href="{{ $chapter->getUrl('/delete') }}" class="text-neg"><i class="zmdi zmdi-delete"></i>{{ trans('common.delete') }}</a></li>
31 @endif 31 @endif
32 </ul> 32 </ul>
33 </div> 33 </div>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
6 <div class="container"> 6 <div class="container">
7 7
8 8
9 - <h1>{{ $message or trans('errors.page_not_found') }}</h1> 9 + <h1>{{ $message or trans('errors.404_page_not_found') }}</h1>
10 <p>{{ trans('errors.sorry_page_not_found') }}</p> 10 <p>{{ trans('errors.sorry_page_not_found') }}</p>
11 <p><a href="{{ baseUrl('/') }}" class="button">{{ trans('errors.return_home') }}</a></p> 11 <p><a href="{{ baseUrl('/') }}" class="button">{{ trans('errors.return_home') }}</a></p>
12 12
......
...@@ -19,21 +19,21 @@ ...@@ -19,21 +19,21 @@
19 </ul> 19 </ul>
20 </span> 20 </span>
21 @if(userCan('page-update', $page)) 21 @if(userCan('page-update', $page))
22 - <a href="{{ $page->getUrl('/edit') }}" class="text-primary text-button" ><i class="zmdi zmdi-edit"></i>{{ trans('entities.edit') }}</a> 22 + <a href="{{ $page->getUrl('/edit') }}" class="text-primary text-button" ><i class="zmdi zmdi-edit"></i>{{ trans('common.edit') }}</a>
23 @endif 23 @endif
24 @if(userCan('page-update', $page) || userCan('restrictions-manage', $page) || userCan('page-delete', $page)) 24 @if(userCan('page-update', $page) || userCan('restrictions-manage', $page) || userCan('page-delete', $page))
25 <div dropdown class="dropdown-container"> 25 <div dropdown class="dropdown-container">
26 <a dropdown-toggle class="text-primary text-button"><i class="zmdi zmdi-more-vert"></i></a> 26 <a dropdown-toggle class="text-primary text-button"><i class="zmdi zmdi-more-vert"></i></a>
27 <ul> 27 <ul>
28 @if(userCan('page-update', $page)) 28 @if(userCan('page-update', $page))
29 - <li><a href="{{ $page->getUrl('/move') }}" class="text-primary" ><i class="zmdi zmdi-folder"></i>{{ trans('entities.move') }}</a></li> 29 + <li><a href="{{ $page->getUrl('/move') }}" class="text-primary" ><i class="zmdi zmdi-folder"></i>{{ trans('common.move') }}</a></li>
30 <li><a href="{{ $page->getUrl('/revisions') }}" class="text-primary"><i class="zmdi zmdi-replay"></i>{{ trans('entities.revisions') }}</a></li> 30 <li><a href="{{ $page->getUrl('/revisions') }}" class="text-primary"><i class="zmdi zmdi-replay"></i>{{ trans('entities.revisions') }}</a></li>
31 @endif 31 @endif
32 @if(userCan('restrictions-manage', $page)) 32 @if(userCan('restrictions-manage', $page))
33 <li><a href="{{ $page->getUrl('/permissions') }}" class="text-primary"><i class="zmdi zmdi-lock-outline"></i>{{ trans('entities.permissions') }}</a></li> 33 <li><a href="{{ $page->getUrl('/permissions') }}" class="text-primary"><i class="zmdi zmdi-lock-outline"></i>{{ trans('entities.permissions') }}</a></li>
34 @endif 34 @endif
35 @if(userCan('page-delete', $page)) 35 @if(userCan('page-delete', $page))
36 - <li><a href="{{ $page->getUrl('/delete') }}" class="text-neg"><i class="zmdi zmdi-delete"></i>{{ trans('entities.delete') }}</a></li> 36 + <li><a href="{{ $page->getUrl('/delete') }}" class="text-neg"><i class="zmdi zmdi-delete"></i>{{ trans('common.delete') }}</a></li>
37 @endif 37 @endif
38 </ul> 38 </ul>
39 </div> 39 </div>
......
...@@ -107,7 +107,6 @@ Route::group(['middleware' => 'auth'], function () { ...@@ -107,7 +107,6 @@ Route::group(['middleware' => 'auth'], function () {
107 Route::get('/get/{entityType}/{entityId}', 'TagController@getForEntity'); 107 Route::get('/get/{entityType}/{entityId}', 'TagController@getForEntity');
108 Route::get('/suggest/names', 'TagController@getNameSuggestions'); 108 Route::get('/suggest/names', 'TagController@getNameSuggestions');
109 Route::get('/suggest/values', 'TagController@getValueSuggestions'); 109 Route::get('/suggest/values', 'TagController@getValueSuggestions');
110 - Route::post('/update/{entityType}/{entityId}', 'TagController@updateForEntity');
111 }); 110 });
112 111
113 Route::get('/ajax/search/entities', 'SearchController@searchEntitiesAjax'); 112 Route::get('/ajax/search/entities', 'SearchController@searchEntitiesAjax');
......