Merge branch 'master' into release

This commit is contained in:
Dan Brown 2019-01-20 15:41:24 +00:00
commit 4c561c7fa0
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9
8 changed files with 126 additions and 51 deletions

View File

@ -90,6 +90,10 @@ STORAGE_S3_SECRET=your-s3-secret
STORAGE_S3_BUCKET=s3-bucket-name STORAGE_S3_BUCKET=s3-bucket-name
STORAGE_S3_REGION=s3-bucket-region STORAGE_S3_REGION=s3-bucket-region
# S3 endpoint to use for storage calls
# Only set this if using a non-Amazon s3-compatible service such as Minio
STORAGE_S3_ENDPOINT=https://my-custom-s3-compatible.service.com:8001
# Storage URL prefix # Storage URL prefix
# Used as a base for any generated image urls. # Used as a base for any generated image urls.
# An s3-format URL will be generated if not set. # An s3-format URL will be generated if not set.

View File

@ -7,8 +7,40 @@ use Illuminate\Http\Request;
class Localization class Localization
{ {
/**
* Array of right-to-left locales
* @var array
*/
protected $rtlLocales = ['ar']; protected $rtlLocales = ['ar'];
/**
* Map of BookStack locale names to best-estimate system locale names.
* @var array
*/
protected $localeMap = [
'ar' => 'ar',
'de' => 'de_DE',
'de_informal' => 'de_DE',
'en' => 'en_GB',
'es' => 'es_ES',
'es_AR' => 'es_AR',
'fr' => 'fr_FR',
'it' => 'it_IT',
'ja' => 'ja',
'kr' => 'ko_KR',
'nl' => 'nl_NL',
'pl' => 'pl_PL',
'pt_BR' => 'pt_BR',
'pt_BR' => 'pt_BR',
'ru' => 'ru',
'sk' => 'sk_SK',
'sv' => 'sv_SE',
'uk' => 'uk_UA',
'uk' => 'uk_UA',
'zh_CN' => 'zh_CN',
'zh_TW' => 'zh_TW',
];
/** /**
* Handle an incoming request. * Handle an incoming request.
* *
@ -31,8 +63,11 @@ class Localization
config()->set('app.rtl', true); config()->set('app.rtl', true);
} }
app()->setLocale($locale); app()->setLocale($locale);
Carbon::setLocale($locale); Carbon::setLocale($locale);
$this->setSystemDateLocale($locale);
return $next($request); return $next($request);
} }
@ -53,4 +88,18 @@ class Localization
} }
return $default; return $default;
} }
/**
* Set the system date locale for localized date formatting.
* Will try both the standard locale name and the UTF8 variant.
* @param string $locale
*/
protected function setSystemDateLocale(string $locale)
{
$systemLocale = $this->localeMap[$locale] ?? $locale;
$set = setlocale(LC_TIME, $systemLocale);
if ($set === false) {
setlocale(LC_TIME, $systemLocale . '.utf8');
}
}
} }

View File

@ -16,7 +16,7 @@
"laravel/framework": "~5.5.44", "laravel/framework": "~5.5.44",
"fideloper/proxy": "~3.3", "fideloper/proxy": "~3.3",
"intervention/image": "^2.4", "intervention/image": "^2.4",
"laravel/socialite": "^3.0", "laravel/socialite": "3.0.x-dev",
"league/flysystem-aws-s3-v3": "^1.0", "league/flysystem-aws-s3-v3": "^1.0",
"barryvdh/laravel-dompdf": "^0.8.1", "barryvdh/laravel-dompdf": "^0.8.1",
"predis/predis": "^1.1", "predis/predis": "^1.1",

93
composer.lock generated
View File

@ -4,20 +4,20 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "06219a5c2419ca23ec2924eb31f4ed16", "content-hash": "0946a07729a7a1bfef9bac185a870afd",
"packages": [ "packages": [
{ {
"name": "aws/aws-sdk-php", "name": "aws/aws-sdk-php",
"version": "3.82.3", "version": "3.86.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/aws/aws-sdk-php.git", "url": "https://github.com/aws/aws-sdk-php.git",
"reference": "a0353c24b18d2ba0f5bb7ca8a478b4ce0b8153f7" "reference": "50224232ac7a4e2a6fa4ebbe0281e5b7503acf76"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/a0353c24b18d2ba0f5bb7ca8a478b4ce0b8153f7", "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/50224232ac7a4e2a6fa4ebbe0281e5b7503acf76",
"reference": "a0353c24b18d2ba0f5bb7ca8a478b4ce0b8153f7", "reference": "50224232ac7a4e2a6fa4ebbe0281e5b7503acf76",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -87,7 +87,7 @@
"s3", "s3",
"sdk" "sdk"
], ],
"time": "2018-12-21T22:21:50+00:00" "time": "2019-01-18T21:10:44+00:00"
}, },
{ {
"name": "barryvdh/laravel-dompdf", "name": "barryvdh/laravel-dompdf",
@ -1457,16 +1457,16 @@
}, },
{ {
"name": "laravel/socialite", "name": "laravel/socialite",
"version": "v3.2.0", "version": "3.0.x-dev",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/laravel/socialite.git", "url": "https://github.com/laravel/socialite.git",
"reference": "7194c0cd9fb2ce449669252b8ec316b85b7de481" "reference": "79316f36641f1916a50ab14d368acdf1d97e46de"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/laravel/socialite/zipball/7194c0cd9fb2ce449669252b8ec316b85b7de481", "url": "https://api.github.com/repos/laravel/socialite/zipball/79316f36641f1916a50ab14d368acdf1d97e46de",
"reference": "7194c0cd9fb2ce449669252b8ec316b85b7de481", "reference": "79316f36641f1916a50ab14d368acdf1d97e46de",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1516,7 +1516,7 @@
"laravel", "laravel",
"oauth" "oauth"
], ],
"time": "2018-10-18T03:39:04+00:00" "time": "2018-12-21T14:06:32+00:00"
}, },
{ {
"name": "league/flysystem", "name": "league/flysystem",
@ -1891,16 +1891,16 @@
}, },
{ {
"name": "nesbot/carbon", "name": "nesbot/carbon",
"version": "1.36.1", "version": "1.36.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/briannesbitt/Carbon.git", "url": "https://github.com/briannesbitt/Carbon.git",
"reference": "63da8cdf89d7a5efe43aabc794365f6e7b7b8983" "reference": "cd324b98bc30290f233dd0e75e6ce49f7ab2a6c9"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/63da8cdf89d7a5efe43aabc794365f6e7b7b8983", "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/cd324b98bc30290f233dd0e75e6ce49f7ab2a6c9",
"reference": "63da8cdf89d7a5efe43aabc794365f6e7b7b8983", "reference": "cd324b98bc30290f233dd0e75e6ce49f7ab2a6c9",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1945,7 +1945,7 @@
"datetime", "datetime",
"time" "time"
], ],
"time": "2018-11-22T18:23:02+00:00" "time": "2018-12-28T10:07:33+00:00"
}, },
{ {
"name": "paragonie/random_compat", "name": "paragonie/random_compat",
@ -2555,20 +2555,20 @@
}, },
{ {
"name": "socialiteproviders/manager", "name": "socialiteproviders/manager",
"version": "v3.3.1", "version": "v3.3.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/SocialiteProviders/Manager.git", "url": "https://github.com/SocialiteProviders/Manager.git",
"reference": "1de3f3d874392da6f1a4c0bf30d843e9cd903ea7" "reference": "58b72a667da292a1d0a0b1e6e9aeda4053617030"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/SocialiteProviders/Manager/zipball/1de3f3d874392da6f1a4c0bf30d843e9cd903ea7", "url": "https://api.github.com/repos/SocialiteProviders/Manager/zipball/58b72a667da292a1d0a0b1e6e9aeda4053617030",
"reference": "1de3f3d874392da6f1a4c0bf30d843e9cd903ea7", "reference": "58b72a667da292a1d0a0b1e6e9aeda4053617030",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"laravel/socialite": "~3.0", "laravel/socialite": "~3.0|~4.0",
"php": "^5.6 || ^7.0" "php": "^5.6 || ^7.0"
}, },
"require-dev": { "require-dev": {
@ -2585,8 +2585,7 @@
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"SocialiteProviders\\Manager\\": "src/", "SocialiteProviders\\Manager\\": "src/"
"SocialiteProviders\\Manager\\Test\\": "tests/"
} }
}, },
"notification-url": "https://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
@ -2597,10 +2596,14 @@
{ {
"name": "Andy Wendt", "name": "Andy Wendt",
"email": "andy@awendt.com" "email": "andy@awendt.com"
},
{
"name": "Anton Komarev",
"email": "a.komarev@cybercog.su"
} }
], ],
"description": "Easily add new or override built-in providers in Laravel Socialite.", "description": "Easily add new or override built-in providers in Laravel Socialite.",
"time": "2017-11-20T08:42:57+00:00" "time": "2019-01-16T07:58:54+00:00"
}, },
{ {
"name": "socialiteproviders/microsoft-azure", "name": "socialiteproviders/microsoft-azure",
@ -3664,16 +3667,16 @@
}, },
{ {
"name": "vlucas/phpdotenv", "name": "vlucas/phpdotenv",
"version": "v2.5.1", "version": "v2.5.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/vlucas/phpdotenv.git", "url": "https://github.com/vlucas/phpdotenv.git",
"reference": "8abb4f9aa89ddea9d52112c65bbe8d0125e2fa8e" "reference": "cfd5dc225767ca154853752abc93aeec040fcf36"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/8abb4f9aa89ddea9d52112c65bbe8d0125e2fa8e", "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/cfd5dc225767ca154853752abc93aeec040fcf36",
"reference": "8abb4f9aa89ddea9d52112c65bbe8d0125e2fa8e", "reference": "cfd5dc225767ca154853752abc93aeec040fcf36",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3710,7 +3713,7 @@
"env", "env",
"environment" "environment"
], ],
"time": "2018-07-29T20:33:41+00:00" "time": "2018-10-30T17:29:25+00:00"
} }
], ],
"packages-dev": [ "packages-dev": [
@ -4423,23 +4426,23 @@
}, },
{ {
"name": "justinrainbow/json-schema", "name": "justinrainbow/json-schema",
"version": "5.2.7", "version": "5.2.8",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/justinrainbow/json-schema.git", "url": "https://github.com/justinrainbow/json-schema.git",
"reference": "8560d4314577199ba51bf2032f02cd1315587c23" "reference": "dcb6e1006bb5fd1e392b4daa68932880f37550d4"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/8560d4314577199ba51bf2032f02cd1315587c23", "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/dcb6e1006bb5fd1e392b4daa68932880f37550d4",
"reference": "8560d4314577199ba51bf2032f02cd1315587c23", "reference": "dcb6e1006bb5fd1e392b4daa68932880f37550d4",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3.3" "php": ">=5.3.3"
}, },
"require-dev": { "require-dev": {
"friendsofphp/php-cs-fixer": "^2.1", "friendsofphp/php-cs-fixer": "~2.2.20",
"json-schema/json-schema-test-suite": "1.2.0", "json-schema/json-schema-test-suite": "1.2.0",
"phpunit/phpunit": "^4.8.35" "phpunit/phpunit": "^4.8.35"
}, },
@ -4485,7 +4488,7 @@
"json", "json",
"schema" "schema"
], ],
"time": "2018-02-14T22:26:30+00:00" "time": "2019-01-14T23:55:14+00:00"
}, },
{ {
"name": "laravel/browser-kit-testing", "name": "laravel/browser-kit-testing",
@ -6265,20 +6268,21 @@
}, },
{ {
"name": "webmozart/assert", "name": "webmozart/assert",
"version": "1.3.0", "version": "1.4.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/webmozart/assert.git", "url": "https://github.com/webmozart/assert.git",
"reference": "0df1908962e7a3071564e857d86874dad1ef204a" "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", "url": "https://api.github.com/repos/webmozart/assert/zipball/83e253c8e0be5b0257b881e1827274667c5c17a9",
"reference": "0df1908962e7a3071564e857d86874dad1ef204a", "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^5.3.3 || ^7.0" "php": "^5.3.3 || ^7.0",
"symfony/polyfill-ctype": "^1.8"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^4.6", "phpunit/phpunit": "^4.6",
@ -6311,12 +6315,14 @@
"check", "check",
"validate" "validate"
], ],
"time": "2018-01-29T19:49:41+00:00" "time": "2018-12-25T11:19:39+00:00"
} }
], ],
"aliases": [], "aliases": [],
"minimum-stability": "stable", "minimum-stability": "stable",
"stability-flags": [], "stability-flags": {
"laravel/socialite": 20
},
"prefer-stable": false, "prefer-stable": false,
"prefer-lowest": false, "prefer-lowest": false,
"platform": { "platform": {
@ -6326,7 +6332,8 @@
"ext-dom": "*", "ext-dom": "*",
"ext-xml": "*", "ext-xml": "*",
"ext-mbstring": "*", "ext-mbstring": "*",
"ext-gd": "*" "ext-gd": "*",
"ext-curl": "*"
}, },
"platform-dev": [], "platform-dev": [],
"platform-overrides": { "platform-overrides": {

View File

@ -49,6 +49,8 @@ return [
'secret' => env('STORAGE_S3_SECRET', 'your-secret'), 'secret' => env('STORAGE_S3_SECRET', 'your-secret'),
'region' => env('STORAGE_S3_REGION', 'your-region'), 'region' => env('STORAGE_S3_REGION', 'your-region'),
'bucket' => env('STORAGE_S3_BUCKET', 'your-bucket'), 'bucket' => env('STORAGE_S3_BUCKET', 'your-bucket'),
'endpoint' => env('STORAGE_S3_ENDPOINT', null),
'use_path_style_endpoint' => env('STORAGE_S3_ENDPOINT', null) !== null,
], ],
'rackspace' => [ 'rackspace' => [

View File

@ -123,20 +123,21 @@ class PageDisplay {
setupStickySidebar() { setupStickySidebar() {
// Make the sidebar stick in view on scroll // Make the sidebar stick in view on scroll
let $window = $(window); const $window = $(window);
let $sidebar = $("#sidebar .scroll-body"); const $sidebar = $("#sidebar .scroll-body");
let $bookTreeParent = $sidebar.parent(); const $sidebarContainer = $sidebar.parent();
const sidebarHeight = $sidebar.height() + 32;
// Check the page is scrollable and the content is taller than the tree // Check the page is scrollable and the content is taller than the tree
let pageScrollable = ($(document).height() > ($window.height() + 40)) && ($sidebar.height() < $('.page-content').height()); const pageScrollable = ($(document).height() > ($window.height() + 40)) && (sidebarHeight < $('.page-content').height());
// Get current tree's width and header height // Get current tree's width and header height
let headerHeight = $("#header").height() + $(".toolbar").height(); const headerHeight = $("#header").height() + $(".toolbar").height();
let isFixed = $window.scrollTop() > headerHeight; let isFixed = $window.scrollTop() > headerHeight;
// Fix the tree as a sidebar // Fix the tree as a sidebar
function stickTree() { function stickTree() {
$sidebar.width($bookTreeParent.width() + 15); $sidebar.width($sidebarContainer.width() + 15);
$sidebar.addClass("fixed"); $sidebar.addClass("fixed");
isFixed = true; isFixed = true;
} }

View File

@ -16,6 +16,14 @@ body {
margin: 0 auto; margin: 0 auto;
} }
.flex-fill {
display: block;
}
.flex.sidebar + .flex.content {
border-left: none;
}
.print-hidden { .print-hidden {
display: none; display: none;
} }
@ -31,4 +39,8 @@ h2 {
line-height: 1; line-height: 1;
margin-top: 0.6em; margin-top: 0.6em;
margin-bottom: 0.3em; margin-bottom: 0.3em;
}
.comments-container {
display: none;
} }

View File

@ -34,7 +34,7 @@
@endif @endif
</td> </td>
<td> @if($revision->createdBy) {{ $revision->createdBy->name }} @else {{ trans('common.deleted_user') }} @endif</td> <td> @if($revision->createdBy) {{ $revision->createdBy->name }} @else {{ trans('common.deleted_user') }} @endif</td>
<td><small>{{ $revision->created_at->format('jS F, Y H:i:s') }} <br> ({{ $revision->created_at->diffForHumans() }})</small></td> <td><small>{{ $revision->created_at->formatLocalized('%e %B %Y %H:%M:%S') }} <br> ({{ $revision->created_at->diffForHumans() }})</small></td>
<td>{{ $revision->summary }}</td> <td>{{ $revision->summary }}</td>
<td class="actions"> <td class="actions">
<a href="{{ $revision->getUrl('changes') }}" target="_blank">{{ trans('entities.pages_revisions_changes') }}</a> <a href="{{ $revision->getUrl('changes') }}" target="_blank">{{ trans('entities.pages_revisions_changes') }}</a>