Dan Brown

Merge branch 'v0.11'

Showing 90 changed files with 446 additions and 359 deletions
...@@ -3,6 +3,10 @@ APP_ENV=production ...@@ -3,6 +3,10 @@ APP_ENV=production
3 APP_DEBUG=false 3 APP_DEBUG=false
4 APP_KEY=SomeRandomString 4 APP_KEY=SomeRandomString
5 5
6 +# The below url has to be set if using social auth options
7 +# or if you are not using BookStack at the root path of your domain.
8 +# APP_URL=http://bookstack.dev
9 +
6 # Database details 10 # Database details
7 DB_HOST=localhost 11 DB_HOST=localhost
8 DB_DATABASE=database_database 12 DB_DATABASE=database_database
...@@ -42,8 +46,6 @@ GITHUB_APP_ID=false ...@@ -42,8 +46,6 @@ GITHUB_APP_ID=false
42 GITHUB_APP_SECRET=false 46 GITHUB_APP_SECRET=false
43 GOOGLE_APP_ID=false 47 GOOGLE_APP_ID=false
44 GOOGLE_APP_SECRET=false 48 GOOGLE_APP_SECRET=false
45 -# URL used for social login redirects, NO TRAILING SLASH
46 -APP_URL=http://bookstack.dev
47 49
48 # External services such as Gravatar 50 # External services such as Gravatar
49 DISABLE_EXTERNAL_SERVICES=false 51 DISABLE_EXTERNAL_SERVICES=false
......
...@@ -25,6 +25,7 @@ before_script: ...@@ -25,6 +25,7 @@ before_script:
25 - composer config -g github-oauth.github.com $GITHUB_ACCESS_TOKEN 25 - composer config -g github-oauth.github.com $GITHUB_ACCESS_TOKEN
26 - phpenv config-rm xdebug.ini 26 - phpenv config-rm xdebug.ini
27 - composer self-update 27 - composer self-update
28 + - composer dump-autoload --no-interaction
28 - composer install --prefer-dist --no-interaction 29 - composer install --prefer-dist --no-interaction
29 - npm install 30 - npm install
30 - ./node_modules/.bin/gulp 31 - ./node_modules/.bin/gulp
......
...@@ -7,11 +7,15 @@ class Book extends Entity ...@@ -7,11 +7,15 @@ class Book extends Entity
7 7
8 /** 8 /**
9 * Get the url for this book. 9 * Get the url for this book.
10 + * @param string|bool $path
10 * @return string 11 * @return string
11 */ 12 */
12 - public function getUrl() 13 + public function getUrl($path = false)
13 { 14 {
14 - return '/books/' . $this->slug; 15 + if ($path !== false) {
16 + return baseUrl('/books/' . $this->slug . '/' . trim($path, '/'));
17 + }
18 + return baseUrl('/books/' . $this->slug);
15 } 19 }
16 20
17 /* 21 /*
......
...@@ -25,12 +25,16 @@ class Chapter extends Entity ...@@ -25,12 +25,16 @@ class Chapter extends Entity
25 25
26 /** 26 /**
27 * Get the url of this chapter. 27 * Get the url of this chapter.
28 + * @param string|bool $path
28 * @return string 29 * @return string
29 */ 30 */
30 - public function getUrl() 31 + public function getUrl($path = false)
31 { 32 {
32 $bookSlug = $this->getAttribute('bookSlug') ? $this->getAttribute('bookSlug') : $this->book->slug; 33 $bookSlug = $this->getAttribute('bookSlug') ? $this->getAttribute('bookSlug') : $this->book->slug;
33 - return '/books/' . $bookSlug. '/chapter/' . $this->slug; 34 + if ($path !== false) {
35 + return baseUrl('/books/' . $bookSlug. '/chapter/' . $this->slug . '/' . trim($path, '/'));
36 + }
37 + return baseUrl('/books/' . $bookSlug. '/chapter/' . $this->slug);
34 } 38 }
35 39
36 /** 40 /**
......
...@@ -48,8 +48,8 @@ class Handler extends ExceptionHandler ...@@ -48,8 +48,8 @@ class Handler extends ExceptionHandler
48 // Handle notify exceptions which will redirect to the 48 // Handle notify exceptions which will redirect to the
49 // specified location then show a notification message. 49 // specified location then show a notification message.
50 if ($e instanceof NotifyException) { 50 if ($e instanceof NotifyException) {
51 - \Session::flash('error', $e->message); 51 + session()->flash('error', $e->message);
52 - return response()->redirectTo($e->redirectLocation); 52 + return redirect($e->redirectLocation);
53 } 53 }
54 54
55 // Handle pretty exceptions which will show a friendly application-fitting page 55 // Handle pretty exceptions which will show a friendly application-fitting page
......
1 -<?php 1 +<?php namespace BookStack\Http\Controllers\Auth;
2 -
3 -namespace BookStack\Http\Controllers\Auth;
4 2
5 use BookStack\Exceptions\AuthException; 3 use BookStack\Exceptions\AuthException;
6 -use BookStack\Exceptions\PrettyException;
7 use Illuminate\Contracts\Auth\Authenticatable; 4 use Illuminate\Contracts\Auth\Authenticatable;
8 use Illuminate\Http\Request; 5 use Illuminate\Http\Request;
9 use BookStack\Exceptions\SocialSignInException; 6 use BookStack\Exceptions\SocialSignInException;
...@@ -36,7 +33,6 @@ class AuthController extends Controller ...@@ -36,7 +33,6 @@ class AuthController extends Controller
36 protected $redirectAfterLogout = '/login'; 33 protected $redirectAfterLogout = '/login';
37 protected $username = 'email'; 34 protected $username = 'email';
38 35
39 -
40 protected $socialAuthService; 36 protected $socialAuthService;
41 protected $emailConfirmationService; 37 protected $emailConfirmationService;
42 protected $userRepo; 38 protected $userRepo;
...@@ -53,6 +49,8 @@ class AuthController extends Controller ...@@ -53,6 +49,8 @@ class AuthController extends Controller
53 $this->socialAuthService = $socialAuthService; 49 $this->socialAuthService = $socialAuthService;
54 $this->emailConfirmationService = $emailConfirmationService; 50 $this->emailConfirmationService = $emailConfirmationService;
55 $this->userRepo = $userRepo; 51 $this->userRepo = $userRepo;
52 + $this->redirectPath = baseUrl('/');
53 + $this->redirectAfterLogout = baseUrl('/login');
56 $this->username = config('auth.method') === 'standard' ? 'email' : 'username'; 54 $this->username = config('auth.method') === 'standard' ? 'email' : 'username';
57 parent::__construct(); 55 parent::__construct();
58 } 56 }
......
...@@ -412,7 +412,7 @@ class PageController extends Controller ...@@ -412,7 +412,7 @@ class PageController extends Controller
412 */ 412 */
413 public function showRecentlyCreated() 413 public function showRecentlyCreated()
414 { 414 {
415 - $pages = $this->pageRepo->getRecentlyCreatedPaginated(20); 415 + $pages = $this->pageRepo->getRecentlyCreatedPaginated(20)->setPath(baseUrl('/pages/recently-created'));
416 return view('pages/detailed-listing', [ 416 return view('pages/detailed-listing', [
417 'title' => 'Recently Created Pages', 417 'title' => 'Recently Created Pages',
418 'pages' => $pages 418 'pages' => $pages
...@@ -425,7 +425,7 @@ class PageController extends Controller ...@@ -425,7 +425,7 @@ class PageController extends Controller
425 */ 425 */
426 public function showRecentlyUpdated() 426 public function showRecentlyUpdated()
427 { 427 {
428 - $pages = $this->pageRepo->getRecentlyUpdatedPaginated(20); 428 + $pages = $this->pageRepo->getRecentlyUpdatedPaginated(20)->setPath(baseUrl('/pages/recently-updated'));
429 return view('pages/detailed-listing', [ 429 return view('pages/detailed-listing', [
430 'title' => 'Recently Updated Pages', 430 'title' => 'Recently Updated Pages',
431 'pages' => $pages 431 'pages' => $pages
......
...@@ -33,7 +33,7 @@ class Authenticate ...@@ -33,7 +33,7 @@ class Authenticate
33 public function handle($request, Closure $next) 33 public function handle($request, Closure $next)
34 { 34 {
35 if ($this->auth->check() && setting('registration-confirmation') && !$this->auth->user()->email_confirmed) { 35 if ($this->auth->check() && setting('registration-confirmation') && !$this->auth->user()->email_confirmed) {
36 - return redirect()->guest('/register/confirm/awaiting'); 36 + return redirect()->guest(baseUrl('/register/confirm/awaiting'));
37 } 37 }
38 38
39 if ($this->auth->guest() && !setting('app-public')) { 39 if ($this->auth->guest() && !setting('app-public')) {
......
...@@ -56,14 +56,20 @@ class Page extends Entity ...@@ -56,14 +56,20 @@ class Page extends Entity
56 56
57 /** 57 /**
58 * Get the url for this page. 58 * Get the url for this page.
59 + * @param string|bool $path
59 * @return string 60 * @return string
60 */ 61 */
61 - public function getUrl() 62 + public function getUrl($path = false)
62 { 63 {
63 $bookSlug = $this->getAttribute('bookSlug') ? $this->getAttribute('bookSlug') : $this->book->slug; 64 $bookSlug = $this->getAttribute('bookSlug') ? $this->getAttribute('bookSlug') : $this->book->slug;
64 $midText = $this->draft ? '/draft/' : '/page/'; 65 $midText = $this->draft ? '/draft/' : '/page/';
65 $idComponent = $this->draft ? $this->id : $this->slug; 66 $idComponent = $this->draft ? $this->id : $this->slug;
66 - return '/books/' . $bookSlug . $midText . $idComponent; 67 +
68 + if ($path !== false) {
69 + return baseUrl('/books/' . $bookSlug . $midText . $idComponent . '/' . trim($path, '/'));
70 + }
71 +
72 + return baseUrl('/books/' . $bookSlug . $midText . $idComponent);
67 } 73 }
68 74
69 /** 75 /**
......
1 +<?php namespace BookStack\Providers;
2 +
3 +
4 +use Illuminate\Support\ServiceProvider;
5 +use Illuminate\Pagination\Paginator;
6 +
7 +class PaginationServiceProvider extends ServiceProvider
8 +{
9 + /**
10 + * Register the service provider.
11 + *
12 + * @return void
13 + */
14 + public function register()
15 + {
16 + Paginator::currentPathResolver(function () {
17 + return baseUrl($this->app['request']->path());
18 + });
19 +
20 + Paginator::currentPageResolver(function ($pageName = 'page') {
21 + $page = $this->app['request']->input($pageName);
22 +
23 + if (filter_var($page, FILTER_VALIDATE_INT) !== false && (int) $page >= 1) {
24 + return $page;
25 + }
26 +
27 + return 1;
28 + });
29 + }
30 +}
...\ No newline at end of file ...\ No newline at end of file
...@@ -216,12 +216,10 @@ class BookRepo extends EntityRepo ...@@ -216,12 +216,10 @@ class BookRepo extends EntityRepo
216 */ 216 */
217 public function findSuitableSlug($name, $currentId = false) 217 public function findSuitableSlug($name, $currentId = false)
218 { 218 {
219 - $originalSlug = Str::slug($name); 219 + $slug = Str::slug($name);
220 - $slug = $originalSlug; 220 + if ($slug === "") $slug = substr(md5(rand(1, 500)), 0, 5);
221 - $count = 2;
222 while ($this->doesSlugExist($slug, $currentId)) { 221 while ($this->doesSlugExist($slug, $currentId)) {
223 - $slug = $originalSlug . '-' . $count; 222 + $slug .= '-' . substr(md5(rand(1, 500)), 0, 3);
224 - $count++;
225 } 223 }
226 return $slug; 224 return $slug;
227 } 225 }
...@@ -229,7 +227,7 @@ class BookRepo extends EntityRepo ...@@ -229,7 +227,7 @@ class BookRepo extends EntityRepo
229 /** 227 /**
230 * Get all child objects of a book. 228 * Get all child objects of a book.
231 * Returns a sorted collection of Pages and Chapters. 229 * Returns a sorted collection of Pages and Chapters.
232 - * Loads the bookslug onto child elements to prevent access database access for getting the slug. 230 + * Loads the book slug onto child elements to prevent access database access for getting the slug.
233 * @param Book $book 231 * @param Book $book
234 * @param bool $filterDrafts 232 * @param bool $filterDrafts
235 * @return mixed 233 * @return mixed
...@@ -245,7 +243,7 @@ class BookRepo extends EntityRepo ...@@ -245,7 +243,7 @@ class BookRepo extends EntityRepo
245 243
246 $pages = $pageQuery->get(); 244 $pages = $pageQuery->get();
247 245
248 - $chapterQuery = $book->chapters()->with(['pages' => function($query) use ($filterDrafts) { 246 + $chapterQuery = $book->chapters()->with(['pages' => function ($query) use ($filterDrafts) {
249 $this->permissionService->enforcePageRestrictions($query, 'view'); 247 $this->permissionService->enforcePageRestrictions($query, 'view');
250 if ($filterDrafts) $query->where('draft', '=', false); 248 if ($filterDrafts) $query->where('draft', '=', false);
251 }]); 249 }]);
...@@ -263,7 +261,7 @@ class BookRepo extends EntityRepo ...@@ -263,7 +261,7 @@ class BookRepo extends EntityRepo
263 $child->pages->each(function ($page) use ($bookSlug) { 261 $child->pages->each(function ($page) use ($bookSlug) {
264 $page->setAttribute('bookSlug', $bookSlug); 262 $page->setAttribute('bookSlug', $bookSlug);
265 }); 263 });
266 - $child->pages = $child->pages->sortBy(function($child, $key) { 264 + $child->pages = $child->pages->sortBy(function ($child, $key) {
267 $score = $child->priority; 265 $score = $child->priority;
268 if ($child->draft) $score -= 100; 266 if ($child->draft) $score -= 100;
269 return $score; 267 return $score;
...@@ -272,7 +270,7 @@ class BookRepo extends EntityRepo ...@@ -272,7 +270,7 @@ class BookRepo extends EntityRepo
272 }); 270 });
273 271
274 // Sort items with drafts first then by priority. 272 // Sort items with drafts first then by priority.
275 - return $children->sortBy(function($child, $key) { 273 + return $children->sortBy(function ($child, $key) {
276 $score = $child->priority; 274 $score = $child->priority;
277 if ($child->isA('page') && $child->draft) $score -= 100; 275 if ($child->isA('page') && $child->draft) $score -= 100;
278 return $score; 276 return $score;
......
...@@ -81,7 +81,7 @@ class ChapterRepo extends EntityRepo ...@@ -81,7 +81,7 @@ class ChapterRepo extends EntityRepo
81 { 81 {
82 $pages = $this->permissionService->enforcePageRestrictions($chapter->pages())->get(); 82 $pages = $this->permissionService->enforcePageRestrictions($chapter->pages())->get();
83 // Sort items with drafts first then by priority. 83 // Sort items with drafts first then by priority.
84 - return $pages->sortBy(function($child, $key) { 84 + return $pages->sortBy(function ($child, $key) {
85 $score = $child->priority; 85 $score = $child->priority;
86 if ($child->draft) $score -= 100; 86 if ($child->draft) $score -= 100;
87 return $score; 87 return $score;
...@@ -151,6 +151,7 @@ class ChapterRepo extends EntityRepo ...@@ -151,6 +151,7 @@ class ChapterRepo extends EntityRepo
151 public function findSuitableSlug($name, $bookId, $currentId = false) 151 public function findSuitableSlug($name, $bookId, $currentId = false)
152 { 152 {
153 $slug = Str::slug($name); 153 $slug = Str::slug($name);
154 + if ($slug === "") $slug = substr(md5(rand(1, 500)), 0, 5);
154 while ($this->doesSlugExist($slug, $bookId, $currentId)) { 155 while ($this->doesSlugExist($slug, $bookId, $currentId)) {
155 $slug .= '-' . substr(md5(rand(1, 500)), 0, 3); 156 $slug .= '-' . substr(md5(rand(1, 500)), 0, 3);
156 } 157 }
......
...@@ -13,7 +13,7 @@ class ImageRepo ...@@ -13,7 +13,7 @@ class ImageRepo
13 13
14 protected $image; 14 protected $image;
15 protected $imageService; 15 protected $imageService;
16 - protected $restictionService; 16 + protected $restrictionService;
17 protected $page; 17 protected $page;
18 18
19 /** 19 /**
...@@ -27,7 +27,7 @@ class ImageRepo ...@@ -27,7 +27,7 @@ class ImageRepo
27 { 27 {
28 $this->image = $image; 28 $this->image = $image;
29 $this->imageService = $imageService; 29 $this->imageService = $imageService;
30 - $this->restictionService = $permissionService; 30 + $this->restrictionService = $permissionService;
31 $this->page = $page; 31 $this->page = $page;
32 } 32 }
33 33
...@@ -52,7 +52,7 @@ class ImageRepo ...@@ -52,7 +52,7 @@ class ImageRepo
52 */ 52 */
53 private function returnPaginated($query, $page = 0, $pageSize = 24) 53 private function returnPaginated($query, $page = 0, $pageSize = 24)
54 { 54 {
55 - $images = $this->restictionService->filterRelatedPages($query, 'images', 'uploaded_to'); 55 + $images = $this->restrictionService->filterRelatedPages($query, 'images', 'uploaded_to');
56 $images = $images->orderBy('created_at', 'desc')->skip($pageSize * $page)->take($pageSize + 1)->get(); 56 $images = $images->orderBy('created_at', 'desc')->skip($pageSize * $page)->take($pageSize + 1)->get();
57 $hasMore = count($images) > $pageSize; 57 $hasMore = count($images) > $pageSize;
58 58
......
...@@ -599,14 +599,15 @@ class PageRepo extends EntityRepo ...@@ -599,14 +599,15 @@ class PageRepo extends EntityRepo
599 599
600 /** 600 /**
601 * Gets a suitable slug for the resource 601 * Gets a suitable slug for the resource
602 - * @param $name 602 + * @param string $name
603 - * @param $bookId 603 + * @param int $bookId
604 * @param bool|false $currentId 604 * @param bool|false $currentId
605 * @return string 605 * @return string
606 */ 606 */
607 public function findSuitableSlug($name, $bookId, $currentId = false) 607 public function findSuitableSlug($name, $bookId, $currentId = false)
608 { 608 {
609 $slug = Str::slug($name); 609 $slug = Str::slug($name);
610 + if ($slug === "") $slug = substr(md5(rand(1, 500)), 0, 5);
610 while ($this->doesSlugExist($slug, $bookId, $currentId)) { 611 while ($this->doesSlugExist($slug, $bookId, $currentId)) {
611 $slug .= '-' . substr(md5(rand(1, 500)), 0, 3); 612 $slug .= '-' . substr(md5(rand(1, 500)), 0, 3);
612 } 613 }
......
...@@ -273,7 +273,7 @@ class ImageService ...@@ -273,7 +273,7 @@ class ImageService
273 $this->storageUrl = $storageUrl; 273 $this->storageUrl = $storageUrl;
274 } 274 }
275 275
276 - return ($this->storageUrl == false ? '' : rtrim($this->storageUrl, '/')) . $filePath; 276 + return ($this->storageUrl == false ? rtrim(baseUrl(''), '/') : rtrim($this->storageUrl, '/')) . $filePath;
277 } 277 }
278 278
279 279
......
...@@ -113,20 +113,20 @@ class SocialAuthService ...@@ -113,20 +113,20 @@ 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', title_case($socialDriver) . ' account was successfully attached to your profile.');
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', 'This ' . title_case($socialDriver) . ' account is already attached to your profile.');
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. 127 // Change the user that the social account is assigned to.
128 if ($isLoggedIn && $socialAccount !== null && $socialAccount->user->id != $currentUser->id) { 128 if ($isLoggedIn && $socialAccount !== null && $socialAccount->user->id != $currentUser->id) {
129 - \Session::flash('success', 'This ' . title_case($socialDriver) . ' account is already used by another user.'); 129 + session()->flash('success', 'This ' . title_case($socialDriver) . ' account is already used by another user.');
130 return redirect($currentUser->getEditUrl()); 130 return redirect($currentUser->getEditUrl());
131 } 131 }
132 132
...@@ -135,6 +135,7 @@ class SocialAuthService ...@@ -135,6 +135,7 @@ class SocialAuthService
135 if (setting('registration-enabled')) { 135 if (setting('registration-enabled')) {
136 $message .= ' or, If you do not yet have an account, You can register an account using the ' . $socialDriver . ' option'; 136 $message .= ' or, If you do not yet have an account, You can register an account using the ' . $socialDriver . ' option';
137 } 137 }
138 +
138 throw new SocialSignInException($message . '.', '/login'); 139 throw new SocialSignInException($message . '.', '/login');
139 } 140 }
140 141
......
...@@ -138,8 +138,8 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon ...@@ -138,8 +138,8 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
138 */ 138 */
139 public function getAvatar($size = 50) 139 public function getAvatar($size = 50)
140 { 140 {
141 - if ($this->image_id === 0 || $this->image_id === '0' || $this->image_id === null) return '/user_avatar.png'; 141 + if ($this->image_id === 0 || $this->image_id === '0' || $this->image_id === null) return baseUrl('/user_avatar.png');
142 - return $this->avatar->getThumb($size, $size, false); 142 + return baseUrl($this->avatar->getThumb($size, $size, false));
143 } 143 }
144 144
145 /** 145 /**
...@@ -157,7 +157,16 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon ...@@ -157,7 +157,16 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
157 */ 157 */
158 public function getEditUrl() 158 public function getEditUrl()
159 { 159 {
160 - return '/settings/users/' . $this->id; 160 + return baseUrl('/settings/users/' . $this->id);
161 + }
162 +
163 + /**
164 + * Get the url that links to this user's profile.
165 + * @return mixed
166 + */
167 + public function getProfileUrl()
168 + {
169 + return baseUrl('/user/' . $this->id);
161 } 170 }
162 171
163 /** 172 /**
......
...@@ -20,11 +20,11 @@ if (!function_exists('versioned_asset')) { ...@@ -20,11 +20,11 @@ if (!function_exists('versioned_asset')) {
20 } 20 }
21 21
22 if (isset($manifest[$file])) { 22 if (isset($manifest[$file])) {
23 - return '/' . $manifest[$file]; 23 + return baseUrl($manifest[$file]);
24 } 24 }
25 25
26 if (file_exists(public_path($file))) { 26 if (file_exists(public_path($file))) {
27 - return '/' . $file; 27 + return baseUrl($file);
28 } 28 }
29 29
30 throw new InvalidArgumentException("File {$file} not defined in asset manifest."); 30 throw new InvalidArgumentException("File {$file} not defined in asset manifest.");
...@@ -63,6 +63,40 @@ function setting($key, $default = false) ...@@ -63,6 +63,40 @@ function setting($key, $default = false)
63 } 63 }
64 64
65 /** 65 /**
66 + * Helper to create url's relative to the applications root path.
67 + * @param $path
68 + * @return string
69 + */
70 +function baseUrl($path)
71 +{
72 + if (strpos($path, 'http') === 0) return $path;
73 + $path = trim($path, '/');
74 + return rtrim(config('app.url'), '/') . '/' . $path;
75 +}
76 +
77 +/**
78 + * Get an instance of the redirector.
79 + * Overrides the default laravel redirect helper.
80 + * Ensures it redirects even when the app is in a subdirectory.
81 + *
82 + * @param string|null $to
83 + * @param int $status
84 + * @param array $headers
85 + * @param bool $secure
86 + * @return \Illuminate\Routing\Redirector|\Illuminate\Http\RedirectResponse
87 + */
88 +function redirect($to = null, $status = 302, $headers = [], $secure = null)
89 +{
90 + if (is_null($to)) {
91 + return app('redirect');
92 + }
93 +
94 + $to = baseUrl($to);
95 +
96 + return app('redirect')->to($to, $status, $headers, $secure);
97 +}
98 +
99 +/**
66 * Generate a url with multiple parameters for sorting purposes. 100 * Generate a url with multiple parameters for sorting purposes.
67 * Works out the logic to set the correct sorting direction 101 * Works out the logic to set the correct sorting direction
68 * Discards empty parameters and allows overriding. 102 * Discards empty parameters and allows overriding.
...@@ -91,5 +125,5 @@ function sortUrl($path, $data, $overrideData = []) ...@@ -91,5 +125,5 @@ function sortUrl($path, $data, $overrideData = [])
91 125
92 if (count($queryStringSections) === 0) return $path; 126 if (count($queryStringSections) === 0) return $path;
93 127
94 - return $path . '?' . implode('&', $queryStringSections); 128 + return baseUrl($path . '?' . implode('&', $queryStringSections));
95 } 129 }
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -14,6 +14,7 @@ define('LARAVEL_START', microtime(true)); ...@@ -14,6 +14,7 @@ define('LARAVEL_START', microtime(true));
14 | 14 |
15 */ 15 */
16 16
17 +require __DIR__.'/../app/helpers.php';
17 require __DIR__.'/../vendor/autoload.php'; 18 require __DIR__.'/../vendor/autoload.php';
18 19
19 /* 20 /*
......
...@@ -29,10 +29,7 @@ ...@@ -29,10 +29,7 @@
29 ], 29 ],
30 "psr-4": { 30 "psr-4": {
31 "BookStack\\": "app/" 31 "BookStack\\": "app/"
32 - }, 32 + }
33 - "files": [
34 - "app/helpers.php"
35 - ]
36 }, 33 },
37 "autoload-dev": { 34 "autoload-dev": {
38 "classmap": [ 35 "classmap": [
......
...@@ -31,7 +31,7 @@ return [ ...@@ -31,7 +31,7 @@ return [
31 | 31 |
32 */ 32 */
33 33
34 - 'url' => env('APP_URL', 'http://localhost'), 34 + 'url' => env('APP_URL', '') === 'http://bookstack.dev' ? '' : env('APP_URL', ''),
35 35
36 /* 36 /*
37 |-------------------------------------------------------------------------- 37 |--------------------------------------------------------------------------
...@@ -130,7 +130,6 @@ return [ ...@@ -130,7 +130,6 @@ return [
130 Illuminate\Foundation\Providers\FoundationServiceProvider::class, 130 Illuminate\Foundation\Providers\FoundationServiceProvider::class,
131 Illuminate\Hashing\HashServiceProvider::class, 131 Illuminate\Hashing\HashServiceProvider::class,
132 Illuminate\Mail\MailServiceProvider::class, 132 Illuminate\Mail\MailServiceProvider::class,
133 - Illuminate\Pagination\PaginationServiceProvider::class,
134 Illuminate\Pipeline\PipelineServiceProvider::class, 133 Illuminate\Pipeline\PipelineServiceProvider::class,
135 Illuminate\Queue\QueueServiceProvider::class, 134 Illuminate\Queue\QueueServiceProvider::class,
136 Illuminate\Redis\RedisServiceProvider::class, 135 Illuminate\Redis\RedisServiceProvider::class,
...@@ -153,6 +152,8 @@ return [ ...@@ -153,6 +152,8 @@ return [
153 /* 152 /*
154 * Application Service Providers... 153 * Application Service Providers...
155 */ 154 */
155 + BookStack\Providers\PaginationServiceProvider::class,
156 +
156 BookStack\Providers\AuthServiceProvider::class, 157 BookStack\Providers\AuthServiceProvider::class,
157 BookStack\Providers\AppServiceProvider::class, 158 BookStack\Providers\AppServiceProvider::class,
158 BookStack\Providers\EventServiceProvider::class, 159 BookStack\Providers\EventServiceProvider::class,
......
...@@ -5,8 +5,9 @@ ...@@ -5,8 +5,9 @@
5 */ 5 */
6 return [ 6 return [
7 7
8 - 'app-editor' => 'wysiwyg', 8 + 'app-name' => 'BookStack',
9 - 'app-color' => '#0288D1', 9 + 'app-editor' => 'wysiwyg',
10 + 'app-color' => '#0288D1',
10 'app-color-light' => 'rgba(21, 101, 192, 0.15)' 11 'app-color-light' => 'rgba(21, 101, 192, 0.15)'
11 12
12 ]; 13 ];
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
12 "babel-runtime": "^5.8.29", 12 "babel-runtime": "^5.8.29",
13 "bootstrap-sass": "^3.0.0", 13 "bootstrap-sass": "^3.0.0",
14 "dropzone": "^4.0.1", 14 "dropzone": "^4.0.1",
15 - "laravel-elixir": "^3.4.0", 15 + "laravel-elixir": "^5.0.0",
16 "marked": "^0.3.5", 16 "marked": "^0.3.5",
17 "moment": "^2.12.0", 17 "moment": "^2.12.0",
18 "zeroclipboard": "^2.2.0" 18 "zeroclipboard": "^2.2.0"
......
...@@ -50,3 +50,4 @@ These are the great projects used to help build BookStack: ...@@ -50,3 +50,4 @@ These are the great projects used to help build BookStack:
50 * [ZeroClipboard](http://zeroclipboard.org/) 50 * [ZeroClipboard](http://zeroclipboard.org/)
51 * [TinyColorPicker](http://www.dematte.at/tinyColorPicker/index.html) 51 * [TinyColorPicker](http://www.dematte.at/tinyColorPicker/index.html)
52 * [Marked](https://github.com/chjj/marked) 52 * [Marked](https://github.com/chjj/marked)
53 +* [Moment.js](http://momentjs.com/)
......
1 "use strict"; 1 "use strict";
2 2
3 -var moment = require('moment'); 3 +const moment = require('moment');
4 4
5 module.exports = function (ngApp, events) { 5 module.exports = function (ngApp, events) {
6 6
...@@ -35,7 +35,7 @@ module.exports = function (ngApp, events) { ...@@ -35,7 +35,7 @@ module.exports = function (ngApp, events) {
35 * @returns {string} 35 * @returns {string}
36 */ 36 */
37 $scope.getUploadUrl = function () { 37 $scope.getUploadUrl = function () {
38 - return '/images/' + $scope.imageType + '/upload'; 38 + return window.baseUrl('/images/' + $scope.imageType + '/upload');
39 }; 39 };
40 40
41 /** 41 /**
...@@ -133,7 +133,7 @@ module.exports = function (ngApp, events) { ...@@ -133,7 +133,7 @@ module.exports = function (ngApp, events) {
133 $scope.showing = false; 133 $scope.showing = false;
134 }; 134 };
135 135
136 - var baseUrl = '/images/' + $scope.imageType + '/all/' 136 + var baseUrl = window.baseUrl('/images/' + $scope.imageType + '/all/');
137 137
138 /** 138 /**
139 * Fetch the list image data from the server. 139 * Fetch the list image data from the server.
...@@ -178,7 +178,7 @@ module.exports = function (ngApp, events) { ...@@ -178,7 +178,7 @@ module.exports = function (ngApp, events) {
178 $scope.images = []; 178 $scope.images = [];
179 $scope.hasMore = false; 179 $scope.hasMore = false;
180 page = 0; 180 page = 0;
181 - baseUrl = '/images/' + $scope.imageType + '/search/'; 181 + baseUrl = window.baseUrl('/images/' + $scope.imageType + '/search/');
182 fetchData(); 182 fetchData();
183 }; 183 };
184 184
...@@ -192,7 +192,7 @@ module.exports = function (ngApp, events) { ...@@ -192,7 +192,7 @@ module.exports = function (ngApp, events) {
192 $scope.hasMore = false; 192 $scope.hasMore = false;
193 page = 0; 193 page = 0;
194 $scope.view = viewName; 194 $scope.view = viewName;
195 - baseUrl = '/images/' + $scope.imageType + '/' + viewName + '/'; 195 + baseUrl = window.baseUrl('/images/' + $scope.imageType + '/' + viewName + '/');
196 fetchData(); 196 fetchData();
197 } 197 }
198 198
...@@ -202,7 +202,7 @@ module.exports = function (ngApp, events) { ...@@ -202,7 +202,7 @@ module.exports = function (ngApp, events) {
202 */ 202 */
203 $scope.saveImageDetails = function (event) { 203 $scope.saveImageDetails = function (event) {
204 event.preventDefault(); 204 event.preventDefault();
205 - var url = '/images/update/' + $scope.selectedImage.id; 205 + var url = window.baseUrl('/images/update/' + $scope.selectedImage.id);
206 $http.put(url, this.selectedImage).then((response) => { 206 $http.put(url, this.selectedImage).then((response) => {
207 events.emit('success', 'Image details updated'); 207 events.emit('success', 'Image details updated');
208 }, (response) => { 208 }, (response) => {
...@@ -228,7 +228,7 @@ module.exports = function (ngApp, events) { ...@@ -228,7 +228,7 @@ module.exports = function (ngApp, events) {
228 $scope.deleteImage = function (event) { 228 $scope.deleteImage = function (event) {
229 event.preventDefault(); 229 event.preventDefault();
230 var force = $scope.dependantPages !== false; 230 var force = $scope.dependantPages !== false;
231 - var url = '/images/' + $scope.selectedImage.id; 231 + var url = window.baseUrl('/images/' + $scope.selectedImage.id);
232 if (force) url += '?force=true'; 232 if (force) url += '?force=true';
233 $http.delete(url).then((response) => { 233 $http.delete(url).then((response) => {
234 $scope.images.splice($scope.images.indexOf($scope.selectedImage), 1); 234 $scope.images.splice($scope.images.indexOf($scope.selectedImage), 1);
...@@ -267,7 +267,7 @@ module.exports = function (ngApp, events) { ...@@ -267,7 +267,7 @@ module.exports = function (ngApp, events) {
267 if (term.length == 0) return; 267 if (term.length == 0) return;
268 $scope.searching = true; 268 $scope.searching = true;
269 $scope.searchResults = ''; 269 $scope.searchResults = '';
270 - var searchUrl = '/search/book/' + $attrs.bookId; 270 + var searchUrl = window.baseUrl('/search/book/' + $attrs.bookId);
271 searchUrl += '?term=' + encodeURIComponent(term); 271 searchUrl += '?term=' + encodeURIComponent(term);
272 $http.get(searchUrl).then((response) => { 272 $http.get(searchUrl).then((response) => {
273 $scope.searchResults = $sce.trustAsHtml(response.data); 273 $scope.searchResults = $sce.trustAsHtml(response.data);
...@@ -368,7 +368,8 @@ module.exports = function (ngApp, events) { ...@@ -368,7 +368,8 @@ module.exports = function (ngApp, events) {
368 368
369 if (isMarkdown) data.markdown = $scope.editContent; 369 if (isMarkdown) data.markdown = $scope.editContent;
370 370
371 - $http.put('/ajax/page/' + pageId + '/save-draft', data).then((responseData) => { 371 + let url = window.baseUrl('/ajax/page/' + pageId + '/save-draft');
372 + $http.put(url, data).then((responseData) => {
372 var updateTime = moment.utc(moment.unix(responseData.data.timestamp)).toDate(); 373 var updateTime = moment.utc(moment.unix(responseData.data.timestamp)).toDate();
373 $scope.draftText = responseData.data.message + moment(updateTime).format('HH:mm'); 374 $scope.draftText = responseData.data.message + moment(updateTime).format('HH:mm');
374 if (!$scope.isNewPageDraft) $scope.isUpdateDraft = true; 375 if (!$scope.isNewPageDraft) $scope.isUpdateDraft = true;
...@@ -393,7 +394,8 @@ module.exports = function (ngApp, events) { ...@@ -393,7 +394,8 @@ module.exports = function (ngApp, events) {
393 * content from the system via an AJAX request. 394 * content from the system via an AJAX request.
394 */ 395 */
395 $scope.discardDraft = function () { 396 $scope.discardDraft = function () {
396 - $http.get('/ajax/page/' + pageId).then((responseData) => { 397 + let url = window.baseUrl('/ajax/page/' + pageId);
398 + $http.get(url).then((responseData) => {
397 if (autoSave) $interval.cancel(autoSave); 399 if (autoSave) $interval.cancel(autoSave);
398 $scope.draftText = 'Editing Page'; 400 $scope.draftText = 'Editing Page';
399 $scope.isUpdateDraft = false; 401 $scope.isUpdateDraft = false;
...@@ -437,7 +439,8 @@ module.exports = function (ngApp, events) { ...@@ -437,7 +439,8 @@ module.exports = function (ngApp, events) {
437 * Get all tags for the current book and add into scope. 439 * Get all tags for the current book and add into scope.
438 */ 440 */
439 function getTags() { 441 function getTags() {
440 - $http.get('/ajax/tags/get/page/' + pageId).then((responseData) => { 442 + let url = window.baseUrl('/ajax/tags/get/page/' + pageId);
443 + $http.get(url).then((responseData) => {
441 $scope.tags = responseData.data; 444 $scope.tags = responseData.data;
442 addEmptyTag(); 445 addEmptyTag();
443 }); 446 });
...@@ -486,7 +489,8 @@ module.exports = function (ngApp, events) { ...@@ -486,7 +489,8 @@ module.exports = function (ngApp, events) {
486 $scope.saveTags = function() { 489 $scope.saveTags = function() {
487 setTagOrder(); 490 setTagOrder();
488 let postData = {tags: $scope.tags}; 491 let postData = {tags: $scope.tags};
489 - $http.post('/ajax/tags/update/page/' + pageId, postData).then((responseData) => { 492 + let url = window.baseUrl('/ajax/tags/update/page/' + pageId);
493 + $http.post(url, postData).then((responseData) => {
490 $scope.tags = responseData.data.tags; 494 $scope.tags = responseData.data.tags;
491 addEmptyTag(); 495 addEmptyTag();
492 events.emit('success', responseData.data.message); 496 events.emit('success', responseData.data.message);
......
1 "use strict"; 1 "use strict";
2 -var DropZone = require('dropzone'); 2 +const DropZone = require('dropzone');
3 -var markdown = require('marked'); 3 +const markdown = require('marked');
4 4
5 -var toggleSwitchTemplate = require('./components/toggle-switch.html'); 5 +const toggleSwitchTemplate = require('./components/toggle-switch.html');
6 -var imagePickerTemplate = require('./components/image-picker.html'); 6 +const imagePickerTemplate = require('./components/image-picker.html');
7 -var dropZoneTemplate = require('./components/drop-zone.html'); 7 +const dropZoneTemplate = require('./components/drop-zone.html');
8 8
9 module.exports = function (ngApp, events) { 9 module.exports = function (ngApp, events) {
10 10
...@@ -54,7 +54,7 @@ module.exports = function (ngApp, events) { ...@@ -54,7 +54,7 @@ module.exports = function (ngApp, events) {
54 imageClass: '@' 54 imageClass: '@'
55 }, 55 },
56 link: function (scope, element, attrs) { 56 link: function (scope, element, attrs) {
57 - var usingIds = typeof scope.currentId !== 'undefined' || scope.currentId === 'false'; 57 + let usingIds = typeof scope.currentId !== 'undefined' || scope.currentId === 'false';
58 scope.image = scope.currentImage; 58 scope.image = scope.currentImage;
59 scope.value = scope.currentImage || ''; 59 scope.value = scope.currentImage || '';
60 if (usingIds) scope.value = scope.currentId; 60 if (usingIds) scope.value = scope.currentId;
...@@ -80,7 +80,7 @@ module.exports = function (ngApp, events) { ...@@ -80,7 +80,7 @@ module.exports = function (ngApp, events) {
80 }; 80 };
81 81
82 scope.updateImageFromModel = function (model) { 82 scope.updateImageFromModel = function (model) {
83 - var isResized = scope.resizeWidth && scope.resizeHeight; 83 + let isResized = scope.resizeWidth && scope.resizeHeight;
84 84
85 if (!isResized) { 85 if (!isResized) {
86 scope.$apply(() => { 86 scope.$apply(() => {
...@@ -89,8 +89,9 @@ module.exports = function (ngApp, events) { ...@@ -89,8 +89,9 @@ module.exports = function (ngApp, events) {
89 return; 89 return;
90 } 90 }
91 91
92 - var cropped = scope.resizeCrop ? 'true' : 'false'; 92 + let cropped = scope.resizeCrop ? 'true' : 'false';
93 - var requestString = '/images/thumb/' + model.id + '/' + scope.resizeWidth + '/' + scope.resizeHeight + '/' + cropped; 93 + let requestString = '/images/thumb/' + model.id + '/' + scope.resizeWidth + '/' + scope.resizeHeight + '/' + cropped;
94 + requestString = window.baseUrl(requestString);
94 $http.get(requestString).then((response) => { 95 $http.get(requestString).then((response) => {
95 setImage(model, response.data.url); 96 setImage(model, response.data.url);
96 }); 97 });
...@@ -265,11 +266,14 @@ module.exports = function (ngApp, events) { ...@@ -265,11 +266,14 @@ module.exports = function (ngApp, events) {
265 link: function (scope, element, attrs) { 266 link: function (scope, element, attrs) {
266 267
267 // Set initial model content 268 // Set initial model content
268 - var content = element.val(); 269 + element = element.find('textarea').first();
270 + let content = element.val();
269 scope.mdModel = content; 271 scope.mdModel = content;
270 scope.mdChange(markdown(content)); 272 scope.mdChange(markdown(content));
271 273
272 - element.on('change input', (e) => { 274 + console.log('test');
275 +
276 + element.on('change input', (event) => {
273 content = element.val(); 277 content = element.val();
274 $timeout(() => { 278 $timeout(() => {
275 scope.mdModel = content; 279 scope.mdModel = content;
...@@ -297,7 +301,7 @@ module.exports = function (ngApp, events) { ...@@ -297,7 +301,7 @@ module.exports = function (ngApp, events) {
297 link: function (scope, element, attrs) { 301 link: function (scope, element, attrs) {
298 302
299 // Elements 303 // Elements
300 - const input = element.find('textarea[markdown-input]'); 304 + const input = element.find('[markdown-input] textarea').first();
301 const display = element.find('.markdown-display').first(); 305 const display = element.find('.markdown-display').first();
302 const insertImage = element.find('button[data-action="insertImage"]'); 306 const insertImage = element.find('button[data-action="insertImage"]');
303 307
...@@ -342,9 +346,9 @@ module.exports = function (ngApp, events) { ...@@ -342,9 +346,9 @@ module.exports = function (ngApp, events) {
342 // Insert image shortcut 346 // Insert image shortcut
343 if (event.which === 73 && event.ctrlKey && event.shiftKey) { 347 if (event.which === 73 && event.ctrlKey && event.shiftKey) {
344 event.preventDefault(); 348 event.preventDefault();
345 - var caretPos = input[0].selectionStart; 349 + let caretPos = input[0].selectionStart;
346 - var currentContent = input.val(); 350 + let currentContent = input.val();
347 - var mdImageText = "![](http://)"; 351 + const mdImageText = "![](http://)";
348 input.val(currentContent.substring(0, caretPos) + mdImageText + currentContent.substring(caretPos)); 352 input.val(currentContent.substring(0, caretPos) + mdImageText + currentContent.substring(caretPos));
349 input.focus(); 353 input.focus();
350 input[0].selectionStart = caretPos + ("![](".length); 354 input[0].selectionStart = caretPos + ("![](".length);
...@@ -358,9 +362,9 @@ module.exports = function (ngApp, events) { ...@@ -358,9 +362,9 @@ module.exports = function (ngApp, events) {
358 // Insert image from image manager 362 // Insert image from image manager
359 insertImage.click(event => { 363 insertImage.click(event => {
360 window.ImageManager.showExternal(image => { 364 window.ImageManager.showExternal(image => {
361 - var caretPos = currentCaretPos; 365 + let caretPos = currentCaretPos;
362 - var currentContent = input.val(); 366 + let currentContent = input.val();
363 - var mdImageText = "![" + image.name + "](" + image.url + ")"; 367 + let mdImageText = "![" + image.name + "](" + image.url + ")";
364 input.val(currentContent.substring(0, caretPos) + mdImageText + currentContent.substring(caretPos)); 368 input.val(currentContent.substring(0, caretPos) + mdImageText + currentContent.substring(caretPos));
365 input.change(); 369 input.change();
366 }); 370 });
...@@ -634,7 +638,7 @@ module.exports = function (ngApp, events) { ...@@ -634,7 +638,7 @@ module.exports = function (ngApp, events) {
634 // Get search url with correct types 638 // Get search url with correct types
635 function getSearchUrl() { 639 function getSearchUrl() {
636 let types = (attrs.entityTypes) ? encodeURIComponent(attrs.entityTypes) : encodeURIComponent('page,book,chapter'); 640 let types = (attrs.entityTypes) ? encodeURIComponent(attrs.entityTypes) : encodeURIComponent('page,book,chapter');
637 - return `/ajax/search/entities?types=${types}`; 641 + return window.baseUrl(`/ajax/search/entities?types=${types}`);
638 } 642 }
639 643
640 // Get initial contents 644 // Get initial contents
......
...@@ -7,6 +7,14 @@ var ngAnimate = require('angular-animate'); ...@@ -7,6 +7,14 @@ var ngAnimate = require('angular-animate');
7 var ngSanitize = require('angular-sanitize'); 7 var ngSanitize = require('angular-sanitize');
8 require('angular-ui-sortable'); 8 require('angular-ui-sortable');
9 9
10 +// Url retrieval function
11 +window.baseUrl = function(path) {
12 + let basePath = document.querySelector('meta[name="base-url"]').getAttribute('content');
13 + if (basePath[basePath.length-1] === '/') basePath = basePath.slice(0, basePath.length-1);
14 + if (path[0] === '/') path = path.slice(1);
15 + return basePath + '/' + path;
16 +};
17 +
10 var ngApp = angular.module('bookStack', ['ngResource', 'ngAnimate', 'ngSanitize', 'ui.sortable']); 18 var ngApp = angular.module('bookStack', ['ngResource', 'ngAnimate', 'ngSanitize', 'ui.sortable']);
11 19
12 // Global Event System 20 // Global Event System
...@@ -33,6 +41,7 @@ class Events { ...@@ -33,6 +41,7 @@ class Events {
33 }; 41 };
34 window.Events = new Events(); 42 window.Events = new Events();
35 43
44 +
36 var services = require('./services')(ngApp, Events); 45 var services = require('./services')(ngApp, Events);
37 var directives = require('./directives')(ngApp, Events); 46 var directives = require('./directives')(ngApp, Events);
38 var controllers = require('./controllers')(ngApp, Events); 47 var controllers = require('./controllers')(ngApp, Events);
......
...@@ -26,7 +26,7 @@ function editorPaste(e) { ...@@ -26,7 +26,7 @@ function editorPaste(e) {
26 formData.append('file', file, remoteFilename); 26 formData.append('file', file, remoteFilename);
27 formData.append('_token', document.querySelector('meta[name="token"]').getAttribute('content')); 27 formData.append('_token', document.querySelector('meta[name="token"]').getAttribute('content'));
28 28
29 - xhr.open('POST', '/images/gallery/upload'); 29 + xhr.open('POST', window.baseUrl('/images/gallery/upload'));
30 xhr.onload = function () { 30 xhr.onload = function () {
31 if (xhr.status === 200 || xhr.status === 201) { 31 if (xhr.status === 200 || xhr.status === 201) {
32 var result = JSON.parse(xhr.responseText); 32 var result = JSON.parse(xhr.responseText);
...@@ -58,8 +58,8 @@ function registerEditorShortcuts(editor) { ...@@ -58,8 +58,8 @@ function registerEditorShortcuts(editor) {
58 var mceOptions = module.exports = { 58 var mceOptions = module.exports = {
59 selector: '#html-editor', 59 selector: '#html-editor',
60 content_css: [ 60 content_css: [
61 - '/css/styles.css', 61 + window.baseUrl('/css/styles.css'),
62 - '/libs/material-design-iconic-font/css/material-design-iconic-font.min.css' 62 + window.baseUrl('/libs/material-design-iconic-font/css/material-design-iconic-font.min.css')
63 ], 63 ],
64 body_class: 'page-content', 64 body_class: 'page-content',
65 relative_urls: false, 65 relative_urls: false,
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
2 // Configure ZeroClipboard 2 // Configure ZeroClipboard
3 var zeroClipBoard = require('zeroclipboard'); 3 var zeroClipBoard = require('zeroclipboard');
4 zeroClipBoard.config({ 4 zeroClipBoard.config({
5 - swfPath: '/ZeroClipboard.swf' 5 + swfPath: window.baseUrl('/ZeroClipboard.swf')
6 }); 6 });
7 7
8 window.setupPageShow = module.exports = function (pageId) { 8 window.setupPageShow = module.exports = function (pageId) {
...@@ -36,7 +36,8 @@ window.setupPageShow = module.exports = function (pageId) { ...@@ -36,7 +36,8 @@ window.setupPageShow = module.exports = function (pageId) {
36 36
37 // Show pointer and set link 37 // Show pointer and set link
38 var $elem = $(this); 38 var $elem = $(this);
39 - var link = window.location.protocol + "//" + window.location.host + '/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 $pointer.find('input').val(link); 41 $pointer.find('input').val(link);
41 $pointer.find('button').first().attr('data-clipboard-text', link); 42 $pointer.find('button').first().attr('data-clipboard-text', link);
42 $elem.before($pointer); 43 $elem.before($pointer);
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
6 font-style: normal; 6 font-style: normal;
7 font-weight: 100; 7 font-weight: 100;
8 src: local('Roboto Thin'), local('Roboto-Thin'), 8 src: local('Roboto Thin'), local('Roboto-Thin'),
9 - url('/fonts/roboto-v15-cyrillic_latin-100.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ 9 + url('../fonts/roboto-v15-cyrillic_latin-100.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */
10 - url('/fonts/roboto-v15-cyrillic_latin-100.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ 10 + url('../fonts/roboto-v15-cyrillic_latin-100.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
11 } 11 }
12 /* roboto-100italic - cyrillic_latin */ 12 /* roboto-100italic - cyrillic_latin */
13 @font-face { 13 @font-face {
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
15 font-style: italic; 15 font-style: italic;
16 font-weight: 100; 16 font-weight: 100;
17 src: local('Roboto Thin Italic'), local('Roboto-ThinItalic'), 17 src: local('Roboto Thin Italic'), local('Roboto-ThinItalic'),
18 - url('/fonts/roboto-v15-cyrillic_latin-100italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ 18 + url('../fonts/roboto-v15-cyrillic_latin-100italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */
19 - url('/fonts/roboto-v15-cyrillic_latin-100italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ 19 + url('../fonts/roboto-v15-cyrillic_latin-100italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
20 } 20 }
21 /* roboto-300 - cyrillic_latin */ 21 /* roboto-300 - cyrillic_latin */
22 @font-face { 22 @font-face {
...@@ -24,8 +24,8 @@ ...@@ -24,8 +24,8 @@
24 font-style: normal; 24 font-style: normal;
25 font-weight: 300; 25 font-weight: 300;
26 src: local('Roboto Light'), local('Roboto-Light'), 26 src: local('Roboto Light'), local('Roboto-Light'),
27 - url('/fonts/roboto-v15-cyrillic_latin-300.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ 27 + url('../fonts/roboto-v15-cyrillic_latin-300.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */
28 - url('/fonts/roboto-v15-cyrillic_latin-300.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ 28 + url('../fonts/roboto-v15-cyrillic_latin-300.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
29 } 29 }
30 /* roboto-300italic - cyrillic_latin */ 30 /* roboto-300italic - cyrillic_latin */
31 @font-face { 31 @font-face {
...@@ -33,8 +33,8 @@ ...@@ -33,8 +33,8 @@
33 font-style: italic; 33 font-style: italic;
34 font-weight: 300; 34 font-weight: 300;
35 src: local('Roboto Light Italic'), local('Roboto-LightItalic'), 35 src: local('Roboto Light Italic'), local('Roboto-LightItalic'),
36 - url('/fonts/roboto-v15-cyrillic_latin-300italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ 36 + url('../fonts/roboto-v15-cyrillic_latin-300italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */
37 - url('/fonts/roboto-v15-cyrillic_latin-300italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ 37 + url('../fonts/roboto-v15-cyrillic_latin-300italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
38 } 38 }
39 /* roboto-regular - cyrillic_latin */ 39 /* roboto-regular - cyrillic_latin */
40 @font-face { 40 @font-face {
...@@ -42,8 +42,8 @@ ...@@ -42,8 +42,8 @@
42 font-style: normal; 42 font-style: normal;
43 font-weight: 400; 43 font-weight: 400;
44 src: local('Roboto'), local('Roboto-Regular'), 44 src: local('Roboto'), local('Roboto-Regular'),
45 - url('/fonts/roboto-v15-cyrillic_latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ 45 + url('../fonts/roboto-v15-cyrillic_latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */
46 - url('/fonts/roboto-v15-cyrillic_latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ 46 + url('../fonts/roboto-v15-cyrillic_latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
47 } 47 }
48 /* roboto-italic - cyrillic_latin */ 48 /* roboto-italic - cyrillic_latin */
49 @font-face { 49 @font-face {
...@@ -51,8 +51,8 @@ ...@@ -51,8 +51,8 @@
51 font-style: italic; 51 font-style: italic;
52 font-weight: 400; 52 font-weight: 400;
53 src: local('Roboto Italic'), local('Roboto-Italic'), 53 src: local('Roboto Italic'), local('Roboto-Italic'),
54 - url('/fonts/roboto-v15-cyrillic_latin-italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ 54 + url('../fonts/roboto-v15-cyrillic_latin-italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */
55 - url('/fonts/roboto-v15-cyrillic_latin-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ 55 + url('../fonts/roboto-v15-cyrillic_latin-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
56 } 56 }
57 /* roboto-500 - cyrillic_latin */ 57 /* roboto-500 - cyrillic_latin */
58 @font-face { 58 @font-face {
...@@ -60,8 +60,8 @@ ...@@ -60,8 +60,8 @@
60 font-style: normal; 60 font-style: normal;
61 font-weight: 500; 61 font-weight: 500;
62 src: local('Roboto Medium'), local('Roboto-Medium'), 62 src: local('Roboto Medium'), local('Roboto-Medium'),
63 - url('/fonts/roboto-v15-cyrillic_latin-500.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ 63 + url('../fonts/roboto-v15-cyrillic_latin-500.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */
64 - url('/fonts/roboto-v15-cyrillic_latin-500.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ 64 + url('../fonts/roboto-v15-cyrillic_latin-500.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
65 } 65 }
66 /* roboto-500italic - cyrillic_latin */ 66 /* roboto-500italic - cyrillic_latin */
67 @font-face { 67 @font-face {
...@@ -69,8 +69,8 @@ ...@@ -69,8 +69,8 @@
69 font-style: italic; 69 font-style: italic;
70 font-weight: 500; 70 font-weight: 500;
71 src: local('Roboto Medium Italic'), local('Roboto-MediumItalic'), 71 src: local('Roboto Medium Italic'), local('Roboto-MediumItalic'),
72 - url('/fonts/roboto-v15-cyrillic_latin-500italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ 72 + url('../fonts/roboto-v15-cyrillic_latin-500italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */
73 - url('/fonts/roboto-v15-cyrillic_latin-500italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ 73 + url('../fonts/roboto-v15-cyrillic_latin-500italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
74 } 74 }
75 /* roboto-700 - cyrillic_latin */ 75 /* roboto-700 - cyrillic_latin */
76 @font-face { 76 @font-face {
...@@ -78,8 +78,8 @@ ...@@ -78,8 +78,8 @@
78 font-style: normal; 78 font-style: normal;
79 font-weight: 700; 79 font-weight: 700;
80 src: local('Roboto Bold'), local('Roboto-Bold'), 80 src: local('Roboto Bold'), local('Roboto-Bold'),
81 - url('/fonts/roboto-v15-cyrillic_latin-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ 81 + url('../fonts/roboto-v15-cyrillic_latin-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */
82 - url('/fonts/roboto-v15-cyrillic_latin-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ 82 + url('../fonts/roboto-v15-cyrillic_latin-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
83 } 83 }
84 /* roboto-700italic - cyrillic_latin */ 84 /* roboto-700italic - cyrillic_latin */
85 @font-face { 85 @font-face {
...@@ -87,8 +87,8 @@ ...@@ -87,8 +87,8 @@
87 font-style: italic; 87 font-style: italic;
88 font-weight: 700; 88 font-weight: 700;
89 src: local('Roboto Bold Italic'), local('Roboto-BoldItalic'), 89 src: local('Roboto Bold Italic'), local('Roboto-BoldItalic'),
90 - url('/fonts/roboto-v15-cyrillic_latin-700italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ 90 + url('../fonts/roboto-v15-cyrillic_latin-700italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */
91 - url('/fonts/roboto-v15-cyrillic_latin-700italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ 91 + url('../fonts/roboto-v15-cyrillic_latin-700italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
92 } 92 }
93 93
94 /* roboto-mono-regular - latin */ 94 /* roboto-mono-regular - latin */
...@@ -97,6 +97,6 @@ ...@@ -97,6 +97,6 @@
97 font-style: normal; 97 font-style: normal;
98 font-weight: 400; 98 font-weight: 400;
99 src: local('Roboto Mono'), local('RobotoMono-Regular'), 99 src: local('Roboto Mono'), local('RobotoMono-Regular'),
100 - url('/fonts/roboto-mono-v4-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */ 100 + url('../fonts/roboto-mono-v4-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+ */
101 - url('/fonts/roboto-mono-v4-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ 101 + url('../fonts/roboto-mono-v4-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
102 } 102 }
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -23,7 +23,7 @@ button { ...@@ -23,7 +23,7 @@ button {
23 23
24 table { 24 table {
25 min-width: 100px; 25 min-width: 100px;
26 - td { 26 + td, th {
27 min-width: 10px; 27 min-width: 10px;
28 padding: 4px 6px; 28 padding: 4px 6px;
29 border: 1px solid #DDD; 29 border: 1px solid #DDD;
......
...@@ -158,8 +158,8 @@ ...@@ -158,8 +158,8 @@
158 .tabs { 158 .tabs {
159 display: block; 159 display: block;
160 border-right: 1px solid #DDD; 160 border-right: 1px solid #DDD;
161 - width: 54px; 161 + width: 48px;
162 - flex: 0; 162 + flex: 0 1 auto;
163 } 163 }
164 .tabs i { 164 .tabs i {
165 color: rgba(0, 0, 0, 0.5); 165 color: rgba(0, 0, 0, 0.5);
......
...@@ -24,21 +24,22 @@ ...@@ -24,21 +24,22 @@
24 text-align: center; 24 text-align: center;
25 } 25 }
26 26
27 -.edit-area.flex > .mce-tinymce.mce-container.mce-panel { 27 +.edit-area.flex > div > .mce-tinymce.mce-container.mce-panel {
28 - height: 100%; 28 + flex: 1 1 auto;
29 - max-height: 100%;
30 - flex: 1;
31 display: flex !important; 29 display: flex !important;
32 flex-direction: column; 30 flex-direction: column;
33 align-items: stretch; 31 align-items: stretch;
34 margin: 0 -1px; 32 margin: 0 -1px;
35 > .mce-container-body { 33 > .mce-container-body {
36 - flex: 1; 34 + flex: 1 1 auto;
37 display: flex !important; 35 display: flex !important;
38 flex-direction: column; 36 flex-direction: column;
39 align-items: stretch; 37 align-items: stretch;
38 + > .mce-toolbar-grp {
39 + flex: 0 1 auto;
40 + }
40 > .mce-edit-area { 41 > .mce-edit-area {
41 - flex: 1; 42 + flex: 1 1 auto;
42 display: flex !important; 43 display: flex !important;
43 flex-direction: column; 44 flex-direction: column;
44 align-items: stretch; 45 align-items: stretch;
......
...@@ -6,5 +6,5 @@ ...@@ -6,5 +6,5 @@
6 <div class="form-group"> 6 <div class="form-group">
7 <label for="password">Password</label> 7 <label for="password">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="/password/email">Forgot Password?</a></span> 9 + <span class="block small"><a href="{{ baseUrl('/password/email') }}">Forgot Password?</a></span>
10 </div> 10 </div>
...\ No newline at end of file ...\ No newline at end of file
......
1 @extends('public') 1 @extends('public')
2 2
3 @section('header-buttons') 3 @section('header-buttons')
4 - @if(Setting::get('registration-enabled')) 4 + @if(setting('registration-enabled', false))
5 - <a href="/register"><i class="zmdi zmdi-account-add"></i>Sign up</a> 5 + <a href="{{ baseUrl("/register") }}"><i class="zmdi zmdi-account-add"></i>Sign up</a>
6 @endif 6 @endif
7 @stop 7 @stop
8 8
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
12 <div class="center-box"> 12 <div class="center-box">
13 <h1>Log In</h1> 13 <h1>Log In</h1>
14 14
15 - <form action="/login" method="POST" id="login-form"> 15 + <form action="{{ baseUrl("/login") }}" method="POST" id="login-form">
16 {!! csrf_field() !!} 16 {!! csrf_field() !!}
17 17
18 18
...@@ -34,10 +34,10 @@ ...@@ -34,10 +34,10 @@
34 <hr class="margin-top"> 34 <hr class="margin-top">
35 <h3 class="text-muted">Social Login</h3> 35 <h3 class="text-muted">Social Login</h3>
36 @if(isset($socialDrivers['google'])) 36 @if(isset($socialDrivers['google']))
37 - <a href="/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
39 @if(isset($socialDrivers['github'])) 39 @if(isset($socialDrivers['github']))
40 - <a href="/login/service/github" style="color:#444;"><i class="zmdi zmdi-github zmdi-hc-4x"></i></a> 40 + <a href="{{ baseUrl("/login/service/github") }}" style="color:#444;"><i class="zmdi zmdi-github zmdi-hc-4x"></i></a>
41 @endif 41 @endif
42 @endif 42 @endif
43 </div> 43 </div>
......
1 @extends('public') 1 @extends('public')
2 2
3 -@section('body-class', 'image-cover login')
4 -
5 @section('content') 3 @section('content')
6 4
7 5
...@@ -11,7 +9,7 @@ ...@@ -11,7 +9,7 @@
11 9
12 <p class="muted small">Enter your email below and you will be sent an email with a password reset link.</p> 10 <p class="muted small">Enter your email below and you will be sent an email with a password reset link.</p>
13 11
14 - <form action="/password/email" method="POST"> 12 + <form action="{{ baseUrl("/password/email") }}" method="POST">
15 {!! csrf_field() !!} 13 {!! csrf_field() !!}
16 14
17 <div class="form-group"> 15 <div class="form-group">
......
...@@ -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="/login"><i class="zmdi zmdi-sign-in"></i>Sign in</a> 5 + <a href="{{ baseUrl("/login") }}"><i class="zmdi zmdi-sign-in"></i>Sign in</a>
6 @endif 6 @endif
7 @stop 7 @stop
8 8
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
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>Thanks for registering!</h2>
14 - <p>Please check your email and click the confirmation button to access {{ \Setting::get('app-name') }}.</p> 14 + <p>Please check your email and click the confirmation button to access {{ setting('app-name', 'BookStack') }}.</p>
15 </div> 15 </div>
16 </div> 16 </div>
17 17
......
1 @extends('public') 1 @extends('public')
2 2
3 @section('header-buttons') 3 @section('header-buttons')
4 - <a href="/login"><i class="zmdi zmdi-sign-in"></i>Sign in</a> 4 + <a href="{{ baseUrl("/login") }}"><i class="zmdi zmdi-sign-in"></i>Sign in</a>
5 @stop 5 @stop
6 6
7 @section('content') 7 @section('content')
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
10 <div class="center-box"> 10 <div class="center-box">
11 <h1>Sign Up</h1> 11 <h1>Sign Up</h1>
12 12
13 - <form action="/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">
...@@ -38,10 +38,10 @@ ...@@ -38,10 +38,10 @@
38 <h3 class="text-muted">Social Registration</h3> 38 <h3 class="text-muted">Social Registration</h3>
39 <p class="text-small">Register and sign in using another service.</p> 39 <p class="text-small">Register and sign in using another service.</p>
40 @if(isset($socialDrivers['google'])) 40 @if(isset($socialDrivers['google']))
41 - <a href="/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
43 @if(isset($socialDrivers['github'])) 43 @if(isset($socialDrivers['github']))
44 - <a href="/register/service/github" style="color:#444;"><i class="zmdi zmdi-github zmdi-hc-4x"></i></a> 44 + <a href="{{ baseUrl("/register/service/github") }}" style="color:#444;"><i class="zmdi zmdi-github zmdi-hc-4x"></i></a>
45 @endif 45 @endif
46 @endif 46 @endif
47 </div> 47 </div>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
9 <div class="center-box text-left"> 9 <div class="center-box text-left">
10 <h1>Reset Password</h1> 10 <h1>Reset Password</h1>
11 11
12 - <form action="/password/reset" method="POST"> 12 + <form action="{{ baseUrl("/password/reset") }}" method="POST">
13 {!! csrf_field() !!} 13 {!! csrf_field() !!}
14 <input type="hidden" name="token" value="{{ $token }}"> 14 <input type="hidden" name="token" value="{{ $token }}">
15 15
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
10 If you cannot find the email you can re-send the confirmation email by submitting the form below. 10 If you cannot find the email you can re-send the confirmation email by submitting the form below.
11 </p> 11 </p>
12 <hr> 12 <hr>
13 - <form action="/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">Email Address</label>
......
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html class="@yield('body-class')"> 2 <html class="@yield('body-class')">
3 <head> 3 <head>
4 - <title>{{ isset($pageTitle) ? $pageTitle . ' | ' : '' }}{{ setting('app-name', 'BookStack') }}</title> 4 + <title>{{ isset($pageTitle) ? $pageTitle . ' | ' : '' }}{{ setting('app-name') }}</title>
5 5
6 <!-- Meta --> 6 <!-- Meta -->
7 <meta name="viewport" content="width=device-width"> 7 <meta name="viewport" content="width=device-width">
8 <meta name="token" content="{{ csrf_token() }}"> 8 <meta name="token" content="{{ csrf_token() }}">
9 + <meta name="base-url" content="{{ baseUrl('/') }}">
9 <meta charset="utf-8"> 10 <meta charset="utf-8">
10 11
11 <!-- Styles and Fonts --> 12 <!-- Styles and Fonts -->
12 <link rel="stylesheet" href="{{ versioned_asset('css/styles.css') }}"> 13 <link rel="stylesheet" href="{{ versioned_asset('css/styles.css') }}">
13 <link rel="stylesheet" media="print" href="{{ versioned_asset('css/print-styles.css') }}"> 14 <link rel="stylesheet" media="print" href="{{ versioned_asset('css/print-styles.css') }}">
14 - <link rel="stylesheet" href="/libs/material-design-iconic-font/css/material-design-iconic-font.min.css"> 15 + <link rel="stylesheet" href="{{ baseUrl('/libs/material-design-iconic-font/css/material-design-iconic-font.min.css') }}">
15 16
16 <!-- Scripts --> 17 <!-- Scripts -->
17 - <script src="/libs/jquery/jquery.min.js?version=2.1.4"></script> 18 + <script src="{{ baseUrl('/libs/jquery/jquery.min.js?version=2.1.4') }}"></script>
18 - <script src="/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>
19 20
20 @yield('head') 21 @yield('head')
21 22
...@@ -34,15 +35,15 @@ ...@@ -34,15 +35,15 @@
34 <div class="container"> 35 <div class="container">
35 <div class="row"> 36 <div class="row">
36 <div class="col-lg-4 col-sm-4" ng-non-bindable> 37 <div class="col-lg-4 col-sm-4" ng-non-bindable>
37 - <a href="/" class="logo"> 38 + <a href="{{ baseUrl('/') }}" class="logo">
38 @if(setting('app-logo', '') !== 'none') 39 @if(setting('app-logo', '') !== 'none')
39 - <img class="logo-image" src="{{ setting('app-logo', '') === '' ? '/logo.png' : setting('app-logo', '') }}" alt="Logo"> 40 + <img class="logo-image" src="{{ setting('app-logo', '') === '' ? baseUrl('/logo.png') : baseUrl(setting('app-logo', '')) }}" alt="Logo">
40 @endif 41 @endif
41 - <span class="logo-text">{{ setting('app-name', 'BookStack') }}</span> 42 + <span class="logo-text">{{ setting('app-name') }}</span>
42 </a> 43 </a>
43 </div> 44 </div>
44 <div class="col-lg-4 col-sm-3 text-center"> 45 <div class="col-lg-4 col-sm-3 text-center">
45 - <form action="/search/all" method="GET" class="search-box"> 46 + <form action="{{ baseUrl('/search/all') }}" method="GET" class="search-box">
46 <input id="header-search-box-input" type="text" name="term" tabindex="2" value="{{ isset($searchTerm) ? $searchTerm : '' }}"> 47 <input id="header-search-box-input" type="text" name="term" tabindex="2" value="{{ isset($searchTerm) ? $searchTerm : '' }}">
47 <button id="header-search-box-button" type="submit" class="text-button"><i class="zmdi zmdi-search"></i></button> 48 <button id="header-search-box-button" type="submit" class="text-button"><i class="zmdi zmdi-search"></i></button>
48 </form> 49 </form>
...@@ -50,12 +51,12 @@ ...@@ -50,12 +51,12 @@
50 <div class="col-lg-4 col-sm-5"> 51 <div class="col-lg-4 col-sm-5">
51 <div class="float right"> 52 <div class="float right">
52 <div class="links text-center"> 53 <div class="links text-center">
53 - <a href="/books"><i class="zmdi zmdi-book"></i>Books</a> 54 + <a href="{{ baseUrl('/books') }}"><i class="zmdi zmdi-book"></i>Books</a>
54 @if(isset($currentUser) && userCan('settings-manage')) 55 @if(isset($currentUser) && userCan('settings-manage'))
55 - <a href="/settings"><i class="zmdi zmdi-settings"></i>Settings</a> 56 + <a href="{{ baseUrl('/settings') }}"><i class="zmdi zmdi-settings"></i>Settings</a>
56 @endif 57 @endif
57 @if(!isset($signedIn) || !$signedIn) 58 @if(!isset($signedIn) || !$signedIn)
58 - <a href="/login"><i class="zmdi zmdi-sign-in"></i>Sign In</a> 59 + <a href="{{ baseUrl('/login') }}"><i class="zmdi zmdi-sign-in"></i>Sign In</a>
59 @endif 60 @endif
60 </div> 61 </div>
61 @if(isset($signedIn) && $signedIn) 62 @if(isset($signedIn) && $signedIn)
...@@ -66,13 +67,13 @@ ...@@ -66,13 +67,13 @@
66 </span> 67 </span>
67 <ul> 68 <ul>
68 <li> 69 <li>
69 - <a href="/user/{{$currentUser->id}}" class="text-primary"><i class="zmdi zmdi-account zmdi-hc-fw zmdi-hc-lg"></i>View Profile</a> 70 + <a href="{{ baseUrl("/user/{$currentUser->id}") }}" class="text-primary"><i class="zmdi zmdi-account zmdi-hc-fw zmdi-hc-lg"></i>View Profile</a>
70 </li> 71 </li>
71 <li> 72 <li>
72 - <a href="/settings/users/{{$currentUser->id}}" class="text-primary"><i class="zmdi zmdi-edit zmdi-hc-fw zmdi-hc-lg"></i>Edit Profile</a> 73 + <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>
73 </li> 74 </li>
74 <li> 75 <li>
75 - <a href="/logout" class="text-neg"><i class="zmdi zmdi-run zmdi-hc-fw zmdi-hc-lg"></i>Logout</a> 76 + <a href="{{ baseUrl('/logout') }}" class="text-neg"><i class="zmdi zmdi-run zmdi-hc-fw zmdi-hc-lg"></i>Logout</a>
76 </li> 77 </li>
77 </ul> 78 </ul>
78 </div> 79 </div>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
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>Create New Book</h1>
7 - <form action="/books" method="POST"> 7 + <form action="{{ baseUrl("/books") }}" method="POST">
8 @include('books/form') 8 @include('books/form')
9 </form> 9 </form>
10 </div> 10 </div>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
4 4
5 <div class="container small" ng-non-bindable> 5 <div class="container small" ng-non-bindable>
6 <h1>Edit Book</h1> 6 <h1>Edit Book</h1>
7 - <form action="/books/{{$book->slug}}" method="POST"> 7 + <form action="{{ $book->getUrl() }}" method="POST">
8 <input type="hidden" name="_method" value="PUT"> 8 <input type="hidden" name="_method" value="PUT">
9 @include('books/form', ['model' => $book]) 9 @include('books/form', ['model' => $book])
10 </form> 10 </form>
......
...@@ -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="/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>Add new book</a>
13 @endif 13 @endif
14 </div> 14 </div>
15 </div> 15 </div>
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
31 @else 31 @else
32 <p class="text-muted">No books have been created.</p> 32 <p class="text-muted">No books have been created.</p>
33 @if(userCan('books-create-all')) 33 @if(userCan('books-create-all'))
34 - <a href="/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>Create one now</a>
35 @endif 35 @endif
36 @endif 36 @endif
37 </div> 37 </div>
......
...@@ -8,10 +8,10 @@ ...@@ -8,10 +8,10 @@
8 <div class="col-md-12"> 8 <div class="col-md-12">
9 <div class="action-buttons faded"> 9 <div class="action-buttons faded">
10 @if(userCan('page-create', $book)) 10 @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> 11 + <a href="{{ $book->getUrl('/page/create') }}" class="text-pos text-button"><i class="zmdi zmdi-plus"></i> New Page</a>
12 @endif 12 @endif
13 @if(userCan('chapter-create', $book)) 13 @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> 14 + <a href="{{ $book->getUrl('/chapter/create') }}" class="text-pos text-button"><i class="zmdi zmdi-plus"></i> New Chapter</a>
15 @endif 15 @endif
16 @if(userCan('book-update', $book)) 16 @if(userCan('book-update', $book))
17 <a href="{{$book->getEditUrl()}}" class="text-primary text-button"><i class="zmdi zmdi-edit"></i>Edit</a> 17 <a href="{{$book->getEditUrl()}}" class="text-primary text-button"><i class="zmdi zmdi-edit"></i>Edit</a>
...@@ -21,13 +21,13 @@ ...@@ -21,13 +21,13 @@
21 <a dropdown-toggle class="text-primary text-button"><i class="zmdi zmdi-more-vert"></i></a> 21 <a dropdown-toggle class="text-primary text-button"><i class="zmdi zmdi-more-vert"></i></a>
22 <ul> 22 <ul>
23 @if(userCan('book-update', $book)) 23 @if(userCan('book-update', $book))
24 - <li><a href="{{ $book->getUrl() }}/sort" class="text-primary"><i class="zmdi zmdi-sort"></i>Sort</a></li> 24 + <li><a href="{{ $book->getUrl('/sort') }}" class="text-primary"><i class="zmdi zmdi-sort"></i>Sort</a></li>
25 @endif 25 @endif
26 @if(userCan('restrictions-manage', $book)) 26 @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> 27 + <li><a href="{{ $book->getUrl('/permissions') }}" class="text-primary"><i class="zmdi zmdi-lock-outline"></i>Permissions</a></li>
28 @endif 28 @endif
29 @if(userCan('book-delete', $book)) 29 @if(userCan('book-delete', $book))
30 - <li><a href="{{ $book->getUrl() }}/delete" class="text-neg"><i class="zmdi zmdi-delete"></i>Delete</a></li> 30 + <li><a href="{{ $book->getUrl('/delete') }}" class="text-neg"><i class="zmdi zmdi-delete"></i>Delete</a></li>
31 @endif 31 @endif
32 </ul> 32 </ul>
33 </div> 33 </div>
...@@ -61,16 +61,16 @@ ...@@ -61,16 +61,16 @@
61 @else 61 @else
62 <p class="text-muted">No pages or chapters have been created for this book.</p> 62 <p class="text-muted">No pages or chapters have been created for this book.</p>
63 <p> 63 <p>
64 - <a href="{{$book->getUrl() . '/page/create'}}" class="text-page"><i class="zmdi zmdi-file-text"></i>Create a new page</a> 64 + <a href="{{ $book->getUrl('/page/create') }}" class="text-page"><i class="zmdi zmdi-file-text"></i>Create a new page</a>
65 &nbsp;&nbsp;<em class="text-muted">-or-</em>&nbsp;&nbsp;&nbsp; 65 &nbsp;&nbsp;<em class="text-muted">-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> 66 + <a href="{{ $book->getUrl('/chapter/create') }}" class="text-chapter"><i class="zmdi zmdi-collection-bookmark"></i>Add a chapter</a>
67 </p> 67 </p>
68 <hr> 68 <hr>
69 @endif 69 @endif
70 <p class="text-muted small"> 70 <p class="text-muted small">
71 - Created {{$book->created_at->diffForHumans()}} @if($book->createdBy) by <a href="/user/{{ $book->createdBy->id }}">{{$book->createdBy->name}}</a> @endif 71 + Created {{$book->created_at->diffForHumans()}} @if($book->createdBy) by <a href="{{ $book->createdBy->getProfileUrl() }}">{{$book->createdBy->name}}</a> @endif
72 <br> 72 <br>
73 - Last Updated {{$book->updated_at->diffForHumans()}} @if($book->updatedBy) by <a href="/user/{{ $book->updatedBy->id }}">{{$book->updatedBy->name}}</a> @endif 73 + Last Updated {{$book->updated_at->diffForHumans()}} @if($book->updatedBy) by <a href="{{ $book->updatedBy->getProfileUrl() }}">{{$book->updatedBy->name}}</a> @endif
74 </p> 74 </p>
75 </div> 75 </div>
76 </div> 76 </div>
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
90 @if($book->restricted) 90 @if($book->restricted)
91 <p class="text-muted"> 91 <p class="text-muted">
92 @if(userCan('restrictions-manage', $book)) 92 @if(userCan('restrictions-manage', $book))
93 - <a href="{{ $book->getUrl() }}/permissions"><i class="zmdi zmdi-lock-outline"></i>Book Permissions Active</a> 93 + <a href="{{ $book->getUrl('/permissions') }}"><i class="zmdi zmdi-lock-outline"></i>Book Permissions Active</a>
94 @else 94 @else
95 <i class="zmdi zmdi-lock-outline"></i>Book Permissions Active 95 <i class="zmdi zmdi-lock-outline"></i>Book Permissions Active
96 @endif 96 @endif
......
1 @extends('base') 1 @extends('base')
2 2
3 @section('head') 3 @section('head')
4 - <script src="/libs/jquery-sortable/jquery-sortable.min.js"></script> 4 + <script src="{{ baseUrl("/libs/jquery-sortable/jquery-sortable.min.js") }}"></script>
5 @stop 5 @stop
6 6
7 @section('content') 7 @section('content')
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
22 @foreach($books as $otherBook) 22 @foreach($books as $otherBook)
23 @if($otherBook->id !== $book->id) 23 @if($otherBook->id !== $book->id)
24 <div> 24 <div>
25 - <a href="/books/{{ $otherBook->slug }}/sort-item" class="text-book"><i class="zmdi zmdi-book"></i>{{ $otherBook->name }}</a> 25 + <a href="{{ $otherBook->getUrl('/sort-item') }}" class="text-book"><i class="zmdi zmdi-book"></i>{{ $otherBook->name }}</a>
26 </div> 26 </div>
27 @endif 27 @endif
28 @endforeach 28 @endforeach
...@@ -32,12 +32,12 @@ ...@@ -32,12 +32,12 @@
32 32
33 </div> 33 </div>
34 34
35 - <form action="{{$book->getUrl()}}/sort" method="POST"> 35 + <form action="{{ $book->getUrl('/sort') }}" method="POST">
36 {!! csrf_field() !!} 36 {!! csrf_field() !!}
37 <input type="hidden" name="_method" value="PUT"> 37 <input type="hidden" name="_method" value="PUT">
38 <input type="hidden" id="sort-tree-input" name="sort-tree"> 38 <input type="hidden" id="sort-tree-input" name="sort-tree">
39 <div class="list"> 39 <div class="list">
40 - <a href="{{$book->getUrl()}}" class="button muted">Cancel</a> 40 + <a href="{{ $book->getUrl() }}" class="button muted">Cancel</a>
41 <button class="button pos" type="submit">Save Order</button> 41 <button class="button pos" type="submit">Save Order</button>
42 </div> 42 </div>
43 </form> 43 </form>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
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>Create New Chapter</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>
10 </div> 10 </div>
......
...@@ -8,10 +8,10 @@ ...@@ -8,10 +8,10 @@
8 and added directly to the book.</p> 8 and added directly to the book.</p>
9 <p class="text-neg">Are you sure you want to delete this chapter?</p> 9 <p class="text-neg">Are you sure you want to delete this chapter?</p>
10 10
11 - <form action="{{$chapter->getUrl()}}" method="POST"> 11 + <form action="{{ $chapter->getUrl() }}" method="POST">
12 {!! csrf_field() !!} 12 {!! csrf_field() !!}
13 <input type="hidden" name="_method" value="DELETE"> 13 <input type="hidden" name="_method" value="DELETE">
14 - <a href="{{$chapter->getUrl()}}" class="button primary">Cancel</a> 14 + <a href="{{ $chapter->getUrl() }}" class="button primary">Cancel</a>
15 <button type="submit" class="button neg">Confirm</button> 15 <button type="submit" class="button neg">Confirm</button>
16 </form> 16 </form>
17 </div> 17 </div>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
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>Edit Chapter</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])
10 </form> 10 </form>
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
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>{{ count($chapter->pages) }} Pages</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 - <h4 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></h4> 23 + <h4 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></h4>
24 @endforeach 24 @endforeach
25 </div> 25 </div>
26 @endif 26 @endif
......
...@@ -7,9 +7,9 @@ ...@@ -7,9 +7,9 @@
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 <div class="breadcrumbs">
10 - <a href="{{$book->getUrl()}}" class="text-book text-button"><i class="zmdi zmdi-book"></i>{{ $book->getShortName() }}</a> 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> 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> 12 + <a href="{{ $chapter->getUrl() }}" class="text-chapter text-button"><i class="zmdi zmdi-collection-bookmark"></i>{{ $chapter->getShortName() }}</a>
13 </div> 13 </div>
14 </div> 14 </div>
15 </div> 15 </div>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
19 <div class="container"> 19 <div class="container">
20 <h1>Move Chapter <small class="subheader">{{$chapter->name}}</small></h1> 20 <h1>Move Chapter <small class="subheader">{{$chapter->name}}</small></h1>
21 21
22 - <form action="{{ $chapter->getUrl() }}/move" method="POST"> 22 + <form action="{{ $chapter->getUrl('/move') }}" method="POST">
23 {!! csrf_field() !!} 23 {!! csrf_field() !!}
24 <input type="hidden" name="_method" value="PUT"> 24 <input type="hidden" name="_method" value="PUT">
25 25
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
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 <div class="breadcrumbs">
10 - <a href="{{$chapter->book->getUrl()}}" class="text-book text-button"><i class="zmdi zmdi-book"></i>{{ $chapter->book->getShortName() }}</a> 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> 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> 12 <a href="{{ $chapter->getUrl() }}" class="text-chapter text-button"><i class="zmdi zmdi-collection-bookmark"></i>{{$chapter->getShortName()}}</a>
13 </div> 13 </div>
......
...@@ -7,29 +7,29 @@ ...@@ -7,29 +7,29 @@
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 <div class="breadcrumbs">
10 - <a href="{{$book->getUrl()}}" class="text-book text-button"><i class="zmdi zmdi-book"></i>{{ $book->getShortName() }}</a> 10 + <a href="{{ $book->getUrl() }}" class="text-book text-button"><i class="zmdi zmdi-book"></i>{{ $book->getShortName() }}</a>
11 </div> 11 </div>
12 </div> 12 </div>
13 <div class="col-sm-4 faded"> 13 <div class="col-sm-4 faded">
14 <div class="action-buttons"> 14 <div class="action-buttons">
15 @if(userCan('page-create', $chapter)) 15 @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> 16 + <a href="{{ $chapter->getUrl('/create-page') }}" class="text-pos text-button"><i class="zmdi zmdi-plus"></i>New Page</a>
17 @endif 17 @endif
18 @if(userCan('chapter-update', $chapter)) 18 @if(userCan('chapter-update', $chapter))
19 - <a href="{{$chapter->getUrl() . '/edit'}}" class="text-primary text-button"><i class="zmdi zmdi-edit"></i>Edit</a> 19 + <a href="{{ $chapter->getUrl('/edit') }}" class="text-primary text-button"><i class="zmdi zmdi-edit"></i>Edit</a>
20 @endif 20 @endif
21 @if(userCan('chapter-update', $chapter) || userCan('restrictions-manage', $chapter) || userCan('chapter-delete', $chapter)) 21 @if(userCan('chapter-update', $chapter) || userCan('restrictions-manage', $chapter) || userCan('chapter-delete', $chapter))
22 <div dropdown class="dropdown-container"> 22 <div dropdown class="dropdown-container">
23 <a dropdown-toggle class="text-primary text-button"><i class="zmdi zmdi-more-vert"></i></a> 23 <a dropdown-toggle class="text-primary text-button"><i class="zmdi zmdi-more-vert"></i></a>
24 <ul> 24 <ul>
25 @if(userCan('chapter-update', $chapter)) 25 @if(userCan('chapter-update', $chapter))
26 - <li><a href="{{$chapter->getUrl() . '/move'}}" class="text-primary"><i class="zmdi zmdi-folder"></i>Move</a></li> 26 + <li><a href="{{ $chapter->getUrl('/move') }}" class="text-primary"><i class="zmdi zmdi-folder"></i>Move</a></li>
27 @endif 27 @endif
28 @if(userCan('restrictions-manage', $chapter)) 28 @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> 29 + <li><a href="{{ $chapter->getUrl('/permissions') }}" class="text-primary"><i class="zmdi zmdi-lock-outline"></i>Permissions</a></li>
30 @endif 30 @endif
31 @if(userCan('chapter-delete', $chapter)) 31 @if(userCan('chapter-delete', $chapter))
32 - <li><a href="{{$chapter->getUrl() . '/delete'}}" class="text-neg"><i class="zmdi zmdi-delete"></i>Delete</a></li> 32 + <li><a href="{{ $chapter->getUrl('/delete') }}" class="text-neg"><i class="zmdi zmdi-delete"></i>Delete</a></li>
33 @endif 33 @endif
34 </ul> 34 </ul>
35 </div> 35 </div>
...@@ -60,22 +60,22 @@ ...@@ -60,22 +60,22 @@
60 <p class="text-muted">No pages are currently in this chapter.</p> 60 <p class="text-muted">No pages are currently in this chapter.</p>
61 <p> 61 <p>
62 @if(userCan('page-create', $chapter)) 62 @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> 63 + <a href="{{ $chapter->getUrl('/create-page') }}" class="text-page"><i class="zmdi zmdi-file-text"></i>Create a new page</a>
64 @endif 64 @endif
65 @if(userCan('page-create', $chapter) && userCan('book-update', $book)) 65 @if(userCan('page-create', $chapter) && userCan('book-update', $book))
66 &nbsp;&nbsp;<em class="text-muted">-or-</em>&nbsp;&nbsp;&nbsp; 66 &nbsp;&nbsp;<em class="text-muted">-or-</em>&nbsp;&nbsp;&nbsp;
67 @endif 67 @endif
68 @if(userCan('book-update', $book)) 68 @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> 69 + <a href="{{ $book->getUrl('/sort') }}" class="text-book"><i class="zmdi zmdi-book"></i>Sort the current book</a>
70 @endif 70 @endif
71 </p> 71 </p>
72 <hr> 72 <hr>
73 @endif 73 @endif
74 74
75 <p class="text-muted small"> 75 <p class="text-muted small">
76 - Created {{$chapter->created_at->diffForHumans()}} @if($chapter->createdBy) by <a href="/user/{{ $chapter->createdBy->id }}">{{ $chapter->createdBy->name}}</a> @endif 76 + Created {{ $chapter->created_at->diffForHumans() }} @if($chapter->createdBy) by <a href="{{ $chapter->createdBy->getProfileUrl() }}">{{ $chapter->createdBy->name}}</a> @endif
77 <br> 77 <br>
78 - Last Updated {{$chapter->updated_at->diffForHumans()}} @if($chapter->updatedBy) by <a href="/user/{{ $chapter->updatedBy->id }}">{{ $chapter->updatedBy->name}}</a> @endif 78 + Last Updated {{ $chapter->updated_at->diffForHumans() }} @if($chapter->updatedBy) by <a href="{{ $chapter->updatedBy->getProfileUrl() }}">{{ $chapter->updatedBy->name}}</a> @endif
79 </p> 79 </p>
80 </div> 80 </div>
81 <div class="col-md-3 col-md-offset-1"> 81 <div class="col-md-3 col-md-offset-1">
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
85 85
86 @if($book->restricted) 86 @if($book->restricted)
87 @if(userCan('restrictions-manage', $book)) 87 @if(userCan('restrictions-manage', $book))
88 - <a href="{{ $book->getUrl() }}/permissions"><i class="zmdi zmdi-lock-outline"></i>Book Permissions Active</a> 88 + <a href="{{ $book->getUrl('/permissions') }}"><i class="zmdi zmdi-lock-outline"></i>Book Permissions Active</a>
89 @else 89 @else
90 <i class="zmdi zmdi-lock-outline"></i>Book Permissions Active 90 <i class="zmdi zmdi-lock-outline"></i>Book Permissions Active
91 @endif 91 @endif
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
94 94
95 @if($chapter->restricted) 95 @if($chapter->restricted)
96 @if(userCan('restrictions-manage', $chapter)) 96 @if(userCan('restrictions-manage', $chapter))
97 - <a href="{{ $chapter->getUrl() }}/permissions"><i class="zmdi zmdi-lock-outline"></i>Chapter Permissions Active</a> 97 + <a href="{{ $chapter->getUrl('/permissions') }}"><i class="zmdi zmdi-lock-outline"></i>Chapter Permissions Active</a>
98 @else 98 @else
99 <i class="zmdi zmdi-lock-outline"></i>Chapter Permissions Active 99 <i class="zmdi zmdi-lock-outline"></i>Chapter Permissions Active
100 @endif 100 @endif
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
6 <div class="container"> 6 <div class="container">
7 <h1 class="text-muted">{{ $message or 'Page Not Found' }}</h1> 7 <h1 class="text-muted">{{ $message or 'Page Not Found' }}</h1>
8 <p>Sorry, The page you were looking for could not be found.</p> 8 <p>Sorry, The page you were looking for could not be found.</p>
9 - <a href="/" class="button">Return To Home</a> 9 + <a href="{{ baseUrl('/') }}" class="button">Return To Home</a>
10 </div> 10 </div>
11 11
12 @stop 12 @stop
...\ No newline at end of file ...\ No newline at end of file
......
1 -<!DOCTYPE html> 1 +@extends('public')
2 -<html>
3 - <head>
4 - <title>Be right back.</title>
5 2
6 - <link href="//fonts.googleapis.com/css?family=Lato:100" rel="stylesheet" type="text/css"> 3 +@section('content')
7 4
8 - <style> 5 + <div class="container">
9 - html, body { 6 + <h1 class="text-muted">{{ setting('app-name') }} is down right now</h1>
10 - height: 100%; 7 + <p>It will be back up soon.</p>
11 - } 8 + </div>
12 9
13 - body { 10 +@stop
14 - margin: 0;
15 - padding: 0;
16 - width: 100%;
17 - color: #B0BEC5;
18 - display: table;
19 - font-weight: 100;
20 - font-family: 'Lato';
21 - }
22 -
23 - .container {
24 - text-align: center;
25 - display: table-cell;
26 - vertical-align: middle;
27 - }
28 -
29 - .content {
30 - text-align: center;
31 - display: inline-block;
32 - }
33 -
34 - .title {
35 - font-size: 72px;
36 - margin-bottom: 40px;
37 - }
38 - </style>
39 - </head>
40 - <body>
41 - <div class="container">
42 - <div class="content">
43 - <div class="title">Be right back.</div>
44 - </div>
45 - </div>
46 - </body>
47 -</html>
...\ No newline at end of file ...\ No newline at end of file
......
1 -<form action="{{ $model->getUrl() }}/permissions" method="POST"> 1 +<form action="{{ $model->getUrl('/permissions') }}" method="POST">
2 {!! csrf_field() !!} 2 {!! csrf_field() !!}
3 <input type="hidden" name="_method" value="PUT"> 3 <input type="hidden" name="_method" value="PUT">
4 4
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
42 </div> 42 </div>
43 43
44 <div class="col-sm-4"> 44 <div class="col-sm-4">
45 - <h3><a class="no-color" href="/pages/recently-created">Recently Created Pages</a></h3> 45 + <h3><a class="no-color" href="{{ baseUrl("/pages/recently-created") }}">Recently Created Pages</a></h3>
46 <div id="recently-created-pages"> 46 <div id="recently-created-pages">
47 @include('partials/entity-list', [ 47 @include('partials/entity-list', [
48 'entities' => $recentlyCreatedPages, 48 'entities' => $recentlyCreatedPages,
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
51 ]) 51 ])
52 </div> 52 </div>
53 53
54 - <h3><a class="no-color" href="/pages/recently-updated">Recently Updated Pages</a></h3> 54 + <h3><a class="no-color" href="{{ baseUrl("/pages/recently-updated") }}">Recently Updated Pages</a></h3>
55 <div id="recently-updated-pages"> 55 <div id="recently-updated-pages">
56 @include('partials/entity-list', [ 56 @include('partials/entity-list', [
57 'entities' => $recentlyUpdatedPages, 57 'entities' => $recentlyUpdatedPages,
......
...@@ -6,10 +6,10 @@ ...@@ -6,10 +6,10 @@
6 <h1>Delete {{ $page->draft ? 'Draft' : '' }} Page</h1> 6 <h1>Delete {{ $page->draft ? 'Draft' : '' }} Page</h1>
7 <p class="text-neg">Are you sure you want to delete this {{ $page->draft ? 'draft' : '' }} page?</p> 7 <p class="text-neg">Are you sure you want to delete this {{ $page->draft ? 'draft' : '' }} page?</p>
8 8
9 - <form action="{{$page->getUrl()}}" method="POST"> 9 + <form action="{{ $page->getUrl() }}" method="POST">
10 {!! csrf_field() !!} 10 {!! csrf_field() !!}
11 <input type="hidden" name="_method" value="DELETE"> 11 <input type="hidden" name="_method" value="DELETE">
12 - <a href="{{$page->getUrl()}}" class="button primary">Cancel</a> 12 + <a href="{{ $page->getUrl() }}" class="button primary">Cancel</a>
13 <button type="submit" class="button neg">Confirm</button> 13 <button type="submit" class="button neg">Confirm</button>
14 </form> 14 </form>
15 </div> 15 </div>
......
1 @extends('base') 1 @extends('base')
2 2
3 @section('head') 3 @section('head')
4 - <script src="/libs/tinymce/tinymce.min.js?ver=4.3.7"></script> 4 + <script src="{{ baseUrl('/libs/tinymce/tinymce.min.js?ver=4.3.7') }}"></script>
5 @stop 5 @stop
6 6
7 @section('body-class', 'flexbox') 7 @section('body-class', 'flexbox')
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
9 @section('content') 9 @section('content')
10 10
11 <div class="flex-fill flex"> 11 <div class="flex-fill flex">
12 - <form action="{{$page->getUrl()}}" autocomplete="off" data-page-id="{{ $page->id }}" method="POST" class="flex flex-fill"> 12 + <form action="{{ $page->getUrl() }}" autocomplete="off" data-page-id="{{ $page->id }}" method="POST" class="flex flex-fill">
13 @if(!isset($isDraft)) 13 @if(!isset($isDraft))
14 <input type="hidden" name="_method" value="PUT"> 14 <input type="hidden" name="_method" value="PUT">
15 @endif 15 @endif
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
14 <tbody ui-sortable="sortOptions" ng-model="tags" > 14 <tbody ui-sortable="sortOptions" ng-model="tags" >
15 <tr ng-repeat="tag in tags track by $index"> 15 <tr ng-repeat="tag in tags track by $index">
16 <td width="20" ><i class="handle zmdi zmdi-menu"></i></td> 16 <td width="20" ><i class="handle zmdi zmdi-menu"></i></td>
17 - <td><input autosuggest="/ajax/tags/suggest/names" autosuggest-type="name" class="outline" ng-attr-name="tags[@{{$index}}][name]" type="text" ng-model="tag.name" ng-change="tagChange(tag)" ng-blur="tagBlur(tag)" placeholder="Tag"></td> 17 + <td><input autosuggest="{{ baseUrl('/ajax/tags/suggest/names') }}" autosuggest-type="name" class="outline" ng-attr-name="tags[@{{$index}}][name]" type="text" ng-model="tag.name" ng-change="tagChange(tag)" ng-blur="tagBlur(tag)" placeholder="Tag"></td>
18 - <td><input autosuggest="/ajax/tags/suggest/values" autosuggest-type="value" class="outline" ng-attr-name="tags[@{{$index}}][value]" type="text" ng-model="tag.value" ng-change="tagChange(tag)" ng-blur="tagBlur(tag)" placeholder="Tag Value (Optional)"></td> 18 + <td><input autosuggest="{{ baseUrl('/ajax/tags/suggest/values') }}" autosuggest-type="value" class="outline" ng-attr-name="tags[@{{$index}}][value]" type="text" ng-model="tag.value" ng-change="tagChange(tag)" ng-blur="tagBlur(tag)" placeholder="Tag Value (Optional)"></td>
19 <td width="10" ng-show="tags.length != 1" class="text-center text-neg" style="padding: 0;" ng-click="removeTag(tag)"><i class="zmdi zmdi-close"></i></td> 19 <td width="10" ng-show="tags.length != 1" class="text-center text-neg" style="padding: 0;" ng-click="removeTag(tag)"><i class="zmdi zmdi-close"></i></td>
20 </tr> 20 </tr>
21 </tbody> 21 </tbody>
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
20 <a ng-click="forceDraftSave()" class="text-pos"><i class="zmdi zmdi-save"></i>Save Draft</a> 20 <a ng-click="forceDraftSave()" class="text-pos"><i class="zmdi zmdi-save"></i>Save Draft</a>
21 </li> 21 </li>
22 <li ng-if="isNewPageDraft"> 22 <li ng-if="isNewPageDraft">
23 - <a href="{{$model->getUrl()}}/delete" class="text-neg"><i class="zmdi zmdi-delete"></i>Delete Draft</a> 23 + <a href="{{ $model->getUrl('/delete') }}" class="text-neg"><i class="zmdi zmdi-delete"></i>Delete Draft</a>
24 </li> 24 </li>
25 <li> 25 <li>
26 <a type="button" ng-if="isUpdateDraft" ng-click="discardDraft()" class="text-neg"><i class="zmdi zmdi-close-circle"></i>Discard Draft</a> 26 <a type="button" ng-if="isUpdateDraft" ng-click="discardDraft()" class="text-neg"><i class="zmdi zmdi-close-circle"></i>Discard Draft</a>
...@@ -55,8 +55,11 @@ ...@@ -55,8 +55,11 @@
55 55
56 <div class="edit-area flex-fill flex"> 56 <div class="edit-area flex-fill flex">
57 @if(setting('app-editor') === 'wysiwyg') 57 @if(setting('app-editor') === 'wysiwyg')
58 - <textarea id="html-editor" tinymce="editorOptions" mce-change="editorChange" mce-model="editContent" name="html" rows="5" 58 + <div tinymce="editorOptions" mce-change="editorChange" mce-model="editContent" class="flex-fill flex">
59 - @if($errors->has('html')) class="neg" @endif>@if(isset($model) || old('html')){{htmlspecialchars( old('html') ? old('html') : $model->html)}}@endif</textarea> 59 + <textarea id="html-editor" name="html" rows="5" ng-non-bindable
60 + @if($errors->has('html')) class="neg" @endif>@if(isset($model) || old('html')){{htmlspecialchars( old('html') ? old('html') : $model->html)}}@endif</textarea>
61 + </div>
62 +
60 @if($errors->has('html')) 63 @if($errors->has('html'))
61 <div class="text-neg text-small">{{ $errors->first('html') }}</div> 64 <div class="text-neg text-small">{{ $errors->first('html') }}</div>
62 @endif 65 @endif
...@@ -72,8 +75,12 @@ ...@@ -72,8 +75,12 @@
72 <button class="text-button" type="button" data-action="insertImage"><i class="zmdi zmdi-image"></i>Insert Image</button> 75 <button class="text-button" type="button" data-action="insertImage"><i class="zmdi zmdi-image"></i>Insert Image</button>
73 </div> 76 </div>
74 </div> 77 </div>
75 - <textarea markdown-input md-change="editorChange" id="markdown-editor-input" md-model="editContent" name="markdown" rows="5" 78 +
76 - @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> 79 + <div markdown-input md-change="editorChange" md-model="editContent" class="flex flex-fill">
80 + <textarea ng-non-bindable id="markdown-editor-input" name="markdown" rows="5"
81 + @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>
82 + </div>
83 +
77 </div> 84 </div>
78 85
79 <div class="markdown-editor-wrap"> 86 <div class="markdown-editor-wrap">
......
...@@ -7,16 +7,16 @@ ...@@ -7,16 +7,16 @@
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 <div class="breadcrumbs">
10 - <a href="{{$book->getUrl()}}" class="text-book text-button"><i class="zmdi zmdi-book"></i>{{ $book->getShortName() }}</a> 10 + <a href="{{ $book->getUrl() }}" class="text-book text-button"><i class="zmdi zmdi-book"></i>{{ $book->getShortName() }}</a>
11 @if($page->hasChapter()) 11 @if($page->hasChapter())
12 <span class="sep">&raquo;</span> 12 <span class="sep">&raquo;</span>
13 <a href="{{ $page->chapter->getUrl() }}" class="text-chapter text-button"> 13 <a href="{{ $page->chapter->getUrl() }}" class="text-chapter text-button">
14 <i class="zmdi zmdi-collection-bookmark"></i> 14 <i class="zmdi zmdi-collection-bookmark"></i>
15 - {{$page->chapter->getShortName()}} 15 + {{ $page->chapter->getShortName() }}
16 </a> 16 </a>
17 @endif 17 @endif
18 <span class="sep">&raquo;</span> 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> 19 + <a href="{{ $page->getUrl() }}" class="text-page text-button"><i class="zmdi zmdi-file-text"></i>{{ $page->getShortName() }}</a>
20 </div> 20 </div>
21 </div> 21 </div>
22 </div> 22 </div>
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
26 <div class="container"> 26 <div class="container">
27 <h1>Move Page <small class="subheader">{{$page->name}}</small></h1> 27 <h1>Move Page <small class="subheader">{{$page->name}}</small></h1>
28 28
29 - <form action="{{ $page->getUrl() }}/move" method="POST"> 29 + <form action="{{ $page->getUrl('/move') }}" method="POST">
30 {!! csrf_field() !!} 30 {!! csrf_field() !!}
31 <input type="hidden" name="_method" value="PUT"> 31 <input type="hidden" name="_method" value="PUT">
32 32
......
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
8 <table> 8 <table>
9 @foreach($page->tags as $tag) 9 @foreach($page->tags as $tag)
10 <tr class="tag"> 10 <tr class="tag">
11 - <td @if(!$tag->value) colspan="2" @endif><a href="/search/all?term=%5B{{ urlencode($tag->name) }}%5D">{{ $tag->name }}</a></td> 11 + <td @if(!$tag->value) colspan="2" @endif><a href="{{ baseUrl('/search/all?term=%5B' . urlencode($tag->name) .'%5D') }}">{{ $tag->name }}</a></td>
12 - @if($tag->value) <td class="tag-value"><a href="/search/all?term=%5B{{ urlencode($tag->name) }}%3D{{ urlencode($tag->value) }}%5D">{{$tag->value}}</a></td> @endif 12 + @if($tag->value) <td class="tag-value"><a href="{{ baseUrl('/search/all?term=%5B' . urlencode($tag->name) .'%3D' . urlencode($tag->value) . '%5D') }}">{{$tag->value}}</a></td> @endif
13 </tr> 13 </tr>
14 @endforeach 14 @endforeach
15 </table> 15 </table>
......
...@@ -7,16 +7,16 @@ ...@@ -7,16 +7,16 @@
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 <div class="breadcrumbs">
10 - <a href="{{$page->book->getUrl()}}" class="text-book text-button"><i class="zmdi zmdi-book"></i>{{ $page->book->getShortName() }}</a> 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()) 11 @if($page->hasChapter())
12 <span class="sep">&raquo;</span> 12 <span class="sep">&raquo;</span>
13 <a href="{{ $page->chapter->getUrl() }}" class="text-chapter text-button"> 13 <a href="{{ $page->chapter->getUrl() }}" class="text-chapter text-button">
14 <i class="zmdi zmdi-collection-bookmark"></i> 14 <i class="zmdi zmdi-collection-bookmark"></i>
15 - {{$page->chapter->getShortName()}} 15 + {{ $page->chapter->getShortName() }}
16 </a> 16 </a>
17 @endif 17 @endif
18 <span class="sep">&raquo;</span> 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> 19 + <a href="{{ $page->getUrl() }}" class="text-page text-button"><i class="zmdi zmdi-file"></i>{{ $page->getShortName() }}</a>
20 </div> 20 </div>
21 </div> 21 </div>
22 </div> 22 </div>
......
...@@ -7,16 +7,16 @@ ...@@ -7,16 +7,16 @@
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 <div class="breadcrumbs">
10 - <a href="{{$page->book->getUrl()}}" class="text-book text-button"><i class="zmdi zmdi-book"></i>{{ $page->book->getShortName() }}</a> 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()) 11 @if($page->hasChapter())
12 <span class="sep">&raquo;</span> 12 <span class="sep">&raquo;</span>
13 <a href="{{ $page->chapter->getUrl() }}" class="text-chapter text-button"> 13 <a href="{{ $page->chapter->getUrl() }}" class="text-chapter text-button">
14 <i class="zmdi zmdi-collection-bookmark"></i> 14 <i class="zmdi zmdi-collection-bookmark"></i>
15 - {{$page->chapter->getShortName()}} 15 + {{ $page->chapter->getShortName() }}
16 </a> 16 </a>
17 @endif 17 @endif
18 <span class="sep">&raquo;</span> 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> 19 + <a href="{{ $page->getUrl() }}" class="text-page text-button"><i class="zmdi zmdi-file"></i>{{ $page->getShortName() }}</a>
20 </div> 20 </div>
21 </div> 21 </div>
22 </div> 22 </div>
...@@ -40,20 +40,20 @@ ...@@ -40,20 +40,20 @@
40 </tr> 40 </tr>
41 @foreach($page->revisions as $index => $revision) 41 @foreach($page->revisions as $index => $revision)
42 <tr> 42 <tr>
43 - <td>{{$revision->name}}</td> 43 + <td>{{ $revision->name }}</td>
44 <td style="line-height: 0;"> 44 <td style="line-height: 0;">
45 @if($revision->createdBy) 45 @if($revision->createdBy)
46 - <img class="avatar" src="{{ $revision->createdBy->getAvatar(30) }}" alt="{{$revision->createdBy->name}}"> 46 + <img class="avatar" src="{{ $revision->createdBy->getAvatar(30) }}" alt="{{ $revision->createdBy->name }}">
47 @endif 47 @endif
48 </td> 48 </td>
49 - <td> @if($revision->createdBy) {{$revision->createdBy->name}} @else Deleted User @endif</td> 49 + <td> @if($revision->createdBy) {{ $revision->createdBy->name }} @else Deleted User @endif</td>
50 - <td><small>{{$revision->created_at->format('jS F, Y H:i:s')}} <br> ({{$revision->created_at->diffForHumans()}})</small></td> 50 + <td><small>{{ $revision->created_at->format('jS F, Y H:i:s') }} <br> ({{ $revision->created_at->diffForHumans() }})</small></td>
51 - <td>{{$revision->summary}}</td> 51 + <td>{{ $revision->summary }}</td>
52 @if ($index !== 0) 52 @if ($index !== 0)
53 <td> 53 <td>
54 - <a href="{{$revision->getUrl()}}" target="_blank">Preview</a> 54 + <a href="{{ $revision->getUrl() }}" target="_blank">Preview</a>
55 <span class="text-muted">&nbsp;|&nbsp;</span> 55 <span class="text-muted">&nbsp;|&nbsp;</span>
56 - <a href="{{$revision->getUrl()}}/restore">Restore</a> 56 + <a href="{{ $revision->getUrl() }}/restore">Restore</a>
57 </td> 57 </td>
58 @else 58 @else
59 <td><a target="_blank" href="{{ $page->getUrl() }}"><i>Current Version</i></a></td> 59 <td><a target="_blank" href="{{ $page->getUrl() }}"><i>Current Version</i></a></td>
......
...@@ -7,12 +7,12 @@ ...@@ -7,12 +7,12 @@
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 <div class="breadcrumbs">
10 - <a href="{{$book->getUrl()}}" class="text-book text-button"><i class="zmdi zmdi-book"></i>{{ $book->getShortName() }}</a> 10 + <a href="{{ $book->getUrl() }}" class="text-book text-button"><i class="zmdi zmdi-book"></i>{{ $book->getShortName() }}</a>
11 @if($page->hasChapter()) 11 @if($page->hasChapter())
12 <span class="sep">&raquo;</span> 12 <span class="sep">&raquo;</span>
13 <a href="{{ $page->chapter->getUrl() }}" class="text-chapter text-button"> 13 <a href="{{ $page->chapter->getUrl() }}" class="text-chapter text-button">
14 <i class="zmdi zmdi-collection-bookmark"></i> 14 <i class="zmdi zmdi-collection-bookmark"></i>
15 - {{$page->chapter->getShortName()}} 15 + {{ $page->chapter->getShortName() }}
16 </a> 16 </a>
17 @endif 17 @endif
18 </div> 18 </div>
...@@ -22,27 +22,27 @@ ...@@ -22,27 +22,27 @@
22 <span dropdown class="dropdown-container"> 22 <span dropdown class="dropdown-container">
23 <div dropdown-toggle class="text-button text-primary"><i class="zmdi zmdi-open-in-new"></i>Export</div> 23 <div dropdown-toggle class="text-button text-primary"><i class="zmdi zmdi-open-in-new"></i>Export</div>
24 <ul class="wide"> 24 <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> 25 + <li><a href="{{ $page->getUrl('/export/html') }}" target="_blank">Contained Web File <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> 26 + <li><a href="{{ $page->getUrl('/export/pdf') }}" target="_blank">PDF File <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> 27 + <li><a href="{{ $page->getUrl('/export/plaintext') }}" target="_blank">Plain Text File <span class="text-muted float right">.txt</span></a></li>
28 </ul> 28 </ul>
29 </span> 29 </span>
30 @if(userCan('page-update', $page)) 30 @if(userCan('page-update', $page))
31 - <a href="{{$page->getUrl()}}/edit" class="text-primary text-button" ><i class="zmdi zmdi-edit"></i>Edit</a> 31 + <a href="{{ $page->getUrl('/edit') }}" class="text-primary text-button" ><i class="zmdi zmdi-edit"></i>Edit</a>
32 @endif 32 @endif
33 @if(userCan('page-update', $page) || userCan('restrictions-manage', $page) || userCan('page-delete', $page)) 33 @if(userCan('page-update', $page) || userCan('restrictions-manage', $page) || userCan('page-delete', $page))
34 <div dropdown class="dropdown-container"> 34 <div dropdown class="dropdown-container">
35 <a dropdown-toggle class="text-primary text-button"><i class="zmdi zmdi-more-vert"></i></a> 35 <a dropdown-toggle class="text-primary text-button"><i class="zmdi zmdi-more-vert"></i></a>
36 <ul> 36 <ul>
37 @if(userCan('page-update', $page)) 37 @if(userCan('page-update', $page))
38 - <li><a href="{{$page->getUrl()}}/move" class="text-primary" ><i class="zmdi zmdi-folder"></i>Move</a></li> 38 + <li><a href="{{ $page->getUrl('/move') }}" class="text-primary" ><i class="zmdi zmdi-folder"></i>Move</a></li>
39 - <li><a href="{{$page->getUrl()}}/revisions" class="text-primary"><i class="zmdi zmdi-replay"></i>Revisions</a></li> 39 + <li><a href="{{ $page->getUrl('/revisions') }}" class="text-primary"><i class="zmdi zmdi-replay"></i>Revisions</a></li>
40 @endif 40 @endif
41 @if(userCan('restrictions-manage', $page)) 41 @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> 42 + <li><a href="{{ $page->getUrl('/permissions') }}" class="text-primary"><i class="zmdi zmdi-lock-outline"></i>Permissions</a></li>
43 @endif 43 @endif
44 @if(userCan('page-delete', $page)) 44 @if(userCan('page-delete', $page))
45 - <li><a href="{{$page->getUrl()}}/delete" class="text-neg"><i class="zmdi zmdi-delete"></i>Delete</a></li> 45 + <li><a href="{{ $page->getUrl('/delete') }}" class="text-neg"><i class="zmdi zmdi-delete"></i>Delete</a></li>
46 @endif 46 @endif
47 </ul> 47 </ul>
48 </div> 48 </div>
...@@ -73,13 +73,14 @@ ...@@ -73,13 +73,14 @@
73 <hr> 73 <hr>
74 74
75 <p class="text-muted small"> 75 <p class="text-muted small">
76 - Created {{$page->created_at->diffForHumans()}} @if($page->createdBy) by <a href="/user/{{ $page->createdBy->id }}">{{$page->createdBy->name}}</a> @endif 76 + Created {{ $page->created_at->diffForHumans() }} @if($page->createdBy) by <a href="{{ $page->createdBy->getProfileUrl() }}">{{$page->createdBy->name}}</a> @endif
77 <br> 77 <br>
78 - Last Updated {{$page->updated_at->diffForHumans()}} @if($page->updatedBy) by <a href="/user/{{ $page->updatedBy->id }}">{{$page->updatedBy->name}}</a> @endif 78 + Last Updated {{ $page->updated_at->diffForHumans() }} @if($page->updatedBy) by <a href="{{ $page->updatedBy->getProfileUrl() }}">{{$page->updatedBy->name}}</a> @endif
79 </p> 79 </p>
80 80
81 </div> 81 </div>
82 </div> 82 </div>
83 +
83 <div class="col-md-3 print-hidden"> 84 <div class="col-md-3 print-hidden">
84 <div class="margin-top large"></div> 85 <div class="margin-top large"></div>
85 @if($book->restricted || ($page->chapter && $page->chapter->restricted) || $page->restricted) 86 @if($book->restricted || ($page->chapter && $page->chapter->restricted) || $page->restricted)
...@@ -87,7 +88,7 @@ ...@@ -87,7 +88,7 @@
87 88
88 @if($book->restricted) 89 @if($book->restricted)
89 @if(userCan('restrictions-manage', $book)) 90 @if(userCan('restrictions-manage', $book))
90 - <a href="{{ $book->getUrl() }}/permissions"><i class="zmdi zmdi-lock-outline"></i>Book Permissions Active</a> 91 + <a href="{{ $book->getUrl('/permissions') }}"><i class="zmdi zmdi-lock-outline"></i>Book Permissions Active</a>
91 @else 92 @else
92 <i class="zmdi zmdi-lock-outline"></i>Book Permissions Active 93 <i class="zmdi zmdi-lock-outline"></i>Book Permissions Active
93 @endif 94 @endif
...@@ -96,7 +97,7 @@ ...@@ -96,7 +97,7 @@
96 97
97 @if($page->chapter && $page->chapter->restricted) 98 @if($page->chapter && $page->chapter->restricted)
98 @if(userCan('restrictions-manage', $page->chapter)) 99 @if(userCan('restrictions-manage', $page->chapter))
99 - <a href="{{ $page->chapter->getUrl() }}/permissions"><i class="zmdi zmdi-lock-outline"></i>Chapter Permissions Active</a> 100 + <a href="{{ $page->chapter->getUrl('/permissions') }}"><i class="zmdi zmdi-lock-outline"></i>Chapter Permissions Active</a>
100 @else 101 @else
101 <i class="zmdi zmdi-lock-outline"></i>Chapter Permissions Active 102 <i class="zmdi zmdi-lock-outline"></i>Chapter Permissions Active
102 @endif 103 @endif
...@@ -105,7 +106,7 @@ ...@@ -105,7 +106,7 @@
105 106
106 @if($page->restricted) 107 @if($page->restricted)
107 @if(userCan('restrictions-manage', $page)) 108 @if(userCan('restrictions-manage', $page))
108 - <a href="{{ $page->getUrl() }}/permissions"><i class="zmdi zmdi-lock-outline"></i>Page Permissions Active</a> 109 + <a href="{{ $page->getUrl('/permissions') }}"><i class="zmdi zmdi-lock-outline"></i>Page Permissions Active</a>
109 @else 110 @else
110 <i class="zmdi zmdi-lock-outline"></i>Page Permissions Active 111 <i class="zmdi zmdi-lock-outline"></i>Page Permissions Active
111 @endif 112 @endif
...@@ -114,8 +115,8 @@ ...@@ -114,8 +115,8 @@
114 </div> 115 </div>
115 @endif 116 @endif
116 @include('pages/sidebar-tree-list', ['book' => $book, 'sidebarTree' => $sidebarTree]) 117 @include('pages/sidebar-tree-list', ['book' => $book, 'sidebarTree' => $sidebarTree])
117 -
118 </div> 118 </div>
119 +
119 </div> 120 </div>
120 </div> 121 </div>
121 122
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
2 <div class="book-tree" ng-non-bindable> 2 <div class="book-tree" ng-non-bindable>
3 <h6 class="text-muted">Book Navigation</h6> 3 <h6 class="text-muted">Book Navigation</h6>
4 <ul class="sidebar-page-list menu"> 4 <ul class="sidebar-page-list menu">
5 - <li class="book-header"><a href="{{$book->getUrl()}}" class="book {{ $current->matches($book)? 'selected' : '' }}"><i class="zmdi zmdi-book"></i>{{$book->name}}</a></li> 5 + <li class="book-header"><a href="{{ $book->getUrl() }}" class="book {{ $current->matches($book)? 'selected' : '' }}"><i class="zmdi zmdi-book"></i>{{$book->name}}</a></li>
6 6
7 7
8 @foreach($sidebarTree as $bookChild) 8 @foreach($sidebarTree as $bookChild)
9 <li class="list-item-{{ $bookChild->getClassName() }} {{ $bookChild->getClassName() }} {{ $bookChild->isA('page') && $bookChild->draft ? 'draft' : '' }}"> 9 <li class="list-item-{{ $bookChild->getClassName() }} {{ $bookChild->getClassName() }} {{ $bookChild->isA('page') && $bookChild->draft ? 'draft' : '' }}">
10 - <a href="{{$bookChild->getUrl()}}" class="{{ $bookChild->getClassName() }} {{ $current->matches($bookChild)? 'selected' : '' }}"> 10 + <a href="{{ $bookChild->getUrl() }}" class="{{ $bookChild->getClassName() }} {{ $current->matches($bookChild)? 'selected' : '' }}">
11 @if($bookChild->isA('chapter'))<i class="zmdi zmdi-collection-bookmark"></i>@else <i class="zmdi zmdi-file-text"></i>@endif{{ $bookChild->name }} 11 @if($bookChild->isA('chapter'))<i class="zmdi zmdi-collection-bookmark"></i>@else <i class="zmdi zmdi-file-text"></i>@endif{{ $bookChild->name }}
12 </a> 12 </a>
13 13
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
18 <ul class="menu sub-menu inset-list @if($bookChild->matchesOrContains($current)) open @endif"> 18 <ul class="menu sub-menu inset-list @if($bookChild->matchesOrContains($current)) open @endif">
19 @foreach($bookChild->pages as $childPage) 19 @foreach($bookChild->pages as $childPage)
20 <li class="list-item-page {{ $childPage->isA('page') && $childPage->draft ? 'draft' : '' }}"> 20 <li class="list-item-page {{ $childPage->isA('page') && $childPage->draft ? 'draft' : '' }}">
21 - <a href="{{$childPage->getUrl()}}" class="page {{ $current->matches($childPage)? 'selected' : '' }}"> 21 + <a href="{{ $childPage->getUrl() }}" class="page {{ $current->matches($childPage)? 'selected' : '' }}">
22 <i class="zmdi zmdi-file-text"></i> {{ $childPage->name }} 22 <i class="zmdi zmdi-file-text"></i> {{ $childPage->name }}
23 </a> 23 </a>
24 </li> 24 </li>
......
...@@ -3,13 +3,13 @@ ...@@ -3,13 +3,13 @@
3 3
4 @if($activity->user) 4 @if($activity->user)
5 <div class="left"> 5 <div class="left">
6 - <img class="avatar" src="{{ $activity->user->getAvatar(30) }}" alt="{{$activity->user->name}}"> 6 + <img class="avatar" src="{{ $activity->user->getAvatar(30) }}" alt="{{ $activity->user->name }}">
7 </div> 7 </div>
8 @endif 8 @endif
9 9
10 <div class="right" ng-non-bindable> 10 <div class="right" ng-non-bindable>
11 @if($activity->user) 11 @if($activity->user)
12 - <a href="/user/{{ $activity->user->id }}">{{$activity->user->name}}</a> 12 + <a href="{{ $activity->user->getProfileUrl() }}">{{ $activity->user->name }}</a>
13 @else 13 @else
14 A deleted user 14 A deleted user
15 @endif 15 @endif
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
20 <a href="{{ $activity->entity->getUrl() }}">{{ $activity->entity->name }}</a> 20 <a href="{{ $activity->entity->getUrl() }}">{{ $activity->entity->name }}</a>
21 @endif 21 @endif
22 22
23 - @if($activity->extra) "{{$activity->extra}}" @endif 23 + @if($activity->extra) "{{ $activity->extra }}" @endif
24 24
25 <br> 25 <br>
26 26
......
1 <style> 1 <style>
2 header, #back-to-top, .primary-background { 2 header, #back-to-top, .primary-background {
3 - background-color: {{ Setting::get('app-color') }} !important; 3 + background-color: {{ setting('app-color') }} !important;
4 } 4 }
5 .faded-small, .primary-background-light { 5 .faded-small, .primary-background-light {
6 - background-color: {{ Setting::get('app-color-light') }}; 6 + background-color: {{ setting('app-color-light') }};
7 } 7 }
8 .button-base, .button, input[type="button"], input[type="submit"] { 8 .button-base, .button, input[type="button"], input[type="submit"] {
9 - background-color: {{ Setting::get('app-color') }}; 9 + background-color: {{ setting('app-color') }};
10 } 10 }
11 .button-base:hover, .button:hover, input[type="button"]:hover, input[type="submit"]:hover, .button:focus { 11 .button-base:hover, .button:hover, input[type="button"]:hover, input[type="submit"]:hover, .button:focus {
12 - background-color: {{ Setting::get('app-color') }}; 12 + background-color: {{ setting('app-color') }};
13 } 13 }
14 .nav-tabs a.selected, .nav-tabs .tab-item.selected { 14 .nav-tabs a.selected, .nav-tabs .tab-item.selected {
15 - border-bottom-color: {{ Setting::get('app-color') }}; 15 + border-bottom-color: {{ setting('app-color') }};
16 } 16 }
17 p.primary:hover, p .primary:hover, span.primary:hover, .text-primary:hover, a, a:hover, a:focus, .text-button, .text-button:hover, .text-button:focus { 17 p.primary:hover, p .primary:hover, span.primary:hover, .text-primary:hover, a, a:hover, a:focus, .text-button, .text-button:hover, .text-button:focus {
18 - color: {{ Setting::get('app-color') }}; 18 + color: {{ setting('app-color') }};
19 } 19 }
20 </style> 20 </style>
...\ No newline at end of file ...\ No newline at end of file
......
1 1
2 -<script src="/libs/highlightjs/highlight.min.js"></script> 2 +<script src="{{ baseUrl('/libs/highlightjs/highlight.min.js') }}"></script>
3 <script> 3 <script>
4 $(function() { 4 $(function() {
5 var aCodes = document.getElementsByTagName('pre'); 5 var aCodes = document.getElementsByTagName('pre');
......
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 - <title>BookStack</title> 4 + <title>{{ setting('app-name') }}</title>
5 5
6 <!-- Meta --> 6 <!-- Meta -->
7 <meta name="viewport" content="width=device-width"> 7 <meta name="viewport" content="width=device-width">
8 <meta name="token" content="{{ csrf_token() }}"> 8 <meta name="token" content="{{ csrf_token() }}">
9 + <meta name="base-url" content="{{ baseUrl('/') }}">
9 <meta charset="utf-8"> 10 <meta charset="utf-8">
10 11
11 <!-- Styles and Fonts --> 12 <!-- Styles and Fonts -->
12 <link rel="stylesheet" href="{{ versioned_asset('css/styles.css') }}"> 13 <link rel="stylesheet" href="{{ versioned_asset('css/styles.css') }}">
13 <link rel="stylesheet" media="print" href="{{ versioned_asset('css/print-styles.css') }}"> 14 <link rel="stylesheet" media="print" href="{{ versioned_asset('css/print-styles.css') }}">
14 - <link rel="stylesheet" href="/libs/material-design-iconic-font/css/material-design-iconic-font.min.css"> 15 + <link rel="stylesheet" href="{{ baseUrl("/libs/material-design-iconic-font/css/material-design-iconic-font.min.css") }}">
15 16
16 <!-- Scripts --> 17 <!-- Scripts -->
17 - <script src="/libs/jquery/jquery.min.js?version=2.1.4"></script> 18 + <script src="{{ baseUrl("/libs/jquery/jquery.min.js?version=2.1.4") }}"></script>
18 @include('partials/custom-styles') 19 @include('partials/custom-styles')
19 </head> 20 </head>
20 <body class="@yield('body-class')" ng-app="bookStack"> 21 <body class="@yield('body-class')" ng-app="bookStack">
...@@ -26,9 +27,11 @@ ...@@ -26,9 +27,11 @@
26 <div class="row"> 27 <div class="row">
27 <div class="col-md-6"> 28 <div class="col-md-6">
28 29
29 - <a href="/" class="logo"> 30 + <a href="{{ baseUrl('/') }}" class="logo">
30 - <img class="logo-image" src="/logo.png" alt="Logo"> 31 + @if(setting('app-logo', '') !== 'none')
31 - <span class="logo-text">{{ Setting::get('app-name', 'BookStack') }}</span> 32 + <img class="logo-image" src="{{ setting('app-logo', '') === '' ? baseUrl('/logo.png') : baseUrl(setting('app-logo', '')) }}" alt="Logo">
33 + @endif
34 + <span class="logo-text">{{ setting('app-name') }}</span>
32 </a> 35 </a>
33 </div> 36 </div>
34 <div class="col-md-6"> 37 <div class="col-md-6">
...@@ -38,16 +41,19 @@ ...@@ -38,16 +41,19 @@
38 </div> 41 </div>
39 @if(isset($signedIn) && $signedIn) 42 @if(isset($signedIn) && $signedIn)
40 <div class="dropdown-container" dropdown> 43 <div class="dropdown-container" dropdown>
41 - <span class="user-name" dropdown-toggle> 44 + <span class="user-name" dropdown-toggle>
42 - <img class="avatar" src="{{$currentUser->getAvatar(30)}}" alt="{{ $currentUser->name }}"> 45 + <img class="avatar" src="{{$currentUser->getAvatar(30)}}" alt="{{ $currentUser->name }}">
43 - <span class="name" ng-non-bindable>{{ $currentUser->name }}</span> <i class="zmdi zmdi-caret-down"></i> 46 + <span class="name" ng-non-bindable>{{ $currentUser->getShortName(9) }}</span> <i class="zmdi zmdi-caret-down"></i>
44 - </span> 47 + </span>
45 <ul> 48 <ul>
46 <li> 49 <li>
47 - <a href="/users/{{$currentUser->id}}" class="text-primary"><i class="zmdi zmdi-edit zmdi-hc-lg"></i>Edit Profile</a> 50 + <a href="{{ baseUrl("/user/{$currentUser->id}") }}" class="text-primary"><i class="zmdi zmdi-account zmdi-hc-fw zmdi-hc-lg"></i>View Profile</a>
51 + </li>
52 + <li>
53 + <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>
48 </li> 54 </li>
49 <li> 55 <li>
50 - <a href="/logout" class="text-neg"><i class="zmdi zmdi-run zmdi-hc-lg"></i>Logout</a> 56 + <a href="{{ baseUrl('/logout') }}" class="text-neg"><i class="zmdi zmdi-run zmdi-hc-fw zmdi-hc-lg"></i>Logout</a>
51 </li> 57 </li>
52 </ul> 58 </ul>
53 </div> 59 </div>
......
...@@ -4,41 +4,41 @@ ...@@ -4,41 +4,41 @@
4 4
5 <div class="container anim fadeIn" ng-non-bindable> 5 <div class="container anim fadeIn" ng-non-bindable>
6 6
7 - <h1>Search Results&nbsp;&nbsp;&nbsp; <span class="text-muted">{{$searchTerm}}</span></h1> 7 + <h1>Search Results&nbsp;&nbsp;&nbsp; <span class="text-muted">{{ $searchTerm }}</span></h1>
8 8
9 <p> 9 <p>
10 10
11 @if(count($pages) > 0) 11 @if(count($pages) > 0)
12 - <a href="/search/pages?term={{$searchTerm}}" class="text-page"><i class="zmdi zmdi-file-text"></i>View all matched pages</a> 12 + <a href="{{ baseUrl("/search/pages?term={$searchTerm}") }}" class="text-page"><i class="zmdi zmdi-file-text"></i>View all matched pages</a>
13 @endif 13 @endif
14 14
15 15
16 @if(count($chapters) > 0) 16 @if(count($chapters) > 0)
17 &nbsp; &nbsp;&nbsp; 17 &nbsp; &nbsp;&nbsp;
18 - <a href="/search/chapters?term={{$searchTerm}}" class="text-chapter"><i class="zmdi zmdi-collection-bookmark"></i>View all matched chapters</a> 18 + <a href="{{ baseUrl("/search/chapters?term={$searchTerm}") }}" class="text-chapter"><i class="zmdi zmdi-collection-bookmark"></i>View all matched chapters</a>
19 @endif 19 @endif
20 20
21 @if(count($books) > 0) 21 @if(count($books) > 0)
22 &nbsp; &nbsp;&nbsp; 22 &nbsp; &nbsp;&nbsp;
23 - <a href="/search/books?term={{$searchTerm}}" class="text-book"><i class="zmdi zmdi-book"></i>View all matched books</a> 23 + <a href="{{ baseUrl("/search/books?term={$searchTerm}") }}" class="text-book"><i class="zmdi zmdi-book"></i>View all matched books</a>
24 @endif 24 @endif
25 </p> 25 </p>
26 <div class="row"> 26 <div class="row">
27 27
28 <div class="col-md-6"> 28 <div class="col-md-6">
29 - <h3><a href="/search/pages?term={{$searchTerm}}" class="no-color">Matching Pages</a></h3> 29 + <h3><a href="{{ baseUrl("/search/pages?term={$searchTerm}") }}" class="no-color">Matching Pages</a></h3>
30 @include('partials/entity-list', ['entities' => $pages, 'style' => 'detailed']) 30 @include('partials/entity-list', ['entities' => $pages, 'style' => 'detailed'])
31 </div> 31 </div>
32 32
33 <div class="col-md-5 col-md-offset-1"> 33 <div class="col-md-5 col-md-offset-1">
34 34
35 @if(count($books) > 0) 35 @if(count($books) > 0)
36 - <h3><a href="/search/books?term={{$searchTerm}}" class="no-color">Matching Books</a></h3> 36 + <h3><a href="{{ baseUrl("/search/books?term={$searchTerm}") }}" class="no-color">Matching Books</a></h3>
37 @include('partials/entity-list', ['entities' => $books]) 37 @include('partials/entity-list', ['entities' => $books])
38 @endif 38 @endif
39 39
40 @if(count($chapters) > 0) 40 @if(count($chapters) > 0)
41 - <h3><a href="/search/chapters?term={{$searchTerm}}" class="no-color">Matching Chapters</a></h3> 41 + <h3><a href="{{ baseUrl("/search/chapters?term={$searchTerm}") }}" class="no-color">Matching Chapters</a></h3>
42 @include('partials/entity-list', ['entities' => $chapters]) 42 @include('partials/entity-list', ['entities' => $chapters])
43 @endif 43 @endif
44 44
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
6 <div class="row"> 6 <div class="row">
7 7
8 <div class="col-sm-7"> 8 <div class="col-sm-7">
9 - <h1>{{ $title }} <small>{{$searchTerm}}</small></h1> 9 + <h1>{{ $title }} <small>{{ $searchTerm }}</small></h1>
10 @include('partials.entity-list', ['entities' => $entities, 'style' => 'detailed']) 10 @include('partials.entity-list', ['entities' => $entities, 'style' => 'detailed'])
11 {!! $entities->links() !!} 11 {!! $entities->links() !!}
12 </div> 12 </div>
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
8 8
9 <h1>Settings</h1> 9 <h1>Settings</h1>
10 10
11 - <form action="/settings" method="POST" ng-cloak> 11 + <form action="{{ baseUrl("/settings") }}" method="POST" ng-cloak>
12 {!! csrf_field() !!} 12 {!! csrf_field() !!}
13 13
14 <h3>App Settings</h3> 14 <h3>App Settings</h3>
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
41 <div class="form-group" id="logo-control"> 41 <div class="form-group" id="logo-control">
42 <label for="setting-app-logo">Application logo</label> 42 <label for="setting-app-logo">Application logo</label>
43 <p class="small">This image should be 43px in height. <br>Large images will be scaled down.</p> 43 <p class="small">This image should be 43px in height. <br>Large images will be scaled down.</p>
44 - <image-picker resize-height="43" show-remove="true" resize-width="200" current-image="{{ setting('app-logo', '') }}" default-image="/logo.png" name="setting-app-logo" image-class="logo-image"></image-picker> 44 + <image-picker resize-height="43" show-remove="true" resize-width="200" current-image="{{ setting('app-logo', '') }}" default-image="{{ baseUrl('/logo.png') }}" name="setting-app-logo" image-class="logo-image"></image-picker>
45 </div> 45 </div>
46 <div class="form-group" id="color-control"> 46 <div class="form-group" id="color-control">
47 <label for="setting-app-color">Application primary color</label> 47 <label for="setting-app-color">Application primary color</label>
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
112 @stop 112 @stop
113 113
114 @section('scripts') 114 @section('scripts')
115 - <script src="/libs/jq-color-picker/tiny-color-picker.min.js?version=1.0.0"></script> 115 + <script src="{{ baseUrl("/libs/jq-color-picker/tiny-color-picker.min.js?version=1.0.0") }}"></script>
116 <script type="text/javascript"> 116 <script type="text/javascript">
117 $('#setting-app-color').colorPicker({ 117 $('#setting-app-color').colorPicker({
118 opacity: false, 118 opacity: false,
...@@ -125,9 +125,9 @@ ...@@ -125,9 +125,9 @@
125 if (!isEmpty) $elm.val(hexVal); 125 if (!isEmpty) $elm.val(hexVal);
126 $('#setting-app-color-light').val(isEmpty ? '' : rgbLightVal); 126 $('#setting-app-color-light').val(isEmpty ? '' : rgbLightVal);
127 // Set page elements to provide preview 127 // Set page elements to provide preview
128 - $('#header, .image-picker .button').css('background-color', hexVal); 128 + $('#header, .image-picker .button').attr('style', 'background-color:'+ hexVal+'!important;');
129 $('.faded-small').css('background-color', rgbLightVal); 129 $('.faded-small').css('background-color', rgbLightVal);
130 - $('.setting-nav a.selected').css('border-bottom-color', hexVal); 130 + $('.setting-nav a.selected').css('border-bottom-color', hexVal + '!important');
131 } 131 }
132 }); 132 });
133 </script> 133 </script>
......
...@@ -4,13 +4,13 @@ ...@@ -4,13 +4,13 @@
4 <div class="row"> 4 <div class="row">
5 <div class="col-md-12 setting-nav nav-tabs"> 5 <div class="col-md-12 setting-nav nav-tabs">
6 @if($currentUser->can('settings-manage')) 6 @if($currentUser->can('settings-manage'))
7 - <a href="/settings" @if($selected == 'settings') class="selected text-button" @endif><i class="zmdi zmdi-settings"></i>Settings</a> 7 + <a href="{{ baseUrl('/settings') }}" @if($selected == 'settings') class="selected text-button" @endif><i class="zmdi zmdi-settings"></i>Settings</a>
8 @endif 8 @endif
9 @if($currentUser->can('users-manage')) 9 @if($currentUser->can('users-manage'))
10 - <a href="/settings/users" @if($selected == 'users') class="selected text-button" @endif><i class="zmdi zmdi-accounts"></i>Users</a> 10 + <a href="{{ baseUrl('/settings/users') }}" @if($selected == 'users') class="selected text-button" @endif><i class="zmdi zmdi-accounts"></i>Users</a>
11 @endif 11 @endif
12 @if($currentUser->can('user-roles-manage')) 12 @if($currentUser->can('user-roles-manage'))
13 - <a href="/settings/roles" @if($selected == 'roles') class="selected text-button" @endif><i class="zmdi zmdi-lock-open"></i>Roles</a> 13 + <a href="{{ baseUrl('/settings/roles') }}" @if($selected == 'roles') class="selected text-button" @endif><i class="zmdi zmdi-lock-open"></i>Roles</a>
14 @endif 14 @endif
15 </div> 15 </div>
16 </div> 16 </div>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
7 <div class="container"> 7 <div class="container">
8 <h1>Create New Role</h1> 8 <h1>Create New Role</h1>
9 9
10 - <form action="/settings/roles/new" method="POST"> 10 + <form action="{{ baseUrl("/settings/roles/new") }}" method="POST">
11 @include('settings/roles/form') 11 @include('settings/roles/form')
12 </form> 12 </form>
13 </div> 13 </div>
......
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
6 6
7 <div class="container small" ng-non-bindable> 7 <div class="container small" ng-non-bindable>
8 <h1>Delete Role</h1> 8 <h1>Delete Role</h1>
9 - <p>This will delete the role with the name '{{$role->display_name}}'.</p> 9 + <p>This will delete the role with the name '{{ $role->display_name }}'.</p>
10 10
11 - <form action="/settings/roles/delete/{{$role->id}}" method="POST"> 11 + <form action="{{ baseUrl("/settings/roles/delete/{$role->id}") }}" method="POST">
12 {!! csrf_field() !!} 12 {!! csrf_field() !!}
13 <input type="hidden" name="_method" value="DELETE"> 13 <input type="hidden" name="_method" value="DELETE">
14 14
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
20 @endif 20 @endif
21 21
22 <p class="text-neg">Are you sure you want to delete this role?</p> 22 <p class="text-neg">Are you sure you want to delete this role?</p>
23 - <a href="/settings/roles/{{ $role->id }}" class="button">Cancel</a> 23 + <a href="{{ baseUrl("/settings/roles/{$role->id}") }}" class="button">Cancel</a>
24 <button type="submit" class="button neg">Confirm</button> 24 <button type="submit" class="button neg">Confirm</button>
25 </form> 25 </form>
26 </div> 26 </div>
......
...@@ -11,11 +11,11 @@ ...@@ -11,11 +11,11 @@
11 </div> 11 </div>
12 <div class="col-sm-6"> 12 <div class="col-sm-6">
13 <p></p> 13 <p></p>
14 - <a href="/settings/roles/delete/{{ $role->id }}" class="button neg float right">Delete Role</a> 14 + <a href="{{ baseUrl("/settings/roles/delete/{$role->id}") }}" class="button neg float right">Delete Role</a>
15 </div> 15 </div>
16 </div> 16 </div>
17 17
18 - <form action="/settings/roles/{{ $role->id }}" method="POST"> 18 + <form action="{{ baseUrl("/settings/roles/{$role->id}") }}" method="POST">
19 <input type="hidden" name="_method" value="PUT"> 19 <input type="hidden" name="_method" value="PUT">
20 @include('settings/roles/form', ['model' => $role]) 20 @include('settings/roles/form', ['model' => $role])
21 </form> 21 </form>
......
...@@ -109,7 +109,7 @@ ...@@ -109,7 +109,7 @@
109 </table> 109 </table>
110 </div> 110 </div>
111 </div> 111 </div>
112 - <a href="/settings/roles" class="button muted">Cancel</a> 112 + <a href="{{ baseUrl("/settings/roles") }}" class="button muted">Cancel</a>
113 <button type="submit" class="button pos">Save Role</button> 113 <button type="submit" class="button pos">Save Role</button>
114 </div> 114 </div>
115 <div class="col-md-3"> 115 <div class="col-md-3">
...@@ -119,10 +119,10 @@ ...@@ -119,10 +119,10 @@
119 <table class="list-table"> 119 <table class="list-table">
120 @foreach($role->users as $user) 120 @foreach($role->users as $user)
121 <tr> 121 <tr>
122 - <td style="line-height: 0;"><img class="avatar small" src="{{$user->getAvatar(40)}}" alt="{{$user->name}}"></td> 122 + <td style="line-height: 0;"><img class="avatar small" src="{{ $user->getAvatar(40) }}" alt="{{ $user->name }}"></td>
123 <td> 123 <td>
124 @if(userCan('users-manage') || $currentUser->id == $user->id) 124 @if(userCan('users-manage') || $currentUser->id == $user->id)
125 - <a href="/settings/users/{{$user->id}}"> 125 + <a href="{{ baseUrl("/settings/users/{$user->id}") }}">
126 @endif 126 @endif
127 {{ $user->name }} 127 {{ $user->name }}
128 @if(userCan('users-manage') || $currentUser->id == $user->id) 128 @if(userCan('users-manage') || $currentUser->id == $user->id)
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
12 </div> 12 </div>
13 <div class="col-sm-4"> 13 <div class="col-sm-4">
14 <p></p> 14 <p></p>
15 - <a href="/settings/roles/new" class="button float right pos"><i class="zmdi zmdi-lock-open"></i>Add new role</a> 15 + <a href="{{ baseUrl("/settings/roles/new") }}" class="button float right pos"><i class="zmdi zmdi-lock-open"></i>Add new role</a>
16 </div> 16 </div>
17 </div> 17 </div>
18 18
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
24 </tr> 24 </tr>
25 @foreach($roles as $role) 25 @foreach($roles as $role)
26 <tr> 26 <tr>
27 - <td><a href="/settings/roles/{{ $role->id }}">{{ $role->display_name }}</a></td> 27 + <td><a href="{{ baseUrl("/settings/roles/{$role->id}") }}">{{ $role->display_name }}</a></td>
28 <td>{{ $role->description }}</td> 28 <td>{{ $role->description }}</td>
29 <td class="text-right">{{ $role->users->count() }}</td> 29 <td class="text-right">{{ $role->users->count() }}</td>
30 </tr> 30 </tr>
......
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
6 <div class="container small" ng-non-bindable> 6 <div class="container small" ng-non-bindable>
7 <h1>Create User</h1> 7 <h1>Create User</h1>
8 8
9 - <form action="/settings/users/create" method="post"> 9 + <form action="{{ baseUrl("/settings/users/create") }}" method="post">
10 {!! csrf_field() !!} 10 {!! csrf_field() !!}
11 - @include('users.forms.' . $authMethod) 11 + @include('users/forms/' . $authMethod)
12 </form> 12 </form>
13 </div> 13 </div>
14 14
......
...@@ -4,13 +4,13 @@ ...@@ -4,13 +4,13 @@
4 4
5 <div class="container small" ng-non-bindable> 5 <div class="container small" ng-non-bindable>
6 <h1>Delete User</h1> 6 <h1>Delete User</h1>
7 - <p>This will fully delete this user with the name '<span class="text-neg">{{$user->name}}</span>' from the system.</p> 7 + <p>This will fully delete this user with the name '<span class="text-neg">{{ $user->name }}</span>' from the system.</p>
8 <p class="text-neg">Are you sure you want to delete this user?</p> 8 <p class="text-neg">Are you sure you want to delete this user?</p>
9 9
10 - <form action="/settings/users/{{$user->id}}" method="POST"> 10 + <form action="{{ baseUrl("/settings/users/{$user->id}") }}" method="POST">
11 {!! csrf_field() !!} 11 {!! csrf_field() !!}
12 <input type="hidden" name="_method" value="DELETE"> 12 <input type="hidden" name="_method" value="DELETE">
13 - <a href="/settings/users/{{$user->id}}" class="button muted">Cancel</a> 13 + <a href="{{ baseUrl("/settings/users/{$user->id}") }}" class="button muted">Cancel</a>
14 <button type="submit" class="button neg">Confirm</button> 14 <button type="submit" class="button neg">Confirm</button>
15 </form> 15 </form>
16 </div> 16 </div>
......
...@@ -8,14 +8,14 @@ ...@@ -8,14 +8,14 @@
8 8
9 9
10 <div class="container small"> 10 <div class="container small">
11 - <form action="/settings/users/{{$user->id}}" method="post"> 11 + <form action="{{ baseUrl("/settings/users/{$user->id}") }}" method="post">
12 <div class="row"> 12 <div class="row">
13 <div class="col-sm-8"> 13 <div class="col-sm-8">
14 <h1>Edit {{ $user->id === $currentUser->id ? 'Profile' : 'User' }}</h1> 14 <h1>Edit {{ $user->id === $currentUser->id ? 'Profile' : 'User' }}</h1>
15 </div> 15 </div>
16 <div class="col-sm-4"> 16 <div class="col-sm-4">
17 <p></p> 17 <p></p>
18 - <a href="/settings/users/{{$user->id}}/delete" class="neg button float right">Delete User</a> 18 + <a href="{{ baseUrl("/settings/users/{$user->id}/delete") }}" class="neg button float right">Delete User</a>
19 </div> 19 </div>
20 </div> 20 </div>
21 <div class="row"> 21 <div class="row">
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
29 <div class="form-group" id="logo-control"> 29 <div class="form-group" id="logo-control">
30 <label for="user-avatar">User Avatar</label> 30 <label for="user-avatar">User Avatar</label>
31 <p class="small">This image should be approx 256px square.</p> 31 <p class="small">This image should be approx 256px square.</p>
32 - <image-picker resize-height="512" resize-width="512" current-image="{{ $user->getAvatar(80) }}" current-id="{{ $user->image_id }}" default-image="/user_avatar.png" name="image_id" show-remove="false" image-class="['avatar' ,'large']"></image-picker> 32 + <image-picker resize-height="512" resize-width="512" current-image="{{ $user->getAvatar(80) }}" current-id="{{ $user->image_id }}" default-image="{{ baseUrl("/user_avatar.png") }}" name="image_id" show-remove="false" image-class="['avatar' ,'large']"></image-picker>
33 </div> 33 </div>
34 </div> 34 </div>
35 </div> 35 </div>
...@@ -49,9 +49,9 @@ ...@@ -49,9 +49,9 @@
49 <div><i class="zmdi zmdi-google-plus-box zmdi-hc-4x" style="color: #DC4E41;"></i></div> 49 <div><i class="zmdi zmdi-google-plus-box zmdi-hc-4x" style="color: #DC4E41;"></i></div>
50 <div> 50 <div>
51 @if($user->hasSocialAccount('google')) 51 @if($user->hasSocialAccount('google'))
52 - <a href="/login/service/google/detach" class="button neg">Disconnect Account</a> 52 + <a href="{{ baseUrl("/login/service/google/detach") }}" class="button neg">Disconnect Account</a>
53 @else 53 @else
54 - <a href="/login/service/google" class="button pos">Attach Account</a> 54 + <a href="{{ baseUrl("/login/service/google") }}" class="button pos">Attach Account</a>
55 @endif 55 @endif
56 </div> 56 </div>
57 </div> 57 </div>
...@@ -61,9 +61,9 @@ ...@@ -61,9 +61,9 @@
61 <div><i class="zmdi zmdi-github zmdi-hc-4x" style="color: #444;"></i></div> 61 <div><i class="zmdi zmdi-github zmdi-hc-4x" style="color: #444;"></i></div>
62 <div> 62 <div>
63 @if($user->hasSocialAccount('github')) 63 @if($user->hasSocialAccount('github'))
64 - <a href="/login/service/github/detach" class="button neg">Disconnect Account</a> 64 + <a href="{{ baseUrl("/login/service/github/detach") }}" class="button neg">Disconnect Account</a>
65 @else 65 @else
66 - <a href="/login/service/github" class="button pos">Attach Account</a> 66 + <a href="{{ baseUrl("/login/service/github") }}" class="button pos">Attach Account</a>
67 @endif 67 @endif
68 </div> 68 </div>
69 </div> 69 </div>
......
...@@ -25,6 +25,6 @@ ...@@ -25,6 +25,6 @@
25 @endif 25 @endif
26 26
27 <div class="form-group"> 27 <div class="form-group">
28 - <a href="/settings/users" class="button muted">Cancel</a> 28 + <a href="{{ baseUrl("/settings/users") }}" class="button muted">Cancel</a>
29 <button class="button pos" type="submit">Save</button> 29 <button class="button pos" type="submit">Save</button>
30 </div> 30 </div>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
34 </div> 34 </div>
35 35
36 <div class="form-group"> 36 <div class="form-group">
37 - <a href="/settings/users" class="button muted">Cancel</a> 37 + <a href="{{ baseUrl("/settings/users") }}" class="button muted">Cancel</a>
38 <button class="button pos" type="submit">Save</button> 38 <button class="button pos" type="submit">Save</button>
39 </div> 39 </div>
40 40
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
14 <div class="col-sm-4"> 14 <div class="col-sm-4">
15 <p></p> 15 <p></p>
16 @if(userCan('users-manage')) 16 @if(userCan('users-manage'))
17 - <a href="/settings/users/create" class="pos button float right"><i class="zmdi zmdi-account-add"></i>Add new user</a> 17 + <a href="{{ baseUrl("/settings/users/create") }}" class="pos button float right"><i class="zmdi zmdi-account-add"></i>Add new user</a>
18 @endif 18 @endif
19 </div> 19 </div>
20 </div> 20 </div>
...@@ -26,9 +26,9 @@ ...@@ -26,9 +26,9 @@
26 </div> 26 </div>
27 </div> 27 </div>
28 <div class="col-sm-4"> 28 <div class="col-sm-4">
29 - <form method="get" class="float right" action="/settings/users"> 29 + <form method="get" class="float right" action="{{ baseUrl("/settings/users") }}">
30 @foreach(collect($listDetails)->except('search') as $name => $val) 30 @foreach(collect($listDetails)->except('search') as $name => $val)
31 - <input type="hidden" name="{{$name}}" value="{{$val}}"> 31 + <input type="hidden" name="{{ $name }}" value="{{ $val }}">
32 @endforeach 32 @endforeach
33 <input type="text" name="search" placeholder="Search Users" @if($listDetails['search']) value="{{$listDetails['search']}}" @endif> 33 <input type="text" name="search" placeholder="Search Users" @if($listDetails['search']) value="{{$listDetails['search']}}" @endif>
34 </form> 34 </form>
...@@ -47,10 +47,10 @@ ...@@ -47,10 +47,10 @@
47 </tr> 47 </tr>
48 @foreach($users as $user) 48 @foreach($users as $user)
49 <tr> 49 <tr>
50 - <td style="line-height: 0;"><img class="avatar med" src="{{$user->getAvatar(40)}}" alt="{{$user->name}}"></td> 50 + <td style="line-height: 0;"><img class="avatar med" src="{{ $user->getAvatar(40)}}" alt="{{ $user->name }}"></td>
51 <td> 51 <td>
52 @if(userCan('users-manage') || $currentUser->id == $user->id) 52 @if(userCan('users-manage') || $currentUser->id == $user->id)
53 - <a href="/settings/users/{{$user->id}}"> 53 + <a href="{{ baseUrl("/settings/users/{$user->id}") }}">
54 @endif 54 @endif
55 {{ $user->name }} 55 {{ $user->name }}
56 @if(userCan('users-manage') || $currentUser->id == $user->id) 56 @if(userCan('users-manage') || $currentUser->id == $user->id)
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
59 </td> 59 </td>
60 <td> 60 <td>
61 @if(userCan('users-manage') || $currentUser->id == $user->id) 61 @if(userCan('users-manage') || $currentUser->id == $user->id)
62 - <a href="/settings/users/{{$user->id}}"> 62 + <a href="{{ baseUrl("/settings/users/{$user->id}") }}">
63 @endif 63 @endif
64 {{ $user->email }} 64 {{ $user->email }}
65 @if(userCan('users-manage') || $currentUser->id == $user->id) 65 @if(userCan('users-manage') || $currentUser->id == $user->id)
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
68 </td> 68 </td>
69 <td> 69 <td>
70 @foreach($user->roles as $index => $role) 70 @foreach($user->roles as $index => $role)
71 - <small><a href="/settings/roles/{{$role->id}}">{{$role->display_name}}</a>@if($index !== count($user->roles) -1),@endif</small> 71 + <small><a href="{{ baseUrl("/settings/roles/{$role->id}") }}">{{$role->display_name}}</a>@if($index !== count($user->roles) -1),@endif</small>
72 @endforeach 72 @endforeach
73 </td> 73 </td>
74 </tr> 74 </tr>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
12 <div class="col-md-7"> 12 <div class="col-md-7">
13 <div class="clearfix"> 13 <div class="clearfix">
14 <div class="padded-right float left"> 14 <div class="padded-right float left">
15 - <img class="avatar square huge" src="{{$user->getAvatar(120)}}" alt="{{ $user->name }}"> 15 + <img class="avatar square huge" src="{{ $user->getAvatar(120) }}" alt="{{ $user->name }}">
16 </div> 16 </div>
17 <div> 17 <div>
18 <h3 style="margin-top: 0;">{{ $user->name }}</h3> 18 <h3 style="margin-top: 0;">{{ $user->name }}</h3>
......
...@@ -151,8 +151,10 @@ class EntityTest extends TestCase ...@@ -151,8 +151,10 @@ class EntityTest extends TestCase
151 ->visit('/books/create') 151 ->visit('/books/create')
152 ->type($book->name, '#name') 152 ->type($book->name, '#name')
153 ->type($book->description, '#description') 153 ->type($book->description, '#description')
154 - ->press('Save Book') 154 + ->press('Save Book');
155 - ->seePageIs('/books/my-first-book-2'); 155 +
156 + $expectedPattern = '/\/books\/my-first-book-[0-9a-zA-Z]{3}/';
157 + $this->assertRegExp($expectedPattern, $this->currentUri, "Did not land on expected page [$expectedPattern].\n");
156 158
157 $book = \BookStack\Book::where('slug', '=', 'my-first-book')->first(); 159 $book = \BookStack\Book::where('slug', '=', 'my-first-book')->first();
158 return $book; 160 return $book;
......