Dan Brown
Committed by GitHub

Merge pull request #234 from BookStackApp/translations

Setup for translations
Showing 137 changed files with 1039 additions and 608 deletions
...@@ -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,11 +113,11 @@ class AttachmentController extends Controller ...@@ -113,11 +113,11 @@ 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());
120 - return $attachment; 120 + return response()->json($attachment);
121 } 121 }
122 122
123 /** 123 /**
...@@ -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 }
......
...@@ -87,7 +87,7 @@ class LoginController extends Controller ...@@ -87,7 +87,7 @@ class LoginController extends Controller
87 // Check for users with same email already 87 // Check for users with same email already
88 $alreadyUser = $user->newQuery()->where('email', '=', $user->email)->count() > 0; 88 $alreadyUser = $user->newQuery()->where('email', '=', $user->email)->count() > 0;
89 if ($alreadyUser) { 89 if ($alreadyUser) {
90 - 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]));
91 } 91 }
92 92
93 $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 }
......
...@@ -43,4 +43,39 @@ class HomeController extends Controller ...@@ -43,4 +43,39 @@ class HomeController extends Controller
43 ]); 43 ]);
44 } 44 }
45 45
46 + /**
47 + * Get a js representation of the current translations
48 + * @return \Illuminate\Contracts\Routing\ResponseFactory|\Symfony\Component\HttpFoundation\Response
49 + */
50 + public function getTranslations() {
51 + $locale = trans()->getLocale();
52 + $cacheKey = 'GLOBAL_TRANSLATIONS_' . $locale;
53 + if (cache()->has($cacheKey) && config('app.env') !== 'development') {
54 + $resp = cache($cacheKey);
55 + } else {
56 + $translations = [
57 + // Get only translations which might be used in JS
58 + 'common' => trans('common'),
59 + 'components' => trans('components'),
60 + 'entities' => trans('entities'),
61 + 'errors' => trans('errors')
62 + ];
63 + if ($locale !== 'en') {
64 + $enTrans = [
65 + 'common' => trans('common', [], null, 'en'),
66 + 'components' => trans('components', [], null, 'en'),
67 + 'entities' => trans('entities', [], null, 'en'),
68 + 'errors' => trans('errors', [], null, 'en')
69 + ];
70 + $translations = array_replace_recursive($enTrans, $translations);
71 + }
72 + $resp = 'window.translations = ' . json_encode($translations);
73 + cache()->put($cacheKey, $resp, 120);
74 + }
75 +
76 + return response($resp, 200, [
77 + 'Content-Type' => 'application/javascript'
78 + ]);
79 + }
80 +
46 } 81 }
......
...@@ -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 }
......
...@@ -43,8 +43,9 @@ class ResetPassword extends Notification ...@@ -43,8 +43,9 @@ class ResetPassword extends Notification
43 public function toMail() 43 public function toMail()
44 { 44 {
45 return (new MailMessage) 45 return (new MailMessage)
46 - ->line('You are receiving this email because we received a password reset request for your account.') 46 + ->subject(trans('auth.email_reset_subject', ['appName' => setting('app-name')]))
47 - ->action('Reset Password', baseUrl('password/reset/' . $this->token)) 47 + ->line(trans('auth.email_reset_text'))
48 - ->line('If you did not request a password reset, no further action is required.'); 48 + ->action(trans('auth.reset_password'), baseUrl('password/reset/' . $this->token))
49 + ->line(trans('auth.email_reset_not_requested'));
49 } 50 }
50 } 51 }
......
...@@ -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
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
6 return [ 6 return [
7 7
8 'app-name' => 'BookStack', 8 'app-name' => 'BookStack',
9 + 'app-logo' => '',
9 'app-name-header' => true, 10 'app-name-header' => true,
10 'app-editor' => 'wysiwyg', 11 'app-editor' => 'wysiwyg',
11 'app-color' => '#0288D1', 12 'app-color' => '#0288D1',
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
22 <php> 22 <php>
23 <env name="APP_ENV" value="testing"/> 23 <env name="APP_ENV" value="testing"/>
24 <env name="APP_DEBUG" value="false"/> 24 <env name="APP_DEBUG" value="false"/>
25 + <env name="APP_LANG" value="en"/>
25 <env name="CACHE_DRIVER" value="array"/> 26 <env name="CACHE_DRIVER" value="array"/>
26 <env name="SESSION_DRIVER" value="array"/> 27 <env name="SESSION_DRIVER" value="array"/>
27 <env name="QUEUE_DRIVER" value="sync"/> 28 <env name="QUEUE_DRIVER" value="sync"/>
......
1 "use strict"; 1 "use strict";
2 2
3 // AngularJS - Create application and load components 3 // AngularJS - Create application and load components
4 -var angular = require('angular'); 4 +import angular from "angular";
5 -var ngResource = require('angular-resource'); 5 +import "angular-resource";
6 -var ngAnimate = require('angular-animate'); 6 +import "angular-animate";
7 -var ngSanitize = require('angular-sanitize'); 7 +import "angular-sanitize";
8 -require('angular-ui-sortable'); 8 +import "angular-ui-sortable";
9 9
10 // Url retrieval function 10 // Url retrieval function
11 window.baseUrl = function(path) { 11 window.baseUrl = function(path) {
...@@ -15,7 +15,13 @@ window.baseUrl = function(path) { ...@@ -15,7 +15,13 @@ window.baseUrl = function(path) {
15 return basePath + '/' + path; 15 return basePath + '/' + path;
16 }; 16 };
17 17
18 -var ngApp = angular.module('bookStack', ['ngResource', 'ngAnimate', 'ngSanitize', 'ui.sortable']); 18 +let ngApp = angular.module('bookStack', ['ngResource', 'ngAnimate', 'ngSanitize', 'ui.sortable']);
19 +
20 +// Translation setup
21 +// Creates a global function with name 'trans' to be used in the same way as Laravel's translation system
22 +import Translations from "./translations"
23 +let translator = new Translations(window.translations);
24 +window.trans = translator.get.bind(translator);
19 25
20 // Global Event System 26 // Global Event System
21 class EventManager { 27 class EventManager {
...@@ -25,9 +31,9 @@ class EventManager { ...@@ -25,9 +31,9 @@ class EventManager {
25 31
26 emit(eventName, eventData) { 32 emit(eventName, eventData) {
27 if (typeof this.listeners[eventName] === 'undefined') return this; 33 if (typeof this.listeners[eventName] === 'undefined') return this;
28 - var eventsToStart = this.listeners[eventName]; 34 + let eventsToStart = this.listeners[eventName];
29 for (let i = 0; i < eventsToStart.length; i++) { 35 for (let i = 0; i < eventsToStart.length; i++) {
30 - var event = eventsToStart[i]; 36 + let event = eventsToStart[i];
31 event(eventData); 37 event(eventData);
32 } 38 }
33 return this; 39 return this;
...@@ -70,93 +76,83 @@ jQuery.expr[":"].contains = $.expr.createPseudo(function (arg) { ...@@ -70,93 +76,83 @@ jQuery.expr[":"].contains = $.expr.createPseudo(function (arg) {
70 }); 76 });
71 77
72 // Global jQuery Elements 78 // Global jQuery Elements
73 -$(function () { 79 +let notifications = $('.notification');
74 - 80 +let successNotification = notifications.filter('.pos');
75 - var notifications = $('.notification'); 81 +let errorNotification = notifications.filter('.neg');
76 - var successNotification = notifications.filter('.pos'); 82 +let warningNotification = notifications.filter('.warning');
77 - var errorNotification = notifications.filter('.neg'); 83 +// Notification Events
78 - var warningNotification = notifications.filter('.warning'); 84 +window.Events.listen('success', function (text) {
79 - // Notification Events 85 + successNotification.hide();
80 - window.Events.listen('success', function (text) { 86 + successNotification.find('span').text(text);
81 - successNotification.hide(); 87 + setTimeout(() => {
82 - successNotification.find('span').text(text); 88 + successNotification.show();
89 + }, 1);
90 +});
91 +window.Events.listen('warning', function (text) {
92 + warningNotification.find('span').text(text);
93 + warningNotification.show();
94 +});
95 +window.Events.listen('error', function (text) {
96 + errorNotification.find('span').text(text);
97 + errorNotification.show();
98 +});
99 +
100 +// Notification hiding
101 +notifications.click(function () {
102 + $(this).fadeOut(100);
103 +});
104 +
105 +// Chapter page list toggles
106 +$('.chapter-toggle').click(function (e) {
107 + e.preventDefault();
108 + $(this).toggleClass('open');
109 + $(this).closest('.chapter').find('.inset-list').slideToggle(180);
110 +});
111 +
112 +// Back to top button
113 +$('#back-to-top').click(function() {
114 + $('#header').smoothScrollTo();
115 +});
116 +let scrollTopShowing = false;
117 +let scrollTop = document.getElementById('back-to-top');
118 +let scrollTopBreakpoint = 1200;
119 +window.addEventListener('scroll', function() {
120 + let scrollTopPos = document.documentElement.scrollTop || document.body.scrollTop || 0;
121 + if (!scrollTopShowing && scrollTopPos > scrollTopBreakpoint) {
122 + scrollTop.style.display = 'block';
123 + scrollTopShowing = true;
83 setTimeout(() => { 124 setTimeout(() => {
84 - successNotification.show(); 125 + scrollTop.style.opacity = 0.4;
85 }, 1); 126 }, 1);
86 - }); 127 + } else if (scrollTopShowing && scrollTopPos < scrollTopBreakpoint) {
87 - window.Events.listen('warning', function (text) { 128 + scrollTop.style.opacity = 0;
88 - warningNotification.find('span').text(text); 129 + scrollTopShowing = false;
89 - warningNotification.show(); 130 + setTimeout(() => {
90 - }); 131 + scrollTop.style.display = 'none';
91 - window.Events.listen('error', function (text) { 132 + }, 500);
92 - errorNotification.find('span').text(text);
93 - errorNotification.show();
94 - });
95 -
96 - // Notification hiding
97 - notifications.click(function () {
98 - $(this).fadeOut(100);
99 - });
100 -
101 - // Chapter page list toggles
102 - $('.chapter-toggle').click(function (e) {
103 - e.preventDefault();
104 - $(this).toggleClass('open');
105 - $(this).closest('.chapter').find('.inset-list').slideToggle(180);
106 - });
107 -
108 - // Back to top button
109 - $('#back-to-top').click(function() {
110 - $('#header').smoothScrollTo();
111 - });
112 - var scrollTopShowing = false;
113 - var scrollTop = document.getElementById('back-to-top');
114 - var scrollTopBreakpoint = 1200;
115 - window.addEventListener('scroll', function() {
116 - let scrollTopPos = document.documentElement.scrollTop || document.body.scrollTop || 0;
117 - if (!scrollTopShowing && scrollTopPos > scrollTopBreakpoint) {
118 - scrollTop.style.display = 'block';
119 - scrollTopShowing = true;
120 - setTimeout(() => {
121 - scrollTop.style.opacity = 0.4;
122 - }, 1);
123 - } else if (scrollTopShowing && scrollTopPos < scrollTopBreakpoint) {
124 - scrollTop.style.opacity = 0;
125 - scrollTopShowing = false;
126 - setTimeout(() => {
127 - scrollTop.style.display = 'none';
128 - }, 500);
129 - }
130 - });
131 -
132 - // Common jQuery actions
133 - $('[data-action="expand-entity-list-details"]').click(function() {
134 - $('.entity-list.compact').find('p').not('.empty-text').slideToggle(240);
135 - });
136 -
137 - // Popup close
138 - $('.popup-close').click(function() {
139 - $(this).closest('.overlay').fadeOut(240);
140 - });
141 - $('.overlay').click(function(event) {
142 - if (!$(event.target).hasClass('overlay')) return;
143 - $(this).fadeOut(240);
144 - });
145 -
146 - // Prevent markdown display link click redirect
147 - $('.markdown-display').on('click', 'a', function(event) {
148 - event.preventDefault();
149 - window.open($(this).attr('href'));
150 - });
151 -
152 - // Detect IE for css
153 - if(navigator.userAgent.indexOf('MSIE')!==-1
154 - || navigator.appVersion.indexOf('Trident/') > 0
155 - || navigator.userAgent.indexOf('Safari') !== -1){
156 - $('body').addClass('flexbox-support');
157 } 133 }
134 +});
158 135
136 +// Common jQuery actions
137 +$('[data-action="expand-entity-list-details"]').click(function() {
138 + $('.entity-list.compact').find('p').not('.empty-text').slideToggle(240);
159 }); 139 });
160 140
141 +// Popup close
142 +$('.popup-close').click(function() {
143 + $(this).closest('.overlay').fadeOut(240);
144 +});
145 +$('.overlay').click(function(event) {
146 + if (!$(event.target).hasClass('overlay')) return;
147 + $(this).fadeOut(240);
148 +});
149 +
150 +// Detect IE for css
151 +if(navigator.userAgent.indexOf('MSIE')!==-1
152 + || navigator.appVersion.indexOf('Trident/') > 0
153 + || navigator.userAgent.indexOf('Safari') !== -1){
154 + $('body').addClass('flexbox-support');
155 +}
156 +
161 // Page specific items 157 // Page specific items
162 -require('./pages/page-show'); 158 +import "./pages/page-show";
......
1 "use strict"; 1 "use strict";
2 // Configure ZeroClipboard 2 // Configure ZeroClipboard
3 -var zeroClipBoard = require('zeroclipboard'); 3 +import zeroClipBoard from "zeroclipboard";
4 -zeroClipBoard.config({
5 - swfPath: window.baseUrl('/ZeroClipboard.swf')
6 -});
7 4
8 -window.setupPageShow = module.exports = function (pageId) { 5 +export default window.setupPageShow = function (pageId) {
9 6
10 // Set up pointer 7 // Set up pointer
11 - var $pointer = $('#pointer').detach(); 8 + let $pointer = $('#pointer').detach();
12 - var $pointerInner = $pointer.children('div.pointer').first(); 9 + let $pointerInner = $pointer.children('div.pointer').first();
13 - var isSelection = false; 10 + let isSelection = false;
14 11
15 // Select all contents on input click 12 // Select all contents on input click
16 $pointer.on('click', 'input', function (e) { 13 $pointer.on('click', 'input', function (e) {
...@@ -19,6 +16,9 @@ window.setupPageShow = module.exports = function (pageId) { ...@@ -19,6 +16,9 @@ window.setupPageShow = module.exports = function (pageId) {
19 }); 16 });
20 17
21 // Set up copy-to-clipboard 18 // Set up copy-to-clipboard
19 + zeroClipBoard.config({
20 + swfPath: window.baseUrl('/ZeroClipboard.swf')
21 + });
22 new zeroClipBoard($pointer.find('button').first()[0]); 22 new zeroClipBoard($pointer.find('button').first()[0]);
23 23
24 // Hide pointer when clicking away 24 // Hide pointer when clicking away
...@@ -31,11 +31,11 @@ window.setupPageShow = module.exports = function (pageId) { ...@@ -31,11 +31,11 @@ window.setupPageShow = module.exports = function (pageId) {
31 // Show pointer when selecting a single block of tagged content 31 // Show pointer when selecting a single block of tagged content
32 $('.page-content [id^="bkmrk"]').on('mouseup keyup', function (e) { 32 $('.page-content [id^="bkmrk"]').on('mouseup keyup', function (e) {
33 e.stopPropagation(); 33 e.stopPropagation();
34 - var selection = window.getSelection(); 34 + let selection = window.getSelection();
35 if (selection.toString().length === 0) return; 35 if (selection.toString().length === 0) return;
36 36
37 // Show pointer and set link 37 // Show pointer and set link
38 - var $elem = $(this); 38 + let $elem = $(this);
39 let link = window.baseUrl('/link/' + pageId + '#' + $elem.attr('id')); 39 let link = window.baseUrl('/link/' + pageId + '#' + $elem.attr('id'));
40 if (link.indexOf('http') !== 0) link = window.location.protocol + "//" + window.location.host + link; 40 if (link.indexOf('http') !== 0) link = window.location.protocol + "//" + window.location.host + link;
41 $pointer.find('input').val(link); 41 $pointer.find('input').val(link);
...@@ -44,9 +44,9 @@ window.setupPageShow = module.exports = function (pageId) { ...@@ -44,9 +44,9 @@ window.setupPageShow = module.exports = function (pageId) {
44 $pointer.show(); 44 $pointer.show();
45 45
46 // Set pointer to sit near mouse-up position 46 // Set pointer to sit near mouse-up position
47 - var pointerLeftOffset = (e.pageX - $elem.offset().left - ($pointerInner.width() / 2)); 47 + let pointerLeftOffset = (e.pageX - $elem.offset().left - ($pointerInner.width() / 2));
48 if (pointerLeftOffset < 0) pointerLeftOffset = 0; 48 if (pointerLeftOffset < 0) pointerLeftOffset = 0;
49 - var pointerLeftOffsetPercent = (pointerLeftOffset / $elem.width()) * 100; 49 + let pointerLeftOffsetPercent = (pointerLeftOffset / $elem.width()) * 100;
50 $pointerInner.css('left', pointerLeftOffsetPercent + '%'); 50 $pointerInner.css('left', pointerLeftOffsetPercent + '%');
51 51
52 isSelection = true; 52 isSelection = true;
...@@ -57,7 +57,7 @@ window.setupPageShow = module.exports = function (pageId) { ...@@ -57,7 +57,7 @@ window.setupPageShow = module.exports = function (pageId) {
57 57
58 // Go to, and highlight if necessary, the specified text. 58 // Go to, and highlight if necessary, the specified text.
59 function goToText(text) { 59 function goToText(text) {
60 - var idElem = $('.page-content #' + text).first(); 60 + let idElem = $('.page-content #' + text).first();
61 if (idElem.length !== 0) { 61 if (idElem.length !== 0) {
62 idElem.smoothScrollTo(); 62 idElem.smoothScrollTo();
63 idElem.css('background-color', 'rgba(244, 249, 54, 0.25)'); 63 idElem.css('background-color', 'rgba(244, 249, 54, 0.25)');
...@@ -68,19 +68,19 @@ window.setupPageShow = module.exports = function (pageId) { ...@@ -68,19 +68,19 @@ window.setupPageShow = module.exports = function (pageId) {
68 68
69 // Check the hash on load 69 // Check the hash on load
70 if (window.location.hash) { 70 if (window.location.hash) {
71 - var text = window.location.hash.replace(/\%20/g, ' ').substr(1); 71 + let text = window.location.hash.replace(/\%20/g, ' ').substr(1);
72 goToText(text); 72 goToText(text);
73 } 73 }
74 74
75 // Make the book-tree sidebar stick in view on scroll 75 // Make the book-tree sidebar stick in view on scroll
76 - var $window = $(window); 76 + let $window = $(window);
77 - var $bookTree = $(".book-tree"); 77 + let $bookTree = $(".book-tree");
78 - var $bookTreeParent = $bookTree.parent(); 78 + let $bookTreeParent = $bookTree.parent();
79 // Check the page is scrollable and the content is taller than the tree 79 // Check the page is scrollable and the content is taller than the tree
80 - var pageScrollable = ($(document).height() > $window.height()) && ($bookTree.height() < $('.page-content').height()); 80 + let pageScrollable = ($(document).height() > $window.height()) && ($bookTree.height() < $('.page-content').height());
81 // Get current tree's width and header height 81 // Get current tree's width and header height
82 - var headerHeight = $("#header").height() + $(".toolbar").height(); 82 + let headerHeight = $("#header").height() + $(".toolbar").height();
83 - var isFixed = $window.scrollTop() > headerHeight; 83 + let isFixed = $window.scrollTop() > headerHeight;
84 // Function to fix the tree as a sidebar 84 // Function to fix the tree as a sidebar
85 function stickTree() { 85 function stickTree() {
86 $bookTree.width($bookTreeParent.width() + 15); 86 $bookTree.width($bookTreeParent.width() + 15);
...@@ -95,7 +95,7 @@ window.setupPageShow = module.exports = function (pageId) { ...@@ -95,7 +95,7 @@ window.setupPageShow = module.exports = function (pageId) {
95 } 95 }
96 // Checks if the tree stickiness state should change 96 // Checks if the tree stickiness state should change
97 function checkTreeStickiness(skipCheck) { 97 function checkTreeStickiness(skipCheck) {
98 - var shouldBeFixed = $window.scrollTop() > headerHeight; 98 + let shouldBeFixed = $window.scrollTop() > headerHeight;
99 if (shouldBeFixed && (!isFixed || skipCheck)) { 99 if (shouldBeFixed && (!isFixed || skipCheck)) {
100 stickTree(); 100 stickTree();
101 } else if (!shouldBeFixed && (isFixed || skipCheck)) { 101 } else if (!shouldBeFixed && (isFixed || skipCheck)) {
......
1 +/**
2 + * Translation Manager
3 + * Handles the JavaScript side of translating strings
4 + * in a way which fits with Laravel.
5 + */
6 +class Translator {
7 +
8 + /**
9 + * Create an instance, Passing in the required translations
10 + * @param translations
11 + */
12 + constructor(translations) {
13 + this.store = translations;
14 + }
15 +
16 + /**
17 + * Get a translation, Same format as laravel's 'trans' helper
18 + * @param key
19 + * @param replacements
20 + * @returns {*}
21 + */
22 + get(key, replacements) {
23 + let splitKey = key.split('.');
24 + let value = splitKey.reduce((a, b) => {
25 + return a != undefined ? a[b] : a;
26 + }, this.store);
27 +
28 + if (value === undefined) {
29 + console.log(`Translation with key "${key}" does not exist`);
30 + value = key;
31 + }
32 +
33 + if (replacements === undefined) return value;
34 +
35 + let replaceMatches = value.match(/:([\S]+)/g);
36 + if (replaceMatches === null) return value;
37 + replaceMatches.forEach(match => {
38 + let key = match.substring(1);
39 + if (typeof replacements[key] === 'undefined') return;
40 + value = value.replace(match, replacements[key]);
41 + });
42 + return value;
43 + }
44 +
45 +}
46 +
47 +export default Translator
...@@ -465,4 +465,8 @@ body.flexbox-support #entity-selector-wrap .popup-body .form-group { ...@@ -465,4 +465,8 @@ body.flexbox-support #entity-selector-wrap .popup-body .form-group {
465 border-bottom-width: 3px; 465 border-bottom-width: 3px;
466 } 466 }
467 } 467 }
468 +}
469 +
470 +.image-picker .none {
471 + display: none;
468 } 472 }
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -267,9 +267,4 @@ input.outline { ...@@ -267,9 +267,4 @@ input.outline {
267 267
268 .image-picker img { 268 .image-picker img {
269 background-color: #BBB; 269 background-color: #BBB;
270 -}
271 -
272 -div[toggle-switch] {
273 - height: 18px;
274 - width: 150px;
275 } 270 }
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -322,6 +322,9 @@ ul.pagination { ...@@ -322,6 +322,9 @@ ul.pagination {
322 font-size: 0.75em; 322 font-size: 0.75em;
323 margin-top: $-xs; 323 margin-top: $-xs;
324 } 324 }
325 + .text-muted p.text-muted {
326 + margin-top: 0;
327 + }
325 .page.draft .text-page { 328 .page.draft .text-page {
326 color: $color-page-draft; 329 color: $color-page-draft;
327 } 330 }
......
...@@ -35,6 +35,12 @@ table.table { ...@@ -35,6 +35,12 @@ table.table {
35 tr:hover { 35 tr:hover {
36 background-color: #EEE; 36 background-color: #EEE;
37 } 37 }
38 + .text-right {
39 + text-align: right;
40 + }
41 + .text-center {
42 + text-align: center;
43 + }
38 } 44 }
39 45
40 table.no-style { 46 table.no-style {
......
...@@ -109,6 +109,9 @@ em, i, .italic { ...@@ -109,6 +109,9 @@ em, i, .italic {
109 small, p.small, span.small, .text-small { 109 small, p.small, span.small, .text-small {
110 font-size: 0.8em; 110 font-size: 0.8em;
111 color: lighten($text-dark, 20%); 111 color: lighten($text-dark, 20%);
112 + small, p.small, span.small, .text-small {
113 + font-size: 1em;
114 + }
112 } 115 }
113 116
114 sup, .superscript { 117 sup, .superscript {
......
...@@ -16,7 +16,7 @@ return [ ...@@ -16,7 +16,7 @@ return [
16 'app_name_desc' => 'Dieser Name wird im Header und E-Mails angezeigt.', 16 'app_name_desc' => 'Dieser Name wird im Header und E-Mails angezeigt.',
17 'app_name_header' => 'Anwendungsname im Header anzeigen?', 17 'app_name_header' => 'Anwendungsname im Header anzeigen?',
18 'app_public_viewing' => '&Ouml;ffentliche Ansicht erlauben?', 18 'app_public_viewing' => '&Ouml;ffentliche Ansicht erlauben?',
19 - 'app_secure_images' => 'Erh&oml;hte Sicherheit f&uuml;r Bilduploads aktivieren?', 19 + 'app_secure_images' => 'Erh&ouml;hte Sicherheit f&uuml;r Bilduploads aktivieren?',
20 'app_secure_images_desc' => 'Aus Leistungsgr&uuml;nden sind alle Bilder &ouml;ffentlich sichtbar. Diese Option f&uuml;gt zuf&auml;llige, schwer zu eratene, Zeichenketten vor die Bild-URLs hinzu. Stellen sie sicher, dass Verzeichnindexes deaktiviert sind, um einen einfachen Zugrif zu verhindern.', 20 'app_secure_images_desc' => 'Aus Leistungsgr&uuml;nden sind alle Bilder &ouml;ffentlich sichtbar. Diese Option f&uuml;gt zuf&auml;llige, schwer zu eratene, Zeichenketten vor die Bild-URLs hinzu. Stellen sie sicher, dass Verzeichnindexes deaktiviert sind, um einen einfachen Zugrif zu verhindern.',
21 'app_editor' => 'Seiteneditor', 21 'app_editor' => 'Seiteneditor',
22 'app_editor_desc' => 'W&auml;hlen sie den Editor aus, der von allen Benutzern genutzt werden soll, um Seiten zu editieren.', 22 'app_editor_desc' => 'W&auml;hlen sie den Editor aus, der von allen Benutzern genutzt werden soll, um Seiten zu editieren.',
......
...@@ -14,7 +14,49 @@ return [ ...@@ -14,7 +14,49 @@ return [
14 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', 14 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.',
15 15
16 /** 16 /**
17 - * Email Confirmation Text 17 + * Login & Register
18 + */
19 + 'sign_up' => 'Sign up',
20 + 'log_in' => 'Log in',
21 + 'logout' => 'Logout',
22 +
23 + 'name' => 'Name',
24 + 'username' => 'Username',
25 + 'email' => 'Email',
26 + 'password' => 'Password',
27 + 'password_confirm' => 'Confirm Password',
28 + 'password_hint' => 'Must be over 5 characters',
29 + 'forgot_password' => 'Forgot Password?',
30 + 'remember_me' => 'Remember Me',
31 + 'ldap_email_hint' => 'Please enter an email to use for this account.',
32 + 'create_account' => 'Create Account',
33 + 'social_login' => 'Social Login',
34 + 'social_registration' => 'Social Registration',
35 + 'social_registration_text' => 'Register and sign in using another service.',
36 +
37 + 'register_thanks' => 'Thanks for registering!',
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 +
43 +
44 + /**
45 + * Password Reset
46 + */
47 + 'reset_password' => 'Reset Password',
48 + 'reset_password_send_instructions' => 'Enter your email below and you will be sent an email with a password 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.',
52 +
53 + 'email_reset_subject' => 'Reset your :appName password',
54 + 'email_reset_text' => 'You are receiving this email because we received a password reset request for your account.',
55 + 'email_reset_not_requested' => 'If you did not request a password reset, no further action is required.',
56 +
57 +
58 + /**
59 + * Email Confirmation
18 */ 60 */
19 'email_confirm_subject' => 'Confirm your email on :appName', 61 'email_confirm_subject' => 'Confirm your email on :appName',
20 'email_confirm_greeting' => 'Thanks for joining :appName!', 62 'email_confirm_greeting' => 'Thanks for joining :appName!',
...@@ -23,4 +65,10 @@ return [ ...@@ -23,4 +65,10 @@ return [
23 'email_confirm_send_error' => 'Email confirmation required but the system could not send the email. Contact the admin to ensure email is set up correctly.', 65 'email_confirm_send_error' => 'Email confirmation required but the system could not send the email. Contact the admin to ensure email is set up correctly.',
24 'email_confirm_success' => 'Your email has been confirmed!', 66 'email_confirm_success' => 'Your email has been confirmed!',
25 'email_confirm_resent' => 'Confirmation email resent, Please check your inbox.', 67 'email_confirm_resent' => 'Confirmation email resent, Please check your inbox.',
68 +
69 + 'email_not_confirmed' => 'Email Address Not Confirmed',
70 + 'email_not_confirmed_text' => 'Your email address has not yet been confirmed.',
71 + 'email_not_confirmed_click_link' => 'Please click the link in the email that was sent shortly after you registered.',
72 + 'email_not_confirmed_resend' => 'If you cannot find the email you can re-send the confirmation email by submitting the form below.',
73 + 'email_not_confirmed_resend_button' => 'Resend Confirmation Email',
26 ]; 74 ];
...\ No newline at end of file ...\ No newline at end of file
......
1 +<?php
2 +return [
3 +
4 + /**
5 + * Buttons
6 + */
7 + 'cancel' => 'Cancel',
8 + 'confirm' => 'Confirm',
9 + 'back' => 'Back',
10 + 'save' => 'Save',
11 + 'continue' => 'Continue',
12 + 'select' => 'Select',
13 +
14 + /**
15 + * Form Labels
16 + */
17 + 'name' => 'Name',
18 + 'description' => 'Description',
19 + 'role' => 'Role',
20 +
21 + /**
22 + * Actions
23 + */
24 + 'actions' => 'Actions',
25 + 'view' => 'View',
26 + 'create' => 'Create',
27 + 'update' => 'Update',
28 + 'edit' => 'Edit',
29 + 'sort' => 'Sort',
30 + 'move' => 'Move',
31 + 'delete' => 'Delete',
32 + 'search' => 'Search',
33 + 'search_clear' => 'Clear Search',
34 + 'reset' => 'Reset',
35 + 'remove' => 'Remove',
36 +
37 +
38 + /**
39 + * Misc
40 + */
41 + 'deleted_user' => 'Deleted User',
42 + 'no_activity' => 'No activity to show',
43 + 'no_items' => 'No items available',
44 + 'back_to_top' => 'Back to top',
45 + 'toggle_details' => 'Toggle Details',
46 +
47 + /**
48 + * Header
49 + */
50 + 'view_profile' => 'View Profile',
51 + 'edit_profile' => 'Edit Profile',
52 +
53 + /**
54 + * Email Content
55 + */
56 + 'email_action_help' => 'If you’re having trouble clicking the ":actionText" button, copy and paste the URL below into your web browser:',
57 + 'email_rights' => 'All rights reserved',
58 +];
...\ No newline at end of file ...\ No newline at end of file
1 +<?php
2 +return [
3 +
4 + /**
5 + * Image Manager
6 + */
7 + 'image_select' => 'Image Select',
8 + 'image_all' => 'All',
9 + 'image_all_title' => 'View all images',
10 + 'image_book_title' => 'View images uploaded to this book',
11 + 'image_page_title' => 'View images uploaded to this page',
12 + 'image_search_hint' => 'Search by image name',
13 + 'image_uploaded' => 'Uploaded :uploadedDate',
14 + 'image_load_more' => 'Load More',
15 + 'image_image_name' => 'Image Name',
16 + 'image_delete_confirm' => 'This image is used in the pages below, Click delete again to confirm you want to delete this image.',
17 + 'image_select_image' => 'Select Image',
18 + 'image_dropzone' => 'Drop images or click here to upload',
19 + 'images_deleted' => 'Images Deleted',
20 + 'image_preview' => 'Image Preview',
21 + 'image_upload_success' => 'Image uploaded successfully',
22 + 'image_update_success' => 'Image details successfully updated',
23 + 'image_delete_success' => 'Image successfully deleted'
24 +];
...\ No newline at end of file ...\ No newline at end of file
...@@ -6,7 +6,65 @@ return [ ...@@ -6,7 +6,65 @@ return [
6 * Error text strings. 6 * Error text strings.
7 */ 7 */
8 8
9 - // Pages 9 + // Permissions
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 +
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 + 'server_upload_limit' => 'The server does not allow uploads of this size. Please try a smaller file size.',
37 + 'image_upload_error' => 'An error occurred uploading the image',
38 +
39 + // Attachments
40 + 'attachment_page_mismatch' => 'Page mismatch during attachment update',
41 +
42 + // Pages
43 + 'page_draft_autosave_fail' => 'Failed to save draft. Ensure you have internet connection before saving this page',
44 +
45 + // Entities
46 + 'entity_not_found' => 'Entity not found',
47 + 'book_not_found' => 'Book not found',
48 + 'page_not_found' => 'Page not found',
49 + 'chapter_not_found' => 'Chapter not found',
50 + 'selected_book_not_found' => 'The selected book was not found',
51 + 'selected_book_chapter_not_found' => 'The selected Book or Chapter was not found',
52 + 'guests_cannot_save_drafts' => 'Guests cannot save drafts',
53 +
54 + // Users
55 + 'users_cannot_delete_only_admin' => 'You cannot delete the only admin',
56 + 'users_cannot_delete_guest' => 'You cannot delete the guest user',
57 +
58 + // Roles
59 + 'role_cannot_be_edited' => 'This role cannot be edited',
60 + 'role_system_cannot_be_deleted' => 'This role is a system role and cannot be deleted',
61 + 'role_registration_default_cannot_delete' => 'This role cannot be deleted while set as the default registration role',
62 +
63 + // Error pages
64 + '404_page_not_found' => 'Page Not Found',
65 + 'sorry_page_not_found' => 'Sorry, The page you were looking for could not be found.',
66 + 'return_home' => 'Return to home',
67 + 'error_occurred' => 'An Error Occurred',
68 + 'app_down' => ':appName is down right now',
69 + 'back_soon' => 'It will be back up soon.',
12 ]; 70 ];
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -10,7 +10,12 @@ return [ ...@@ -10,7 +10,12 @@ return [
10 10
11 'settings' => 'Settings', 11 'settings' => 'Settings',
12 'settings_save' => 'Save Settings', 12 'settings_save' => 'Save Settings',
13 - 13 + 'settings_save_success' => 'Settings saved',
14 +
15 + /**
16 + * App settings
17 + */
18 +
14 'app_settings' => 'App Settings', 19 'app_settings' => 'App Settings',
15 'app_name' => 'Application name', 20 'app_name' => 'Application name',
16 'app_name_desc' => 'This name is shown in the header and any emails.', 21 'app_name_desc' => 'This name is shown in the header and any emails.',
...@@ -27,6 +32,10 @@ return [ ...@@ -27,6 +32,10 @@ return [
27 'app_primary_color' => 'Application primary color', 32 'app_primary_color' => 'Application primary color',
28 'app_primary_color_desc' => 'This should be a hex value. <br>Leave empty to reset to the default color.', 33 'app_primary_color_desc' => 'This should be a hex value. <br>Leave empty to reset to the default color.',
29 34
35 + /**
36 + * Registration settings
37 + */
38 +
30 'reg_settings' => 'Registration Settings', 39 'reg_settings' => 'Registration Settings',
31 'reg_allow' => 'Allow registration?', 40 'reg_allow' => 'Allow registration?',
32 'reg_default_role' => 'Default user role after registration', 41 'reg_default_role' => 'Default user role after registration',
...@@ -36,4 +45,96 @@ return [ ...@@ -36,4 +45,96 @@ return [
36 'reg_confirm_restrict_domain_desc' => 'Enter a comma separated list of email domains you would like to restrict registration to. Users will be sent an email to confirm their address before being allowed to interact with the application. <br> Note that users will be able to change their email addresses after successful registration.', 45 'reg_confirm_restrict_domain_desc' => 'Enter a comma separated list of email domains you would like to restrict registration to. Users will be sent an email to confirm their address before being allowed to interact with the application. <br> Note that users will be able to change their email addresses after successful registration.',
37 'reg_confirm_restrict_domain_placeholder' => 'No restriction set', 46 'reg_confirm_restrict_domain_placeholder' => 'No restriction set',
38 47
39 -];
...\ No newline at end of file ...\ No newline at end of file
48 + /**
49 + * Role settings
50 + */
51 +
52 + 'roles' => 'Roles',
53 + 'role_user_roles' => 'User Roles',
54 + 'role_create' => 'Create New Role',
55 + 'role_create_success' => 'Role successfully created',
56 + 'role_delete' => 'Delete Role',
57 + 'role_delete_confirm' => 'This will delete the role with the name \':roleName\'.',
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",
60 + 'role_delete_sure' => 'Are you sure you want to delete this role?',
61 + 'role_delete_success' => 'Role successfully deleted',
62 + 'role_edit' => 'Edit Role',
63 + 'role_details' => 'Role Details',
64 + 'role_name' => 'Role Name',
65 + 'role_desc' => 'Short Description of Role',
66 + 'role_system' => 'System Permissions',
67 + 'role_manage_users' => 'Manage users',
68 + 'role_manage_roles' => 'Manage roles & role permissions',
69 + 'role_manage_entity_permissions' => 'Manage all book, chapter & page permissions',
70 + 'role_manage_own_entity_permissions' => 'Manage permissions on own book, chapter & pages',
71 + 'role_manage_settings' => 'Manage app settings',
72 + 'role_asset' => 'Asset Permissions',
73 + 'role_asset_desc' => 'These permissions control default access to the assets within the system. Permissions on Books, Chapters and Pages will override these permissions.',
74 + 'role_all' => 'All',
75 + 'role_own' => 'Own',
76 + 'role_controlled_by_asset' => 'Controlled by the asset they are uploaded to',
77 + 'role_save' => 'Save Role',
78 + 'role_update_success' => 'Role successfully updated',
79 + 'role_users' => 'Users in this role',
80 + 'role_users_none' => 'No users are currently assigned to this role',
81 +
82 + /**
83 + * Users
84 + */
85 +
86 + 'users' => 'Users',
87 + 'user_profile' => 'User Profile',
88 + 'users_add_new' => 'Add New User',
89 + 'users_search' => 'Search Users',
90 + 'users_role' => 'User Roles',
91 + 'users_external_auth_id' => 'External Authentication ID',
92 + 'users_password_warning' => 'Only fill the below if you would like to change your password:',
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.',
94 + 'users_delete' => 'Delete User',
95 + 'users_delete_named' => 'Delete ser :userName',
96 + 'users_delete_warning' => 'This will fully delete this user with the name \':userName\' from the system.',
97 + 'users_delete_confirm' => 'Are you sure you want to delete this user?',
98 + 'users_delete_success' => 'Users successfully removed',
99 + 'users_edit' => 'Edit User',
100 + 'users_edit_profile' => 'Edit Profile',
101 + 'users_edit_success' => 'User successfully updated',
102 + 'users_avatar' => 'User Avatar',
103 + 'users_avatar_desc' => 'This image should be approx 256px square.',
104 + 'users_social_accounts' => 'Social Accounts',
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.',
106 + 'users_social_connect' => 'Connect 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.',
110 +];
111 +
112 +
113 +
114 +
115 +
116 +
117 +
118 +
119 +
120 +
121 +
122 +
123 +
124 +
125 +
126 +
127 +
128 +
129 +
130 +
131 +
132 +
133 +
134 +
135 +
136 +
137 +
138 +
139 +
140 +
......
...@@ -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
......
1 <div class="form-group"> 1 <div class="form-group">
2 - <label for="username">Username</label> 2 + <label for="username">{{ trans('auth.username') }}</label>
3 @include('form/text', ['name' => 'username', 'tabindex' => 1]) 3 @include('form/text', ['name' => 'username', 'tabindex' => 1])
4 </div> 4 </div>
5 5
6 @if(session('request-email', false) === true) 6 @if(session('request-email', false) === true)
7 <div class="form-group"> 7 <div class="form-group">
8 - <label for="email">Email</label> 8 + <label for="email">{{ trans('auth.email') }}</label>
9 @include('form/text', ['name' => 'email', 'tabindex' => 1]) 9 @include('form/text', ['name' => 'email', 'tabindex' => 1])
10 <span class="text-neg"> 10 <span class="text-neg">
11 - Please enter an email to use for this account. 11 + {{ trans('auth.ldap_email_hint') }}
12 </span> 12 </span>
13 </div> 13 </div>
14 @endif 14 @endif
15 15
16 <div class="form-group"> 16 <div class="form-group">
17 - <label for="password">Password</label> 17 + <label for="password">{{ trans('auth.password') }}</label>
18 @include('form/password', ['name' => 'password', 'tabindex' => 2]) 18 @include('form/password', ['name' => 'password', 'tabindex' => 2])
19 </div> 19 </div>
...\ No newline at end of file ...\ No newline at end of file
......
1 <div class="form-group"> 1 <div class="form-group">
2 - <label for="email">Email</label> 2 + <label for="email">{{ trans('auth.email') }}</label>
3 @include('form/text', ['name' => 'email', 'tabindex' => 1]) 3 @include('form/text', ['name' => 'email', 'tabindex' => 1])
4 </div> 4 </div>
5 5
6 <div class="form-group"> 6 <div class="form-group">
7 - <label for="password">Password</label> 7 + <label for="password">{{ trans('auth.password') }}</label>
8 @include('form/password', ['name' => 'password', 'tabindex' => 2]) 8 @include('form/password', ['name' => 'password', 'tabindex' => 2])
9 - <span class="block small"><a href="{{ baseUrl('/password/email') }}">Forgot Password?</a></span> 9 + <span class="block small"><a href="{{ baseUrl('/password/email') }}">{{ trans('auth.forgot_password') }}</a></span>
10 </div> 10 </div>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
2 2
3 @section('header-buttons') 3 @section('header-buttons')
4 @if(setting('registration-enabled', false)) 4 @if(setting('registration-enabled', false))
5 - <a href="{{ baseUrl("/register") }}"><i class="zmdi zmdi-account-add"></i>Sign up</a> 5 + <a href="{{ baseUrl("/register") }}"><i class="zmdi zmdi-account-add"></i>{{ trans('auth.sign_up') }}</a>
6 @endif 6 @endif
7 @stop 7 @stop
8 8
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
10 10
11 <div class="text-center"> 11 <div class="text-center">
12 <div class="center-box"> 12 <div class="center-box">
13 - <h1>Log In</h1> 13 + <h1>{{ title_case(trans('auth.log_in')) }}</h1>
14 14
15 <form action="{{ baseUrl("/login") }}" method="POST" id="login-form"> 15 <form action="{{ baseUrl("/login") }}" method="POST" id="login-form">
16 {!! csrf_field() !!} 16 {!! csrf_field() !!}
...@@ -19,20 +19,20 @@ ...@@ -19,20 +19,20 @@
19 @include('auth/forms/login/' . $authMethod) 19 @include('auth/forms/login/' . $authMethod)
20 20
21 <div class="form-group"> 21 <div class="form-group">
22 - <label for="remember" class="inline">Remember Me</label> 22 + <label for="remember" class="inline">{{ trans('auth.remember_me') }}</label>
23 <input type="checkbox" id="remember" name="remember" class="toggle-switch-checkbox"> 23 <input type="checkbox" id="remember" name="remember" class="toggle-switch-checkbox">
24 <label for="remember" class="toggle-switch"></label> 24 <label for="remember" class="toggle-switch"></label>
25 </div> 25 </div>
26 26
27 27
28 <div class="from-group"> 28 <div class="from-group">
29 - <button class="button block pos" tabindex="3"><i class="zmdi zmdi-sign-in"></i> Sign In</button> 29 + <button class="button block pos" tabindex="3"><i class="zmdi zmdi-sign-in"></i> {{ title_case(trans('auth.log_in')) }}</button>
30 </div> 30 </div>
31 </form> 31 </form>
32 32
33 @if(count($socialDrivers) > 0) 33 @if(count($socialDrivers) > 0)
34 <hr class="margin-top"> 34 <hr class="margin-top">
35 - <h3 class="text-muted">Social Login</h3> 35 + <h3 class="text-muted">{{ trans('auth.social_login') }}</h3>
36 @if(isset($socialDrivers['google'])) 36 @if(isset($socialDrivers['google']))
37 <a href="{{ baseUrl("/login/service/google") }}" style="color: #DC4E41;"><i class="zmdi zmdi-google-plus-box zmdi-hc-4x"></i></a> 37 <a href="{{ baseUrl("/login/service/google") }}" style="color: #DC4E41;"><i class="zmdi zmdi-google-plus-box zmdi-hc-4x"></i></a>
38 @endif 38 @endif
......
1 @extends('public') 1 @extends('public')
2 2
3 @section('header-buttons') 3 @section('header-buttons')
4 - <a href="{{ baseUrl("/login") }}"><i class="zmdi zmdi-sign-in"></i>Sign in</a> 4 + <a href="{{ baseUrl("/login") }}"><i class="zmdi zmdi-sign-in"></i>{{ trans('auth.log_in') }}</a>
5 @if(setting('registration-enabled')) 5 @if(setting('registration-enabled'))
6 - <a href="{{ baseUrl("/register") }}"><i class="zmdi zmdi-account-add"></i>Sign up</a> 6 + <a href="{{ baseUrl("/register") }}"><i class="zmdi zmdi-account-add"></i>{{ trans('auth.sign_up') }}</a>
7 @endif 7 @endif
8 @stop 8 @stop
9 9
...@@ -12,20 +12,20 @@ ...@@ -12,20 +12,20 @@
12 12
13 <div class="text-center"> 13 <div class="text-center">
14 <div class="center-box text-left"> 14 <div class="center-box text-left">
15 - <h1>Reset Password</h1> 15 + <h1>{{ trans('auth.reset_password') }}</h1>
16 16
17 - <p class="muted small">Enter your email below and you will be sent an email with a password reset link.</p> 17 + <p class="muted small">{{ trans('auth.reset_password_send_instructions') }}</p>
18 18
19 <form action="{{ baseUrl("/password/email") }}" method="POST"> 19 <form action="{{ baseUrl("/password/email") }}" method="POST">
20 {!! csrf_field() !!} 20 {!! csrf_field() !!}
21 21
22 <div class="form-group"> 22 <div class="form-group">
23 - <label for="email">Email</label> 23 + <label for="email">{{ trans('auth.email') }}</label>
24 @include('form/text', ['name' => 'email']) 24 @include('form/text', ['name' => 'email'])
25 </div> 25 </div>
26 26
27 <div class="from-group"> 27 <div class="from-group">
28 - <button class="button block pos">Send Reset Link</button> 28 + <button class="button block pos">{{ trans('auth.reset_password_send_button') }}</button>
29 </div> 29 </div>
30 </form> 30 </form>
31 </div> 31 </div>
......
1 @extends('public') 1 @extends('public')
2 2
3 @section('header-buttons') 3 @section('header-buttons')
4 - <a href="{{ baseUrl("/login") }}"><i class="zmdi zmdi-sign-in"></i>Sign in</a> 4 + <a href="{{ baseUrl("/login") }}"><i class="zmdi zmdi-sign-in"></i>{{ trans('auth.log_in') }}</a>
5 @if(setting('registration-enabled')) 5 @if(setting('registration-enabled'))
6 - <a href="{{ baseUrl("/register") }}"><i class="zmdi zmdi-account-add"></i>Sign up</a> 6 + <a href="{{ baseUrl("/register") }}"><i class="zmdi zmdi-account-add"></i>{{ trans('auth.sign_up') }}</a>
7 @endif 7 @endif
8 @stop 8 @stop
9 9
...@@ -14,29 +14,29 @@ ...@@ -14,29 +14,29 @@
14 14
15 <div class="text-center"> 15 <div class="text-center">
16 <div class="center-box text-left"> 16 <div class="center-box text-left">
17 - <h1>Reset Password</h1> 17 + <h1>{{ trans('auth.reset_password') }}</h1>
18 18
19 <form action="{{ baseUrl("/password/reset") }}" method="POST"> 19 <form action="{{ baseUrl("/password/reset") }}" method="POST">
20 {!! csrf_field() !!} 20 {!! csrf_field() !!}
21 <input type="hidden" name="token" value="{{ $token }}"> 21 <input type="hidden" name="token" value="{{ $token }}">
22 22
23 <div class="form-group"> 23 <div class="form-group">
24 - <label for="email">Email</label> 24 + <label for="email">{{ trans('auth.email') }}</label>
25 @include('form/text', ['name' => 'email']) 25 @include('form/text', ['name' => 'email'])
26 </div> 26 </div>
27 27
28 <div class="form-group"> 28 <div class="form-group">
29 - <label for="password">Password</label> 29 + <label for="password">{{ trans('auth.password') }}</label>
30 @include('form/password', ['name' => 'password']) 30 @include('form/password', ['name' => 'password'])
31 </div> 31 </div>
32 32
33 <div class="form-group"> 33 <div class="form-group">
34 - <label for="password_confirmation">Confirm Password</label> 34 + <label for="password_confirmation">{{ trans('auth.password_confirm') }}</label>
35 @include('form/password', ['name' => 'password_confirmation']) 35 @include('form/password', ['name' => 'password_confirmation'])
36 </div> 36 </div>
37 37
38 <div class="from-group"> 38 <div class="from-group">
39 - <button class="button block pos">Reset Password</button> 39 + <button class="button block pos">{{ trans('auth.reset_password') }}</button>
40 </div> 40 </div>
41 </form> 41 </form>
42 </div> 42 </div>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
2 2
3 @section('header-buttons') 3 @section('header-buttons')
4 @if(!$signedIn) 4 @if(!$signedIn)
5 - <a href="{{ baseUrl("/login") }}"><i class="zmdi zmdi-sign-in"></i>Sign in</a> 5 + <a href="{{ baseUrl("/login") }}"><i class="zmdi zmdi-sign-in"></i>{{ trans('auth.log_in') }}</a>
6 @endif 6 @endif
7 @stop 7 @stop
8 8
...@@ -10,10 +10,9 @@ ...@@ -10,10 +10,9 @@
10 10
11 <div class="text-center"> 11 <div class="text-center">
12 <div class="center-box"> 12 <div class="center-box">
13 - <h2>Thanks for registering!</h2> 13 + <h2>{{ trans('auth.register_thanks') }}</h2>
14 - <p>Please check your email and click the confirmation button to access {{ setting('app-name', 'BookStack') }}.</p> 14 + <p>{{ trans('auth.register_confirm', ['appName' => setting('app-name')]) }}</p>
15 </div> 15 </div>
16 </div> 16 </div>
17 17
18 -
19 @stop 18 @stop
......
1 @extends('public') 1 @extends('public')
2 2
3 @section('header-buttons') 3 @section('header-buttons')
4 - <a href="{{ baseUrl("/login") }}"><i class="zmdi zmdi-sign-in"></i>Sign in</a> 4 + <a href="{{ baseUrl("/login") }}"><i class="zmdi zmdi-sign-in"></i>{{ trans('auth.log_in') }}</a>
5 @stop 5 @stop
6 6
7 @section('content') 7 @section('content')
8 8
9 <div class="text-center"> 9 <div class="text-center">
10 <div class="center-box"> 10 <div class="center-box">
11 - <h1>Sign Up</h1> 11 + <h1>{{ title_case(trans('auth.sign_up')) }}</h1>
12 12
13 <form action="{{ baseUrl("/register") }}" method="POST"> 13 <form action="{{ baseUrl("/register") }}" method="POST">
14 {!! csrf_field() !!} 14 {!! csrf_field() !!}
15 15
16 <div class="form-group"> 16 <div class="form-group">
17 - <label for="email">Name</label> 17 + <label for="email">{{ trans('auth.name') }}</label>
18 @include('form/text', ['name' => 'name']) 18 @include('form/text', ['name' => 'name'])
19 </div> 19 </div>
20 20
21 <div class="form-group"> 21 <div class="form-group">
22 - <label for="email">Email</label> 22 + <label for="email">{{ trans('auth.email') }}</label>
23 @include('form/text', ['name' => 'email']) 23 @include('form/text', ['name' => 'email'])
24 </div> 24 </div>
25 25
26 <div class="form-group"> 26 <div class="form-group">
27 - <label for="password">Password</label> 27 + <label for="password">{{ trans('auth.password') }}</label>
28 - @include('form/password', ['name' => 'password', 'placeholder' => 'Must be over 5 characters']) 28 + @include('form/password', ['name' => 'password', 'placeholder' => trans('auth.password_hint')])
29 </div> 29 </div>
30 30
31 <div class="from-group"> 31 <div class="from-group">
32 - <button class="button block pos">Create Account</button> 32 + <button class="button block pos">{{ trans('auth.create_account') }}</button>
33 </div> 33 </div>
34 </form> 34 </form>
35 35
36 @if(count($socialDrivers) > 0) 36 @if(count($socialDrivers) > 0)
37 <hr class="margin-top"> 37 <hr class="margin-top">
38 - <h3 class="text-muted">Social Registration</h3> 38 + <h3 class="text-muted">{{ trans('auth.social_registration') }}</h3>
39 - <p class="text-small">Register and sign in using another service.</p> 39 + <p class="text-small">{{ trans('auth.social_registration_text') }}</p>
40 @if(isset($socialDrivers['google'])) 40 @if(isset($socialDrivers['google']))
41 <a href="{{ baseUrl("/register/service/google") }}" style="color: #DC4E41;"><i class="zmdi zmdi-google-plus-box zmdi-hc-4x"></i></a> 41 <a href="{{ baseUrl("/register/service/google") }}" style="color: #DC4E41;"><i class="zmdi zmdi-google-plus-box zmdi-hc-4x"></i></a>
42 @endif 42 @endif
......
...@@ -4,16 +4,16 @@ ...@@ -4,16 +4,16 @@
4 4
5 <div class="row"> 5 <div class="row">
6 <div class="col-md-6 col-md-offset-3"> 6 <div class="col-md-6 col-md-offset-3">
7 - <h2>Email Address not confirmed</h2> 7 + <h2>{{ trans('auth.email_not_confirmed') }}</h2>
8 - <p class="text-muted">Your email address has not yet been confirmed. <br> 8 + <p class="text-muted">{{ trans('auth.email_not_confirmed_text') }}<br>
9 - Please click the link in the email that was sent shortly after you registered. <br> 9 + {{ trans('auth.email_not_confirmed_click_link') }} <br>
10 - If you cannot find the email you can re-send the confirmation email by submitting the form below. 10 + {{ trans('auth.email_not_confirmed_resend') }}
11 </p> 11 </p>
12 <hr> 12 <hr>
13 <form action="{{ baseUrl("/register/confirm/resend") }}" method="POST"> 13 <form action="{{ baseUrl("/register/confirm/resend") }}" method="POST">
14 {!! csrf_field() !!} 14 {!! csrf_field() !!}
15 <div class="form-group"> 15 <div class="form-group">
16 - <label for="email">Email Address</label> 16 + <label for="email">{{ trans('auth.email') }}</label>
17 @if(auth()->check()) 17 @if(auth()->check())
18 @include('form/text', ['name' => 'email', 'model' => auth()->user()]) 18 @include('form/text', ['name' => 'email', 'model' => auth()->user()])
19 @else 19 @else
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
21 @endif 21 @endif
22 </div> 22 </div>
23 <div class="form-group"> 23 <div class="form-group">
24 - <button type="submit" class="button pos">Resend Confirmation Email</button> 24 + <button type="submit" class="button pos">{{ trans('auth.email_not_confirmed_resend_button') }}</button>
25 </div> 25 </div>
26 </form> 26 </form>
27 </div> 27 </div>
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
17 <!-- Scripts --> 17 <!-- Scripts -->
18 <script src="{{ baseUrl('/libs/jquery/jquery.min.js?version=2.1.4') }}"></script> 18 <script src="{{ baseUrl('/libs/jquery/jquery.min.js?version=2.1.4') }}"></script>
19 <script src="{{ baseUrl('/libs/jquery/jquery-ui.min.js?version=1.11.4') }}"></script> 19 <script src="{{ baseUrl('/libs/jquery/jquery-ui.min.js?version=1.11.4') }}"></script>
20 + <script src="{{ baseUrl('/translations.js') }}"></script>
20 21
21 @yield('head') 22 @yield('head')
22 23
...@@ -53,32 +54,16 @@ ...@@ -53,32 +54,16 @@
53 <div class="col-lg-4 col-sm-5"> 54 <div class="col-lg-4 col-sm-5">
54 <div class="float right"> 55 <div class="float right">
55 <div class="links text-center"> 56 <div class="links text-center">
56 - <a href="{{ baseUrl('/books') }}"><i class="zmdi zmdi-book"></i>Books</a> 57 + <a href="{{ baseUrl('/books') }}"><i class="zmdi zmdi-book"></i>{{ trans('entities.books') }}</a>
57 @if(isset($currentUser) && userCan('settings-manage')) 58 @if(isset($currentUser) && userCan('settings-manage'))
58 - <a href="{{ baseUrl('/settings') }}"><i class="zmdi zmdi-settings"></i>Settings</a> 59 + <a href="{{ baseUrl('/settings') }}"><i class="zmdi zmdi-settings"></i>{{ trans('settings.settings') }}</a>
59 @endif 60 @endif
60 @if(!isset($signedIn) || !$signedIn) 61 @if(!isset($signedIn) || !$signedIn)
61 - <a href="{{ baseUrl('/login') }}"><i class="zmdi zmdi-sign-in"></i>Sign In</a> 62 + <a href="{{ baseUrl('/login') }}"><i class="zmdi zmdi-sign-in"></i>{{ trans('auth.log_in') }}</a>
62 @endif 63 @endif
63 </div> 64 </div>
64 @if(isset($signedIn) && $signedIn) 65 @if(isset($signedIn) && $signedIn)
65 - <div class="dropdown-container" dropdown> 66 + @include('partials._header-dropdown', ['currentUser' => $currentUser])
66 - <span class="user-name" dropdown-toggle>
67 - <img class="avatar" src="{{$currentUser->getAvatar(30)}}" alt="{{ $currentUser->name }}">
68 - <span class="name" ng-non-bindable>{{ $currentUser->getShortName(9) }}</span> <i class="zmdi zmdi-caret-down"></i>
69 - </span>
70 - <ul>
71 - <li>
72 - <a href="{{ baseUrl("/user/{$currentUser->id}") }}" class="text-primary"><i class="zmdi zmdi-account zmdi-hc-fw zmdi-hc-lg"></i>View Profile</a>
73 - </li>
74 - <li>
75 - <a href="{{ baseUrl("/settings/users/{$currentUser->id}") }}" class="text-primary"><i class="zmdi zmdi-edit zmdi-hc-fw zmdi-hc-lg"></i>Edit Profile</a>
76 - </li>
77 - <li>
78 - <a href="{{ baseUrl('/logout') }}" class="text-neg"><i class="zmdi zmdi-run zmdi-hc-fw zmdi-hc-lg"></i>Logout</a>
79 - </li>
80 - </ul>
81 - </div>
82 @endif 67 @endif
83 68
84 </div> 69 </div>
...@@ -93,7 +78,7 @@ ...@@ -93,7 +78,7 @@
93 78
94 <div id="back-to-top"> 79 <div id="back-to-top">
95 <div class="inner"> 80 <div class="inner">
96 - <i class="zmdi zmdi-chevron-up"></i> <span>Back to top</span> 81 + <i class="zmdi zmdi-chevron-up"></i> <span>{{ trans('common.back_to_top') }}</span>
97 </div> 82 </div>
98 </div> 83 </div>
99 @yield('bottom') 84 @yield('bottom')
......
1 +<div class="breadcrumbs">
2 + <a href="{{$book->getUrl()}}" class="text-book text-button"><i class="zmdi zmdi-book"></i>{{ $book->getShortName() }}</a>
3 +</div>
...\ No newline at end of file ...\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
3 @section('content') 3 @section('content')
4 4
5 <div class="container small" ng-non-bindable> 5 <div class="container small" ng-non-bindable>
6 - <h1>Create New Book</h1> 6 + <h1>{{ trans('entities.books_create') }}</h1>
7 <form action="{{ baseUrl("/books") }}" method="POST"> 7 <form action="{{ baseUrl("/books") }}" method="POST">
8 @include('books/form') 8 @include('books/form')
9 </form> 9 </form>
......
...@@ -2,16 +2,26 @@ ...@@ -2,16 +2,26 @@
2 2
3 @section('content') 3 @section('content')
4 4
5 + <div class="faded-small toolbar">
6 + <div class="container">
7 + <div class="row">
8 + <div class="col-sm-12 faded">
9 + @include('books._breadcrumbs', ['book' => $book])
10 + </div>
11 + </div>
12 + </div>
13 + </div>
14 +
5 <div class="container small" ng-non-bindable> 15 <div class="container small" ng-non-bindable>
6 - <h1>Delete Book</h1> 16 + <h1>{{ trans('entities.books_delete') }}</h1>
7 - <p>This will delete the book with the name '{{$book->name}}', All pages and chapters will be removed.</p> 17 + <p>{{ trans('entities.books_delete_explain', ['bookName' => $book->name]) }}</p>
8 - <p class="text-neg">Are you sure you want to delete this book?</p> 18 + <p class="text-neg">{{ trans('entities.books_delete_confirmation') }}</p>
9 19
10 <form action="{{$book->getUrl()}}" method="POST"> 20 <form action="{{$book->getUrl()}}" method="POST">
11 {!! csrf_field() !!} 21 {!! csrf_field() !!}
12 <input type="hidden" name="_method" value="DELETE"> 22 <input type="hidden" name="_method" value="DELETE">
13 - <a href="{{$book->getUrl()}}" class="button">Cancel</a> 23 + <a href="{{$book->getUrl()}}" class="button">{{ trans('common.cancel') }}</a>
14 - <button type="submit" class="button neg">Confirm</button> 24 + <button type="submit" class="button neg">{{ trans('common.confirm') }}</button>
15 </form> 25 </form>
16 </div> 26 </div>
17 27
......
...@@ -2,8 +2,18 @@ ...@@ -2,8 +2,18 @@
2 2
3 @section('content') 3 @section('content')
4 4
5 + <div class="faded-small toolbar">
6 + <div class="container">
7 + <div class="row">
8 + <div class="col-sm-12 faded">
9 + @include('books._breadcrumbs', ['book' => $book])
10 + </div>
11 + </div>
12 + </div>
13 + </div>
14 +
5 <div class="container small" ng-non-bindable> 15 <div class="container small" ng-non-bindable>
6 - <h1>Edit Book</h1> 16 + <h1>{{ trans('entities.books_edit') }}</h1>
7 <form action="{{ $book->getUrl() }}" method="POST"> 17 <form action="{{ $book->getUrl() }}" method="POST">
8 <input type="hidden" name="_method" value="PUT"> 18 <input type="hidden" name="_method" value="PUT">
9 @include('books/form', ['model' => $book]) 19 @include('books/form', ['model' => $book])
......
1 1
2 {{ csrf_field() }} 2 {{ csrf_field() }}
3 <div class="form-group title-input"> 3 <div class="form-group title-input">
4 - <label for="name">Book Name</label> 4 + <label for="name">{{ trans('common.name') }}</label>
5 @include('form/text', ['name' => 'name']) 5 @include('form/text', ['name' => 'name'])
6 </div> 6 </div>
7 7
8 <div class="form-group description-input"> 8 <div class="form-group description-input">
9 - <label for="description">Description</label> 9 + <label for="description">{{ trans('common.description') }}</label>
10 @include('form/textarea', ['name' => 'description']) 10 @include('form/textarea', ['name' => 'description'])
11 </div> 11 </div>
12 12
13 <div class="form-group"> 13 <div class="form-group">
14 - <a href="{{ back()->getTargetUrl() }}" class="button muted">Cancel</a> 14 + <a href="{{ back()->getTargetUrl() }}" class="button muted">{{ trans('common.cancel') }}</a>
15 - <button type="submit" class="button pos">Save Book</button> 15 + <button type="submit" class="button pos">{{ trans('entities.books_save') }}</button>
16 </div> 16 </div>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
9 <div class="col-xs-11 faded"> 9 <div class="col-xs-11 faded">
10 <div class="action-buttons"> 10 <div class="action-buttons">
11 @if($currentUser->can('book-create-all')) 11 @if($currentUser->can('book-create-all'))
12 - <a href="{{ baseUrl("/books/create") }}" class="text-pos text-button"><i class="zmdi zmdi-plus"></i>Add new book</a> 12 + <a href="{{ baseUrl("/books/create") }}" class="text-pos text-button"><i class="zmdi zmdi-plus"></i>{{ trans('entities.books_create') }}</a>
13 @endif 13 @endif
14 </div> 14 </div>
15 </div> 15 </div>
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
21 <div class="container" ng-non-bindable> 21 <div class="container" ng-non-bindable>
22 <div class="row"> 22 <div class="row">
23 <div class="col-sm-7"> 23 <div class="col-sm-7">
24 - <h1>Books</h1> 24 + <h1>{{ trans('entities.books') }}</h1>
25 @if(count($books) > 0) 25 @if(count($books) > 0)
26 @foreach($books as $book) 26 @foreach($books as $book)
27 @include('books/list-item', ['book' => $book]) 27 @include('books/list-item', ['book' => $book])
...@@ -29,27 +29,27 @@ ...@@ -29,27 +29,27 @@
29 @endforeach 29 @endforeach
30 {!! $books->render() !!} 30 {!! $books->render() !!}
31 @else 31 @else
32 - <p class="text-muted">No books have been created.</p> 32 + <p class="text-muted">{{ trans('entities.books_empty') }}</p>
33 @if(userCan('books-create-all')) 33 @if(userCan('books-create-all'))
34 - <a href="{{ baseUrl("/books/create") }}" class="text-pos"><i class="zmdi zmdi-edit"></i>Create one now</a> 34 + <a href="{{ baseUrl("/books/create") }}" class="text-pos"><i class="zmdi zmdi-edit"></i>{{ trans('entities.create_one_now') }}</a>
35 @endif 35 @endif
36 @endif 36 @endif
37 </div> 37 </div>
38 <div class="col-sm-4 col-sm-offset-1"> 38 <div class="col-sm-4 col-sm-offset-1">
39 <div id="recents"> 39 <div id="recents">
40 @if($recents) 40 @if($recents)
41 - <div class="margin-top large">&nbsp;</div> 41 + <div class="margin-top">&nbsp;</div>
42 - <h3>Recently Viewed</h3> 42 + <h3>{{ trans('entities.recently_viewed') }}</h3>
43 @include('partials/entity-list', ['entities' => $recents]) 43 @include('partials/entity-list', ['entities' => $recents])
44 @endif 44 @endif
45 </div> 45 </div>
46 <div class="margin-top large">&nbsp;</div> 46 <div class="margin-top large">&nbsp;</div>
47 <div id="popular"> 47 <div id="popular">
48 - <h3>Popular Books</h3> 48 + <h3>{{ trans('entities.books_popular') }}</h3>
49 @if(count($popular) > 0) 49 @if(count($popular) > 0)
50 @include('partials/entity-list', ['entities' => $popular]) 50 @include('partials/entity-list', ['entities' => $popular])
51 @else 51 @else
52 - <p class="text-muted">The most popular books will appear here.</p> 52 + <p class="text-muted">{{ trans('entities.books_popular_empty') }}</p>
53 @endif 53 @endif
54 </div> 54 </div>
55 </div> 55 </div>
......
...@@ -6,9 +6,7 @@ ...@@ -6,9 +6,7 @@
6 <div class="container"> 6 <div class="container">
7 <div class="row"> 7 <div class="row">
8 <div class="col-sm-12 faded"> 8 <div class="col-sm-12 faded">
9 - <div class="breadcrumbs"> 9 + @include('books._breadcrumbs', ['book' => $book])
10 - <a href="{{$book->getUrl()}}" class="text-book text-button"><i class="zmdi zmdi-book"></i>{{ $book->getShortName() }}</a>
11 - </div>
12 </div> 10 </div>
13 </div> 11 </div>
14 </div> 12 </div>
...@@ -16,7 +14,7 @@ ...@@ -16,7 +14,7 @@
16 14
17 15
18 <div class="container" ng-non-bindable> 16 <div class="container" ng-non-bindable>
19 - <h1>Book Permissions</h1> 17 + <h1>{{ trans('entities.books_permissions') }}</h1>
20 @include('form/restriction-form', ['model' => $book]) 18 @include('form/restriction-form', ['model' => $book])
21 </div> 19 </div>
22 20
......
...@@ -5,29 +5,32 @@ ...@@ -5,29 +5,32 @@
5 <div class="faded-small toolbar"> 5 <div class="faded-small toolbar">
6 <div class="container"> 6 <div class="container">
7 <div class="row"> 7 <div class="row">
8 - <div class="col-md-12"> 8 + <div class="col-md-6 faded">
9 + @include('books._breadcrumbs', ['book' => $book])
10 + </div>
11 + <div class="col-md-6">
9 <div class="action-buttons faded"> 12 <div class="action-buttons faded">
10 @if(userCan('page-create', $book)) 13 @if(userCan('page-create', $book))
11 - <a href="{{ $book->getUrl('/page/create') }}" class="text-pos text-button"><i class="zmdi zmdi-plus"></i> New Page</a> 14 + <a href="{{ $book->getUrl('/page/create') }}" class="text-pos text-button"><i class="zmdi zmdi-plus"></i>{{ trans('entities.pages_new') }}</a>
12 @endif 15 @endif
13 @if(userCan('chapter-create', $book)) 16 @if(userCan('chapter-create', $book))
14 - <a href="{{ $book->getUrl('/chapter/create') }}" class="text-pos text-button"><i class="zmdi zmdi-plus"></i> New Chapter</a> 17 + <a href="{{ $book->getUrl('/chapter/create') }}" class="text-pos text-button"><i class="zmdi zmdi-plus"></i>{{ trans('entities.chapters_new') }}</a>
15 @endif 18 @endif
16 @if(userCan('book-update', $book)) 19 @if(userCan('book-update', $book))
17 - <a href="{{$book->getEditUrl()}}" class="text-primary text-button"><i class="zmdi zmdi-edit"></i>Edit</a> 20 + <a href="{{$book->getEditUrl()}}" class="text-primary text-button"><i class="zmdi zmdi-edit"></i>{{ trans('common.edit') }}</a>
18 @endif 21 @endif
19 @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))
20 <div dropdown class="dropdown-container"> 23 <div dropdown class="dropdown-container">
21 <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>
22 <ul> 25 <ul>
23 @if(userCan('book-update', $book)) 26 @if(userCan('book-update', $book))
24 - <li><a href="{{ $book->getUrl('/sort') }}" class="text-primary"><i class="zmdi zmdi-sort"></i>Sort</a></li> 27 + <li><a href="{{ $book->getUrl('/sort') }}" class="text-primary"><i class="zmdi zmdi-sort"></i>{{ trans('common.sort') }}</a></li>
25 @endif 28 @endif
26 @if(userCan('restrictions-manage', $book)) 29 @if(userCan('restrictions-manage', $book))
27 - <li><a href="{{ $book->getUrl('/permissions') }}" class="text-primary"><i class="zmdi zmdi-lock-outline"></i>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>
28 @endif 31 @endif
29 @if(userCan('book-delete', $book)) 32 @if(userCan('book-delete', $book))
30 - <li><a href="{{ $book->getUrl('/delete') }}" class="text-neg"><i class="zmdi zmdi-delete"></i>Delete</a></li> 33 + <li><a href="{{ $book->getUrl('/delete') }}" class="text-neg"><i class="zmdi zmdi-delete"></i>{{ trans('common.delete') }}</a></li>
31 @endif 34 @endif
32 </ul> 35 </ul>
33 </div> 36 </div>
...@@ -59,23 +62,19 @@ ...@@ -59,23 +62,19 @@
59 <hr> 62 <hr>
60 @endforeach 63 @endforeach
61 @else 64 @else
62 - <p class="text-muted">No pages or chapters have been created for this book.</p> 65 + <p class="text-muted">{{ trans('entities.books_empty_contents') }}</p>
63 <p> 66 <p>
64 - <a href="{{ $book->getUrl('/page/create') }}" class="text-page"><i class="zmdi zmdi-file-text"></i>Create a new page</a> 67 + <a href="{{ $book->getUrl('/page/create') }}" class="text-page"><i class="zmdi zmdi-file-text"></i>{{ trans('entities.books_empty_create_page') }}</a>
65 - &nbsp;&nbsp;<em class="text-muted">-or-</em>&nbsp;&nbsp;&nbsp; 68 + &nbsp;&nbsp;<em class="text-muted">-{{ trans('entities.books_empty_or') }}-</em>&nbsp;&nbsp;&nbsp;
66 - <a href="{{ $book->getUrl('/chapter/create') }}" class="text-chapter"><i class="zmdi zmdi-collection-bookmark"></i>Add a chapter</a> 69 + <a href="{{ $book->getUrl('/chapter/create') }}" class="text-chapter"><i class="zmdi zmdi-collection-bookmark"></i>{{ trans('entities.books_empty_add_chapter') }}</a>
67 </p> 70 </p>
68 <hr> 71 <hr>
69 @endif 72 @endif
70 - <p class="text-muted small"> 73 + @include('partials.entity-meta', ['entity' => $book])
71 - Created {{$book->created_at->diffForHumans()}} @if($book->createdBy) by <a href="{{ $book->createdBy->getProfileUrl() }}">{{$book->createdBy->name}}</a> @endif
72 - <br>
73 - Last Updated {{$book->updated_at->diffForHumans()}} @if($book->updatedBy) by <a href="{{ $book->updatedBy->getProfileUrl() }}">{{$book->updatedBy->name}}</a> @endif
74 - </p>
75 </div> 74 </div>
76 </div> 75 </div>
77 <div class="search-results" ng-cloak ng-show="searching"> 76 <div class="search-results" ng-cloak ng-show="searching">
78 - <h3 class="text-muted">Search Results <a ng-if="searching" ng-click="clearSearch()" class="text-small"><i class="zmdi zmdi-close"></i>Clear Search</a></h3> 77 + <h3 class="text-muted">{{ trans('entities.search_results') }} <a ng-if="searching" ng-click="clearSearch()" class="text-small"><i class="zmdi zmdi-close"></i>{{ trans('entities.search_clear') }}</a></h3>
79 <div ng-if="!searchResults"> 78 <div ng-if="!searchResults">
80 @include('partials/loading-icon') 79 @include('partials/loading-icon')
81 </div> 80 </div>
...@@ -90,21 +89,21 @@ ...@@ -90,21 +89,21 @@
90 @if($book->restricted) 89 @if($book->restricted)
91 <p class="text-muted"> 90 <p class="text-muted">
92 @if(userCan('restrictions-manage', $book)) 91 @if(userCan('restrictions-manage', $book))
93 - <a href="{{ $book->getUrl('/permissions') }}"><i class="zmdi zmdi-lock-outline"></i>Book Permissions Active</a> 92 + <a href="{{ $book->getUrl('/permissions') }}"><i class="zmdi zmdi-lock-outline"></i>{{ trans('entities.books_permissions_active') }}</a>
94 @else 93 @else
95 - <i class="zmdi zmdi-lock-outline"></i>Book Permissions Active 94 + <i class="zmdi zmdi-lock-outline"></i>{{ trans('entities.books_permissions_active') }}
96 @endif 95 @endif
97 </p> 96 </p>
98 @endif 97 @endif
99 <div class="search-box"> 98 <div class="search-box">
100 <form ng-submit="searchBook($event)"> 99 <form ng-submit="searchBook($event)">
101 - <input ng-model="searchTerm" ng-change="checkSearchForm()" type="text" name="term" placeholder="Search This Book"> 100 + <input ng-model="searchTerm" ng-change="checkSearchForm()" type="text" name="term" placeholder="{{ trans('entities.books_search_this') }}">
102 <button type="submit"><i class="zmdi zmdi-search"></i></button> 101 <button type="submit"><i class="zmdi zmdi-search"></i></button>
103 <button ng-if="searching" ng-click="clearSearch()" type="button"><i class="zmdi zmdi-close"></i></button> 102 <button ng-if="searching" ng-click="clearSearch()" type="button"><i class="zmdi zmdi-close"></i></button>
104 </form> 103 </form>
105 </div> 104 </div>
106 <div class="activity anim fadeIn"> 105 <div class="activity anim fadeIn">
107 - <h3>Recent Activity</h3> 106 + <h3>{{ trans('entities.recent_activity') }}</h3>
108 @include('partials/activity-list', ['activity' => Activity::entityActivity($book, 20, 0)]) 107 @include('partials/activity-list', ['activity' => Activity::entityActivity($book, 20, 0)])
109 </div> 108 </div>
110 </div> 109 </div>
......
...@@ -6,8 +6,18 @@ ...@@ -6,8 +6,18 @@
6 6
7 @section('content') 7 @section('content')
8 8
9 + <div class="faded-small toolbar">
10 + <div class="container">
11 + <div class="row">
12 + <div class="col-sm-12 faded">
13 + @include('books._breadcrumbs', ['book' => $book])
14 + </div>
15 + </div>
16 + </div>
17 + </div>
18 +
9 <div class="container" ng-non-bindable> 19 <div class="container" ng-non-bindable>
10 - <h1>Sorting Pages & Chapters<span class="subheader">For {{ $book->name }}</span></h1> 20 + <h1>{{ trans('entities.books_sort') }}</h1>
11 <div class="row"> 21 <div class="row">
12 <div class="col-md-8" id="sort-boxes"> 22 <div class="col-md-8" id="sort-boxes">
13 23
...@@ -17,7 +27,7 @@ ...@@ -17,7 +27,7 @@
17 27
18 @if(count($books) > 1) 28 @if(count($books) > 1)
19 <div class="col-md-4"> 29 <div class="col-md-4">
20 - <h3>Show Other Books</h3> 30 + <h3>{{ trans('entities.books_sort_show_other') }}</h3>
21 <div id="additional-books"> 31 <div id="additional-books">
22 @foreach($books as $otherBook) 32 @foreach($books as $otherBook)
23 @if($otherBook->id !== $book->id) 33 @if($otherBook->id !== $book->id)
...@@ -37,8 +47,8 @@ ...@@ -37,8 +47,8 @@
37 <input type="hidden" name="_method" value="PUT"> 47 <input type="hidden" name="_method" value="PUT">
38 <input type="hidden" id="sort-tree-input" name="sort-tree"> 48 <input type="hidden" id="sort-tree-input" name="sort-tree">
39 <div class="list"> 49 <div class="list">
40 - <a href="{{ $book->getUrl() }}" class="button muted">Cancel</a> 50 + <a href="{{ $book->getUrl() }}" class="button muted">{{ trans('common.cancel') }}</a>
41 - <button class="button pos" type="submit">Save Order</button> 51 + <button class="button pos" type="submit">{{ trans('entities.books_sort_save') }}</button>
42 </div> 52 </div>
43 </form> 53 </form>
44 54
......
1 +<div class="breadcrumbs">
2 + <a href="{{ $chapter->book->getUrl() }}" class="text-book text-button"><i class="zmdi zmdi-book"></i>{{ $chapter->book->getShortName() }}</a>
3 + <span class="sep">&raquo;</span>
4 + <a href="{{ $chapter->getUrl() }}" class="text-chapter text-button"><i class="zmdi zmdi-collection-bookmark"></i>{{$chapter->getShortName()}}</a>
5 +</div>
...\ No newline at end of file ...\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
3 @section('content') 3 @section('content')
4 4
5 <div class="container small" ng-non-bindable> 5 <div class="container small" ng-non-bindable>
6 - <h1>Create New Chapter</h1> 6 + <h1>{{ trans('entities.chapters_create') }}</h1>
7 <form action="{{ $book->getUrl('/chapter/create') }}" method="POST"> 7 <form action="{{ $book->getUrl('/chapter/create') }}" method="POST">
8 @include('chapters/form') 8 @include('chapters/form')
9 </form> 9 </form>
......
...@@ -2,17 +2,26 @@ ...@@ -2,17 +2,26 @@
2 2
3 @section('content') 3 @section('content')
4 4
5 + <div class="faded-small toolbar">
6 + <div class="container">
7 + <div class="row">
8 + <div class="col-sm-12 faded">
9 + @include('chapters._breadcrumbs', ['chapter' => $chapter])
10 + </div>
11 + </div>
12 + </div>
13 + </div>
14 +
5 <div class="container small" ng-non-bindable> 15 <div class="container small" ng-non-bindable>
6 - <h1>Delete Chapter</h1> 16 + <h1>{{ trans('entities.chapters_delete') }}</h1>
7 - <p>This will delete the chapter with the name '{{$chapter->name}}', All pages will be removed 17 + <p>{{ trans('entities.chapters_delete_explain', ['chapterName' => $chapter->name]) }}</p>
8 - and added directly to the book.</p> 18 + <p class="text-neg">{{ trans('entities.chapters_delete_confirm') }}</p>
9 - <p class="text-neg">Are you sure you want to delete this chapter?</p>
10 19
11 <form action="{{ $chapter->getUrl() }}" method="POST"> 20 <form action="{{ $chapter->getUrl() }}" method="POST">
12 {!! csrf_field() !!} 21 {!! csrf_field() !!}
13 <input type="hidden" name="_method" value="DELETE"> 22 <input type="hidden" name="_method" value="DELETE">
14 - <a href="{{ $chapter->getUrl() }}" class="button primary">Cancel</a> 23 + <a href="{{ $chapter->getUrl() }}" class="button primary">{{ trans('common.cancel') }}</a>
15 - <button type="submit" class="button neg">Confirm</button> 24 + <button type="submit" class="button neg">{{ trans('common.confirm') }}</button>
16 </form> 25 </form>
17 </div> 26 </div>
18 27
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
3 @section('content') 3 @section('content')
4 4
5 <div class="container small" ng-non-bindable> 5 <div class="container small" ng-non-bindable>
6 - <h1>Edit Chapter</h1> 6 + <h1>{{ trans('entities.chapters_edit') }}</h1>
7 <form action="{{ $chapter->getUrl() }}" method="POST"> 7 <form action="{{ $chapter->getUrl() }}" method="POST">
8 <input type="hidden" name="_method" value="PUT"> 8 <input type="hidden" name="_method" value="PUT">
9 @include('chapters/form', ['model' => $chapter]) 9 @include('chapters/form', ['model' => $chapter])
......
...@@ -2,16 +2,16 @@ ...@@ -2,16 +2,16 @@
2 {!! csrf_field() !!} 2 {!! csrf_field() !!}
3 3
4 <div class="form-group title-input"> 4 <div class="form-group title-input">
5 - <label for="name">Chapter Name</label> 5 + <label for="name">{{ trans('common.name') }}</label>
6 @include('form/text', ['name' => 'name']) 6 @include('form/text', ['name' => 'name'])
7 </div> 7 </div>
8 8
9 <div class="form-group description-input"> 9 <div class="form-group description-input">
10 - <label for="description">Description</label> 10 + <label for="description">{{ trans('common.description') }}</label>
11 @include('form/textarea', ['name' => 'description']) 11 @include('form/textarea', ['name' => 'description'])
12 </div> 12 </div>
13 13
14 <div class="form-group"> 14 <div class="form-group">
15 - <a href="{{ back()->getTargetUrl() }}" class="button muted">Cancel</a> 15 + <a href="{{ back()->getTargetUrl() }}" class="button muted">{{ trans('common.cancel') }}</a>
16 - <button type="submit" class="button pos">Save Chapter</button> 16 + <button type="submit" class="button pos">{{ trans('entities.chapters_save') }}</button>
17 </div> 17 </div>
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
17 @endif 17 @endif
18 18
19 @if(!isset($hidePages) && count($chapter->pages) > 0) 19 @if(!isset($hidePages) && count($chapter->pages) > 0)
20 - <p class="text-muted chapter-toggle"><i class="zmdi zmdi-caret-right"></i> <i class="zmdi zmdi-file-text"></i> <span>{{ count($chapter->pages) }} Pages</span></p> 20 + <p class="text-muted chapter-toggle"><i class="zmdi zmdi-caret-right"></i> <i class="zmdi zmdi-file-text"></i> <span>{{ trans('entities.x_pages', ['count' => $chapter->pages->count()]) }}</span></p>
21 <div class="inset-list"> 21 <div class="inset-list">
22 @foreach($chapter->pages as $page) 22 @foreach($chapter->pages as $page)
23 <h5 class="@if($page->draft) draft @endif"><a href="{{ $page->getUrl() }}" class="text-page @if($page->draft) draft @endif"><i class="zmdi zmdi-file-text"></i>{{$page->name}}</a></h5> 23 <h5 class="@if($page->draft) draft @endif"><a href="{{ $page->getUrl() }}" class="text-page @if($page->draft) draft @endif"><i class="zmdi zmdi-file-text"></i>{{$page->name}}</a></h5>
......
...@@ -6,27 +6,23 @@ ...@@ -6,27 +6,23 @@
6 <div class="container"> 6 <div class="container">
7 <div class="row"> 7 <div class="row">
8 <div class="col-sm-12 faded"> 8 <div class="col-sm-12 faded">
9 - <div class="breadcrumbs"> 9 + @include('chapters._breadcrumbs', ['chapter' => $chapter])
10 - <a href="{{ $book->getUrl() }}" class="text-book text-button"><i class="zmdi zmdi-book"></i>{{ $book->getShortName() }}</a>
11 - <span class="sep">&raquo;</span>
12 - <a href="{{ $chapter->getUrl() }}" class="text-chapter text-button"><i class="zmdi zmdi-collection-bookmark"></i>{{ $chapter->getShortName() }}</a>
13 - </div>
14 </div> 10 </div>
15 </div> 11 </div>
16 </div> 12 </div>
17 </div> 13 </div>
18 14
19 <div class="container"> 15 <div class="container">
20 - <h1>Move Chapter <small class="subheader">{{$chapter->name}}</small></h1> 16 + <h1>{{ trans('entities.chapters_move') }}</h1>
21 17
22 <form action="{{ $chapter->getUrl('/move') }}" method="POST"> 18 <form action="{{ $chapter->getUrl('/move') }}" method="POST">
23 {!! csrf_field() !!} 19 {!! csrf_field() !!}
24 <input type="hidden" name="_method" value="PUT"> 20 <input type="hidden" name="_method" value="PUT">
25 21
26 - @include('partials/entity-selector', ['name' => 'entity_selection', 'selectorSize' => 'large', 'entityTypes' => 'book']) 22 + @include('components.entity-selector', ['name' => 'entity_selection', 'selectorSize' => 'large', 'entityTypes' => 'book'])
27 23
28 - <a href="{{ $chapter->getUrl() }}" class="button muted">Cancel</a> 24 + <a href="{{ $chapter->getUrl() }}" class="button muted">{{ trans('common.cancel') }}</a>
29 - <button type="submit" class="button pos">Move Chapter</button> 25 + <button type="submit" class="button pos">{{ trans('entities.chapters_move') }}</button>
30 </form> 26 </form>
31 </div> 27 </div>
32 28
......
...@@ -6,18 +6,14 @@ ...@@ -6,18 +6,14 @@
6 <div class="container"> 6 <div class="container">
7 <div class="row"> 7 <div class="row">
8 <div class="col-sm-12 faded"> 8 <div class="col-sm-12 faded">
9 - <div class="breadcrumbs"> 9 + @include('chapters._breadcrumbs', ['chapter' => $chapter])
10 - <a href="{{ $chapter->book->getUrl() }}" class="text-book text-button"><i class="zmdi zmdi-book"></i>{{ $chapter->book->getShortName() }}</a>
11 - <span class="sep">&raquo;</span>
12 - <a href="{{ $chapter->getUrl() }}" class="text-chapter text-button"><i class="zmdi zmdi-collection-bookmark"></i>{{$chapter->getShortName()}}</a>
13 - </div>
14 </div> 10 </div>
15 </div> 11 </div>
16 </div> 12 </div>
17 </div> 13 </div>
18 14
19 <div class="container" ng-non-bindable> 15 <div class="container" ng-non-bindable>
20 - <h1>Chapter Permissions</h1> 16 + <h1>{{ trans('entities.chapters_permissions') }}</h1>
21 @include('form/restriction-form', ['model' => $chapter]) 17 @include('form/restriction-form', ['model' => $chapter])
22 </div> 18 </div>
23 19
......
...@@ -6,30 +6,28 @@ ...@@ -6,30 +6,28 @@
6 <div class="container"> 6 <div class="container">
7 <div class="row"> 7 <div class="row">
8 <div class="col-sm-8 faded" ng-non-bindable> 8 <div class="col-sm-8 faded" ng-non-bindable>
9 - <div class="breadcrumbs"> 9 + @include('chapters._breadcrumbs', ['chapter' => $chapter])
10 - <a href="{{ $book->getUrl() }}" class="text-book text-button"><i class="zmdi zmdi-book"></i>{{ $book->getShortName() }}</a>
11 - </div>
12 </div> 10 </div>
13 <div class="col-sm-4 faded"> 11 <div class="col-sm-4 faded">
14 <div class="action-buttons"> 12 <div class="action-buttons">
15 @if(userCan('page-create', $chapter)) 13 @if(userCan('page-create', $chapter))
16 - <a href="{{ $chapter->getUrl('/create-page') }}" class="text-pos text-button"><i class="zmdi zmdi-plus"></i>New Page</a> 14 + <a href="{{ $chapter->getUrl('/create-page') }}" class="text-pos text-button"><i class="zmdi zmdi-plus"></i>{{ trans('entities.pages_new') }}</a>
17 @endif 15 @endif
18 @if(userCan('chapter-update', $chapter)) 16 @if(userCan('chapter-update', $chapter))
19 - <a href="{{ $chapter->getUrl('/edit') }}" class="text-primary text-button"><i class="zmdi zmdi-edit"></i>Edit</a> 17 + <a href="{{ $chapter->getUrl('/edit') }}" class="text-primary text-button"><i class="zmdi zmdi-edit"></i>{{ trans('common.edit') }}</a>
20 @endif 18 @endif
21 @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))
22 <div dropdown class="dropdown-container"> 20 <div dropdown class="dropdown-container">
23 <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>
24 <ul> 22 <ul>
25 @if(userCan('chapter-update', $chapter)) 23 @if(userCan('chapter-update', $chapter))
26 - <li><a href="{{ $chapter->getUrl('/move') }}" class="text-primary"><i class="zmdi zmdi-folder"></i>Move</a></li> 24 + <li><a href="{{ $chapter->getUrl('/move') }}" class="text-primary"><i class="zmdi zmdi-folder"></i>{{ trans('common.move') }}</a></li>
27 @endif 25 @endif
28 @if(userCan('restrictions-manage', $chapter)) 26 @if(userCan('restrictions-manage', $chapter))
29 - <li><a href="{{ $chapter->getUrl('/permissions') }}" class="text-primary"><i class="zmdi zmdi-lock-outline"></i>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>
30 @endif 28 @endif
31 @if(userCan('chapter-delete', $chapter)) 29 @if(userCan('chapter-delete', $chapter))
32 - <li><a href="{{ $chapter->getUrl('/delete') }}" class="text-neg"><i class="zmdi zmdi-delete"></i>Delete</a></li> 30 + <li><a href="{{ $chapter->getUrl('/delete') }}" class="text-neg"><i class="zmdi zmdi-delete"></i>{{ trans('common.delete') }}</a></li>
33 @endif 31 @endif
34 </ul> 32 </ul>
35 </div> 33 </div>
...@@ -57,26 +55,22 @@ ...@@ -57,26 +55,22 @@
57 </div> 55 </div>
58 @else 56 @else
59 <hr> 57 <hr>
60 - <p class="text-muted">No pages are currently in this chapter.</p> 58 + <p class="text-muted">{{ trans('entities.chapters_empty') }}</p>
61 <p> 59 <p>
62 @if(userCan('page-create', $chapter)) 60 @if(userCan('page-create', $chapter))
63 - <a href="{{ $chapter->getUrl('/create-page') }}" class="text-page"><i class="zmdi zmdi-file-text"></i>Create a new page</a> 61 + <a href="{{ $chapter->getUrl('/create-page') }}" class="text-page"><i class="zmdi zmdi-file-text"></i>{{ trans('entities.books_empty_create_page') }}</a>
64 @endif 62 @endif
65 @if(userCan('page-create', $chapter) && userCan('book-update', $book)) 63 @if(userCan('page-create', $chapter) && userCan('book-update', $book))
66 - &nbsp;&nbsp;<em class="text-muted">-or-</em>&nbsp;&nbsp;&nbsp; 64 + &nbsp;&nbsp;<em class="text-muted">-{{ trans('entities.books_empty_or') }}-</em>&nbsp;&nbsp;&nbsp;
67 @endif 65 @endif
68 @if(userCan('book-update', $book)) 66 @if(userCan('book-update', $book))
69 - <a href="{{ $book->getUrl('/sort') }}" class="text-book"><i class="zmdi zmdi-book"></i>Sort the current book</a> 67 + <a href="{{ $book->getUrl('/sort') }}" class="text-book"><i class="zmdi zmdi-book"></i>{{ trans('entities.books_empty_sort_current_book') }}</a>
70 @endif 68 @endif
71 </p> 69 </p>
72 <hr> 70 <hr>
73 @endif 71 @endif
74 72
75 - <p class="text-muted small"> 73 + @include('partials.entity-meta', ['entity' => $chapter])
76 - Created {{ $chapter->created_at->diffForHumans() }} @if($chapter->createdBy) by <a href="{{ $chapter->createdBy->getProfileUrl() }}">{{ $chapter->createdBy->name}}</a> @endif
77 - <br>
78 - Last Updated {{ $chapter->updated_at->diffForHumans() }} @if($chapter->updatedBy) by <a href="{{ $chapter->updatedBy->getProfileUrl() }}">{{ $chapter->updatedBy->name}}</a> @endif
79 - </p>
80 </div> 74 </div>
81 <div class="col-md-3 col-md-offset-1"> 75 <div class="col-md-3 col-md-offset-1">
82 <div class="margin-top large"></div> 76 <div class="margin-top large"></div>
...@@ -84,19 +78,20 @@ ...@@ -84,19 +78,20 @@
84 <div class="text-muted"> 78 <div class="text-muted">
85 79
86 @if($book->restricted) 80 @if($book->restricted)
87 - @if(userCan('restrictions-manage', $book)) 81 + <p class="text-muted">
88 - <a href="{{ $book->getUrl('/permissions') }}"><i class="zmdi zmdi-lock-outline"></i>Book Permissions Active</a> 82 + @if(userCan('restrictions-manage', $book))
89 - @else 83 + <a href="{{ $book->getUrl('/permissions') }}"><i class="zmdi zmdi-lock-outline"></i>{{ trans('entities.books_permissions_active') }}</a>
90 - <i class="zmdi zmdi-lock-outline"></i>Book Permissions Active 84 + @else
91 - @endif 85 + <i class="zmdi zmdi-lock-outline"></i>{{ trans('entities.books_permissions_active') }}
92 - <br> 86 + @endif
87 + </p>
93 @endif 88 @endif
94 89
95 @if($chapter->restricted) 90 @if($chapter->restricted)
96 @if(userCan('restrictions-manage', $chapter)) 91 @if(userCan('restrictions-manage', $chapter))
97 - <a href="{{ $chapter->getUrl('/permissions') }}"><i class="zmdi zmdi-lock-outline"></i>Chapter Permissions Active</a> 92 + <a href="{{ $chapter->getUrl('/permissions') }}"><i class="zmdi zmdi-lock-outline"></i>{{ trans('entities.chapters_permissions_active') }}</a>
98 @else 93 @else
99 - <i class="zmdi zmdi-lock-outline"></i>Chapter Permissions Active 94 + <i class="zmdi zmdi-lock-outline"></i>{{ trans('entities.chapters_permissions_active') }}
100 @endif 95 @endif
101 @endif 96 @endif
102 </div> 97 </div>
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
2 <div class="overlay" entity-link-selector> 2 <div class="overlay" entity-link-selector>
3 <div class="popup-body small flex-child"> 3 <div class="popup-body small flex-child">
4 <div class="popup-header primary-background"> 4 <div class="popup-header primary-background">
5 - <div class="popup-title">Entity Select</div> 5 + <div class="popup-title">{{ trans('entities.entity_select') }}</div>
6 <button type="button" class="corner-button neg button popup-close">x</button> 6 <button type="button" class="corner-button neg button popup-close">x</button>
7 </div> 7 </div>
8 - @include('partials/entity-selector', ['name' => 'entity-selector']) 8 + @include('components.entity-selector', ['name' => 'entity-selector'])
9 <div class="popup-footer"> 9 <div class="popup-footer">
10 - <button type="button" disabled="true" class="button entity-link-selector-confirm pos corner-button">Select</button> 10 + <button type="button" disabled="true" class="button entity-link-selector-confirm pos corner-button">{{ trans('common.select') }}</button>
11 </div> 11 </div>
12 </div> 12 </div>
13 </div> 13 </div>
......
1 <div class="form-group"> 1 <div class="form-group">
2 <div entity-selector class="entity-selector {{$selectorSize or ''}}" entity-types="{{ $entityTypes or 'book,chapter,page' }}"> 2 <div entity-selector class="entity-selector {{$selectorSize or ''}}" entity-types="{{ $entityTypes or 'book,chapter,page' }}">
3 <input type="hidden" entity-selector-input name="{{$name}}" value=""> 3 <input type="hidden" entity-selector-input name="{{$name}}" value="">
4 - <input type="text" placeholder="Search" ng-model="search" ng-model-options="{debounce: 200}" ng-change="searchEntities()"> 4 + <input type="text" placeholder="{{ trans('common.search') }}" ng-model="search" ng-model-options="{debounce: 200}" ng-change="searchEntities()">
5 - <div class="text-center loading" ng-show="loading">@include('partials/loading-icon')</div> 5 + <div class="text-center loading" ng-show="loading">@include('partials.loading-icon')</div>
6 <div ng-show="!loading" ng-bind-html="entityResults"></div> 6 <div ng-show="!loading" ng-bind-html="entityResults"></div>
7 </div> 7 </div>
8 </div> 8 </div>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
3 <div class="popup-body" ng-click="$event.stopPropagation()"> 3 <div class="popup-body" ng-click="$event.stopPropagation()">
4 4
5 <div class="popup-header primary-background"> 5 <div class="popup-header primary-background">
6 - <div class="popup-title">Image Select</div> 6 + <div class="popup-title">{{ trans('components.image_select') }}</div>
7 <button class="popup-close neg corner-button button">x</button> 7 <button class="popup-close neg corner-button button">x</button>
8 </div> 8 </div>
9 9
...@@ -12,16 +12,16 @@ ...@@ -12,16 +12,16 @@
12 <div class="image-manager-content"> 12 <div class="image-manager-content">
13 <div ng-if="imageType === 'gallery'" class="container"> 13 <div ng-if="imageType === 'gallery'" class="container">
14 <div class="image-manager-header row faded-small nav-tabs"> 14 <div class="image-manager-header row faded-small nav-tabs">
15 - <div class="col-xs-4 tab-item" title="View all images" ng-class="{selected: (view=='all')}" ng-click="setView('all')"><i class="zmdi zmdi-collection-image"></i> All</div> 15 + <div class="col-xs-4 tab-item" title="{{ trans('components.image_all_title') }}" ng-class="{selected: (view=='all')}" ng-click="setView('all')"><i class="zmdi zmdi-collection-image"></i> {{ trans('components.image_all') }}</div>
16 - <div class="col-xs-4 tab-item" title="View images uploaded to this book" ng-class="{selected: (view=='book')}" ng-click="setView('book')"><i class="zmdi zmdi-book text-book"></i> Book</div> 16 + <div class="col-xs-4 tab-item" title="{{ trans('components.image_book_title') }}" ng-class="{selected: (view=='book')}" ng-click="setView('book')"><i class="zmdi zmdi-book text-book"></i> {{ trans('entities.book') }}</div>
17 - <div class="col-xs-4 tab-item" title="View images uploaded to this page" ng-class="{selected: (view=='page')}" ng-click="setView('page')"><i class="zmdi zmdi-file-text text-page"></i> Page</div> 17 + <div class="col-xs-4 tab-item" title="{{ trans('components.image_page_title') }}" ng-class="{selected: (view=='page')}" ng-click="setView('page')"><i class="zmdi zmdi-file-text text-page"></i> {{ trans('entities.page') }}</div>
18 </div> 18 </div>
19 </div> 19 </div>
20 <div ng-show="view === 'all'" > 20 <div ng-show="view === 'all'" >
21 <form ng-submit="searchImages()" class="contained-search-box"> 21 <form ng-submit="searchImages()" class="contained-search-box">
22 - <input type="text" placeholder="Search by image name" ng-model="searchTerm"> 22 + <input type="text" placeholder="{{ trans('components.image_search_hint') }}" ng-model="searchTerm">
23 - <button ng-class="{active: searching}" title="Clear Search" type="button" ng-click="cancelSearch()" class="text-button cancel"><i class="zmdi zmdi-close-circle-o"></i></button> 23 + <button ng-class="{active: searching}" title="{{ trans('common.search_clear') }}" type="button" ng-click="cancelSearch()" class="text-button cancel"><i class="zmdi zmdi-close-circle-o"></i></button>
24 - <button title="Search" class="text-button" type="submit"><i class="zmdi zmdi-search"></i></button> 24 + <button title="{{ trans('common.search') }}" class="text-button" type="submit"><i class="zmdi zmdi-search"></i></button>
25 </form> 25 </form>
26 </div> 26 </div>
27 <div class="image-manager-list"> 27 <div class="image-manager-list">
...@@ -31,11 +31,11 @@ ...@@ -31,11 +31,11 @@
31 <img ng-src="@{{image.thumbs.gallery}}" ng-attr-alt="@{{image.title}}" ng-attr-title="@{{image.name}}"> 31 <img ng-src="@{{image.thumbs.gallery}}" ng-attr-alt="@{{image.title}}" ng-attr-title="@{{image.name}}">
32 <div class="image-meta"> 32 <div class="image-meta">
33 <span class="name" ng-bind="image.name"></span> 33 <span class="name" ng-bind="image.name"></span>
34 - <span class="date">Uploaded @{{ getDate(image.created_at) }}</span> 34 + <span class="date">{{ trans('components.image_uploaded', ['uploadedDate' => "{{ getDate(image.created_at) }" . "}"]) }}</span>
35 </div> 35 </div>
36 </div> 36 </div>
37 </div> 37 </div>
38 - <div class="load-more" ng-show="hasMore" ng-click="fetchData()">Load More</div> 38 + <div class="load-more" ng-show="hasMore" ng-click="fetchData()">{{ trans('components.image_load_more') }}</div>
39 </div> 39 </div>
40 </div> 40 </div>
41 41
...@@ -51,15 +51,14 @@ ...@@ -51,15 +51,14 @@
51 </a> 51 </a>
52 </div> 52 </div>
53 <div class="form-group"> 53 <div class="form-group">
54 - <label for="name">Image Name</label> 54 + <label for="name">{{ trans('components.image_image_name') }}</label>
55 <input type="text" id="name" name="name" ng-model="selectedImage.name"> 55 <input type="text" id="name" name="name" ng-model="selectedImage.name">
56 </div> 56 </div>
57 </form> 57 </form>
58 58
59 <div ng-show="dependantPages"> 59 <div ng-show="dependantPages">
60 <p class="text-neg text-small"> 60 <p class="text-neg text-small">
61 - This image is used in the pages below, Click delete again to confirm you want to delete 61 + {{ trans('components.image_delete_confirm') }}
62 - this image.
63 </p> 62 </p>
64 <ul class="text-neg"> 63 <ul class="text-neg">
65 <li ng-repeat="page in dependantPages"> 64 <li ng-repeat="page in dependantPages">
...@@ -73,13 +72,13 @@ ...@@ -73,13 +72,13 @@
73 <button class="button icon neg"><i class="zmdi zmdi-delete"></i></button> 72 <button class="button icon neg"><i class="zmdi zmdi-delete"></i></button>
74 </form> 73 </form>
75 <button class="button pos anim fadeIn float right" ng-show="selectedImage" ng-click="selectButtonClick()"> 74 <button class="button pos anim fadeIn float right" ng-show="selectedImage" ng-click="selectButtonClick()">
76 - <i class="zmdi zmdi-square-right"></i>Select Image 75 + <i class="zmdi zmdi-square-right"></i>{{ trans('components.image_select_image') }}
77 </button> 76 </button>
78 </div> 77 </div>
79 78
80 </div> 79 </div>
81 80
82 - <drop-zone upload-url="@{{getUploadUrl()}}" uploaded-to="@{{uploadedTo}}" event-success="uploadSuccess"></drop-zone> 81 + <drop-zone message="{{ trans('components.image_dropzone') }}" upload-url="@{{getUploadUrl()}}" uploaded-to="@{{uploadedTo}}" event-success="uploadSuccess"></drop-zone>
83 82
84 83
85 </div> 84 </div>
......
1 +<div class="image-picker" image-picker="{{$name}}" data-default-image="{{ $defaultImage }}" data-resize-height="{{ $resizeHeight }}" data-resize-width="{{ $resizeWidth }}" data-current-id="{{ $currentId or '' }}" data-resize-crop="{{ $resizeCrop or '' }}">
2 +
3 + <div>
4 + <img @if($currentImage && $currentImage !== 'none') src="{{$currentImage}}" @else src="{{$defaultImage}}" @endif class="{{$imageClass}} @if($currentImage=== 'none') none @endif" alt="{{ trans('components.image_preview') }}">
5 + </div>
6 +
7 + <button class="button" type="button" data-action="show-image-manager">{{ trans('components.image_select_image') }}</button>
8 + <br>
9 + <button class="text-button" data-action="reset-image" type="button">{{ trans('common.reset') }}</button>
10 +
11 + @if ($showRemove)
12 + <span class="sep">|</span>
13 + <button class="text-button neg" data-action="remove-image" type="button">{{ trans('common.remove') }}</button>
14 + @endif
15 +
16 + <input type="hidden" name="{{$name}}" id="{{$name}}" value="{{ isset($currentId) && ($currentId !== '' && $currentId !== false) ? $currentId : $currentImage}}">
17 +</div>
18 +
19 +<script>
20 + (function(){
21 +
22 + var picker = document.querySelector('[image-picker="{{$name}}"]');
23 + picker.addEventListener('click', function(event) {
24 + if (event.target.nodeName.toLowerCase() !== 'button') return;
25 + var button = event.target;
26 + var action = button.getAttribute('data-action');
27 + var resize = picker.getAttribute('data-resize-height') && picker.getAttribute('data-resize-width');
28 + var usingIds = picker.getAttribute('data-current-id') !== '';
29 + var resizeCrop = picker.getAttribute('data-resize-crop') !== '';
30 + var imageElem = picker.querySelector('img');
31 + var input = picker.querySelector('input');
32 +
33 + function setImage(image) {
34 + if (image === 'none') {
35 + imageElem.src = picker.getAttribute('data-default-image');
36 + imageElem.classList.add('none');
37 + input.value = 'none';
38 + return;
39 + }
40 + imageElem.src = image.url;
41 + input.value = usingIds ? image.id : image.url;
42 + imageElem.classList.remove('none');
43 + }
44 +
45 + if (action === 'show-image-manager') {
46 + window.ImageManager.showExternal((image) => {
47 + if (!resize) {
48 + setImage(image);
49 + return;
50 + }
51 + var requestString = '/images/thumb/' + image.id + '/' + picker.getAttribute('data-resize-width') + '/' + picker.getAttribute('data-resize-height') + '/' + (resizeCrop ? 'true' : 'false');
52 + $.get(window.baseUrl(requestString), resp => {
53 + image.url = resp.url;
54 + setImage(image);
55 + });
56 + });
57 + } else if (action === 'reset-image') {
58 + setImage({id: 0, url: picker.getAttribute('data-default-image')});
59 + } else if (action === 'remove-image') {
60 + setImage('none');
61 + }
62 +
63 + });
64 +
65 + })();
66 +</script>
...\ No newline at end of file ...\ No newline at end of file
1 +<div toggle-switch="{{$name}}" class="toggle-switch @if($value) active @endif">
2 + <input type="hidden" name="{{$name}}" value="{{$value?'true':'false'}}"/>
3 + <div class="switch-handle"></div>
4 +</div>
5 +<script>
6 + (function() {
7 + var toggle = document.querySelector('[toggle-switch="{{$name}}"]');
8 + var toggleInput = toggle.querySelector('input');
9 + toggle.onclick = function(event) {
10 + var checked = toggleInput.value !== 'true';
11 + toggleInput.value = checked ? 'true' : 'false';
12 + checked ? toggle.classList.add('active') : toggle.classList.remove('active');
13 + };
14 + })()
15 +</script>
...\ No newline at end of file ...\ No newline at end of file
...@@ -4,9 +4,28 @@ ...@@ -4,9 +4,28 @@
4 4
5 5
6 <div class="container"> 6 <div class="container">
7 - <h1 class="text-muted">{{ $message or 'Page Not Found' }}</h1> 7 +
8 - <p>Sorry, The page you were looking for could not be found.</p> 8 +
9 - <a href="{{ baseUrl('/') }}" class="button">Return To Home</a> 9 + <h1>{{ $message or trans('errors.404_page_not_found') }}</h1>
10 + <p>{{ trans('errors.sorry_page_not_found') }}</p>
11 + <p><a href="{{ baseUrl('/') }}" class="button">{{ trans('errors.return_home') }}</a></p>
12 +
13 + <hr>
14 +
15 + <div class="row">
16 + <div class="col-md-4">
17 + <h3 class="text-muted">{{ trans('entities.pages_popular') }}</h3>
18 + @include('partials.entity-list', ['entities' => Views::getPopular(10, 0, [\BookStack\Page::class]), 'style' => 'compact'])
19 + </div>
20 + <div class="col-md-4">
21 + <h3 class="text-muted">{{ trans('entities.books_popular') }}</h3>
22 + @include('partials.entity-list', ['entities' => Views::getPopular(10, 0, [\BookStack\Book::class]), 'style' => 'compact'])
23 + </div>
24 + <div class="col-md-4">
25 + <h3 class="text-muted">{{ trans('entities.chapters_popular') }}</h3>
26 + @include('partials.entity-list', ['entities' => Views::getPopular(10, 0, [\BookStack\Chapter::class]), 'style' => 'compact'])
27 + </div>
28 + </div>
10 </div> 29 </div>
11 30
12 @stop 31 @stop
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
3 @section('content') 3 @section('content')
4 4
5 <div class="container"> 5 <div class="container">
6 - <h1 class="text-muted">An Error Occurred</h1> 6 + <h1 class="text-muted">{{ trans('errors.error_occurred') }}</h1>
7 <p>{{ $message }}</p> 7 <p>{{ $message }}</p>
8 </div> 8 </div>
9 9
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
3 @section('content') 3 @section('content')
4 4
5 <div class="container"> 5 <div class="container">
6 - <h1 class="text-muted">{{ setting('app-name') }} is down right now</h1> 6 + <h1 class="text-muted">{{ trans('errors.app_down', ['appName' => setting('app-name')]) }}</h1>
7 - <p>It will be back up soon.</p> 7 + <p>{{ trans('errors.back_soon') }}</p>
8 </div> 8 </div>
9 9
10 @stop 10 @stop
...\ No newline at end of file ...\ No newline at end of file
......
1 <form action="{{$url}}" method="POST" class="inline"> 1 <form action="{{$url}}" method="POST" class="inline">
2 {{ csrf_field() }} 2 {{ csrf_field() }}
3 <input type="hidden" name="_method" value="DELETE"> 3 <input type="hidden" name="_method" value="DELETE">
4 - <button type="submit" class="button neg">{{ isset($text) ? $text : 'Delete' }}</button> 4 + <button type="submit" class="button neg">{{ isset($text) ? $text : trans('common.delete') }}</button>
5 </form> 5 </form>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -2,31 +2,31 @@ ...@@ -2,31 +2,31 @@
2 {!! csrf_field() !!} 2 {!! csrf_field() !!}
3 <input type="hidden" name="_method" value="PUT"> 3 <input type="hidden" name="_method" value="PUT">
4 4
5 - <p>Once enabled, These permissions will take priority over any set role permissions.</p> 5 + <p>{{ trans('entities.permissions_intro') }}</p>
6 6
7 <div class="form-group"> 7 <div class="form-group">
8 - @include('form/checkbox', ['name' => 'restricted', 'label' => 'Enable custom permissions']) 8 + @include('form/checkbox', ['name' => 'restricted', 'label' => trans('entities.permissions_enable')])
9 </div> 9 </div>
10 10
11 11
12 <table class="table"> 12 <table class="table">
13 <tr> 13 <tr>
14 - <th>Role</th> 14 + <th>{{ trans('common.role') }}</th>
15 - <th @if($model->isA('page')) colspan="3" @else colspan="4" @endif>Actions</th> 15 + <th @if($model->isA('page')) colspan="3" @else colspan="4" @endif>{{ trans('common.actions') }}</th>
16 </tr> 16 </tr>
17 @foreach($roles as $role) 17 @foreach($roles as $role)
18 <tr> 18 <tr>
19 <td>{{ $role->display_name }}</td> 19 <td>{{ $role->display_name }}</td>
20 - <td>@include('form/restriction-checkbox', ['name'=>'restrictions', 'label' => 'View', 'action' => 'view'])</td> 20 + <td>@include('form/restriction-checkbox', ['name'=>'restrictions', 'label' => trans('common.view'), 'action' => 'view'])</td>
21 @if(!$model->isA('page')) 21 @if(!$model->isA('page'))
22 - <td>@include('form/restriction-checkbox', ['name'=>'restrictions', 'label' => 'Create', 'action' => 'create'])</td> 22 + <td>@include('form/restriction-checkbox', ['name'=>'restrictions', 'label' => trans('common.create'), 'action' => 'create'])</td>
23 @endif 23 @endif
24 - <td>@include('form/restriction-checkbox', ['name'=>'restrictions', 'label' => 'Update', 'action' => 'update'])</td> 24 + <td>@include('form/restriction-checkbox', ['name'=>'restrictions', 'label' => trans('common.update'), 'action' => 'update'])</td>
25 - <td>@include('form/restriction-checkbox', ['name'=>'restrictions', 'label' => 'Delete', 'action' => 'delete'])</td> 25 + <td>@include('form/restriction-checkbox', ['name'=>'restrictions', 'label' => trans('common.delete'), 'action' => 'delete'])</td>
26 </tr> 26 </tr>
27 @endforeach 27 @endforeach
28 </table> 28 </table>
29 29
30 - <a href="{{ $model->getUrl() }}" class="button muted">Cancel</a> 30 + <a href="{{ $model->getUrl() }}" class="button muted">{{ trans('common.cancel') }}</a>
31 - <button type="submit" class="button pos">Save Permissions</button> 31 + <button type="submit" class="button pos">{{ trans('entities.permissions_save') }}</button>
32 </form> 32 </form>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -5,14 +5,9 @@ ...@@ -5,14 +5,9 @@
5 <div class="faded-small toolbar"> 5 <div class="faded-small toolbar">
6 <div class="container"> 6 <div class="container">
7 <div class="row"> 7 <div class="row">
8 - <div class="col-sm-4 faded"> 8 + <div class="col-sm-6 faded">
9 <div class="action-buttons text-left"> 9 <div class="action-buttons text-left">
10 - <a data-action="expand-entity-list-details" class="text-primary text-button"><i class="zmdi zmdi-wrap-text"></i>Toggle Details</a> 10 + <a data-action="expand-entity-list-details" class="text-primary text-button"><i class="zmdi zmdi-wrap-text"></i>{{ trans('common.toggle_details') }}</a>
11 - </div>
12 - </div>
13 - <div class="col-sm-8 faded">
14 - <div class="action-buttons">
15 -
16 </div> 11 </div>
17 </div> 12 </div>
18 </div> 13 </div>
...@@ -25,44 +20,44 @@ ...@@ -25,44 +20,44 @@
25 <div class="col-sm-4"> 20 <div class="col-sm-4">
26 <div id="recent-drafts"> 21 <div id="recent-drafts">
27 @if(count($draftPages) > 0) 22 @if(count($draftPages) > 0)
28 - <h4>My Recent Drafts</h4> 23 + <h4>{{ trans('entities.my_recent_drafts') }}</h4>
29 @include('partials/entity-list', ['entities' => $draftPages, 'style' => 'compact']) 24 @include('partials/entity-list', ['entities' => $draftPages, 'style' => 'compact'])
30 @endif 25 @endif
31 </div> 26 </div>
32 @if($signedIn) 27 @if($signedIn)
33 - <h4>My Recently Viewed</h4> 28 + <h4>{{ trans('entities.my_recently_viewed') }}</h4>
34 @else 29 @else
35 - <h4>Recent Books</h4> 30 + <h4>{{ trans('entities.books_recent') }}</h4>
36 @endif 31 @endif
37 @include('partials/entity-list', [ 32 @include('partials/entity-list', [
38 'entities' => $recents, 33 'entities' => $recents,
39 'style' => 'compact', 34 'style' => 'compact',
40 - 'emptyText' => $signedIn ? 'You have not viewed any pages' : 'No books have been created' 35 + 'emptyText' => $signedIn ? trans('entities.no_pages_viewed') : trans('entities.books_empty')
41 ]) 36 ])
42 </div> 37 </div>
43 38
44 <div class="col-sm-4"> 39 <div class="col-sm-4">
45 - <h4><a class="no-color" href="{{ baseUrl("/pages/recently-created") }}">Recently Created Pages</a></h4> 40 + <h4><a class="no-color" href="{{ baseUrl("/pages/recently-created") }}">{{ trans('entities.recently_created_pages') }}</a></h4>
46 <div id="recently-created-pages"> 41 <div id="recently-created-pages">
47 @include('partials/entity-list', [ 42 @include('partials/entity-list', [
48 'entities' => $recentlyCreatedPages, 43 'entities' => $recentlyCreatedPages,
49 'style' => 'compact', 44 'style' => 'compact',
50 - 'emptyText' => 'No pages have been recently created' 45 + 'emptyText' => trans('entities.no_pages_recently_created')
51 ]) 46 ])
52 </div> 47 </div>
53 48
54 - <h4><a class="no-color" href="{{ baseUrl("/pages/recently-updated") }}">Recently Updated Pages</a></h4> 49 + <h4><a class="no-color" href="{{ baseUrl("/pages/recently-updated") }}">{{ trans('entities.recently_updated_pages') }}</a></h4>
55 <div id="recently-updated-pages"> 50 <div id="recently-updated-pages">
56 @include('partials/entity-list', [ 51 @include('partials/entity-list', [
57 'entities' => $recentlyUpdatedPages, 52 'entities' => $recentlyUpdatedPages,
58 'style' => 'compact', 53 'style' => 'compact',
59 - 'emptyText' => 'No pages have been recently updated' 54 + 'emptyText' => trans('entites.no_pages_recently_updated')
60 ]) 55 ])
61 </div> 56 </div>
62 </div> 57 </div>
63 58
64 <div class="col-sm-4" id="recent-activity"> 59 <div class="col-sm-4" id="recent-activity">
65 - <h4>Recent Activity</h4> 60 + <h4>{{ trans('entities.recent_activity') }}</h4>
66 @include('partials/activity-list', ['activity' => $activity]) 61 @include('partials/activity-list', ['activity' => $activity])
67 </div> 62 </div>
68 63
......
1 +<div class="breadcrumbs">
2 + <a href="{{ $page->book->getUrl() }}" class="text-book text-button"><i class="zmdi zmdi-book"></i>{{ $page->book->getShortName() }}</a>
3 + @if($page->hasChapter())
4 + <span class="sep">&raquo;</span>
5 + <a href="{{ $page->chapter->getUrl() }}" class="text-chapter text-button">
6 + <i class="zmdi zmdi-collection-bookmark"></i>
7 + {{ $page->chapter->getShortName() }}
8 + </a>
9 + @endif
10 + <span class="sep">&raquo;</span>
11 + <a href="{{ $page->getUrl() }}" class="text-page text-button"><i class="zmdi zmdi-file"></i>{{ $page->getShortName() }}</a>
12 +</div>
...\ No newline at end of file ...\ No newline at end of file
...@@ -2,15 +2,25 @@ ...@@ -2,15 +2,25 @@
2 2
3 @section('content') 3 @section('content')
4 4
5 + <div class="faded-small toolbar">
6 + <div class="container">
7 + <div class="row">
8 + <div class="col-sm-12 faded">
9 + @include('pages._breadcrumbs', ['page' => $page])
10 + </div>
11 + </div>
12 + </div>
13 + </div>
14 +
5 <div class="container small" ng-non-bindable> 15 <div class="container small" ng-non-bindable>
6 - <h1>Delete {{ $page->draft ? 'Draft' : '' }} Page</h1> 16 + <h1>{{ $page->draft ? trans('entities.pages_delete_draft') : trans('entities.pages_delete') }}</h1>
7 - <p class="text-neg">Are you sure you want to delete this {{ $page->draft ? 'draft' : '' }} page?</p> 17 + <p class="text-neg">{{ $page->draft ? trans('entities.pages_delete_draft_confirm'): trans('entities.pages_delete_confirm') }}</p>
8 18
9 <form action="{{ $page->getUrl() }}" method="POST"> 19 <form action="{{ $page->getUrl() }}" method="POST">
10 {!! csrf_field() !!} 20 {!! csrf_field() !!}
11 <input type="hidden" name="_method" value="DELETE"> 21 <input type="hidden" name="_method" value="DELETE">
12 - <a href="{{ $page->getUrl() }}" class="button primary">Cancel</a> 22 + <a href="{{ $page->getUrl() }}" class="button primary">{{ trans('common.cancel') }}</a>
13 - <button type="submit" class="button neg">Confirm</button> 23 + <button type="submit" class="button neg">{{ trans('common.confirm') }}</button>
14 </form> 24 </form>
15 </div> 25 </div>
16 26
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
20 20
21 </div> 21 </div>
22 22
23 - @include('partials/image-manager', ['imageType' => 'gallery', 'uploaded_to' => $page->id]) 23 + @include('components.image-manager', ['imageType' => 'gallery', 'uploaded_to' => $page->id])
24 - @include('partials/entity-selector-popup') 24 + @include('components.entity-selector-popup')
25 25
26 @stop 26 @stop
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -15,15 +15,11 @@ ...@@ -15,15 +15,11 @@
15 <div class="col-md-8 col-md-offset-2"> 15 <div class="col-md-8 col-md-offset-2">
16 <div class="page-content"> 16 <div class="page-content">
17 17
18 - @include('pages/page-display') 18 + @include('pages.page-display')
19 19
20 <hr> 20 <hr>
21 21
22 - <p class="text-muted small"> 22 + @include('partials.entity-meta', ['entity' => $page])
23 - Created {{$page->created_at->toDayDateTimeString()}} @if($page->createdBy) by {{$page->createdBy->name}} @endif
24 - <br>
25 - Last Updated {{$page->updated_at->toDayDateTimeString()}} @if($page->updatedBy) by {{$page->updatedBy->name}} @endif
26 - </p>
27 23
28 </div> 24 </div>
29 </div> 25 </div>
......
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
9 <div class="row"> 9 <div class="row">
10 <div class="col-sm-4 faded"> 10 <div class="col-sm-4 faded">
11 <div class="action-buttons text-left"> 11 <div class="action-buttons text-left">
12 - <a href="{{ back()->getTargetUrl() }}" class="text-button text-primary"><i class="zmdi zmdi-arrow-left"></i>Back</a> 12 + <a href="{{ back()->getTargetUrl() }}" class="text-button text-primary"><i class="zmdi zmdi-arrow-left"></i>{{ trans('common.back') }}</a>
13 - <a onclick="$('body>header').slideToggle();" class="text-button text-primary"><i class="zmdi zmdi-swap-vertical"></i>Toggle Header</a> 13 + <a onclick="$('body>header').slideToggle();" class="text-button text-primary"><i class="zmdi zmdi-swap-vertical"></i>{{ trans('entities.pages_edit_toggle_header') }}</a>
14 </div> 14 </div>
15 </div> 15 </div>
16 <div class="col-sm-4 faded text-center"> 16 <div class="col-sm-4 faded text-center">
...@@ -20,13 +20,13 @@ ...@@ -20,13 +20,13 @@
20 <i class="zmdi zmdi-check-circle text-pos draft-notification" ng-class="{visible: draftUpdated}"></i> 20 <i class="zmdi zmdi-check-circle text-pos draft-notification" ng-class="{visible: draftUpdated}"></i>
21 <ul> 21 <ul>
22 <li> 22 <li>
23 - <a ng-click="forceDraftSave()" class="text-pos"><i class="zmdi zmdi-save"></i>Save Draft</a> 23 + <a ng-click="forceDraftSave()" class="text-pos"><i class="zmdi zmdi-save"></i>{{ trans('entities.pages_edit_save_draft') }}</a>
24 </li> 24 </li>
25 <li ng-if="isNewPageDraft"> 25 <li ng-if="isNewPageDraft">
26 - <a href="{{ $model->getUrl('/delete') }}" class="text-neg"><i class="zmdi zmdi-delete"></i>Delete Draft</a> 26 + <a href="{{ $model->getUrl('/delete') }}" class="text-neg"><i class="zmdi zmdi-delete"></i>{{ trans('entities.pages_edit_delete_draft') }}</a>
27 </li> 27 </li>
28 <li> 28 <li>
29 - <a type="button" ng-if="isUpdateDraft" ng-click="discardDraft()" class="text-neg"><i class="zmdi zmdi-close-circle"></i>Discard Draft</a> 29 + <a type="button" ng-if="isUpdateDraft" ng-click="discardDraft()" class="text-neg"><i class="zmdi zmdi-close-circle"></i>{{ trans('entities.pages_edit_discard_draft') }}</a>
30 </li> 30 </li>
31 </ul> 31 </ul>
32 </div> 32 </div>
...@@ -34,16 +34,16 @@ ...@@ -34,16 +34,16 @@
34 <div class="col-sm-4 faded"> 34 <div class="col-sm-4 faded">
35 <div class="action-buttons" ng-cloak> 35 <div class="action-buttons" ng-cloak>
36 <div dropdown class="dropdown-container"> 36 <div dropdown class="dropdown-container">
37 - <a dropdown-toggle class="text-primary text-button"><i class="zmdi zmdi-edit"></i> @{{(changeSummary | limitTo:16) + (changeSummary.length>16?'...':'') || 'Set Changelog'}}</a> 37 + <a dropdown-toggle class="text-primary text-button"><i class="zmdi zmdi-edit"></i> <span ng-bind="(changeSummary | limitTo:16) + (changeSummary.length>16?'...':'') || '{{ trans('entities.pages_edit_set_changelog') }}'"></span></a>
38 <ul class="wide"> 38 <ul class="wide">
39 <li class="padded"> 39 <li class="padded">
40 - <p class="text-muted">Enter a brief description of the changes you've made</p> 40 + <p class="text-muted">{{ trans('entities.pages_edit_enter_changelog_desc') }}</p>
41 - <input name="summary" id="summary-input" type="text" placeholder="Enter Changelog" ng-model="changeSummary" /> 41 + <input name="summary" id="summary-input" type="text" placeholder="{{ trans('entities.pages_edit_enter_changelog') }}" ng-model="changeSummary" />
42 </li> 42 </li>
43 </ul> 43 </ul>
44 </div> 44 </div>
45 45
46 - <button type="submit" id="save-button" class="text-button text-pos"><i class="zmdi zmdi-floppy"></i>Save Page</button> 46 + <button type="submit" id="save-button" class="text-button text-pos"><i class="zmdi zmdi-floppy"></i>{{ trans('entities.pages_save') }}</button>
47 </div> 47 </div>
48 </div> 48 </div>
49 </div> 49 </div>
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
53 {{--Title input--}} 53 {{--Title input--}}
54 <div class="title-input page-title clearfix" ng-non-bindable> 54 <div class="title-input page-title clearfix" ng-non-bindable>
55 <div class="input"> 55 <div class="input">
56 - @include('form/text', ['name' => 'name', 'placeholder' => 'Page Title']) 56 + @include('form/text', ['name' => 'name', 'placeholder' => trans('entities.pages_title')])
57 </div> 57 </div>
58 </div> 58 </div>
59 59
...@@ -78,24 +78,24 @@ ...@@ -78,24 +78,24 @@
78 78
79 <div class="markdown-editor-wrap"> 79 <div class="markdown-editor-wrap">
80 <div class="editor-toolbar"> 80 <div class="editor-toolbar">
81 - <span class="float left">Editor</span> 81 + <span class="float left">{{ trans('entities.pages_md_editor') }}</span>
82 <div class="float right buttons"> 82 <div class="float right buttons">
83 - <button class="text-button" type="button" data-action="insertImage"><i class="zmdi zmdi-image"></i>Insert Image</button> 83 + <button class="text-button" type="button" data-action="insertImage"><i class="zmdi zmdi-image"></i>{{ trans('entities.pages_md_insert_image') }}</button>
84 &nbsp;|&nbsp; 84 &nbsp;|&nbsp;
85 - <button class="text-button" type="button" data-action="insertEntityLink"><i class="zmdi zmdi-link"></i>Insert Entity Link</button> 85 + <button class="text-button" type="button" data-action="insertEntityLink"><i class="zmdi zmdi-link"></i>{{ trans('entities.pages_md_insert_link') }}</button>
86 </div> 86 </div>
87 </div> 87 </div>
88 88
89 <div markdown-input md-change="editorChange" md-model="editContent" class="flex flex-fill"> 89 <div markdown-input md-change="editorChange" md-model="editContent" class="flex flex-fill">
90 <textarea ng-non-bindable id="markdown-editor-input" name="markdown" rows="5" 90 <textarea ng-non-bindable id="markdown-editor-input" name="markdown" rows="5"
91 - @if($errors->has('markdown')) class="neg" @endif>@if(isset($model) || old('markdown')){{htmlspecialchars( old('markdown') ? old('markdown') : ($model->markdown === '' ? $model->html : $model->markdown))}}@endif</textarea> 91 + @if($errors->has('markdown')) class="neg" @endif>@if(isset($model) || old('markdown')){{htmlspecialchars( old('markdown') ? old('markdown') : ($model->markdown === '' ? $model->html : $model->markdown))}}@endif</textarea>
92 </div> 92 </div>
93 93
94 </div> 94 </div>
95 95
96 <div class="markdown-editor-wrap"> 96 <div class="markdown-editor-wrap">
97 <div class="editor-toolbar"> 97 <div class="editor-toolbar">
98 - <div class="">Preview</div> 98 + <div class="">{{ trans('entities.pages_md_preview') }}</div>
99 </div> 99 </div>
100 <div class="markdown-display"> 100 <div class="markdown-display">
101 <div class="page-content" ng-bind-html="displayContent"></div> 101 <div class="page-content" ng-bind-html="displayContent"></div>
......
...@@ -3,19 +3,19 @@ ...@@ -3,19 +3,19 @@
3 @section('content') 3 @section('content')
4 4
5 <div class="container small" ng-non-bindable> 5 <div class="container small" ng-non-bindable>
6 - <h1>Create Page</h1> 6 + <h1>{{ trans('entities.pages_new') }}</h1>
7 <form action="{{ $parent->getUrl('/page/create/guest') }}" method="POST"> 7 <form action="{{ $parent->getUrl('/page/create/guest') }}" method="POST">
8 8
9 {!! csrf_field() !!} 9 {!! csrf_field() !!}
10 10
11 <div class="form-group title-input"> 11 <div class="form-group title-input">
12 - <label for="name">Page Name</label> 12 + <label for="name">{{ trans('entities.pages_name') }}</label>
13 @include('form/text', ['name' => 'name']) 13 @include('form/text', ['name' => 'name'])
14 </div> 14 </div>
15 15
16 <div class="form-group"> 16 <div class="form-group">
17 - <a href="{{ $parent->getUrl() }}" class="button muted">Cancel</a> 17 + <a href="{{ $parent->getUrl() }}" class="button muted">{{ trans('common.cancel') }}</a>
18 - <button type="submit" class="button pos">Continue</button> 18 + <button type="submit" class="button pos">{{ trans('common.continue') }}</button>
19 </div> 19 </div>
20 20
21 </form> 21 </form>
......
...@@ -12,8 +12,7 @@ ...@@ -12,8 +12,7 @@
12 @if(isset($style) && $style === 'detailed') 12 @if(isset($style) && $style === 'detailed')
13 <div class="row meta text-muted text-small"> 13 <div class="row meta text-muted text-small">
14 <div class="col-md-6"> 14 <div class="col-md-6">
15 - Created {{$page->created_at->diffForHumans()}} @if($page->createdBy)by {{$page->createdBy->name}}@endif <br> 15 + @include('partials.entity-meta', ['entity' => $page])
16 - Last updated {{ $page->updated_at->diffForHumans() }} @if($page->updatedBy)by {{$page->updatedBy->name}} @endif
17 </div> 16 </div>
18 <div class="col-md-6"> 17 <div class="col-md-6">
19 <a class="text-book" href="{{ $page->book->getUrl() }}"><i class="zmdi zmdi-book"></i>{{ $page->book->getShortName(30) }}</a> 18 <a class="text-book" href="{{ $page->book->getUrl() }}"><i class="zmdi zmdi-book"></i>{{ $page->book->getShortName(30) }}</a>
...@@ -21,7 +20,7 @@ ...@@ -21,7 +20,7 @@
21 @if($page->chapter) 20 @if($page->chapter)
22 <a class="text-chapter" href="{{ $page->chapter->getUrl() }}"><i class="zmdi zmdi-collection-bookmark"></i>{{ $page->chapter->getShortName(30) }}</a> 21 <a class="text-chapter" href="{{ $page->chapter->getUrl() }}"><i class="zmdi zmdi-collection-bookmark"></i>{{ $page->chapter->getShortName(30) }}</a>
23 @else 22 @else
24 - <i class="zmdi zmdi-collection-bookmark"></i> Page is not in a chapter 23 + <i class="zmdi zmdi-collection-bookmark"></i> {{ trans('entities.pages_not_in_chapter') }}
25 @endif 24 @endif
26 </div> 25 </div>
27 </div> 26 </div>
......
...@@ -6,34 +6,23 @@ ...@@ -6,34 +6,23 @@
6 <div class="container"> 6 <div class="container">
7 <div class="row"> 7 <div class="row">
8 <div class="col-sm-12 faded"> 8 <div class="col-sm-12 faded">
9 - <div class="breadcrumbs"> 9 + @include('pages._breadcrumbs', ['page' => $page])
10 - <a href="{{ $book->getUrl() }}" class="text-book text-button"><i class="zmdi zmdi-book"></i>{{ $book->getShortName() }}</a>
11 - @if($page->hasChapter())
12 - <span class="sep">&raquo;</span>
13 - <a href="{{ $page->chapter->getUrl() }}" class="text-chapter text-button">
14 - <i class="zmdi zmdi-collection-bookmark"></i>
15 - {{ $page->chapter->getShortName() }}
16 - </a>
17 - @endif
18 - <span class="sep">&raquo;</span>
19 - <a href="{{ $page->getUrl() }}" class="text-page text-button"><i class="zmdi zmdi-file-text"></i>{{ $page->getShortName() }}</a>
20 - </div>
21 </div> 10 </div>
22 </div> 11 </div>
23 </div> 12 </div>
24 </div> 13 </div>
25 14
26 <div class="container"> 15 <div class="container">
27 - <h1>Move Page <small class="subheader">{{$page->name}}</small></h1> 16 + <h1>{{ trans('entities.pages_move') }}</h1>
28 17
29 <form action="{{ $page->getUrl('/move') }}" method="POST"> 18 <form action="{{ $page->getUrl('/move') }}" method="POST">
30 {!! csrf_field() !!} 19 {!! csrf_field() !!}
31 <input type="hidden" name="_method" value="PUT"> 20 <input type="hidden" name="_method" value="PUT">
32 21
33 - @include('partials/entity-selector', ['name' => 'entity_selection', 'selectorSize' => 'large', 'entityTypes' => 'book,chapter']) 22 + @include('components.entity-selector', ['name' => 'entity_selection', 'selectorSize' => 'large', 'entityTypes' => 'book,chapter'])
34 23
35 - <a href="{{ $page->getUrl() }}" class="button muted">Cancel</a> 24 + <a href="{{ $page->getUrl() }}" class="button muted">{{ trans('common.cancel') }}</a>
36 - <button type="submit" class="button pos">Move Page</button> 25 + <button type="submit" class="button pos">{{ trans('entities.pages_move') }}</button>
37 </form> 26 </form>
38 </div> 27 </div>
39 28
......
...@@ -36,6 +36,5 @@ ...@@ -36,6 +36,5 @@
36 max-width: none; 36 max-width: none;
37 display: none; 37 display: none;
38 } 38 }
39 -
40 </style> 39 </style>
41 @stop 40 @stop
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -6,26 +6,15 @@ ...@@ -6,26 +6,15 @@
6 <div class="container"> 6 <div class="container">
7 <div class="row"> 7 <div class="row">
8 <div class="col-sm-12 faded"> 8 <div class="col-sm-12 faded">
9 - <div class="breadcrumbs"> 9 + @include('pages._breadcrumbs', ['page' => $page])
10 - <a href="{{ $page->book->getUrl() }}" class="text-book text-button"><i class="zmdi zmdi-book"></i>{{ $page->book->getShortName() }}</a>
11 - @if($page->hasChapter())
12 - <span class="sep">&raquo;</span>
13 - <a href="{{ $page->chapter->getUrl() }}" class="text-chapter text-button">
14 - <i class="zmdi zmdi-collection-bookmark"></i>
15 - {{ $page->chapter->getShortName() }}
16 - </a>
17 - @endif
18 - <span class="sep">&raquo;</span>
19 - <a href="{{ $page->getUrl() }}" class="text-page text-button"><i class="zmdi zmdi-file"></i>{{ $page->getShortName() }}</a>
20 - </div>
21 </div> 10 </div>
22 </div> 11 </div>
23 </div> 12 </div>
24 </div> 13 </div>
25 14
26 <div class="container" ng-non-bindable> 15 <div class="container" ng-non-bindable>
27 - <h1>Page Permissions</h1> 16 + <h1>{{ trans('entities.pages_permissions') }}</h1>
28 - @include('form/restriction-form', ['model' => $page]) 17 + @include('form.restriction-form', ['model' => $page])
29 </div> 18 </div>
30 19
31 @stop 20 @stop
......
...@@ -7,14 +7,12 @@ ...@@ -7,14 +7,12 @@
7 <div class="row"> 7 <div class="row">
8 <div class="col-md-9"> 8 <div class="col-md-9">
9 <div class="page-content anim fadeIn"> 9 <div class="page-content anim fadeIn">
10 - @include('pages/page-display') 10 + @include('pages.page-display')
11 </div> 11 </div>
12 </div> 12 </div>
13 </div> 13 </div>
14 </div> 14 </div>
15 15
16 16
17 - 17 + @include('partials.highlight')
18 - @include('partials/highlight')
19 -
20 @stop 18 @stop
......
...@@ -6,37 +6,24 @@ ...@@ -6,37 +6,24 @@
6 <div class="container"> 6 <div class="container">
7 <div class="row"> 7 <div class="row">
8 <div class="col-sm-12 faded"> 8 <div class="col-sm-12 faded">
9 - <div class="breadcrumbs"> 9 + @include('pages._breadcrumbs', ['page' => $page])
10 - <a href="{{ $page->book->getUrl() }}" class="text-book text-button"><i class="zmdi zmdi-book"></i>{{ $page->book->getShortName() }}</a>
11 - @if($page->hasChapter())
12 - <span class="sep">&raquo;</span>
13 - <a href="{{ $page->chapter->getUrl() }}" class="text-chapter text-button">
14 - <i class="zmdi zmdi-collection-bookmark"></i>
15 - {{ $page->chapter->getShortName() }}
16 - </a>
17 - @endif
18 - <span class="sep">&raquo;</span>
19 - <a href="{{ $page->getUrl() }}" class="text-page text-button"><i class="zmdi zmdi-file"></i>{{ $page->getShortName() }}</a>
20 - </div>
21 </div> 10 </div>
22 </div> 11 </div>
23 </div> 12 </div>
24 </div> 13 </div>
25 14
26 -
27 -
28 <div class="container" ng-non-bindable> 15 <div class="container" ng-non-bindable>
29 - <h1>Page Revisions <span class="subheader">For "{{ $page->name }}"</span></h1> 16 + <h1>{{ trans('entities.pages_revisions') }}</h1>
30 17
31 @if(count($page->revisions) > 0) 18 @if(count($page->revisions) > 0)
32 19
33 <table class="table"> 20 <table class="table">
34 <tr> 21 <tr>
35 - <th width="23%">Name</th> 22 + <th width="23%">{{ trans('entities.pages_name') }}</th>
36 - <th colspan="2" width="8%">Created By</th> 23 + <th colspan="2" width="8%">{{ trans('entities.pages_revisions_created_by') }}</th>
37 - <th width="15%">Revision Date</th> 24 + <th width="15%">{{ trans('entities.pages_revisions_date') }}</th>
38 - <th width="25%">Changelog</th> 25 + <th width="25%">{{ trans('entities.pages_revisions_changelog') }}</th>
39 - <th width="20%">Actions</th> 26 + <th width="20%">{{ trans('common.actions') }}</th>
40 </tr> 27 </tr>
41 @foreach($page->revisions as $index => $revision) 28 @foreach($page->revisions as $index => $revision)
42 <tr> 29 <tr>
...@@ -46,19 +33,19 @@ ...@@ -46,19 +33,19 @@
46 <img class="avatar" src="{{ $revision->createdBy->getAvatar(30) }}" alt="{{ $revision->createdBy->name }}"> 33 <img class="avatar" src="{{ $revision->createdBy->getAvatar(30) }}" alt="{{ $revision->createdBy->name }}">
47 @endif 34 @endif
48 </td> 35 </td>
49 - <td> @if($revision->createdBy) {{ $revision->createdBy->name }} @else Deleted User @endif</td> 36 + <td> @if($revision->createdBy) {{ $revision->createdBy->name }} @else {{ trans('common.deleted_user') }} @endif</td>
50 <td><small>{{ $revision->created_at->format('jS F, Y H:i:s') }} <br> ({{ $revision->created_at->diffForHumans() }})</small></td> 37 <td><small>{{ $revision->created_at->format('jS F, Y H:i:s') }} <br> ({{ $revision->created_at->diffForHumans() }})</small></td>
51 <td>{{ $revision->summary }}</td> 38 <td>{{ $revision->summary }}</td>
52 <td> 39 <td>
53 - <a href="{{ $revision->getUrl('changes') }}" target="_blank">Changes</a> 40 + <a href="{{ $revision->getUrl('changes') }}" target="_blank">{{ trans('entities.pages_revisions_changes') }}</a>
54 <span class="text-muted">&nbsp;|&nbsp;</span> 41 <span class="text-muted">&nbsp;|&nbsp;</span>
55 42
56 @if ($index === 0) 43 @if ($index === 0)
57 - <a target="_blank" href="{{ $page->getUrl() }}"><i>Current Version</i></a> 44 + <a target="_blank" href="{{ $page->getUrl() }}"><i>{{ trans('entities.pages_revisions_current') }}</i></a>
58 @else 45 @else
59 - <a href="{{ $revision->getUrl() }}" target="_blank">Preview</a> 46 + <a href="{{ $revision->getUrl() }}" target="_blank">{{ trans('entities.pages_revisions_preview') }}</a>
60 <span class="text-muted">&nbsp;|&nbsp;</span> 47 <span class="text-muted">&nbsp;|&nbsp;</span>
61 - <a href="{{ $revision->getUrl('restore') }}" target="_blank">Restore</a> 48 + <a href="{{ $revision->getUrl('restore') }}" target="_blank">{{ trans('entities.pages_revisions_restore') }}</a>
62 @endif 49 @endif
63 </td> 50 </td>
64 </tr> 51 </tr>
...@@ -66,7 +53,7 @@ ...@@ -66,7 +53,7 @@
66 </table> 53 </table>
67 54
68 @else 55 @else
69 - <p>This page has no revisions.</p> 56 + <p>{{ trans('entities.pages_revisions_none') }}</p>
70 @endif 57 @endif
71 58
72 </div> 59 </div>
......
...@@ -6,43 +6,34 @@ ...@@ -6,43 +6,34 @@
6 <div class="container"> 6 <div class="container">
7 <div class="row"> 7 <div class="row">
8 <div class="col-sm-6 faded"> 8 <div class="col-sm-6 faded">
9 - <div class="breadcrumbs"> 9 + @include('pages._breadcrumbs', ['page' => $page])
10 - <a href="{{ $book->getUrl() }}" class="text-book text-button"><i class="zmdi zmdi-book"></i>{{ $book->getShortName() }}</a>
11 - @if($page->hasChapter())
12 - <span class="sep">&raquo;</span>
13 - <a href="{{ $page->chapter->getUrl() }}" class="text-chapter text-button">
14 - <i class="zmdi zmdi-collection-bookmark"></i>
15 - {{ $page->chapter->getShortName() }}
16 - </a>
17 - @endif
18 - </div>
19 </div> 10 </div>
20 <div class="col-sm-6 faded"> 11 <div class="col-sm-6 faded">
21 <div class="action-buttons"> 12 <div class="action-buttons">
22 <span dropdown class="dropdown-container"> 13 <span dropdown class="dropdown-container">
23 - <div dropdown-toggle class="text-button text-primary"><i class="zmdi zmdi-open-in-new"></i>Export</div> 14 + <div dropdown-toggle class="text-button text-primary"><i class="zmdi zmdi-open-in-new"></i>{{ trans('entities.pages_export') }}</div>
24 <ul class="wide"> 15 <ul class="wide">
25 - <li><a href="{{ $page->getUrl('/export/html') }}" target="_blank">Contained Web File <span class="text-muted float right">.html</span></a></li> 16 + <li><a href="{{ $page->getUrl('/export/html') }}" target="_blank">{{ trans('entities.pages_export_html') }} <span class="text-muted float right">.html</span></a></li>
26 - <li><a href="{{ $page->getUrl('/export/pdf') }}" target="_blank">PDF File <span class="text-muted float right">.pdf</span></a></li> 17 + <li><a href="{{ $page->getUrl('/export/pdf') }}" target="_blank">{{ trans('entities.pages_export_pdf') }} <span class="text-muted float right">.pdf</span></a></li>
27 - <li><a href="{{ $page->getUrl('/export/plaintext') }}" target="_blank">Plain Text File <span class="text-muted float right">.txt</span></a></li> 18 + <li><a href="{{ $page->getUrl('/export/plaintext') }}" target="_blank">{{ trans('entities.pages_export_text') }} <span class="text-muted float right">.txt</span></a></li>
28 </ul> 19 </ul>
29 </span> 20 </span>
30 @if(userCan('page-update', $page)) 21 @if(userCan('page-update', $page))
31 - <a href="{{ $page->getUrl('/edit') }}" class="text-primary text-button" ><i class="zmdi zmdi-edit"></i>Edit</a> 22 + <a href="{{ $page->getUrl('/edit') }}" class="text-primary text-button" ><i class="zmdi zmdi-edit"></i>{{ trans('common.edit') }}</a>
32 @endif 23 @endif
33 @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))
34 <div dropdown class="dropdown-container"> 25 <div dropdown class="dropdown-container">
35 <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>
36 <ul> 27 <ul>
37 @if(userCan('page-update', $page)) 28 @if(userCan('page-update', $page))
38 - <li><a href="{{ $page->getUrl('/move') }}" class="text-primary" ><i class="zmdi zmdi-folder"></i>Move</a></li> 29 + <li><a href="{{ $page->getUrl('/move') }}" class="text-primary" ><i class="zmdi zmdi-folder"></i>{{ trans('common.move') }}</a></li>
39 - <li><a href="{{ $page->getUrl('/revisions') }}" class="text-primary"><i class="zmdi zmdi-replay"></i>Revisions</a></li> 30 + <li><a href="{{ $page->getUrl('/revisions') }}" class="text-primary"><i class="zmdi zmdi-replay"></i>{{ trans('entities.revisions') }}</a></li>
40 @endif 31 @endif
41 @if(userCan('restrictions-manage', $page)) 32 @if(userCan('restrictions-manage', $page))
42 - <li><a href="{{ $page->getUrl('/permissions') }}" class="text-primary"><i class="zmdi zmdi-lock-outline"></i>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>
43 @endif 34 @endif
44 @if(userCan('page-delete', $page)) 35 @if(userCan('page-delete', $page))
45 - <li><a href="{{ $page->getUrl('/delete') }}" class="text-neg"><i class="zmdi zmdi-delete"></i>Delete</a></li> 36 + <li><a href="{{ $page->getUrl('/delete') }}" class="text-neg"><i class="zmdi zmdi-delete"></i>{{ trans('common.delete') }}</a></li>
46 @endif 37 @endif
47 </ul> 38 </ul>
48 </div> 39 </div>
...@@ -64,7 +55,7 @@ ...@@ -64,7 +55,7 @@
64 <div class="pointer anim"> 55 <div class="pointer anim">
65 <i class="zmdi zmdi-link"></i> 56 <i class="zmdi zmdi-link"></i>
66 <input readonly="readonly" type="text" placeholder="url"> 57 <input readonly="readonly" type="text" placeholder="url">
67 - <button class="button icon" title="Copy Link" data-clipboard-text=""><i class="zmdi zmdi-copy"></i></button> 58 + <button class="button icon" title="{{ trans('entities.pages_copy_link') }}" data-clipboard-text=""><i class="zmdi zmdi-copy"></i></button>
68 </div> 59 </div>
69 </div> 60 </div>
70 61
...@@ -72,11 +63,7 @@ ...@@ -72,11 +63,7 @@
72 63
73 <hr> 64 <hr>
74 65
75 - <p class="text-muted small"> 66 + @include('partials.entity-meta', ['entity' => $page])
76 - Created {{ $page->created_at->diffForHumans() }} @if($page->createdBy) by <a href="{{ $page->createdBy->getProfileUrl() }}">{{$page->createdBy->name}}</a> @endif
77 - <br>
78 - Last Updated {{ $page->updated_at->diffForHumans() }} @if($page->updatedBy) by <a href="{{ $page->updatedBy->getProfileUrl() }}">{{$page->updatedBy->name}}</a> @endif
79 - </p>
80 67
81 </div> 68 </div>
82 </div> 69 </div>
...@@ -88,27 +75,27 @@ ...@@ -88,27 +75,27 @@
88 75
89 @if($book->restricted) 76 @if($book->restricted)
90 @if(userCan('restrictions-manage', $book)) 77 @if(userCan('restrictions-manage', $book))
91 - <a href="{{ $book->getUrl('/permissions') }}"><i class="zmdi zmdi-lock-outline"></i>Book Permissions Active</a> 78 + <a href="{{ $book->getUrl('/permissions') }}"><i class="zmdi zmdi-lock-outline"></i>{{ trans('entities.books_permissions_active') }}</a>
92 @else 79 @else
93 - <i class="zmdi zmdi-lock-outline"></i>Book Permissions Active 80 + <i class="zmdi zmdi-lock-outline"></i>{{ trans('entities.books_permissions_active') }}
94 @endif 81 @endif
95 <br> 82 <br>
96 @endif 83 @endif
97 84
98 @if($page->chapter && $page->chapter->restricted) 85 @if($page->chapter && $page->chapter->restricted)
99 @if(userCan('restrictions-manage', $page->chapter)) 86 @if(userCan('restrictions-manage', $page->chapter))
100 - <a href="{{ $page->chapter->getUrl('/permissions') }}"><i class="zmdi zmdi-lock-outline"></i>Chapter Permissions Active</a> 87 + <a href="{{ $page->chapter->getUrl('/permissions') }}"><i class="zmdi zmdi-lock-outline"></i>{{ trans('entities.chapters_permissions_active') }}</a>
101 @else 88 @else
102 - <i class="zmdi zmdi-lock-outline"></i>Chapter Permissions Active 89 + <i class="zmdi zmdi-lock-outline"></i>{{ trans('entities.chapters_permissions_active') }}
103 @endif 90 @endif
104 <br> 91 <br>
105 @endif 92 @endif
106 93
107 @if($page->restricted) 94 @if($page->restricted)
108 @if(userCan('restrictions-manage', $page)) 95 @if(userCan('restrictions-manage', $page))
109 - <a href="{{ $page->getUrl('/permissions') }}"><i class="zmdi zmdi-lock-outline"></i>Page Permissions Active</a> 96 + <a href="{{ $page->getUrl('/permissions') }}"><i class="zmdi zmdi-lock-outline"></i>{{ trans('entities.pages_permissions_active') }}</a>
110 @else 97 @else
111 - <i class="zmdi zmdi-lock-outline"></i>Page Permissions Active 98 + <i class="zmdi zmdi-lock-outline"></i>{{ trans('entities.pages_permissions_active') }}
112 @endif 99 @endif
113 <br> 100 <br>
114 @endif 101 @endif
......