*/
public function getUrl()
{
+ if ($this->external && strpos($this->path, 'http') !== 0) {
+ return $this->path;
+ }
return baseUrl('/attachments/' . $this->id);
}
}
use Exception;
use Illuminate\Auth\AuthenticationException;
-use Illuminate\Http\Request;
-use Illuminate\Pipeline\Pipeline;
use Illuminate\Validation\ValidationException;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Symfony\Component\HttpKernel\Exception\HttpException;
*
* @param \Exception $e
* @return mixed
+ * @throws Exception
*/
public function report(Exception $e)
{
// Handle 404 errors with a loaded session to enable showing user-specific information
if ($this->isExceptionType($e, NotFoundHttpException::class)) {
- return $this->loadErrorMiddleware($request, function ($request) use ($e) {
- $message = $e->getMessage() ?: trans('errors.404_page_not_found');
- return response()->view('errors/404', ['message' => $message], 404);
- });
+ return \Route::respondWithRoute('fallback');
}
return parent::render($request, $e);
}
- /**
- * Load the middleware required to show state/session-enabled error pages.
- * @param Request $request
- * @param $callback
- * @return mixed
- */
- protected function loadErrorMiddleware(Request $request, $callback)
- {
- $middleware = (\Route::getMiddlewareGroups()['web_errors']);
- return (new Pipeline($this->container))
- ->send($request)
- ->through($middleware)
- ->then($callback);
- }
-
/**
* Check the exception chain to compare against the original exception type.
* @param Exception $e
$this->validate($request, [
'uploaded_to' => 'required|integer|exists:pages,id',
'name' => 'required|string|min:1|max:255',
- 'link' => 'url|min:1|max:255'
+ 'link' => 'string|min:1|max:255'
]);
$pageId = $request->get('uploaded_to');
$this->validate($request, [
'uploaded_to' => 'required|integer|exists:pages,id',
'name' => 'required|string|min:1|max:255',
- 'link' => 'required|url|min:1|max:255'
+ 'link' => 'required|string|min:1|max:255'
]);
$pageId = $request->get('uploaded_to');
* @param $attachmentId
* @return \Illuminate\Contracts\Routing\ResponseFactory|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Symfony\Component\HttpFoundation\Response
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
+ * @throws NotFoundException
*/
public function get($attachmentId)
{
$recents = $this->signedIn ? Views::getUserRecentlyViewed(12*$recentFactor, 0) : $this->entityRepo->getRecentlyCreated('book', 12*$recentFactor);
$recentlyUpdatedPages = $this->entityRepo->getRecentlyUpdated('page', 12);
- // Custom homepage
+
$customHomepage = false;
- $homepageSetting = setting('app-homepage');
- if ($homepageSetting) {
- $id = intval(explode(':', $homepageSetting)[0]);
- $customHomepage = $this->entityRepo->getById('page', $id, false, true);
- $this->entityRepo->renderPage($customHomepage, true);
+ $books = false;
+ $booksViewType = false;
+
+ // Check book homepage
+ $bookHomepageSetting = setting('app-book-homepage');
+ if ($bookHomepageSetting) {
+ $books = $this->entityRepo->getAllPaginated('book', 18);
+ $booksViewType = setting()->getUser($this->currentUser, 'books_view_type', config('app.views.books', 'list'));
+ } else {
+ // Check custom homepage
+ $homepageSetting = setting('app-homepage');
+ if ($homepageSetting) {
+ $id = intval(explode(':', $homepageSetting)[0]);
+ $customHomepage = $this->entityRepo->getById('page', $id, false, true);
+ $this->entityRepo->renderPage($customHomepage, true);
+ }
+ }
+
+ $view = 'home';
+ if ($bookHomepageSetting) {
+ $view = 'home-book';
+ } else if ($customHomepage) {
+ $view = 'home-custom';
}
- $view = $customHomepage ? 'home-custom' : 'home';
- return view($view, [
+ return view('common/' . $view, [
'activity' => $activity,
'recents' => $recents,
'recentlyUpdatedPages' => $recentlyUpdatedPages,
'draftPages' => $draftPages,
- 'customHomepage' => $customHomepage
+ 'customHomepage' => $customHomepage,
+ 'books' => $books,
+ 'booksViewType' => $booksViewType
]);
}
]);
}
- /**
- * Get an icon via image request.
- * Can provide a 'color' parameter with hex value to color the icon.
- * @param $iconName
- * @param Request $request
- * @return \Illuminate\Contracts\Routing\ResponseFactory|\Symfony\Component\HttpFoundation\Response
- */
- public function getIcon($iconName, Request $request)
- {
- $attrs = [];
- if ($request->filled('color')) {
- $attrs['fill'] = '#' . $request->get('color');
- }
-
- $icon = icon($iconName, $attrs);
- return response($icon, 200, [
- 'Content-Type' => 'image/svg+xml',
- 'Cache-Control' => 'max-age=3600',
- ]);
- }
-
/**
* Get custom head HTML, Used in ajax calls to show in editor.
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
$allowRobots = $sitePublic;
}
return response()
- ->view('robots', ['allowRobots' => $allowRobots])
+ ->view('common/robots', ['allowRobots' => $allowRobots])
->header('Content-Type', 'text/plain');
}
+
+ /**
+ * Show the route for 404 responses.
+ */
+ public function getNotFound()
+ {
+ return response()->view('errors/404', [], 404);
+ }
}
\Illuminate\Routing\Middleware\SubstituteBindings::class,
\BookStack\Http\Middleware\Localization::class
],
- 'web_errors' => [
- \BookStack\Http\Middleware\EncryptCookies::class,
- \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
- \Illuminate\Session\Middleware\StartSession::class,
- \Illuminate\View\Middleware\ShareErrorsFromSession::class,
- \BookStack\Http\Middleware\VerifyCsrfToken::class,
- \BookStack\Http\Middleware\Localization::class
- ],
'api' => [
'throttle:60,1',
'bindings',
"type": "project",
"require": {
"php": ">=7.0.0",
- "laravel/framework": "5.5.*",
+ "laravel/framework": "~5.5.22",
"fideloper/proxy": "~3.3",
"ext-tidy": "*",
"intervention/image": "^2.4",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
- "content-hash": "ed85d10e69b1071020178cb400a80e48",
+ "content-hash": "3bf33ab103b15b06ca06c85fd8ae3b78",
"packages": [
{
"name": "aws/aws-sdk-php",
- "version": "3.52.6",
+ "version": "3.56.4",
"source": {
"type": "git",
"url": "https://github.com/aws/aws-sdk-php.git",
- "reference": "c9af7657eddc0267cc7ac4f969c10d5c18459992"
+ "reference": "03273bb5c1d8098ff6c23b3fa9ee444c4cc1dcee"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/c9af7657eddc0267cc7ac4f969c10d5c18459992",
- "reference": "c9af7657eddc0267cc7ac4f969c10d5c18459992",
+ "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/03273bb5c1d8098ff6c23b3fa9ee444c4cc1dcee",
+ "reference": "03273bb5c1d8098ff6c23b3fa9ee444c4cc1dcee",
"shasum": ""
},
"require": {
"s3",
"sdk"
],
- "time": "2018-02-09T22:53:37+00:00"
+ "time": "2018-05-18T19:53:15+00:00"
},
{
"name": "barryvdh/laravel-dompdf",
},
{
"name": "egulias/email-validator",
- "version": "2.1.3",
+ "version": "2.1.4",
"source": {
"type": "git",
"url": "https://github.com/egulias/EmailValidator.git",
- "reference": "1bec00a10039b823cc94eef4eddd47dcd3b2ca04"
+ "reference": "8790f594151ca6a2010c6218e09d96df67173ad3"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/1bec00a10039b823cc94eef4eddd47dcd3b2ca04",
- "reference": "1bec00a10039b823cc94eef4eddd47dcd3b2ca04",
+ "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/8790f594151ca6a2010c6218e09d96df67173ad3",
+ "reference": "8790f594151ca6a2010c6218e09d96df67173ad3",
"shasum": ""
},
"require": {
},
"require-dev": {
"dominicsayers/isemail": "dev-master",
- "phpunit/phpunit": "^4.8.35",
+ "phpunit/phpunit": "^4.8.35||^5.7||^6.0",
"satooshi/php-coveralls": "^1.0.1"
},
"suggest": {
"validation",
"validator"
],
- "time": "2017-11-15T23:40:40+00:00"
+ "time": "2018-04-10T10:11:19+00:00"
},
{
"name": "erusev/parsedown",
- "version": "1.6.4",
+ "version": "1.7.1",
"source": {
"type": "git",
"url": "https://github.com/erusev/parsedown.git",
- "reference": "fbe3fe878f4fe69048bb8a52783a09802004f548"
+ "reference": "92e9c27ba0e74b8b028b111d1b6f956a15c01fc1"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/erusev/parsedown/zipball/fbe3fe878f4fe69048bb8a52783a09802004f548",
- "reference": "fbe3fe878f4fe69048bb8a52783a09802004f548",
+ "url": "https://api.github.com/repos/erusev/parsedown/zipball/92e9c27ba0e74b8b028b111d1b6f956a15c01fc1",
+ "reference": "92e9c27ba0e74b8b028b111d1b6f956a15c01fc1",
"shasum": ""
},
"require": {
+ "ext-mbstring": "*",
"php": ">=5.3.0"
},
"require-dev": {
"markdown",
"parser"
],
- "time": "2017-11-14T20:44:03+00:00"
+ "time": "2018-03-08T01:11:30+00:00"
},
{
"name": "fideloper/proxy",
},
{
"name": "guzzlehttp/guzzle",
- "version": "6.3.0",
+ "version": "6.3.3",
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
- "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699"
+ "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f4db5a78a5ea468d4831de7f0bf9d9415e348699",
- "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699",
+ "url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba",
+ "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba",
"shasum": ""
},
"require": {
},
"require-dev": {
"ext-curl": "*",
- "phpunit/phpunit": "^4.0 || ^5.0",
+ "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0",
"psr/log": "^1.0"
},
"suggest": {
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "6.2-dev"
+ "dev-master": "6.3-dev"
}
},
"autoload": {
"rest",
"web service"
],
- "time": "2017-06-22T18:50:49+00:00"
+ "time": "2018-04-22T15:46:56+00:00"
},
{
"name": "guzzlehttp/promises",
},
{
"name": "laravel/framework",
- "version": "v5.5.34",
+ "version": "v5.5.40",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
- "reference": "1de7c0aec13eadbdddc2d1ba4019b064b2c6b966"
+ "reference": "d724ce0aa61bbd9adf658215eec484f5dd6711d6"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/laravel/framework/zipball/1de7c0aec13eadbdddc2d1ba4019b064b2c6b966",
- "reference": "1de7c0aec13eadbdddc2d1ba4019b064b2c6b966",
+ "url": "https://api.github.com/repos/laravel/framework/zipball/d724ce0aa61bbd9adf658215eec484f5dd6711d6",
+ "reference": "d724ce0aa61bbd9adf658215eec484f5dd6711d6",
"shasum": ""
},
"require": {
"doctrine/inflector": "~1.1",
- "erusev/parsedown": "~1.6",
+ "erusev/parsedown": "~1.7",
"ext-mbstring": "*",
"ext-openssl": "*",
- "league/flysystem": "~1.0",
+ "league/flysystem": "^1.0.8",
"monolog/monolog": "~1.12",
"mtdowling/cron-expression": "~1.0",
- "nesbot/carbon": "~1.20",
+ "nesbot/carbon": "^1.24.1",
"php": ">=7.0",
"psr/container": "~1.0",
"psr/simple-cache": "^1.0",
"illuminate/translation": "self.version",
"illuminate/validation": "self.version",
"illuminate/view": "self.version",
- "tightenco/collect": "self.version"
+ "tightenco/collect": "<5.5.33"
},
"require-dev": {
"aws/aws-sdk-php": "~3.0",
"framework",
"laravel"
],
- "time": "2018-02-06T15:36:55+00:00"
+ "time": "2018-03-30T13:29:30+00:00"
},
{
"name": "laravel/socialite",
- "version": "v3.0.9",
+ "version": "v3.0.11",
"source": {
"type": "git",
"url": "https://github.com/laravel/socialite.git",
- "reference": "fc1c8d415699e502f3e61cbc61e3250d5bd942eb"
+ "reference": "4d29ba66fdb38ec994b778e5e51657555cc10511"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/laravel/socialite/zipball/fc1c8d415699e502f3e61cbc61e3250d5bd942eb",
- "reference": "fc1c8d415699e502f3e61cbc61e3250d5bd942eb",
+ "url": "https://api.github.com/repos/laravel/socialite/zipball/4d29ba66fdb38ec994b778e5e51657555cc10511",
+ "reference": "4d29ba66fdb38ec994b778e5e51657555cc10511",
"shasum": ""
},
"require": {
"laravel",
"oauth"
],
- "time": "2017-11-06T16:02:48+00:00"
+ "time": "2018-05-12T17:44:53+00:00"
},
{
"name": "league/flysystem",
- "version": "1.0.42",
+ "version": "1.0.45",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/flysystem.git",
- "reference": "09eabc54e199950041aef258a85847676496fe8e"
+ "reference": "a99f94e63b512d75f851b181afcdf0ee9ebef7e6"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/09eabc54e199950041aef258a85847676496fe8e",
- "reference": "09eabc54e199950041aef258a85847676496fe8e",
+ "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/a99f94e63b512d75f851b181afcdf0ee9ebef7e6",
+ "reference": "a99f94e63b512d75f851b181afcdf0ee9ebef7e6",
"shasum": ""
},
"require": {
"sftp",
"storage"
],
- "time": "2018-01-27T16:03:56+00:00"
+ "time": "2018-05-07T08:44:23+00:00"
},
{
"name": "league/flysystem-aws-s3-v3",
- "version": "1.0.18",
+ "version": "1.0.19",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/flysystem-aws-s3-v3.git",
- "reference": "dc09b19f455750663b922ed52dcc0ff215bed284"
+ "reference": "f135691ef6761542af301b7c9880f140fb12dc74"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/thephpleague/flysystem-aws-s3-v3/zipball/dc09b19f455750663b922ed52dcc0ff215bed284",
- "reference": "dc09b19f455750663b922ed52dcc0ff215bed284",
+ "url": "https://api.github.com/repos/thephpleague/flysystem-aws-s3-v3/zipball/f135691ef6761542af301b7c9880f140fb12dc74",
+ "reference": "f135691ef6761542af301b7c9880f140fb12dc74",
"shasum": ""
},
"require": {
}
],
"description": "Flysystem adapter for the AWS S3 SDK v3.x",
- "time": "2017-06-30T06:29:25+00:00"
+ "time": "2018-03-27T20:33:59+00:00"
},
{
"name": "league/oauth1-client",
},
{
"name": "nesbot/carbon",
- "version": "1.22.1",
+ "version": "1.27.0",
"source": {
"type": "git",
"url": "https://github.com/briannesbitt/Carbon.git",
- "reference": "7cdf42c0b1cc763ab7e4c33c47a24e27c66bfccc"
+ "reference": "ef81c39b67200dcd7401c24363dcac05ac3a4fe9"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/7cdf42c0b1cc763ab7e4c33c47a24e27c66bfccc",
- "reference": "7cdf42c0b1cc763ab7e4c33c47a24e27c66bfccc",
+ "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/ef81c39b67200dcd7401c24363dcac05ac3a4fe9",
+ "reference": "ef81c39b67200dcd7401c24363dcac05ac3a4fe9",
"shasum": ""
},
"require": {
- "php": ">=5.3.0",
- "symfony/translation": "~2.6 || ~3.0"
+ "php": ">=5.3.9",
+ "symfony/translation": "~2.6 || ~3.0 || ~4.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "~2",
- "phpunit/phpunit": "~4.0 || ~5.0"
+ "phpunit/phpunit": "^4.8.35 || ^5.7"
},
"type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.23-dev"
- }
- },
"autoload": {
"psr-4": {
- "Carbon\\": "src/Carbon/"
+ "": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"datetime",
"time"
],
- "time": "2017-01-16T07:55:07+00:00"
+ "time": "2018-04-23T09:02:57+00:00"
},
{
"name": "paragonie/random_compat",
- "version": "v2.0.11",
+ "version": "v2.0.12",
"source": {
"type": "git",
"url": "https://github.com/paragonie/random_compat.git",
- "reference": "5da4d3c796c275c55f057af5a643ae297d96b4d8"
+ "reference": "258c89a6b97de7dfaf5b8c7607d0478e236b04fb"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/paragonie/random_compat/zipball/5da4d3c796c275c55f057af5a643ae297d96b4d8",
- "reference": "5da4d3c796c275c55f057af5a643ae297d96b4d8",
+ "url": "https://api.github.com/repos/paragonie/random_compat/zipball/258c89a6b97de7dfaf5b8c7607d0478e236b04fb",
+ "reference": "258c89a6b97de7dfaf5b8c7607d0478e236b04fb",
"shasum": ""
},
"require": {
"pseudorandom",
"random"
],
- "time": "2017-09-27T21:40:39+00:00"
+ "time": "2018-04-04T21:24:14+00:00"
},
{
"name": "phenx/php-font-lib",
},
{
"name": "psr/simple-cache",
- "version": "1.0.0",
+ "version": "1.0.1",
"source": {
"type": "git",
"url": "https://github.com/php-fig/simple-cache.git",
- "reference": "753fa598e8f3b9966c886fe13f370baa45ef0e24"
+ "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/753fa598e8f3b9966c886fe13f370baa45ef0e24",
- "reference": "753fa598e8f3b9966c886fe13f370baa45ef0e24",
+ "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
+ "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
"shasum": ""
},
"require": {
"psr-16",
"simple-cache"
],
- "time": "2017-01-02T13:31:39+00:00"
+ "time": "2017-10-23T01:57:42+00:00"
},
{
"name": "ramsey/uuid",
},
{
"name": "socialiteproviders/gitlab",
- "version": "v3.0.1",
+ "version": "v3.0.2",
"source": {
"type": "git",
"url": "https://github.com/SocialiteProviders/GitLab.git",
- "reference": "c96dc004563a3caf157608fe9aa9e45c79065d00"
+ "reference": "bab80e8e16853e062c58013b1c1f474bd5a5c49a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/SocialiteProviders/GitLab/zipball/c96dc004563a3caf157608fe9aa9e45c79065d00",
- "reference": "c96dc004563a3caf157608fe9aa9e45c79065d00",
+ "url": "https://api.github.com/repos/SocialiteProviders/GitLab/zipball/bab80e8e16853e062c58013b1c1f474bd5a5c49a",
+ "reference": "bab80e8e16853e062c58013b1c1f474bd5a5c49a",
"shasum": ""
},
"require": {
"php": "^5.6 || ^7.0",
- "socialiteproviders/manager": "~3.0"
+ "socialiteproviders/manager": "~2.0 || ~3.0"
},
"type": "library",
"autoload": {
}
],
"description": "GitLab OAuth2 Provider for Laravel Socialite",
- "time": "2017-01-31T05:06:13+00:00"
+ "time": "2018-05-11T03:10:27+00:00"
},
{
"name": "socialiteproviders/manager",
},
{
"name": "symfony/polyfill-mbstring",
- "version": "v1.7.0",
+ "version": "v1.8.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b"
+ "reference": "3296adf6a6454a050679cde90f95350ad604b171"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/78be803ce01e55d3491c1397cf1c64beb9c1b63b",
- "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/3296adf6a6454a050679cde90f95350ad604b171",
+ "reference": "3296adf6a6454a050679cde90f95350ad604b171",
"shasum": ""
},
"require": {
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.7-dev"
+ "dev-master": "1.8-dev"
}
},
"autoload": {
"portable",
"shim"
],
- "time": "2018-01-30T19:27:44+00:00"
+ "time": "2018-04-26T10:06:28+00:00"
},
{
"name": "symfony/process",
"packages-dev": [
{
"name": "barryvdh/laravel-debugbar",
- "version": "v3.1.1",
+ "version": "v3.1.4",
"source": {
"type": "git",
"url": "https://github.com/barryvdh/laravel-debugbar.git",
- "reference": "f0018d359a2ad6968ad11b283283a925e017f3c9"
+ "reference": "7a91480cc6e597caed5117a3c5d685f06d35c5a1"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/f0018d359a2ad6968ad11b283283a925e017f3c9",
- "reference": "f0018d359a2ad6968ad11b283283a925e017f3c9",
+ "url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/7a91480cc6e597caed5117a3c5d685f06d35c5a1",
+ "reference": "7a91480cc6e597caed5117a3c5d685f06d35c5a1",
"shasum": ""
},
"require": {
"profiler",
"webprofiler"
],
- "time": "2018-02-07T08:29:09+00:00"
+ "time": "2018-03-06T08:35:31+00:00"
},
{
"name": "barryvdh/laravel-ide-helper",
},
{
"name": "mockery/mockery",
- "version": "1.0",
+ "version": "1.1.0",
"source": {
"type": "git",
"url": "https://github.com/mockery/mockery.git",
- "reference": "1bac8c362b12f522fdd1f1fa3556284c91affa38"
+ "reference": "99e29d3596b16dabe4982548527d5ddf90232e99"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/mockery/mockery/zipball/1bac8c362b12f522fdd1f1fa3556284c91affa38",
- "reference": "1bac8c362b12f522fdd1f1fa3556284c91affa38",
+ "url": "https://api.github.com/repos/mockery/mockery/zipball/99e29d3596b16dabe4982548527d5ddf90232e99",
+ "reference": "99e29d3596b16dabe4982548527d5ddf90232e99",
"shasum": ""
},
"require": {
"php": ">=5.6.0"
},
"require-dev": {
- "phpunit/phpunit": "~5.7|~6.1"
+ "phpdocumentor/phpdocumentor": "^2.9",
+ "phpunit/phpunit": "~5.7.10|~6.5"
},
"type": "library",
"extra": {
"homepage": "http://davedevelopment.co.uk"
}
],
- "description": "Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a test double framework with a succinct API capable of clearly defining all possible object operations and interactions using a human readable Domain Specific Language (DSL). Designed as a drop in alternative to PHPUnit's phpunit-mock-objects library, Mockery is easy to integrate with PHPUnit and can operate alongside phpunit-mock-objects without the World ending.",
- "homepage": "http://github.com/mockery/mockery",
+ "description": "Mockery is a simple yet flexible PHP mock object framework",
+ "homepage": "https://github.com/mockery/mockery",
"keywords": [
"BDD",
"TDD",
"test double",
"testing"
],
- "time": "2017-10-06T16:20:43+00:00"
+ "time": "2018-05-08T08:54:48+00:00"
},
{
"name": "myclabs/deep-copy",
},
{
"name": "phpspec/prophecy",
- "version": "1.7.3",
+ "version": "1.7.6",
"source": {
"type": "git",
"url": "https://github.com/phpspec/prophecy.git",
- "reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf"
+ "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpspec/prophecy/zipball/e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf",
- "reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf",
+ "url": "https://api.github.com/repos/phpspec/prophecy/zipball/33a7e3c4fda54e912ff6338c48823bd5c0f0b712",
+ "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712",
"shasum": ""
},
"require": {
"doctrine/instantiator": "^1.0.2",
"php": "^5.3|^7.0",
"phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0",
- "sebastian/comparator": "^1.1|^2.0",
+ "sebastian/comparator": "^1.1|^2.0|^3.0",
"sebastian/recursion-context": "^1.0|^2.0|^3.0"
},
"require-dev": {
"phpspec/phpspec": "^2.5|^3.2",
- "phpunit/phpunit": "^4.8.35 || ^5.7"
+ "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5"
},
"type": "library",
"extra": {
"spy",
"stub"
],
- "time": "2017-11-24T13:59:53+00:00"
+ "time": "2018-04-18T13:57:24+00:00"
},
{
"name": "phpunit/php-code-coverage",
- "version": "5.3.0",
+ "version": "5.3.2",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
- "reference": "661f34d0bd3f1a7225ef491a70a020ad23a057a1"
+ "reference": "c89677919c5dd6d3b3852f230a663118762218ac"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/661f34d0bd3f1a7225ef491a70a020ad23a057a1",
- "reference": "661f34d0bd3f1a7225ef491a70a020ad23a057a1",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c89677919c5dd6d3b3852f230a663118762218ac",
+ "reference": "c89677919c5dd6d3b3852f230a663118762218ac",
"shasum": ""
},
"require": {
"testing",
"xunit"
],
- "time": "2017-12-06T09:29:45+00:00"
+ "time": "2018-04-06T15:36:58+00:00"
},
{
"name": "phpunit/php-file-iterator",
},
{
"name": "phpunit/phpunit",
- "version": "6.5.6",
+ "version": "6.5.8",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
- "reference": "3330ef26ade05359d006041316ed0fa9e8e3cefe"
+ "reference": "4f21a3c6b97c42952fd5c2837bb354ec0199b97b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3330ef26ade05359d006041316ed0fa9e8e3cefe",
- "reference": "3330ef26ade05359d006041316ed0fa9e8e3cefe",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/4f21a3c6b97c42952fd5c2837bb354ec0199b97b",
+ "reference": "4f21a3c6b97c42952fd5c2837bb354ec0199b97b",
"shasum": ""
},
"require": {
"testing",
"xunit"
],
- "time": "2018-02-01T05:57:37+00:00"
+ "time": "2018-04-10T11:38:34+00:00"
},
{
"name": "phpunit/phpunit-mock-objects",
},
{
"name": "squizlabs/php_codesniffer",
- "version": "3.2.2",
+ "version": "3.2.3",
"source": {
"type": "git",
"url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
- "reference": "d7c00c3000ac0ce79c96fcbfef86b49a71158cd1"
+ "reference": "4842476c434e375f9d3182ff7b89059583aa8b27"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/d7c00c3000ac0ce79c96fcbfef86b49a71158cd1",
- "reference": "d7c00c3000ac0ce79c96fcbfef86b49a71158cd1",
+ "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/4842476c434e375f9d3182ff7b89059583aa8b27",
+ "reference": "4842476c434e375f9d3182ff7b89059583aa8b27",
"shasum": ""
},
"require": {
"php": ">=5.4.0"
},
"require-dev": {
- "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0"
+ "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
},
"bin": [
"bin/phpcs",
"phpcs",
"standards"
],
- "time": "2017-12-19T21:44:46+00:00"
+ "time": "2018-02-20T21:35:23+00:00"
},
{
"name": "symfony/class-loader",
|
*/
- 'domain' => null,
+ 'domain' => env('SESSION_DOMAIN', null),
/*
|--------------------------------------------------------------------------
|
*/
- 'secure' => false,
+ 'secure' => env('SESSION_SECURE_COOKIE', false),
+
+ /*
+ |--------------------------------------------------------------------------
+ | HTTP Access Only
+ |--------------------------------------------------------------------------
+ |
+ | Setting this value to true will prevent JavaScript from accessing the
+ | value of the cookie and the cookie will only be accessible through
+ | the HTTP protocol. You are free to modify this option if needed.
+ |
+ */
+
+ 'http_only' => true,
+
+ /*
+ |--------------------------------------------------------------------------
+ | Same-Site Cookies
+ |--------------------------------------------------------------------------
+ |
+ | This option determines how your cookies behave when cross-site requests
+ | take place, and can be used to mitigate CSRF attacks. By default, we
+ | do not enable this as other CSRF protection services are in place.
+ |
+ | Supported: "lax", "strict"
+ |
+ */
+
+ 'same_site' => null,
];
-<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
+<svg viewBox="0 0 24 24" fill="#b6531c" xmlns="http://www.w3.org/2000/svg">
<path d="M0 0h24v24H0z" fill="none"/>
<path d="M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"/>
</svg>
\ No newline at end of file
this.targetElem = document.getElementById('header');
this.showing = false;
this.breakPoint = 1200;
+
+ if (document.body.classList.contains('flexbox')) {
+ this.elem.style.display = 'none';
+ return;
+ }
+
this.elem.addEventListener('click', this.scrollToTop.bind(this));
window.addEventListener('scroll', this.onPageScroll.bind(this));
}
editor.addButton('drawio', {
tooltip: 'Drawing',
- image: window.baseUrl('/icon/drawing.svg?color=000000'),
+ image: `data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9IiMwMDAwMDAiICB4bWxucz0iaHR0cDovL3d3 dy53My5vcmcvMjAwMC9zdmciPgogICAgPHBhdGggZD0iTTIzIDdWMWgtNnYySDdWMUgxdjZoMnYx MEgxdjZoNnYtMmgxMHYyaDZ2LTZoLTJWN2gyek0zIDNoMnYySDNWM3ptMiAxOEgzdi0yaDJ2Mnpt MTItMkg3di0ySDVWN2gyVjVoMTB2MmgydjEwaC0ydjJ6bTQgMmgtMnYtMmgydjJ6TTE5IDVWM2gy djJoLTJ6bS01LjI3IDloLTMuNDlsLS43MyAySDcuODlsMy40LTloMS40bDMuNDEgOWgtMS42M2wt Ljc0LTJ6bS0zLjA0LTEuMjZoMi42MUwxMiA4LjkxbC0xLjMxIDMuODN6Ii8+CiAgICA8cGF0aCBk PSJNMCAwaDI0djI0SDB6IiBmaWxsPSJub25lIi8+Cjwvc3ZnPg==`,
cmd: 'drawio'
});
const modeMap = {
css: 'css',
- c: 'clike',
- java: 'clike',
- scala: 'clike',
- kotlin: 'clike',
- 'c++': 'clike',
- 'c#': 'clike',
- csharp: 'clike',
+ c: 'text/x-csrc',
+ java: 'text/x-java',
+ scala: 'text/x-scala',
+ kotlin: 'text/x-kotlin',
+ 'c++': 'text/x-c++src',
+ 'c#': 'text/x-csharp',
+ csharp: 'text/x-csharp',
diff: 'diff',
go: 'go',
html: 'htmlmixed',
},
getFileUrl(file) {
+ if (file.external && file.path.indexOf('http') !== 0) {
+ return file.path;
+ }
return window.baseUrl(`/attachments/${file.id}`);
},
},
checkValidationErrors(groupName, err) {
- console.error(err);
- if (typeof err.response.data === "undefined" && typeof err.response.data.validation === "undefined") return;
- this.errors[groupName] = err.response.data.validation;
- console.log(this.errors[groupName]);
+ if (typeof err.response.data === "undefined" && typeof err.response.data === "undefined") return;
+ this.errors[groupName] = err.response.data;
},
getUploadUrl(file) {
attachNewLink(file) {
file.uploaded_to = this.pageId;
+ this.errors.link = {};
this.$http.post(window.baseUrl('/attachments/link'), file).then(resp => {
this.files.push(resp.data);
this.file = this.newFile();
lastSave = Date.now();
}, errorRes => {
if (draftErroring) return;
- window.$events('error', trans('errors.page_draft_autosave_fail'));
+ window.$events.emit('error', trans('errors.page_draft_autosave_fail'));
draftErroring = true;
});
},
display: block;
position: relative;
&:before {
- background-image: url("/icon/info-filled.svg?color=015380");
+ background-image: url('data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9IiMwMTUzODAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+ICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz4gICAgPHBhdGggZD0iTTEyIDJDNi40OCAyIDIgNi40OCAyIDEyczQuNDggMTAgMTAgMTAgMTAtNC40OCAxMC0xMFMxNy41MiAyIDEyIDJ6bTEgMTVoLTJ2LTZoMnY2em0wLThoLTJWN2gydjJ6Ii8+PC9zdmc+');
background-repeat: no-repeat;
content: '';
width: 1.2em;
color: darken($positive, 16%);
}
&.success:before {
- background-image: url("/icon/check-circle.svg?color=376c39");
+ background-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9IiMzNzZjMzkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+ICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz4gICAgPHBhdGggZD0iTTEyIDJDNi40OCAyIDIgNi40OCAyIDEyczQuNDggMTAgMTAgMTAgMTAtNC40OCAxMC0xMFMxNy41MiAyIDEyIDJ6bS0yIDE1bC01LTUgMS40MS0xLjQxTDEwIDE0LjE3bDcuNTktNy41OUwxOSA4bC05IDl6Ii8+PC9zdmc+");
}
&.danger {
border-left-color: $negative;
color: darken($negative, 20%);
}
&.danger:before {
- background-image: url("/icon/danger.svg?color=b91818");
+ background-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9IiNiOTE4MTgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+ICAgIDxwYXRoIGQ9Ik0xNS43MyAzSDguMjdMMyA4LjI3djcuNDZMOC4yNyAyMWg3LjQ2TDIxIDE1LjczVjguMjdMMTUuNzMgM3pNMTIgMTcuM2MtLjcyIDAtMS4zLS41OC0xLjMtMS4zIDAtLjcyLjU4LTEuMyAxLjMtMS4zLjcyIDAgMS4zLjU4IDEuMyAxLjMgMCAuNzItLjU4IDEuMy0xLjMgMS4zem0xLTQuM2gtMlY3aDJ2NnoiLz4gICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIvPjwvc3ZnPg==");
}
&.info {
border-left-color: $info;
color: darken($warning, 16%);
}
&.warning:before {
- background-image: url("/icon/warning.svg?color=b6531c");
+ background-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9IiNiNjUzMWMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+ICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz4gICAgPHBhdGggZD0iTTEgMjFoMjJMMTIgMiAxIDIxem0xMi0zaC0ydi0yaDJ2MnptMC00aC0ydi00aDJ2NHoiLz48L3N2Zz4=");
}
}
color: #666;
width: 250px;
max-width: 100%;
+
&.neg, &.invalid {
border: 1px solid $negative;
}
'app_homepage' => 'Application Homepage',
'app_homepage_desc' => 'Select a page to show on the homepage instead of the default view. Page permissions are ignored for selected pages.',
'app_homepage_default' => 'Default homepage view chosen',
+ 'app_homepage_books' => 'Or select the books page as your homepage. This will override any page selected as your homepage.',
'app_disable_comments' => 'Disable comments',
'app_disable_comments_desc' => 'Disable comments across all pages in the application. Existing comments are not shown.',
'image_upload_success' => 'Bilden har laddats upp',
'image_update_success' => 'Bildens uppgifter har ändrats',
'image_delete_success' => 'Bilden har tagits bort',
+ 'image_upload_remove' => 'Radera',
/**
* Code editor
'code_language' => 'Språk',
'code_content' => 'Kod',
'code_save' => 'Spara',
-];
\ No newline at end of file
+];
'pages_name' => 'Sidans namn',
'pages_md_editor' => 'Redigerare',
'pages_md_preview' => 'Förhandsvisa',
- 'pages_md_insert_image' => 'Inoga bild',
+ 'pages_md_insert_image' => 'Infoga bild',
'pages_md_insert_link' => 'Infoga länk',
+ 'pages_md_insert_drawing' => 'Infoga teckning',
'pages_not_in_chapter' => 'Sidan ligger inte i något kapitel',
'pages_move' => 'Flytta sida',
'pages_move_success' => 'Sidan har flyttats till ":parentName"',
* Editor sidebar
*/
'page_tags' => 'Sidtaggar',
+ 'chapter_tags' => 'Kapiteltaggar',
+ 'book_tags' => 'Boktaggar',
'tag' => 'Tagg',
- 'tags' => '',
+ 'tags' => 'Taggar',
'tag_value' => 'Taggvärde (Frivilligt)',
'tags_explain' => "Lägg till taggar för att kategorisera ditt innehåll bättre. \n Du kan tilldela ett värde till en tagg för ännu bättre organisering.",
'tags_add' => 'Lägg till ännu en tagg',
*/
'comment' => 'Kommentar',
'comments' => 'Kommentarer',
+ 'comment_add' => 'Lägg till kommentar',
'comment_placeholder' => 'Lämna en kommentar här',
'comment_count' => '{0} Inga kommentarer|{1} 1 kommentar|[2,*] :count kommentarer',
'comment_save' => 'Spara kommentar',
'cannot_get_image_from_url' => 'Kan inte hämta bild från :url',
'cannot_create_thumbs' => 'Servern kan inte skapa miniatyrer. Kontrollera att du har PHPs GD-tillägg aktiverat.',
'server_upload_limit' => 'Servern tillåter inte så här stora filer. Prova en mindre fil.',
+ 'uploaded' => 'Servern tillåter inte så här stora filer. Prova en mindre fil.',
'image_upload_error' => 'Ett fel inträffade vid uppladdningen',
+ 'image_upload_type_error' => 'Filtypen du försöker ladda upp är ogiltig',
// Attachments
'attachment_page_mismatch' => 'Fel i sidmatchning vid uppdatering av bilaga',
+ 'attachment_not_found' => 'Bilagan hittades ej',
// Pages
'page_draft_autosave_fail' => 'Kunde inte spara utkastet. Kontrollera att du är ansluten till internet.',
'error_occurred' => 'Ett fel inträffade',
'app_down' => ':appName är nere just nu',
'back_soon' => 'Vi är snart tillbaka.',
-];
\ No newline at end of file
+];
@section('toolbar')
<div class="col-xs-6">
<div class="action-buttons text-left">
- <form action="{{ baseUrl("/settings/users/{$currentUser->id}/switch-book-view") }}" method="POST" class="inline">
- {!! csrf_field() !!}
- {!! method_field('PATCH') !!}
- <input type="hidden" value="{{ $booksViewType === 'list'? 'grid' : 'list' }}" name="book_view_type">
- @if ($booksViewType === 'list')
- <button type="submit" class="text-pos text-button">@icon('grid'){{ trans('common.grid_view') }}</button>
- @else
- <button type="submit" class="text-pos text-button">@icon('list'){{ trans('common.list_view') }}</button>
- @endif
- </form>
+ @include('books/view-toggle', ['booksViewType' => $booksViewType])
</div>
</div>
<div class="col-xs-6 faded">
@stop
@section('body')
- @if($booksViewType === 'list')
- <div class="container small" ng-non-bindable>
- @else
- <div class="container" ng-non-bindable>
- @endif
- <h1>{{ trans('entities.books') }}</h1>
- @if(count($books) > 0)
- @if($booksViewType === 'list')
- @foreach($books as $book)
- @include('books/list-item', ['book' => $book])
- <hr>
- @endforeach
- {!! $books->render() !!}
- @else
- <div class="grid third">
- @foreach($books as $key => $book)
- @include('books/grid-item', ['book' => $book])
- @endforeach
- </div>
- <div>
- {!! $books->render() !!}
- </div>
- @endif
- @else
- <p class="text-muted">{{ trans('entities.books_empty') }}</p>
- @if(userCan('books-create-all'))
- <a href="{{ baseUrl("/create-book") }}" class="text-pos">@icon('edit'){{ trans('entities.create_one_now') }}</a>
- @endif
- @endif
- </div>
+ @include('books/list', ['books' => $books, 'bookViewType' => $booksViewType])
@stop
\ No newline at end of file
--- /dev/null
+
+@if($booksViewType === 'list')
+ <div class="container small">
+@else
+ <div class="container">
+@endif
+ <h1>{{ trans('entities.books') }}</h1>
+ @if(count($books) > 0)
+ @if($booksViewType === 'list')
+ @foreach($books as $book)
+ @include('books/list-item', ['book' => $book])
+ <hr>
+ @endforeach
+ {!! $books->render() !!}
+ @else
+ <div class="grid third">
+ @foreach($books as $key => $book)
+ @include('books/grid-item', ['book' => $book])
+ @endforeach
+ </div>
+ <div>
+ {!! $books->render() !!}
+ </div>
+ @endif
+ @else
+ <p class="text-muted">{{ trans('entities.books_empty') }}</p>
+ @if(userCan('books-create-all'))
+ <a href="{{ baseUrl("/create-book") }}" class="text-pos">@icon('edit'){{ trans('entities.create_one_now') }}</a>
+ @endif
+ @endif
+</div>
\ No newline at end of file
--- /dev/null
+<form action="{{ baseUrl("/settings/users/{$currentUser->id}/switch-book-view") }}" method="POST" class="inline">
+ {!! csrf_field() !!}
+ {!! method_field('PATCH') !!}
+ <input type="hidden" value="{{ $booksViewType === 'list'? 'grid' : 'list' }}" name="book_view_type">
+ @if ($booksViewType === 'list')
+ <button type="submit" class="text-pos text-button">@icon('grid'){{ trans('common.grid_view') }}</button>
+ @else
+ <button type="submit" class="text-pos text-button">@icon('list'){{ trans('common.list_view') }}</button>
+ @endif
+</form>
\ No newline at end of file
--- /dev/null
+@extends('sidebar-layout')
+
+@section('toolbar')
+ <div class="col-sm-6 faded">
+ <div class="action-buttons text-left">
+ <a expand-toggle=".entity-list.compact .entity-item-snippet" class="text-primary text-button">@icon('expand-text'){{ trans('common.toggle_details') }}</a>
+ @include('books/view-toggle', ['booksViewType' => $booksViewType])
+ </div>
+ </div>
+@stop
+
+@section('sidebar')
+ @include('common/home-sidebar')
+@stop
+
+@section('body')
+ @include('books/list', ['books' => $books, 'bookViewType' => $booksViewType])
+@stop
\ No newline at end of file
--- /dev/null
+@extends('sidebar-layout')
+
+@section('toolbar')
+ <div class="col-sm-6 faded">
+ <div class="action-buttons text-left">
+ <a expand-toggle=".entity-list.compact .entity-item-snippet" class="text-primary text-button">@icon('expand-text'){{ trans('common.toggle_details') }}</a>
+ </div>
+ </div>
+@stop
+
+@section('sidebar')
+ @include('common/home-sidebar')
+@stop
+
+@section('body')
+ <div class="page-content" page-display="{{ $customHomepage->id }}">
+ @include('pages/page-display', ['page' => $customHomepage])
+ </div>
+@stop
--- /dev/null
+@if(count($draftPages) > 0)
+ <div id="recent-drafts" class="card">
+ <h3>@icon('edit') {{ trans('entities.my_recent_drafts') }}</h3>
+ @include('partials/entity-list', ['entities' => $draftPages, 'style' => 'compact'])
+ </div>
+@endif
+
+<div class="card">
+ <h3>@icon($signedIn ? 'view' : 'star-circle') {{ trans('entities.' . ($signedIn ? 'my_recently_viewed' : 'books_recent')) }}</h3>
+ @include('partials/entity-list', [
+ 'entities' => $recents,
+ 'style' => 'compact',
+ 'emptyText' => $signedIn ? trans('entities.no_pages_viewed') : trans('entities.books_empty')
+ ])
+</div>
+
+<div class="card">
+ <h3>@icon('file') <a class="no-color" href="{{ baseUrl("/pages/recently-updated") }}">{{ trans('entities.recently_updated_pages') }}</a></h3>
+ <div id="recently-updated-pages">
+ @include('partials/entity-list', [
+ 'entities' => $recentlyUpdatedPages,
+ 'style' => 'compact',
+ 'emptyText' => trans('entities.no_pages_recently_updated')
+ ])
+ </div>
+</div>
+
+<div id="recent-activity" class="card">
+ <h3>@icon('time') {{ trans('entities.recent_activity') }}</h3>
+ @include('partials/activity-list', ['activity' => $activity])
+</div>
\ No newline at end of file
+++ /dev/null
-@extends('sidebar-layout')
-
-@section('toolbar')
- <div class="col-sm-6 faded">
- <div class="action-buttons text-left">
- <a expand-toggle=".entity-list.compact .entity-item-snippet" class="text-primary text-button">@icon('expand-text'){{ trans('common.toggle_details') }}</a>
- </div>
- </div>
-@stop
-
-@section('sidebar')
- @if(count($draftPages) > 0)
- <div id="recent-drafts" class="card">
- <h3>@icon('edit') {{ trans('entities.my_recent_drafts') }}</h3>
- @include('partials/entity-list', ['entities' => $draftPages, 'style' => 'compact'])
- </div>
- @endif
-
- <div class="card">
- <h3>@icon($signedIn ? 'view' : 'star-circle') {{ trans('entities.' . ($signedIn ? 'my_recently_viewed' : 'books_recent')) }}</h3>
- @include('partials/entity-list', [
- 'entities' => $recents,
- 'style' => 'compact',
- 'emptyText' => $signedIn ? trans('entities.no_pages_viewed') : trans('entities.books_empty')
- ])
- </div>
-
- <div class="card">
- <h3>@icon('file') <a class="no-color" href="{{ baseUrl("/pages/recently-updated") }}">{{ trans('entities.recently_updated_pages') }}</a></h3>
- <div id="recently-updated-pages">
- @include('partials/entity-list', [
- 'entities' => $recentlyUpdatedPages,
- 'style' => 'compact',
- 'emptyText' => trans('entities.no_pages_recently_updated')
- ])
- </div>
- </div>
-
- <div id="recent-activity" class="card">
- <h3>@icon('time') {{ trans('entities.recent_activity') }}</h3>
- @include('partials/activity-list', ['activity' => $activity])
- </div>
-@stop
-
-@section('body')
- <div class="page-content" ng-non-bindable>
- @include('pages/page-display', ['page' => $customHomepage])
- </div>
-@stop
-
-@section('scripts')
- <script>
- setupPageShow({{$customHomepage->id}});
- </script>
-@stop
-
@stop
@section('body')
- <div class="page-content" page-display="{{ $page->id }}" ng-non-bindable>
+ <div class="page-content" page-display="{{ $page->id }}">
<div class="pointer-container" id="pointer">
<div class="pointer anim" >
<label for="setting-app-homepage">{{ trans('settings.app_homepage') }}</label>
<p class="small">{{ trans('settings.app_homepage_desc') }}</p>
@include('components.page-picker', ['name' => 'setting-app-homepage', 'placeholder' => trans('settings.app_homepage_default'), 'value' => setting('app-homepage')])
+ <p class="small">{{ trans('settings.app_homepage_books') }}</p>
+ @include('components.toggle-switch', ['name' => 'setting-app-book-homepage', 'value' => setting('app-book-homepage')])
</div>
</div>
<?php
Route::get('/translations', 'HomeController@getTranslations');
-Route::get('/icon/{iconName}.svg', 'HomeController@getIcon');
Route::get('/robots.txt', 'HomeController@getRobots');
// Authenticated routes...
// Password reset routes...
Route::get('/password/reset/{token}', 'Auth\ResetPasswordController@showResetForm');
-Route::post('/password/reset', 'Auth\ResetPasswordController@reset');
\ No newline at end of file
+Route::post('/password/reset', 'Auth\ResetPasswordController@reset');
+
+Route::fallback('HomeController@getNotFound');
\ No newline at end of file
$homeVisit->assertSee($name);
$homeVisit->assertStatus(200);
}
+
+ public function test_set_book_homepage()
+ {
+ $editor = $this->getEditor();
+ setting()->putUser($editor, 'books_view_type', 'grid');
+
+ $this->setSettings(['app-book-homepage' => true]);
+
+ $this->asEditor();
+ $homeVisit = $this->get('/');
+ $homeVisit->assertSee('Books');
+ $homeVisit->assertSee('book-grid-item grid-card');
+ $homeVisit->assertSee('grid-card-content');
+ $homeVisit->assertSee('grid-card-footer');
+ $homeVisit->assertSee('featured-image-container');
+
+ $this->setSettings(['app-book-homepage' => false]);
+ $this->test_default_homepage_visible();
+ }
}