Merge branch 'master' into release
This commit is contained in:
commit
8b30c7f02e
|
@ -46,6 +46,9 @@ GITHUB_APP_ID=false
|
|||
GITHUB_APP_SECRET=false
|
||||
GOOGLE_APP_ID=false
|
||||
GOOGLE_APP_SECRET=false
|
||||
OKTA_BASE_URL=false
|
||||
OKTA_KEY=false
|
||||
OKTA_SECRET=false
|
||||
|
||||
# External services such as Gravatar
|
||||
DISABLE_EXTERNAL_SERVICES=false
|
||||
|
|
|
@ -2,8 +2,10 @@
|
|||
/node_modules
|
||||
Homestead.yaml
|
||||
.env
|
||||
/public/dist
|
||||
.idea
|
||||
npm-debug.log
|
||||
yarn-error.log
|
||||
/public/dist
|
||||
/public/plugins
|
||||
/public/css/*.map
|
||||
/public/js/*.map
|
||||
|
@ -18,5 +20,4 @@ yarn.lock
|
|||
nbproject
|
||||
.buildpath
|
||||
.project
|
||||
.settings/org.eclipse.wst.common.project.facet.core.xml
|
||||
.settings/org.eclipse.php.core.prefs
|
||||
.settings/
|
||||
|
|
|
@ -2,7 +2,8 @@ dist: trusty
|
|||
sudo: false
|
||||
language: php
|
||||
php:
|
||||
- 7.0.7
|
||||
- 7.0.20
|
||||
- 7.1.9
|
||||
|
||||
cache:
|
||||
directories:
|
||||
|
@ -14,7 +15,6 @@ before_script:
|
|||
- mysql -u root -e "GRANT ALL ON \`bookstack-test\`.* TO 'bookstack-test'@'localhost';"
|
||||
- mysql -u root -e "FLUSH PRIVILEGES;"
|
||||
- phpenv config-rm xdebug.ini
|
||||
- composer dump-autoload --no-interaction
|
||||
- composer install --prefer-dist --no-interaction
|
||||
- php artisan clear-compiled -n
|
||||
- php artisan optimize -n
|
||||
|
|
29
app/Book.php
29
app/Book.php
|
@ -3,7 +3,7 @@
|
|||
class Book extends Entity
|
||||
{
|
||||
|
||||
protected $fillable = ['name', 'description'];
|
||||
protected $fillable = ['name', 'description', 'image_id'];
|
||||
|
||||
/**
|
||||
* Get the url for this book.
|
||||
|
@ -18,6 +18,33 @@ class Book extends Entity
|
|||
return baseUrl('/books/' . urlencode($this->slug));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns book cover image, if book cover not exists return default cover image.
|
||||
* @param int $width - Width of the image
|
||||
* @param int $height - Height of the image
|
||||
* @return string
|
||||
*/
|
||||
public function getBookCover($width = 440, $height = 250)
|
||||
{
|
||||
$default = baseUrl('/book_default_cover.png');
|
||||
if (!$this->image_id) return $default;
|
||||
|
||||
try {
|
||||
$cover = $this->cover ? baseUrl($this->cover->getThumb($width, $height, false)) : $default;
|
||||
} catch (\Exception $err) {
|
||||
$cover = $default;
|
||||
}
|
||||
return $cover;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the cover image of the book
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
*/
|
||||
public function cover()
|
||||
{
|
||||
return $this->belongsTo(Image::class, 'image_id');
|
||||
}
|
||||
/*
|
||||
* Get the edit url for this book.
|
||||
* @return string
|
||||
|
|
|
@ -11,12 +11,7 @@ class Kernel extends ConsoleKernel
|
|||
* @var array
|
||||
*/
|
||||
protected $commands = [
|
||||
Commands\ClearViews::class,
|
||||
Commands\ClearActivity::class,
|
||||
Commands\ClearRevisions::class,
|
||||
Commands\RegeneratePermissions::class,
|
||||
Commands\RegenerateSearch::class,
|
||||
Commands\UpgradeDatabaseEncoding::class
|
||||
//
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -29,4 +24,14 @@ class Kernel extends ConsoleKernel
|
|||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the commands for the application.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function commands()
|
||||
{
|
||||
$this->load(__DIR__.'/Commands');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,10 +26,10 @@ class Handler extends ExceptionHandler
|
|||
|
||||
/**
|
||||
* Report or log an exception.
|
||||
*
|
||||
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
|
||||
*
|
||||
* @param \Exception $e
|
||||
* @return mixed
|
||||
*/
|
||||
public function report(Exception $e)
|
||||
{
|
||||
|
@ -103,4 +103,16 @@ class Handler extends ExceptionHandler
|
|||
|
||||
return redirect()->guest('login');
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a validation exception into a JSON response.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Illuminate\Validation\ValidationException $exception
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
protected function invalidJson($request, ValidationException $exception)
|
||||
{
|
||||
return response()->json($exception->errors(), $exception->status);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,13 +72,13 @@ class LoginController extends Controller
|
|||
// Explicitly log them out for now if they do no exist.
|
||||
if (!$user->exists) auth()->logout($user);
|
||||
|
||||
if (!$user->exists && $user->email === null && !$request->has('email')) {
|
||||
if (!$user->exists && $user->email === null && !$request->filled('email')) {
|
||||
$request->flash();
|
||||
session()->flash('request-email', true);
|
||||
return redirect('/login');
|
||||
}
|
||||
|
||||
if (!$user->exists && $user->email === null && $request->has('email')) {
|
||||
if (!$user->exists && $user->email === null && $request->filled('email')) {
|
||||
$user->email = $request->get('email');
|
||||
}
|
||||
|
||||
|
@ -102,12 +102,21 @@ class LoginController extends Controller
|
|||
|
||||
/**
|
||||
* Show the application login form.
|
||||
* @param Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function getLogin()
|
||||
public function getLogin(Request $request)
|
||||
{
|
||||
$socialDrivers = $this->socialAuthService->getActiveDrivers();
|
||||
$authMethod = config('auth.method');
|
||||
|
||||
if ($request->has('email')) {
|
||||
session()->flashInput([
|
||||
'email' => $request->get('email'),
|
||||
'password' => (config('app.env') === 'demo') ? $request->get('password', '') : ''
|
||||
]);
|
||||
}
|
||||
|
||||
return view('auth/login', ['socialDrivers' => $socialDrivers, 'authMethod' => $authMethod]);
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ class RegisterController extends Controller
|
|||
*/
|
||||
public function __construct(SocialAuthService $socialAuthService, EmailConfirmationService $emailConfirmationService, UserRepo $userRepo)
|
||||
{
|
||||
$this->middleware('guest')->except(['socialCallback', 'detachSocialAccount']);
|
||||
$this->middleware('guest')->only(['getRegister', 'postRegister', 'socialRegister']);
|
||||
$this->socialAuthService = $socialAuthService;
|
||||
$this->emailConfirmationService = $emailConfirmationService;
|
||||
$this->userRepo = $userRepo;
|
||||
|
@ -250,15 +250,27 @@ class RegisterController extends Controller
|
|||
/**
|
||||
* The callback for social login services.
|
||||
* @param $socialDriver
|
||||
* @param Request $request
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||
* @throws SocialSignInException
|
||||
* @throws UserRegistrationException
|
||||
* @throws \BookStack\Exceptions\SocialDriverNotConfigured
|
||||
* @throws ConfirmationEmailException
|
||||
*/
|
||||
public function socialCallback($socialDriver)
|
||||
public function socialCallback($socialDriver, Request $request)
|
||||
{
|
||||
if (!session()->has('social-callback')) {
|
||||
throw new SocialSignInException(trans('errors.social_no_action_defined'), '/login');
|
||||
}
|
||||
|
||||
// Check request for error information
|
||||
if ($request->has('error') && $request->has('error_description')) {
|
||||
throw new SocialSignInException(trans('errors.social_login_bad_response', [
|
||||
'socialAccount' => $socialDriver,
|
||||
'error' => $request->get('error_description'),
|
||||
]), '/login');
|
||||
}
|
||||
|
||||
$action = session()->pull('social-callback');
|
||||
if ($action == 'login') return $this->socialAuthService->handleLoginCallback($socialDriver);
|
||||
if ($action == 'register') return $this->socialRegisterCallback($socialDriver);
|
||||
|
@ -279,7 +291,9 @@ class RegisterController extends Controller
|
|||
* Register a new user after a registration callback.
|
||||
* @param $socialDriver
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||
* @throws ConfirmationEmailException
|
||||
* @throws UserRegistrationException
|
||||
* @throws \BookStack\Exceptions\SocialDriverNotConfigured
|
||||
*/
|
||||
protected function socialRegisterCallback($socialDriver)
|
||||
{
|
||||
|
|
|
@ -40,12 +40,14 @@ class BookController extends Controller
|
|||
$recents = $this->signedIn ? $this->entityRepo->getRecentlyViewed('book', 4, 0) : false;
|
||||
$popular = $this->entityRepo->getPopular('book', 4, 0);
|
||||
$new = $this->entityRepo->getRecentlyCreated('book', 4, 0);
|
||||
$this->setPageTitle('Books');
|
||||
$booksViewType = setting()->getUser($this->currentUser, 'books_view_type', 'list');
|
||||
$this->setPageTitle(trans('entities.books'));
|
||||
return view('books/index', [
|
||||
'books' => $books,
|
||||
'recents' => $recents,
|
||||
'popular' => $popular,
|
||||
'new' => $new
|
||||
'new' => $new,
|
||||
'booksViewType' => $booksViewType
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -125,9 +127,9 @@ class BookController extends Controller
|
|||
'name' => 'required|string|max:255',
|
||||
'description' => 'string|max:1000'
|
||||
]);
|
||||
$book = $this->entityRepo->updateFromInput('book', $book, $request->all());
|
||||
Activity::add($book, 'book_update', $book->id);
|
||||
return redirect($book->getUrl());
|
||||
$book = $this->entityRepo->updateFromInput('book', $book, $request->all());
|
||||
Activity::add($book, 'book_update', $book->id);
|
||||
return redirect($book->getUrl());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -183,7 +185,7 @@ class BookController extends Controller
|
|||
$this->checkOwnablePermission('book-update', $book);
|
||||
|
||||
// Return if no map sent
|
||||
if (!$request->has('sort-tree')) {
|
||||
if (!$request->filled('sort-tree')) {
|
||||
return redirect($book->getUrl());
|
||||
}
|
||||
|
||||
|
|
|
@ -54,6 +54,7 @@ class HomeController extends Controller
|
|||
/**
|
||||
* Get a js representation of the current translations
|
||||
* @return \Illuminate\Contracts\Routing\ResponseFactory|\Symfony\Component\HttpFoundation\Response
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function getTranslations() {
|
||||
$locale = app()->getLocale();
|
||||
|
@ -86,4 +87,13 @@ class HomeController extends Controller
|
|||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get custom head HTML, Used in ajax calls to show in editor.
|
||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
||||
*/
|
||||
public function customHeadContent()
|
||||
{
|
||||
return view('partials/custom-head-content');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -107,7 +107,7 @@ class ImageController extends Controller
|
|||
$imageUpload = $request->file('file');
|
||||
|
||||
try {
|
||||
$uploadedTo = $request->has('uploaded_to') ? $request->get('uploaded_to') : 0;
|
||||
$uploadedTo = $request->filled('uploaded_to') ? $request->get('uploaded_to') : 0;
|
||||
$image = $this->imageRepo->saveNew($imageUpload, $type, $uploadedTo);
|
||||
} catch (ImageUploadException $e) {
|
||||
return response($e->getMessage(), 500);
|
||||
|
@ -162,7 +162,7 @@ class ImageController extends Controller
|
|||
$this->checkOwnablePermission('image-delete', $image);
|
||||
|
||||
// Check if this image is used on any pages
|
||||
$isForced = ($request->has('force') && ($request->get('force') === 'true') || $request->get('force') === true);
|
||||
$isForced = in_array($request->get('force', ''), [true, 'true']);
|
||||
if (!$isForced) {
|
||||
$pageSearch = $entityRepo->searchForImage($image->url);
|
||||
if ($pageSearch !== false) {
|
||||
|
|
|
@ -161,14 +161,22 @@ class PageController extends Controller
|
|||
$page->html = $this->entityRepo->renderPage($page);
|
||||
$sidebarTree = $this->entityRepo->getBookChildren($page->book);
|
||||
$pageNav = $this->entityRepo->getPageNav($page->html);
|
||||
$page->load(['comments.createdBy']);
|
||||
|
||||
// check if the comment's are enabled
|
||||
$commentsEnabled = !setting('app-disable-comments');
|
||||
if ($commentsEnabled) {
|
||||
$page->load(['comments.createdBy']);
|
||||
}
|
||||
|
||||
Views::add($page);
|
||||
$this->setPageTitle($page->getShortName());
|
||||
return view('pages/show', [
|
||||
'page' => $page,'book' => $page->book,
|
||||
'current' => $page, 'sidebarTree' => $sidebarTree,
|
||||
'pageNav' => $pageNav]);
|
||||
'current' => $page,
|
||||
'sidebarTree' => $sidebarTree,
|
||||
'commentsEnabled' => $commentsEnabled,
|
||||
'pageNav' => $pageNav
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -36,7 +36,7 @@ class SearchController extends Controller
|
|||
$searchTerm = $request->get('term');
|
||||
$this->setPageTitle(trans('entities.search_for_term', ['term' => $searchTerm]));
|
||||
|
||||
$page = $request->has('page') && is_int(intval($request->get('page'))) ? intval($request->get('page')) : 1;
|
||||
$page = intval($request->get('page', '0')) ?: 1;
|
||||
$nextPageLink = baseUrl('/search?term=' . urlencode($searchTerm) . '&page=' . ($page+1));
|
||||
|
||||
$results = $this->searchService->searchEntities($searchTerm, 'all', $page, 20);
|
||||
|
@ -88,8 +88,8 @@ class SearchController extends Controller
|
|||
*/
|
||||
public function searchEntitiesAjax(Request $request)
|
||||
{
|
||||
$entityTypes = $request->has('types') ? collect(explode(',', $request->get('types'))) : collect(['page', 'chapter', 'book']);
|
||||
$searchTerm = ($request->has('term') && trim($request->get('term')) !== '') ? $request->get('term') : false;
|
||||
$entityTypes = $request->filled('types') ? collect(explode(',', $request->get('types'))) : collect(['page', 'chapter', 'book']);
|
||||
$searchTerm = $request->get('term', false);
|
||||
|
||||
// Search for entities otherwise show most popular
|
||||
if ($searchTerm !== false) {
|
||||
|
|
|
@ -37,7 +37,7 @@ class TagController extends Controller
|
|||
*/
|
||||
public function getNameSuggestions(Request $request)
|
||||
{
|
||||
$searchTerm = $request->has('search') ? $request->get('search') : false;
|
||||
$searchTerm = $request->get('search', false);
|
||||
$suggestions = $this->tagRepo->getNameSuggestions($searchTerm);
|
||||
return response()->json($suggestions);
|
||||
}
|
||||
|
@ -49,8 +49,8 @@ class TagController extends Controller
|
|||
*/
|
||||
public function getValueSuggestions(Request $request)
|
||||
{
|
||||
$searchTerm = $request->has('search') ? $request->get('search') : false;
|
||||
$tagName = $request->has('name') ? $request->get('name') : false;
|
||||
$searchTerm = $request->get('search', false);
|
||||
$tagName = $request->get('name', false);
|
||||
$suggestions = $this->tagRepo->getValueSuggestions($searchTerm, $tagName);
|
||||
return response()->json($suggestions);
|
||||
}
|
||||
|
|
|
@ -34,9 +34,9 @@ class UserController extends Controller
|
|||
{
|
||||
$this->checkPermission('users-manage');
|
||||
$listDetails = [
|
||||
'order' => $request->has('order') ? $request->get('order') : 'asc',
|
||||
'search' => $request->has('search') ? $request->get('search') : '',
|
||||
'sort' => $request->has('sort') ? $request->get('sort') : 'name',
|
||||
'order' => $request->get('order', 'asc'),
|
||||
'search' => $request->get('search', ''),
|
||||
'sort' => $request->get('sort', 'name'),
|
||||
];
|
||||
$users = $this->userRepo->getAllUsersPaginatedAndSorted(20, $listDetails);
|
||||
$this->setPageTitle(trans('settings.users'));
|
||||
|
@ -88,7 +88,7 @@ class UserController extends Controller
|
|||
|
||||
$user->save();
|
||||
|
||||
if ($request->has('roles')) {
|
||||
if ($request->filled('roles')) {
|
||||
$roles = $request->get('roles');
|
||||
$user->roles()->sync($roles);
|
||||
}
|
||||
|
@ -155,24 +155,24 @@ class UserController extends Controller
|
|||
$user->fill($request->all());
|
||||
|
||||
// Role updates
|
||||
if (userCan('users-manage') && $request->has('roles')) {
|
||||
if (userCan('users-manage') && $request->filled('roles')) {
|
||||
$roles = $request->get('roles');
|
||||
$user->roles()->sync($roles);
|
||||
}
|
||||
|
||||
// Password updates
|
||||
if ($request->has('password') && $request->get('password') != '') {
|
||||
if ($request->filled('password')) {
|
||||
$password = $request->get('password');
|
||||
$user->password = bcrypt($password);
|
||||
}
|
||||
|
||||
// External auth id updates
|
||||
if ($this->currentUser->can('users-manage') && $request->has('external_auth_id')) {
|
||||
if ($this->currentUser->can('users-manage') && $request->filled('external_auth_id')) {
|
||||
$user->external_auth_id = $request->get('external_auth_id');
|
||||
}
|
||||
|
||||
// Save an user-specific settings
|
||||
if ($request->has('setting')) {
|
||||
if ($request->filled('setting')) {
|
||||
foreach ($request->get('setting') as $key => $value) {
|
||||
setting()->putUser($user, $key, $value);
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ class Kernel extends HttpKernel
|
|||
\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
|
||||
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
|
||||
\BookStack\Http\Middleware\TrimStrings::class,
|
||||
\BookStack\Http\Middleware\TrustProxies::class,
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -44,10 +45,11 @@ class Kernel extends HttpKernel
|
|||
* @var array
|
||||
*/
|
||||
protected $routeMiddleware = [
|
||||
'can' => \Illuminate\Auth\Middleware\Authorize::class,
|
||||
'auth' => \BookStack\Http\Middleware\Authenticate::class,
|
||||
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
|
||||
'can' => \Illuminate\Auth\Middleware\Authorize::class,
|
||||
'guest' => \BookStack\Http\Middleware\RedirectIfAuthenticated::class,
|
||||
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
|
||||
'perm' => \BookStack\Http\Middleware\PermissionMiddleware::class
|
||||
];
|
||||
}
|
||||
|
|
|
@ -30,8 +30,11 @@ class Authenticate
|
|||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
if ($this->auth->check() && setting('registration-confirmation') && !$this->auth->user()->email_confirmed) {
|
||||
return redirect(baseUrl('/register/confirm/awaiting'));
|
||||
if ($this->auth->check()) {
|
||||
$requireConfirmation = (setting('registration-confirmation') || setting('registration-restrict'));
|
||||
if ($requireConfirmation && !$this->auth->user()->email_confirmed) {
|
||||
return redirect('/register/confirm/awaiting');
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->auth->guest() && !setting('app-public')) {
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
|
||||
namespace BookStack\Http\Middleware;
|
||||
|
||||
use Illuminate\Cookie\Middleware\EncryptCookies as BaseEncrypter;
|
||||
use Illuminate\Cookie\Middleware\EncryptCookies as Middleware;
|
||||
|
||||
class EncryptCookies extends BaseEncrypter
|
||||
class EncryptCookies extends Middleware
|
||||
{
|
||||
/**
|
||||
* The names of the cookies that should not be encrypted.
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
|
||||
namespace BookStack\Http\Middleware;
|
||||
|
||||
use Illuminate\Foundation\Http\Middleware\TrimStrings as BaseTrimmer;
|
||||
use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware;
|
||||
|
||||
class TrimStrings extends BaseTrimmer
|
||||
class TrimStrings extends Middleware
|
||||
{
|
||||
/**
|
||||
* The names of the attributes that should not be trimmed.
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
<?php
|
||||
|
||||
namespace BookStack\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
use Fideloper\Proxy\TrustProxies as Middleware;
|
||||
|
||||
class TrustProxies extends Middleware
|
||||
{
|
||||
/**
|
||||
* The trusted proxies for this application.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $proxies;
|
||||
|
||||
/**
|
||||
* The current proxy header mappings.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $headers = [
|
||||
Request::HEADER_FORWARDED => 'FORWARDED',
|
||||
Request::HEADER_X_FORWARDED_FOR => 'X_FORWARDED_FOR',
|
||||
Request::HEADER_X_FORWARDED_HOST => 'X_FORWARDED_HOST',
|
||||
Request::HEADER_X_FORWARDED_PORT => 'X_FORWARDED_PORT',
|
||||
Request::HEADER_X_FORWARDED_PROTO => 'X_FORWARDED_PROTO',
|
||||
];
|
||||
|
||||
/**
|
||||
* Handle the request, Set the correct user-configured proxy information.
|
||||
* @param Request $request
|
||||
* @param Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
$setProxies = config('app.proxies');
|
||||
if ($setProxies !== '**' && $setProxies !== '*' && $setProxies !== '') {
|
||||
$setProxies = explode(',', $setProxies);
|
||||
}
|
||||
$this->proxies = $setProxies;
|
||||
|
||||
return parent::handle($request, $next);
|
||||
}
|
||||
}
|
|
@ -2,9 +2,9 @@
|
|||
|
||||
namespace BookStack\Http\Middleware;
|
||||
|
||||
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;
|
||||
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
|
||||
|
||||
class VerifyCsrfToken extends BaseVerifier
|
||||
class VerifyCsrfToken extends Middleware
|
||||
{
|
||||
/**
|
||||
* The URIs that should be excluded from CSRF verification.
|
||||
|
|
|
@ -17,6 +17,7 @@ class EventServiceProvider extends ServiceProvider
|
|||
SocialiteWasCalled::class => [
|
||||
'SocialiteProviders\Slack\SlackExtendSocialite@handle',
|
||||
'SocialiteProviders\Azure\AzureExtendSocialite@handle',
|
||||
'SocialiteProviders\Okta\OktaExtendSocialite@handle',
|
||||
],
|
||||
];
|
||||
|
||||
|
|
|
@ -442,9 +442,10 @@ class EntityRepo
|
|||
*/
|
||||
public function updateEntityPermissionsFromRequest($request, Entity $entity)
|
||||
{
|
||||
$entity->restricted = $request->has('restricted') && $request->get('restricted') === 'true';
|
||||
$entity->restricted = $request->get('restricted', '') === 'true';
|
||||
$entity->permissions()->delete();
|
||||
if ($request->has('restrictions')) {
|
||||
|
||||
if ($request->filled('restrictions')) {
|
||||
foreach ($request->get('restrictions') as $roleId => $restrictions) {
|
||||
foreach ($restrictions as $action => $value) {
|
||||
$entity->permissions()->create([
|
||||
|
@ -454,6 +455,7 @@ class EntityRepo
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
$entity->save();
|
||||
$this->permissionService->buildJointPermissionsForEntity($entity);
|
||||
}
|
||||
|
@ -553,8 +555,9 @@ class EntityRepo
|
|||
*/
|
||||
protected function nameToSlug($name)
|
||||
{
|
||||
$slug = str_replace(' ', '-', strtolower($name));
|
||||
$slug = preg_replace('/[\+\/\\\?\@\}\{\.\,\=\[\]\#\&\!\*\'\;\:\$\%]/', '', $slug);
|
||||
$slug = preg_replace('/[\+\/\\\?\@\}\{\.\,\=\[\]\#\&\!\*\'\;\:\$\%]/', '', mb_strtolower($name));
|
||||
$slug = preg_replace('/\s{2,}/', ' ', $slug);
|
||||
$slug = str_replace(' ', '-', $slug);
|
||||
if ($slug === "") $slug = substr(md5(rand(1, 500)), 0, 5);
|
||||
return $slug;
|
||||
}
|
||||
|
|
|
@ -127,7 +127,7 @@ class ExportService
|
|||
$pdf = \SnappyPDF::loadHTML($containedHtml);
|
||||
$pdf->setOption('print-media-type', true);
|
||||
} else {
|
||||
$pdf = \PDF::loadHTML($containedHtml);
|
||||
$pdf = \DomPDF::loadHTML($containedHtml);
|
||||
}
|
||||
return $pdf->output();
|
||||
}
|
||||
|
|
|
@ -205,12 +205,17 @@ class PermissionService
|
|||
}
|
||||
|
||||
$entities[] = $entity->book;
|
||||
if ($entity->isA('page') && $entity->chapter_id) $entities[] = $entity->chapter;
|
||||
|
||||
if ($entity->isA('page') && $entity->chapter_id) {
|
||||
$entities[] = $entity->chapter;
|
||||
}
|
||||
|
||||
if ($entity->isA('chapter')) {
|
||||
foreach ($entity->pages as $page) {
|
||||
$entities[] = $page;
|
||||
}
|
||||
}
|
||||
|
||||
$this->deleteManyJointPermissionsForEntities($entities);
|
||||
$this->buildJointPermissionsForEntities(collect($entities));
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<?php namespace BookStack\Services;
|
||||
|
||||
use BookStack\Http\Requests\Request;
|
||||
use GuzzleHttp\Exception\ClientException;
|
||||
use Laravel\Socialite\Contracts\Factory as Socialite;
|
||||
use BookStack\Exceptions\SocialDriverNotConfigured;
|
||||
use BookStack\Exceptions\SocialSignInException;
|
||||
|
@ -14,7 +16,7 @@ class SocialAuthService
|
|||
protected $socialite;
|
||||
protected $socialAccount;
|
||||
|
||||
protected $validSocialDrivers = ['google', 'github', 'facebook', 'slack', 'twitter', 'azure'];
|
||||
protected $validSocialDrivers = ['google', 'github', 'facebook', 'slack', 'twitter', 'azure', 'okta'];
|
||||
|
||||
/**
|
||||
* SocialAuthService constructor.
|
||||
|
@ -91,7 +93,6 @@ class SocialAuthService
|
|||
public function handleLoginCallback($socialDriver)
|
||||
{
|
||||
$driver = $this->validateDriver($socialDriver);
|
||||
|
||||
// Get user details from social driver
|
||||
$socialUser = $this->socialite->driver($driver)->user();
|
||||
$socialId = $socialUser->getId();
|
||||
|
@ -135,7 +136,7 @@ class SocialAuthService
|
|||
$message .= trans('errors.social_account_register_instructions', ['socialAccount' => title_case($socialDriver)]);
|
||||
}
|
||||
|
||||
throw new SocialSignInException($message . '.', '/login');
|
||||
throw new SocialSignInException($message, '/login');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
14
artisan
14
artisan
|
@ -1,19 +1,19 @@
|
|||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
define('LARAVEL_START', microtime(true));
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Register The Auto Loader
|
||||
| Initialize The App
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Composer provides a convenient, automatically generated class loader
|
||||
| for our application. We just need to utilize it! We'll require it
|
||||
| into the script here so that we do not have to worry about the
|
||||
| loading of any our classes "manually". Feels great to relax.
|
||||
| We need to get things going before we start up the app.
|
||||
| The init file loads everything in, in the correct order.
|
||||
|
|
||||
*/
|
||||
|
||||
require __DIR__.'/bootstrap/autoload.php';
|
||||
require __DIR__.'/bootstrap/init.php';
|
||||
|
||||
$app = require_once __DIR__.'/bootstrap/app.php';
|
||||
|
||||
|
@ -40,7 +40,7 @@ $status = $kernel->handle(
|
|||
| Shutdown The Application
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Once Artisan has finished running. We will fire off the shutdown events
|
||||
| Once Artisan has finished running, we will fire off the shutdown events
|
||||
| so that any final work may be done by the application before we shut
|
||||
| down the process. This is the last thing to happen to the request.
|
||||
|
|
||||
|
|
|
@ -1,6 +1,15 @@
|
|||
<?php
|
||||
|
||||
define('LARAVEL_START', microtime(true));
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Load Our Own Helpers
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This custom function loads any helpers, before the Laravel Framework
|
||||
| is built so we can override any helpers as we please.
|
||||
|
|
||||
*/
|
||||
require __DIR__.'/../app/helpers.php';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
@ -13,23 +22,4 @@ define('LARAVEL_START', microtime(true));
|
|||
| loading of any our classes "manually". Feels great to relax.
|
||||
|
|
||||
*/
|
||||
|
||||
require __DIR__.'/../app/helpers.php';
|
||||
require __DIR__.'/../vendor/autoload.php';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Include The Compiled Class File
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| To dramatically increase your application's performance, you may use a
|
||||
| compiled class file which contains all of the classes commonly used
|
||||
| by a request. The Artisan "optimize" is used to create this file.
|
||||
|
|
||||
*/
|
||||
|
||||
$compiledPath = __DIR__.'/cache/compiled.php';
|
||||
|
||||
if (file_exists($compiledPath)) {
|
||||
require $compiledPath;
|
||||
}
|
|
@ -1,32 +1,35 @@
|
|||
{
|
||||
"name": "ssddanbrown/bookstack",
|
||||
"name": "bookstackapp/bookstack",
|
||||
"description": "BookStack documentation platform",
|
||||
"keywords": ["BookStack", "Documentation"],
|
||||
"license": "MIT",
|
||||
"type": "project",
|
||||
"require": {
|
||||
"php": ">=5.6.4",
|
||||
"laravel/framework": "5.4.*",
|
||||
"php": ">=7.0.0",
|
||||
"laravel/framework": "5.5.*",
|
||||
"fideloper/proxy": "~3.3",
|
||||
"ext-tidy": "*",
|
||||
"intervention/image": "^2.3",
|
||||
"intervention/image": "^2.4",
|
||||
"laravel/socialite": "^3.0",
|
||||
"barryvdh/laravel-ide-helper": "^2.2.3",
|
||||
"barryvdh/laravel-debugbar": "^2.3.2",
|
||||
"league/flysystem-aws-s3-v3": "^1.0",
|
||||
"barryvdh/laravel-dompdf": "^0.8",
|
||||
"barryvdh/laravel-dompdf": "^0.8.1",
|
||||
"predis/predis": "^1.1",
|
||||
"gathercontent/htmldiff": "^0.2.1",
|
||||
"barryvdh/laravel-snappy": "^0.3.1",
|
||||
"laravel/browser-kit-testing": "^1.0",
|
||||
"barryvdh/laravel-snappy": "^0.4.0",
|
||||
"socialiteproviders/slack": "^3.0",
|
||||
"socialiteproviders/microsoft-azure": "^3.0"
|
||||
"socialiteproviders/microsoft-azure": "^3.0",
|
||||
"socialiteproviders/okta": "^1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"filp/whoops": "~2.0",
|
||||
"fzaninotto/faker": "~1.4",
|
||||
"mockery/mockery": "0.9.*",
|
||||
"phpunit/phpunit": "~5.0",
|
||||
"mockery/mockery": "~1.0",
|
||||
"phpunit/phpunit": "~6.0",
|
||||
"symfony/css-selector": "3.1.*",
|
||||
"symfony/dom-crawler": "3.1.*"
|
||||
"symfony/dom-crawler": "3.1.*",
|
||||
"laravel/browser-kit-testing": "^2.0",
|
||||
"barryvdh/laravel-ide-helper": "^2.4.1",
|
||||
"barryvdh/laravel-debugbar": "^3.1.0"
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
|
@ -57,14 +60,12 @@
|
|||
"php -r \"!file_exists('bootstrap/cache/compiled.php') || @unlink('bootstrap/cache/compiled.php');\""
|
||||
],
|
||||
"post-install-cmd": [
|
||||
"Illuminate\\Foundation\\ComposerScripts::postInstall",
|
||||
"php artisan optimize",
|
||||
"php artisan cache:clear",
|
||||
"php artisan view:clear"
|
||||
],
|
||||
"post-update-cmd": [
|
||||
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
|
||||
"php artisan optimize"
|
||||
"post-autoload-dump": [
|
||||
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
|
||||
"@php artisan package:discover"
|
||||
],
|
||||
"refresh-test-database": [
|
||||
"php artisan migrate:refresh --database=mysql_testing",
|
||||
|
@ -72,6 +73,10 @@
|
|||
]
|
||||
},
|
||||
"config": {
|
||||
"preferred-install": "dist"
|
||||
"optimize-autoloader": true,
|
||||
"preferred-install": "dist",
|
||||
"platform": {
|
||||
"php": "7.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -219,7 +219,7 @@ return [
|
|||
*/
|
||||
|
||||
'ImageTool' => Intervention\Image\Facades\Image::class,
|
||||
'PDF' => Barryvdh\DomPDF\Facade::class,
|
||||
'DomPDF' => Barryvdh\DomPDF\Facade::class,
|
||||
'SnappyPDF' => Barryvdh\Snappy\Facades\SnappyPdf::class,
|
||||
'Debugbar' => Barryvdh\Debugbar\Facade::class,
|
||||
|
||||
|
@ -234,4 +234,6 @@ return [
|
|||
|
||||
],
|
||||
|
||||
'proxies' => env('APP_PROXIES', ''),
|
||||
|
||||
];
|
||||
|
|
|
@ -80,6 +80,14 @@ return [
|
|||
'name' => 'Microsoft Azure',
|
||||
],
|
||||
|
||||
'okta' => [
|
||||
'client_id' => env('OKTA_APP_ID'),
|
||||
'client_secret' => env('OKTA_APP_SECRET'),
|
||||
'redirect' => env('APP_URL') . '/login/service/okta/callback',
|
||||
'base_url' => env('OKTA_BASE_URL'),
|
||||
'name' => 'Okta',
|
||||
],
|
||||
|
||||
'ldap' => [
|
||||
'server' => env('LDAP_SERVER', false),
|
||||
'dn' => env('LDAP_DN', false),
|
||||
|
|
|
@ -29,7 +29,7 @@ return [
|
|||
|
|
||||
*/
|
||||
|
||||
'lifetime' => 120,
|
||||
'lifetime' => env('SESSION_LIFETIME', 120),
|
||||
|
||||
'expire_on_close' => false,
|
||||
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddCoverImageDisplay extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('books', function (Blueprint $table) {
|
||||
$table->integer('image_id')->nullable()->default(null);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('books', function (Blueprint $table) {
|
||||
$table->dropColumn('image_id');
|
||||
});
|
||||
}
|
||||
}
|
|
@ -11,25 +11,31 @@ class DummyContentSeeder extends Seeder
|
|||
*/
|
||||
public function run()
|
||||
{
|
||||
$user = factory(\BookStack\User::class)->create();
|
||||
$role = \BookStack\Role::getRole('editor');
|
||||
$user->attachRole($role);
|
||||
// Create an editor user
|
||||
$editorUser = factory(\BookStack\User::class)->create();
|
||||
$editorRole = \BookStack\Role::getRole('editor');
|
||||
$editorUser->attachRole($editorRole);
|
||||
|
||||
factory(\BookStack\Book::class, 20)->create(['created_by' => $user->id, 'updated_by' => $user->id])
|
||||
->each(function($book) use ($user) {
|
||||
$chapters = factory(\BookStack\Chapter::class, 5)->create(['created_by' => $user->id, 'updated_by' => $user->id])
|
||||
->each(function($chapter) use ($user, $book){
|
||||
$pages = factory(\BookStack\Page::class, 5)->make(['created_by' => $user->id, 'updated_by' => $user->id, 'book_id' => $book->id]);
|
||||
// Create a viewer user
|
||||
$viewerUser = factory(\BookStack\User::class)->create();
|
||||
$role = \BookStack\Role::getRole('viewer');
|
||||
$viewerUser->attachRole($role);
|
||||
|
||||
factory(\BookStack\Book::class, 20)->create(['created_by' => $editorUser->id, 'updated_by' => $editorUser->id])
|
||||
->each(function($book) use ($editorUser) {
|
||||
$chapters = factory(\BookStack\Chapter::class, 5)->create(['created_by' => $editorUser->id, 'updated_by' => $editorUser->id])
|
||||
->each(function($chapter) use ($editorUser, $book){
|
||||
$pages = factory(\BookStack\Page::class, 5)->make(['created_by' => $editorUser->id, 'updated_by' => $editorUser->id, 'book_id' => $book->id]);
|
||||
$chapter->pages()->saveMany($pages);
|
||||
});
|
||||
$pages = factory(\BookStack\Page::class, 3)->make(['created_by' => $user->id, 'updated_by' => $user->id]);
|
||||
$pages = factory(\BookStack\Page::class, 3)->make(['created_by' => $editorUser->id, 'updated_by' => $editorUser->id]);
|
||||
$book->chapters()->saveMany($chapters);
|
||||
$book->pages()->saveMany($pages);
|
||||
});
|
||||
|
||||
$largeBook = factory(\BookStack\Book::class)->create(['name' => 'Large book' . str_random(10), 'created_by' => $user->id, 'updated_by' => $user->id]);
|
||||
$pages = factory(\BookStack\Page::class, 200)->make(['created_by' => $user->id, 'updated_by' => $user->id]);
|
||||
$chapters = factory(\BookStack\Chapter::class, 50)->make(['created_by' => $user->id, 'updated_by' => $user->id]);
|
||||
$largeBook = factory(\BookStack\Book::class)->create(['name' => 'Large book' . str_random(10), 'created_by' => $editorUser->id, 'updated_by' => $editorUser->id]);
|
||||
$pages = factory(\BookStack\Page::class, 200)->make(['created_by' => $editorUser->id, 'updated_by' => $editorUser->id]);
|
||||
$chapters = factory(\BookStack\Chapter::class, 50)->make(['created_by' => $editorUser->id, 'updated_by' => $editorUser->id]);
|
||||
$largeBook->pages()->saveMany($pages);
|
||||
$largeBook->chapters()->saveMany($chapters);
|
||||
app(\BookStack\Services\PermissionService::class)->buildJointPermissions();
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit backupGlobals="false"
|
||||
backupStaticAttributes="false"
|
||||
bootstrap="bootstrap/autoload.php"
|
||||
bootstrap="bootstrap/init.php"
|
||||
colors="true"
|
||||
convertErrorsToExceptions="true"
|
||||
convertNoticesToExceptions="true"
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 5.5 KiB |
|
@ -4,22 +4,22 @@
|
|||
* Laravel - A PHP Framework For Web Artisans
|
||||
*
|
||||
* @package Laravel
|
||||
* @author Taylor Otwell <taylorotwell@gmail.com>
|
||||
* @author Taylor Otwell <taylor@laravel.com>
|
||||
*/
|
||||
|
||||
define('LARAVEL_START', microtime(true));
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Register The Auto Loader
|
||||
| Initialize The App
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Composer provides a convenient, automatically generated class loader for
|
||||
| our application. We just need to utilize it! We'll simply require it
|
||||
| into the script here so that we don't have to worry about manual
|
||||
| loading any of our classes later on. It feels nice to relax.
|
||||
| We need to get things going before we start up the app.
|
||||
| The init file loads everything in, in the correct order.
|
||||
|
|
||||
*/
|
||||
|
||||
require __DIR__.'/../bootstrap/autoload.php';
|
||||
require __DIR__.'/../bootstrap/init.php';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
13
readme.md
13
readme.md
|
@ -55,7 +55,18 @@ As part of BookStack v0.14 support for translations has been built in. All text
|
|||
|
||||
You will also need to add the language to the `locales` array in the `config/app.php` file.
|
||||
|
||||
Some strings have colon-prefixed variables in such as `:userName`. Leave these values as they are as they will be replaced at run-time.
|
||||
There is a script available which compares translation content to `en` files to see what items are missing or redundant. This can be ran like so from your BookStack install folder:
|
||||
|
||||
```bash
|
||||
# Syntax
|
||||
php resources/lang/check.php <lang>
|
||||
|
||||
# Examples
|
||||
php resources/lang/check.php fr
|
||||
php resources/lang/check.php pt_BR
|
||||
```
|
||||
|
||||
Some strings have colon-prefixed variables in such as `:userName`. Leave these values as they are as they will be replaced at run-time.
|
||||
|
||||
## Contributing
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path d="M12 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0zm-.035 5.537a6.427 6.427 0 0 1 6.428 6.428 6.427 6.427 0 0 1-6.428 6.428 6.427 6.427 0 0 1-6.428-6.428 6.427 6.427 0 0 1 6.428-6.428z" fill="#007dc1"/></svg>
|
After Width: | Height: | Size: 392 B |
|
@ -0,0 +1,37 @@
|
|||
/**
|
||||
* Collapsible
|
||||
* Provides some simple logic to allow collapsible sections.
|
||||
*/
|
||||
class Collapsible {
|
||||
|
||||
constructor(elem) {
|
||||
this.elem = elem;
|
||||
this.trigger = elem.querySelector('[collapsible-trigger]');
|
||||
this.content = elem.querySelector('[collapsible-content]');
|
||||
|
||||
if (!this.trigger) return;
|
||||
|
||||
this.trigger.addEventListener('click', this.toggle.bind(this));
|
||||
}
|
||||
|
||||
open() {
|
||||
this.elem.classList.add('open');
|
||||
$(this.content).slideDown(400);
|
||||
}
|
||||
|
||||
close() {
|
||||
this.elem.classList.remove('open');
|
||||
$(this.content).slideUp(400);
|
||||
}
|
||||
|
||||
toggle() {
|
||||
if (this.elem.classList.contains('open')) {
|
||||
this.close();
|
||||
} else {
|
||||
this.open();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = Collapsible;
|
|
@ -0,0 +1,59 @@
|
|||
|
||||
class ImagePicker {
|
||||
|
||||
constructor(elem) {
|
||||
this.elem = elem;
|
||||
this.imageElem = elem.querySelector('img');
|
||||
this.input = elem.querySelector('input');
|
||||
|
||||
this.isUsingIds = elem.getAttribute('data-current-id') !== '';
|
||||
this.isResizing = elem.getAttribute('data-resize-height') && elem.getAttribute('data-resize-width');
|
||||
this.isResizeCropping = elem.getAttribute('data-resize-crop') !== '';
|
||||
|
||||
let selectButton = elem.querySelector('button[data-action="show-image-manager"]');
|
||||
selectButton.addEventListener('click', this.selectImage.bind(this));
|
||||
|
||||
let resetButton = elem.querySelector('button[data-action="reset-image"]');
|
||||
resetButton.addEventListener('click', this.reset.bind(this));
|
||||
|
||||
let removeButton = elem.querySelector('button[data-action="remove-image"]');
|
||||
if (removeButton) {
|
||||
removeButton.addEventListener('click', this.removeImage.bind(this));
|
||||
}
|
||||
}
|
||||
|
||||
selectImage() {
|
||||
window.ImageManager.show(image => {
|
||||
if (!this.isResizing) {
|
||||
this.setImage(image);
|
||||
return;
|
||||
}
|
||||
|
||||
let requestString = '/images/thumb/' + image.id + '/' + this.elem.getAttribute('data-resize-width') + '/' + this.elem.getAttribute('data-resize-height') + '/' + (this.isResizeCropping ? 'true' : 'false');
|
||||
|
||||
window.$http.get(window.baseUrl(requestString)).then(resp => {
|
||||
image.url = resp.data.url;
|
||||
this.setImage(image);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
reset() {
|
||||
this.setImage({id: 0, url: this.elem.getAttribute('data-default-image')});
|
||||
}
|
||||
|
||||
setImage(image) {
|
||||
this.imageElem.src = image.url;
|
||||
this.input.value = this.isUsingIds ? image.id : image.url;
|
||||
this.imageElem.classList.remove('none');
|
||||
}
|
||||
|
||||
removeImage() {
|
||||
this.imageElem.src = this.elem.getAttribute('data-default-image');
|
||||
this.imageElem.classList.add('none');
|
||||
this.input.value = 'none';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = ImagePicker;
|
|
@ -14,6 +14,8 @@ let componentMapping = {
|
|||
'wysiwyg-editor': require('./wysiwyg-editor'),
|
||||
'markdown-editor': require('./markdown-editor'),
|
||||
'editor-toolbox': require('./editor-toolbox'),
|
||||
'image-picker': require('./image-picker'),
|
||||
'collapsible': require('./collapsible'),
|
||||
};
|
||||
|
||||
window.components = {};
|
||||
|
|
|
@ -84,6 +84,8 @@ class MarkdownEditor {
|
|||
};
|
||||
// Save draft
|
||||
extraKeys[`${metaKey}-S`] = cm => {window.$events.emit('editor-save-draft')};
|
||||
// Save page
|
||||
extraKeys[`${metaKey}-Enter`] = cm => {window.$events.emit('editor-save-page')};
|
||||
// Show link selector
|
||||
extraKeys[`Shift-${metaKey}-K`] = cm => {this.actionShowLinkSelector()};
|
||||
// Insert Link
|
||||
|
|
|
@ -71,6 +71,11 @@ function registerEditorShortcuts(editor) {
|
|||
window.$events.emit('editor-save-draft');
|
||||
});
|
||||
|
||||
// Save page shortcut
|
||||
editor.shortcuts.add('meta+13', '', () => {
|
||||
window.$events.emit('editor-save-page');
|
||||
});
|
||||
|
||||
// Loop through callout styles
|
||||
editor.shortcuts.add('meta+9', '', function() {
|
||||
let selectedNode = editor.selection.getNode();
|
||||
|
@ -92,6 +97,17 @@ function registerEditorShortcuts(editor) {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* Load custom HTML head content from the settings into the editor.
|
||||
* @param editor
|
||||
*/
|
||||
function loadCustomHeadContent(editor) {
|
||||
window.$http.get(window.baseUrl('/custom-head-content')).then(resp => {
|
||||
if (!resp.data) return;
|
||||
let head = editor.getDoc().querySelector('head');
|
||||
head.innerHTML += resp.data;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Create and enable our custom code plugin
|
||||
|
@ -317,6 +333,9 @@ module.exports = {
|
|||
args.content = '';
|
||||
}
|
||||
},
|
||||
init_instance_callback: function(editor) {
|
||||
loadCustomHeadContent(editor);
|
||||
},
|
||||
setup: function (editor) {
|
||||
|
||||
editor.on('init ExecCommand change input NodeChange ObjectResized', editorChange);
|
||||
|
|
|
@ -102,23 +102,28 @@ let setupPageShow = window.setupPageShow = function (pageId) {
|
|||
let $window = $(window);
|
||||
let $sidebar = $("#sidebar .scroll-body");
|
||||
let $bookTreeParent = $sidebar.parent();
|
||||
|
||||
// Check the page is scrollable and the content is taller than the tree
|
||||
let pageScrollable = ($(document).height() > $window.height()) && ($sidebar.height() < $('.page-content').height());
|
||||
|
||||
// Get current tree's width and header height
|
||||
let headerHeight = $("#header").height() + $(".toolbar").height();
|
||||
let isFixed = $window.scrollTop() > headerHeight;
|
||||
// Function to fix the tree as a sidebar
|
||||
|
||||
// Fix the tree as a sidebar
|
||||
function stickTree() {
|
||||
$sidebar.width($bookTreeParent.width() + 15);
|
||||
$sidebar.addClass("fixed");
|
||||
isFixed = true;
|
||||
}
|
||||
// Function to un-fix the tree back into position
|
||||
|
||||
// Un-fix the tree back into position
|
||||
function unstickTree() {
|
||||
$sidebar.css('width', 'auto');
|
||||
$sidebar.removeClass("fixed");
|
||||
isFixed = false;
|
||||
}
|
||||
|
||||
// Checks if the tree stickiness state should change
|
||||
function checkTreeStickiness(skipCheck) {
|
||||
let shouldBeFixed = $window.scrollTop() > headerHeight;
|
||||
|
@ -150,6 +155,59 @@ let setupPageShow = window.setupPageShow = function (pageId) {
|
|||
unstickTree();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Check if support is present for IntersectionObserver
|
||||
if ('IntersectionObserver' in window &&
|
||||
'IntersectionObserverEntry' in window &&
|
||||
'intersectionRatio' in window.IntersectionObserverEntry.prototype) {
|
||||
addPageHighlighting();
|
||||
}
|
||||
|
||||
function addPageHighlighting() {
|
||||
let pageNav = document.querySelector('.sidebar-page-nav');
|
||||
|
||||
// fetch all the headings.
|
||||
let headings = document.querySelector('.page-content').querySelectorAll('h1, h2, h3, h4, h5, h6');
|
||||
// if headings are present, add observers.
|
||||
if (headings.length > 0 && pageNav !== null) {
|
||||
addNavObserver(headings);
|
||||
}
|
||||
|
||||
function addNavObserver(headings) {
|
||||
// Setup the intersection observer.
|
||||
let intersectOpts = {
|
||||
rootMargin: '0px 0px 0px 0px',
|
||||
threshold: 1.0
|
||||
};
|
||||
let pageNavObserver = new IntersectionObserver(headingVisibilityChange, intersectOpts);
|
||||
|
||||
// observe each heading
|
||||
for (let i = 0; i !== headings.length; ++i) {
|
||||
pageNavObserver.observe(headings[i]);
|
||||
}
|
||||
}
|
||||
|
||||
function headingVisibilityChange(entries, observer) {
|
||||
for (let i = 0; i < entries.length; i++) {
|
||||
let currentEntry = entries[i];
|
||||
let isVisible = (currentEntry.intersectionRatio === 1);
|
||||
toggleAnchorHighlighting(currentEntry.target.id, isVisible);
|
||||
}
|
||||
}
|
||||
|
||||
function toggleAnchorHighlighting(elementId, shouldHighlight) {
|
||||
let anchorsToHighlight = pageNav.querySelectorAll('a[href="#' + elementId + '"]');
|
||||
for (let i = 0; i < anchorsToHighlight.length; i++) {
|
||||
// Change below to use classList.toggle when IE support is dropped.
|
||||
if (shouldHighlight) {
|
||||
anchorsToHighlight[i].classList.add('current-heading');
|
||||
} else {
|
||||
anchorsToHighlight[i].classList.remove('current-heading');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = setupPageShow;
|
|
@ -125,6 +125,4 @@ const methods = {
|
|||
|
||||
};
|
||||
|
||||
const computed = [];
|
||||
|
||||
module.exports = {template, data, props, methods, computed};
|
||||
module.exports = {template, data, props, methods};
|
|
@ -34,8 +34,9 @@ function mounted() {
|
|||
this.draftText = trans('entities.pages_editing_page');
|
||||
}
|
||||
|
||||
// Listen to save draft events from editor
|
||||
// Listen to save events from editor
|
||||
window.$events.listen('editor-save-draft', this.saveDraft);
|
||||
window.$events.listen('editor-save-page', this.savePage);
|
||||
|
||||
// Listen to content changes from the editor
|
||||
window.$events.listen('editor-html-change', html => {
|
||||
|
@ -106,6 +107,9 @@ let methods = {
|
|||
});
|
||||
},
|
||||
|
||||
savePage() {
|
||||
this.$el.closest('form').submit();
|
||||
},
|
||||
|
||||
draftNotifyChange(text) {
|
||||
this.draftText = text;
|
||||
|
|
|
@ -9,8 +9,6 @@ let data = {
|
|||
const components = {draggable, autosuggest};
|
||||
const directives = {};
|
||||
|
||||
let computed = {};
|
||||
|
||||
let methods = {
|
||||
|
||||
addEmptyTag() {
|
||||
|
@ -64,5 +62,5 @@ function mounted() {
|
|||
}
|
||||
|
||||
module.exports = {
|
||||
data, computed, methods, mounted, components, directives
|
||||
data, methods, mounted, components, directives
|
||||
};
|
|
@ -63,9 +63,10 @@
|
|||
padding: 0 $-m 0;
|
||||
margin-left: -1px;
|
||||
overflow-y: scroll;
|
||||
.page-content {
|
||||
margin: 0 auto;
|
||||
}
|
||||
}
|
||||
.markdown-display.page-content {
|
||||
margin: 0 auto;
|
||||
max-width: 100%;
|
||||
}
|
||||
}
|
||||
.editor-toolbar {
|
||||
|
@ -190,6 +191,41 @@ input:checked + .toggle-switch {
|
|||
}
|
||||
}
|
||||
|
||||
.form-group[collapsible] {
|
||||
margin-left: -$-m;
|
||||
margin-right: -$-m;
|
||||
padding: 0 $-m;
|
||||
border-top: 1px solid #DDD;
|
||||
border-bottom: 1px solid #DDD;
|
||||
.collapse-title {
|
||||
margin-left: -$-m;
|
||||
margin-right: -$-m;
|
||||
padding: $-s $-m;
|
||||
}
|
||||
.collapse-title, .collapse-title label {
|
||||
cursor: pointer;
|
||||
}
|
||||
.collapse-title label {
|
||||
padding-bottom: 0;
|
||||
margin-bottom: 0;
|
||||
color: inherit;
|
||||
}
|
||||
.collapse-title label:before {
|
||||
display: inline-block;
|
||||
content: '▸';
|
||||
margin-right: $-m;
|
||||
transition: all ease-in-out 400ms;
|
||||
transform: rotate(0);
|
||||
}
|
||||
.collapse-content {
|
||||
display: none;
|
||||
padding-bottom: $-m;
|
||||
}
|
||||
&.open .collapse-title label:before {
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
}
|
||||
|
||||
.inline-input-style {
|
||||
display: block;
|
||||
width: 100%;
|
||||
|
|
|
@ -135,7 +135,7 @@ body.flexbox {
|
|||
width: 30%;
|
||||
left: 0;
|
||||
height: 100%;
|
||||
overflow-y: scroll;
|
||||
overflow-y: auto;
|
||||
-ms-overflow-style: none;
|
||||
//background-color: $primary-faded;
|
||||
border-left: 1px solid #DDD;
|
||||
|
@ -195,6 +195,14 @@ div[class^="col-"] img {
|
|||
display: inline-block;
|
||||
}
|
||||
|
||||
@include larger-than(991px) {
|
||||
.row.auto-clear .col-md-4:nth-child(3n+1){clear:left;}
|
||||
}
|
||||
|
||||
@include smaller-than(992px) {
|
||||
.row.auto-clear .col-xs-6:nth-child(2n+1){clear:left;}
|
||||
}
|
||||
|
||||
.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 {
|
||||
position: relative;
|
||||
min-height: 1px;
|
||||
|
|
|
@ -82,6 +82,9 @@
|
|||
.h6 {
|
||||
margin-left: $nav-indent*4;
|
||||
}
|
||||
.current-heading {
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
// Sidebar list
|
||||
|
@ -373,3 +376,51 @@ ul.pagination {
|
|||
border-bottom: 1px solid #DDD;
|
||||
}
|
||||
}
|
||||
|
||||
// Books grid view
|
||||
.featured-image-container {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background: #F2F2F2;
|
||||
border: 1px solid #ddd;
|
||||
border-bottom: 0;
|
||||
img {
|
||||
display: block;
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
transition: all .5s ease;
|
||||
}
|
||||
img:hover {
|
||||
transform: scale(1.15);
|
||||
opacity: .5;
|
||||
}
|
||||
}
|
||||
|
||||
.book-grid-content {
|
||||
padding: 30px;
|
||||
border: 1px solid #ddd;
|
||||
border-top: 0;
|
||||
border-bottom-width: 2px;
|
||||
h2 {
|
||||
font-size: 1.5em;
|
||||
margin: 0 0 10px;
|
||||
}
|
||||
h2 a {
|
||||
display: block;
|
||||
line-height: 1.2;
|
||||
color: #009688;;
|
||||
text-decoration: none;
|
||||
}
|
||||
p {
|
||||
font-size: .85em;
|
||||
margin: 0 0 10px;
|
||||
line-height: 1.6em;
|
||||
}
|
||||
p.small {
|
||||
font-size: .8em;
|
||||
}
|
||||
}
|
||||
|
||||
.book-grid-item {
|
||||
margin-bottom : 20px;
|
||||
}
|
||||
|
|
|
@ -1,16 +1,13 @@
|
|||
|
||||
|
||||
.mce-tinymce.mce-container.fullscreen {
|
||||
.mce-tinymce.mce-container.mce-fullscreen {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
height: 100%;
|
||||
width: 825px;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
margin-left: -$-s;
|
||||
box-shadow: 0 0 4px 2px rgba(0, 0, 0, 0.08);
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
|
||||
.mce-tinymce {
|
||||
.mce-panel {
|
||||
background-color: #FFF;
|
||||
|
|
|
@ -232,6 +232,3 @@ $btt-size: 40px;
|
|||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,114 @@
|
|||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Compares translation files to find missing and redundant content.
|
||||
*/
|
||||
|
||||
$args = array_slice($argv, 1);
|
||||
|
||||
if (count($args) === 0) {
|
||||
errorOut("Please provide a language code as the first argument (./check.php fr)");
|
||||
}
|
||||
|
||||
|
||||
// Get content from files
|
||||
$lang = formatLang($args[0]);
|
||||
$enContent = loadLang('en');
|
||||
$langContent = loadLang($lang);
|
||||
|
||||
if (count($langContent) === 0) {
|
||||
errorOut("No language content found for '{$lang}'");
|
||||
}
|
||||
|
||||
info("Checking '{$lang}' translation content against 'en'");
|
||||
|
||||
// Track missing lang strings
|
||||
$missingLangStrings = [];
|
||||
foreach ($enContent as $enKey => $enStr) {
|
||||
if (strpos($enKey, 'settings.language_select.') === 0) {
|
||||
unset($langContent[$enKey]);
|
||||
continue;
|
||||
}
|
||||
if (!isset($langContent[$enKey])) {
|
||||
$missingLangStrings[$enKey] = $enStr;
|
||||
continue;
|
||||
}
|
||||
unset($langContent[$enKey]);
|
||||
}
|
||||
|
||||
if (count($missingLangStrings) > 0) {
|
||||
info("\n========================");
|
||||
info("Missing language content");
|
||||
info("========================");
|
||||
outputFlatArray($missingLangStrings, $lang);
|
||||
}
|
||||
|
||||
if (count($langContent) > 0) {
|
||||
info("\n==========================");
|
||||
info("Redundant language content");
|
||||
info("==========================");
|
||||
outputFlatArray($langContent, $lang);
|
||||
}
|
||||
|
||||
function outputFlatArray($arr, $lang) {
|
||||
$grouped = [];
|
||||
foreach ($arr as $key => $val) {
|
||||
$explodedKey = explode('.', $key);
|
||||
$group = $explodedKey[0];
|
||||
$path = implode('.', array_slice($explodedKey, 1));
|
||||
if (!isset($grouped[$group])) $grouped[$group] = [];
|
||||
$grouped[$group][$path] = $val;
|
||||
}
|
||||
foreach ($grouped as $filename => $arr) {
|
||||
echo "\e[36m" . $lang . '/' . $filename . ".php\e[0m\n";
|
||||
echo json_encode($arr, JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE) . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
function formatLang($lang) {
|
||||
$langParts = explode('_', strtoupper($lang));
|
||||
$langParts[0] = strtolower($langParts[0]);
|
||||
return implode('_', $langParts);
|
||||
}
|
||||
|
||||
function loadLang(string $lang) {
|
||||
$dir = __DIR__ . "/{$lang}";
|
||||
if (!file_exists($dir)) {
|
||||
errorOut("Expected directory '{$dir}' does not exist");
|
||||
}
|
||||
$files = scandir($dir);
|
||||
$data = [];
|
||||
foreach ($files as $file) {
|
||||
if (substr($file, -4) !== '.php') continue;
|
||||
$fileData = include ($dir . '/' . $file);
|
||||
$name = substr($file, 0, -4);
|
||||
$data[$name] = $fileData;
|
||||
}
|
||||
return flattenArray($data);
|
||||
}
|
||||
|
||||
function flattenArray(array $arr) {
|
||||
$data = [];
|
||||
foreach ($arr as $key => $arrItem) {
|
||||
if (!is_array($arrItem)) {
|
||||
$data[$key] = $arrItem;
|
||||
continue;
|
||||
}
|
||||
|
||||
$toUse = flattenArray($arrItem);
|
||||
foreach ($toUse as $innerKey => $item) {
|
||||
$data[$key . '.' . $innerKey] = $item;
|
||||
}
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
function info($text) {
|
||||
echo "\e[34m" . $text . "\e[0m\n";
|
||||
}
|
||||
|
||||
function errorOut($text) {
|
||||
echo "\e[31m" . $text . "\e[0m\n";
|
||||
exit(1);
|
||||
}
|
|
@ -17,6 +17,8 @@ return [
|
|||
'name' => 'Name',
|
||||
'description' => 'Beschreibung',
|
||||
'role' => 'Rolle',
|
||||
'cover_image' => 'Titelbild',
|
||||
'cover_image_description' => 'Das Bild sollte eine Auflösung von 300x170px haben.',
|
||||
|
||||
/**
|
||||
* Actions
|
||||
|
@ -43,7 +45,7 @@ return [
|
|||
'no_items' => 'Keine Einträge gefunden.',
|
||||
'back_to_top' => 'nach oben',
|
||||
'toggle_details' => 'Details zeigen/verstecken',
|
||||
|
||||
'toggle_thumbnails' => 'Thumbnails zeigen/verstecken',
|
||||
/**
|
||||
* Header
|
||||
*/
|
||||
|
|
|
@ -31,6 +31,8 @@ return [
|
|||
'app_logo_desc' => "Dieses Bild sollte 43px hoch sein.\nGrößere Bilder werden verkleinert.",
|
||||
'app_primary_color' => 'Primäre Anwendungsfarbe',
|
||||
'app_primary_color_desc' => "Dies sollte ein HEX Wert sein.\nWenn Sie nicht eingeben, wird die Anwendung auf die Standardfarbe zurückgesetzt.",
|
||||
'app_disable_comments' => 'Kommentare deaktivieren',
|
||||
'app_disable_comments_desc' => 'Deaktiviert Kommentare über alle Seiten in der Anwendung. Vorhandene Kommentare werden nicht angezeigt.',
|
||||
|
||||
/**
|
||||
* Registration settings
|
||||
|
@ -96,6 +98,7 @@ return [
|
|||
'users_delete_warning' => 'Der Benutzer ":userName" wird aus dem System gelöscht.',
|
||||
'users_delete_confirm' => 'Sind Sie sicher, dass Sie diesen Benutzer löschen möchten?',
|
||||
'users_delete_success' => 'Benutzer erfolgreich gelöscht.',
|
||||
'users_books_view_type' => 'Bevorzugtes Display-Layout für Bücher',
|
||||
'users_edit' => 'Benutzer bearbeiten',
|
||||
'users_edit_profile' => 'Profil bearbeiten',
|
||||
'users_edit_success' => 'Benutzer erfolgreich aktualisisert',
|
||||
|
|
|
@ -18,6 +18,8 @@ return [
|
|||
'name' => 'Name',
|
||||
'description' => 'Description',
|
||||
'role' => 'Role',
|
||||
'cover_image' => 'Cover image',
|
||||
'cover_image_description' => 'This image should be approx 440x250px.',
|
||||
|
||||
/**
|
||||
* Actions
|
||||
|
@ -45,6 +47,7 @@ return [
|
|||
'no_items' => 'No items available',
|
||||
'back_to_top' => 'Back to top',
|
||||
'toggle_details' => 'Toggle Details',
|
||||
'toggle_thumbnails' => 'Toggle Thumbnails',
|
||||
'details' => 'Details',
|
||||
|
||||
/**
|
||||
|
|
|
@ -20,6 +20,7 @@ return [
|
|||
'ldap_extension_not_installed' => 'LDAP PHP extension not installed',
|
||||
'ldap_cannot_connect' => 'Cannot connect to ldap server, Initial connection failed',
|
||||
'social_no_action_defined' => 'No action defined',
|
||||
'social_login_bad_response' => "Error received during :socialAccount login: \n:error",
|
||||
'social_account_in_use' => 'This :socialAccount account is already in use, Try logging in via the :socialAccount option.',
|
||||
'social_account_email_in_use' => 'The email :email is already in use. If you already have an account you can connect your :socialAccount account from your profile settings.',
|
||||
'social_account_existing' => 'This :socialAccount is already attached to your profile.',
|
||||
|
|
|
@ -34,6 +34,8 @@ return [
|
|||
'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_disable_comments' => 'Disable comments',
|
||||
'app_disable_comments_desc' => 'Disable comments across all pages in the application. Existing comments are not shown.',
|
||||
|
||||
/**
|
||||
* Registration settings
|
||||
|
@ -94,6 +96,7 @@ return [
|
|||
'users_external_auth_id' => 'External Authentication ID',
|
||||
'users_password_warning' => 'Only fill the below if you would like to change your password:',
|
||||
'users_system_public' => 'This user represents any guest users that visit your instance. It cannot be used to log in but is assigned automatically.',
|
||||
'users_books_view_type' => 'Preferred layout for books viewing',
|
||||
'users_delete' => 'Delete User',
|
||||
'users_delete_named' => 'Delete user :userName',
|
||||
'users_delete_warning' => 'This will fully delete this user with the name \':userName\' from the system.',
|
||||
|
|
|
@ -17,7 +17,8 @@ return [
|
|||
'name' => 'Nombre',
|
||||
'description' => 'Descripción',
|
||||
'role' => 'Rol',
|
||||
|
||||
'cover_image' => 'Imagen de portada',
|
||||
'cover_image_description' => 'Esta imagen debe ser aproximadamente 300x170px.',
|
||||
/**
|
||||
* Actions
|
||||
*/
|
||||
|
@ -43,6 +44,7 @@ return [
|
|||
'no_items' => 'No hay items disponibles',
|
||||
'back_to_top' => 'Volver arriba',
|
||||
'toggle_details' => 'Alternar detalles',
|
||||
'toggle_thumbnails' => 'Alternar miniaturas',
|
||||
|
||||
/**
|
||||
* Header
|
||||
|
|
|
@ -31,6 +31,8 @@ return [
|
|||
'app_logo_desc' => 'Esta imagen debería de ser 43px en altura. <br>Iágenes grandes seán escaladas.',
|
||||
'app_primary_color' => 'Color primario de la aplicación',
|
||||
'app_primary_color_desc' => 'Esto debería ser un valor hexadecimal. <br>Deje el valor vaío para reiniciar al valor por defecto.',
|
||||
'app_disable_comments' => 'Deshabilitar comentarios',
|
||||
'app_disable_comments_desc' => 'Deshabilita los comentarios en todas las páginas de la aplicación. Los comentarios existentes no se muestran. ',
|
||||
|
||||
/**
|
||||
* Registration settings
|
||||
|
@ -91,6 +93,7 @@ return [
|
|||
'users_external_auth_id' => 'ID externo de autenticación',
|
||||
'users_password_warning' => 'Solo rellene a continuación si desea cambiar su password:',
|
||||
'users_system_public' => 'Este usuario representa cualquier usuario invitado que visita la aplicación. No puede utilizarse para hacer login sio que es asignado automáticamente.',
|
||||
'users_books_view_type' => 'Diseño de pantalla preferido para libros',
|
||||
'users_delete' => 'Borrar usuario',
|
||||
'users_delete_named' => 'Borrar usuario :userName',
|
||||
'users_delete_warning' => 'Se borrará completamente el usuario con el nombre \':userName\' del sistema.',
|
||||
|
|
|
@ -17,7 +17,8 @@ return [
|
|||
'name' => 'Nom',
|
||||
'description' => 'Description',
|
||||
'role' => 'Rôle',
|
||||
|
||||
'cover_image' => 'Image de couverture',
|
||||
'cover_image_description' => 'Cette image doit être environ 300x170px.',
|
||||
/**
|
||||
* Actions
|
||||
*/
|
||||
|
@ -43,6 +44,7 @@ return [
|
|||
'no_items' => 'Aucun élément',
|
||||
'back_to_top' => 'Retour en haut',
|
||||
'toggle_details' => 'Afficher les détails',
|
||||
'toggle_thumbnails' => 'Afficher les vignettes',
|
||||
|
||||
/**
|
||||
* Header
|
||||
|
|
|
@ -31,7 +31,8 @@ return [
|
|||
'app_logo_desc' => 'Cette image doit faire 43px de hauteur. <br>Les images plus larges seront réduites.',
|
||||
'app_primary_color' => 'Couleur principale de l\'application',
|
||||
'app_primary_color_desc' => 'Cela devrait être une valeur hexadécimale. <br>Laisser vide pour rétablir la couleur par défaut.',
|
||||
|
||||
'app_disable_comments' => 'Désactiver les commentaires',
|
||||
'app_disable_comments_desc' => 'Désactive les commentaires sur toutes les pages de l\'application. Les commentaires existants ne sont pas affichés.',
|
||||
/**
|
||||
* Registration settings
|
||||
*/
|
||||
|
@ -91,6 +92,7 @@ return [
|
|||
'users_external_auth_id' => 'Identifiant d\'authentification externe',
|
||||
'users_password_warning' => 'Remplissez ce fomulaire uniquement si vous souhaitez changer de mot de passe:',
|
||||
'users_system_public' => 'Cet utilisateur représente les invités visitant votre instance. Il est assigné automatiquement aux invités.',
|
||||
'users_books_view_type' => 'Disposition d\'affichage préférée pour les livres',
|
||||
'users_delete' => 'Supprimer un utilisateur',
|
||||
'users_delete_named' => 'Supprimer l\'utilisateur :userName',
|
||||
'users_delete_warning' => 'Ceci va supprimer \':userName\' du système.',
|
||||
|
|
|
@ -34,11 +34,12 @@ return [
|
|||
'app_homepage' => 'Homepage Applicazione',
|
||||
'app_homepage_desc' => 'Seleziona una pagina da mostrare nella home anzichè quella di default. I permessi della pagina sono ignorati per quella selezionata.',
|
||||
'app_homepage_default' => 'Homepage di default scelta',
|
||||
'app_disable_comments' => 'Disattiva commenti',
|
||||
'app_disable_comments_desc' => 'Disabilita i commenti su tutte le pagine nell\'applicazione. I commenti esistenti non sono mostrati. ',
|
||||
|
||||
/**
|
||||
* Registration settings
|
||||
*/
|
||||
|
||||
'reg_settings' => 'Impostazioni Registrazione',
|
||||
'reg_allow' => 'Consentire Registrazione?',
|
||||
'reg_default_role' => 'Ruolo predefinito dopo la registrazione',
|
||||
|
|
|
@ -17,7 +17,7 @@ return [
|
|||
'name' => '名称',
|
||||
'description' => '概要',
|
||||
'role' => '権限',
|
||||
|
||||
'cover_image_description' => 'この画像は約 300x170px をする必要があります。',
|
||||
/**
|
||||
* Actions
|
||||
*/
|
||||
|
|
|
@ -31,6 +31,8 @@ return [
|
|||
'app_logo_desc' => '高さ43pxで表示されます。これを上回る場合、自動で縮小されます。',
|
||||
'app_primary_color' => 'プライマリカラー',
|
||||
'app_primary_color_desc' => '16進数カラーコードで入力します。空にした場合、デフォルトの色にリセットされます。',
|
||||
'app_disable_comments' => 'コメントを無効にする',
|
||||
'app_disable_comments_desc' => 'アプリケーション内のすべてのページのコメントを無効にします。既存のコメントは表示されません。',
|
||||
|
||||
/**
|
||||
* Registration settings
|
||||
|
|
|
@ -18,7 +18,8 @@ return [
|
|||
'name' => 'Naam',
|
||||
'description' => 'Beschrijving',
|
||||
'role' => 'Rol',
|
||||
|
||||
'cover_image' => 'Omslagfoto',
|
||||
'cover_image_description' => 'Deze afbeelding moet ongeveer 300x170px zijn.',
|
||||
/**
|
||||
* Actions
|
||||
*/
|
||||
|
@ -44,6 +45,7 @@ return [
|
|||
'no_items' => 'Geen items beschikbaar',
|
||||
'back_to_top' => 'Terug naar boven',
|
||||
'toggle_details' => 'Details Weergeven',
|
||||
'toggle_thumbnails' => 'Thumbnails Weergeven',
|
||||
|
||||
/**
|
||||
* Header
|
||||
|
|
|
@ -31,6 +31,8 @@ return [
|
|||
'app_logo_desc' => 'De afbeelding moet 43px hoog zijn. <br>Grotere afbeeldingen worden geschaald.',
|
||||
'app_primary_color' => 'Applicatie hoofdkleur',
|
||||
'app_primary_color_desc' => 'Geef een hexadecimale waarde. <br>Als je niks invult wordt de standaardkleur gebruikt.',
|
||||
'app_disable_comments' => 'Reacties uitschakelen',
|
||||
'app_disable_comments_desc' => 'Schakel opmerkingen uit op alle pagina\'s in de applicatie. Bestaande opmerkingen worden niet getoond.',
|
||||
|
||||
/**
|
||||
* Registration settings
|
||||
|
@ -91,6 +93,7 @@ return [
|
|||
'users_external_auth_id' => 'External Authentication ID',
|
||||
'users_password_warning' => 'Vul onderstaande formulier alleen in als je het wachtwoord wilt aanpassen:',
|
||||
'users_system_public' => 'De eigenschappen van deze gebruiker worden voor elke gastbezoeker gebruikt. Er kan niet mee ingelogd worden en wordt automatisch toegewezen.',
|
||||
'users_books_view_type' => 'Voorkeursuitleg voor het weergeven van boeken',
|
||||
'users_delete' => 'Verwijder gebruiker',
|
||||
'users_delete_named' => 'Verwijder gebruiker :userName',
|
||||
'users_delete_warning' => 'Dit zal de gebruiker \':userName\' volledig uit het systeem verwijderen.',
|
||||
|
|
|
@ -17,6 +17,8 @@ return [
|
|||
'name' => 'Nazwa',
|
||||
'description' => 'Opis',
|
||||
'role' => 'Rola',
|
||||
'cover_image' => 'Zdjęcie z okładki',
|
||||
'cover_image_description' => 'Ten obraz powinien wynosić około 300 x 170 piksli.',
|
||||
|
||||
/**
|
||||
* Actions
|
||||
|
|
|
@ -31,6 +31,8 @@ return [
|
|||
'app_logo_desc' => 'Ten obrazek powinien mieć nie więcej niż 43px w pionie. <br>Większe obrazki będą skalowane w dół.',
|
||||
'app_primary_color' => 'Podstawowy kolor aplikacji',
|
||||
'app_primary_color_desc' => 'To powinna być wartość HEX. <br>Zostaw to pole puste, by powrócić do podstawowego koloru.',
|
||||
'app_disable_comments' => 'Wyłącz komentarze',
|
||||
'app_disable_comments_desc' => 'Wyłącz komentarze na wszystkich stronach w aplikacji. Istniejące komentarze nie są pokazywane.',
|
||||
|
||||
/**
|
||||
* Registration settings
|
||||
|
|
|
@ -37,4 +37,6 @@ return [
|
|||
'book_sort' => 'livro classificado',
|
||||
'book_sort_notification' => 'Livro reclassificado com sucesso',
|
||||
|
||||
// Other
|
||||
'commented_on' => 'comentou em',
|
||||
];
|
||||
|
|
|
@ -18,6 +18,8 @@ return [
|
|||
*/
|
||||
'sign_up' => 'Registrar-se',
|
||||
'log_in' => 'Entrar',
|
||||
'log_in_with' => 'Entrar com :socialDriver',
|
||||
'sign_up_with' => 'Registrar com :socialDriver',
|
||||
'logout' => 'Sair',
|
||||
|
||||
'name' => 'Nome',
|
||||
|
|
|
@ -10,6 +10,7 @@ return [
|
|||
'save' => 'Salvar',
|
||||
'continue' => 'Continuar',
|
||||
'select' => 'Selecionar',
|
||||
'more' => 'Mais',
|
||||
|
||||
/**
|
||||
* Form Labels
|
||||
|
@ -17,7 +18,8 @@ return [
|
|||
'name' => 'Nome',
|
||||
'description' => 'Descrição',
|
||||
'role' => 'Regra',
|
||||
|
||||
'cover_image' => 'Imagem de capa',
|
||||
'cover_image_description' => 'Esta imagem deve ser aproximadamente 300x170px.',
|
||||
/**
|
||||
* Actions
|
||||
*/
|
||||
|
@ -28,12 +30,13 @@ return [
|
|||
'edit' => 'Editar',
|
||||
'sort' => 'Ordenar',
|
||||
'move' => 'Mover',
|
||||
'reply' => 'Responder',
|
||||
'delete' => 'Excluir',
|
||||
'search' => 'Pesquisar',
|
||||
'search_clear' => 'Limpar Pesquisa',
|
||||
'reset' => 'Resetar',
|
||||
'remove' => 'Remover',
|
||||
|
||||
'add' => 'Adicionar',
|
||||
|
||||
/**
|
||||
* Misc
|
||||
|
@ -43,6 +46,8 @@ return [
|
|||
'no_items' => 'Nenhum item disponível',
|
||||
'back_to_top' => 'Voltar ao topo',
|
||||
'toggle_details' => 'Alternar Detalhes',
|
||||
'toggle_thumbnails' => 'Alternar Miniaturas',
|
||||
'details' => 'Detalhes',
|
||||
|
||||
/**
|
||||
* Header
|
||||
|
|
|
@ -20,5 +20,13 @@ return [
|
|||
'image_preview' => 'Virtualização de Imagem',
|
||||
'image_upload_success' => 'Upload de imagem efetuado com sucesso',
|
||||
'image_update_success' => 'Upload de detalhes da imagem efetuado com sucesso',
|
||||
'image_delete_success' => 'Imagem excluída com sucesso'
|
||||
'image_delete_success' => 'Imagem excluída com sucesso',
|
||||
|
||||
/**
|
||||
* Code editor
|
||||
*/
|
||||
'code_editor' => 'Editar Código',
|
||||
'code_language' => 'Linguagem do Código',
|
||||
'code_content' => 'Código',
|
||||
'code_save' => 'Salvar Código',
|
||||
];
|
|
@ -14,11 +14,11 @@ return [
|
|||
'recent_activity' => 'Atividade recente',
|
||||
'create_now' => 'Criar um agora',
|
||||
'revisions' => 'Revisões',
|
||||
'meta_revision' => 'Revisão #:revisionCount',
|
||||
'meta_created' => 'Criado em :timeLength',
|
||||
'meta_created_name' => 'Criado em :timeLength por :user',
|
||||
'meta_updated' => 'Atualizado em :timeLength',
|
||||
'meta_updated_name' => 'Atualizado em :timeLength por :user',
|
||||
'x_pages' => ':count Páginas',
|
||||
'entity_select' => 'Seleção de Entidade',
|
||||
'images' => 'Imagens',
|
||||
'my_recent_drafts' => 'Meus rascunhos recentes',
|
||||
|
@ -43,19 +43,39 @@ return [
|
|||
* Search
|
||||
*/
|
||||
'search_results' => 'Resultado(s) da Pesquisa',
|
||||
'search_total_results_found' => ':count resultado encontrado|:count resultados encontrados',
|
||||
'search_clear' => 'Limpar Pesquisa',
|
||||
'search_no_pages' => 'Nenhuma página corresponde à pesquisa',
|
||||
'search_for_term' => 'Pesquisar por :term',
|
||||
'search_more' => 'Mais Resultados',
|
||||
'search_filters' => 'Filtros de Pesquisa',
|
||||
'search_content_type' => 'Tipo de Conteúdo',
|
||||
'search_exact_matches' => 'Correspondências Exatas',
|
||||
'search_tags' => 'Tags',
|
||||
'search_viewed_by_me' => 'Visto por mim',
|
||||
'search_not_viewed_by_me' => 'Não visto por mim',
|
||||
'search_permissions_set' => 'Permissão definida',
|
||||
'search_created_by_me' => 'Criado por mim',
|
||||
'search_updated_by_me' => 'Atualizado por mim',
|
||||
'search_updated_before' => 'Atualizado antes de',
|
||||
'search_updated_after' => 'Atualizado depois de',
|
||||
'search_created_before' => 'Criado antes de',
|
||||
'search_created_after' => 'Criado depois de',
|
||||
'search_set_date' => 'Definir data',
|
||||
'search_update' => 'Refazer Pesquisa',
|
||||
|
||||
/**
|
||||
* Books
|
||||
*/
|
||||
'book' => 'Livro',
|
||||
'books' => 'Livros',
|
||||
'x_books' => ':count Livro|:count Livros',
|
||||
'books_empty' => 'Nenhum livro foi criado',
|
||||
'books_popular' => 'Livros populares',
|
||||
'books_recent' => 'Livros recentes',
|
||||
'books_new' => 'Livros novos',
|
||||
'books_popular_empty' => 'Os livros mais populares aparecerão aqui.',
|
||||
'books_new_empty' => 'Os livros criados mais recentemente aparecerão aqui.',
|
||||
'books_create' => 'Criar novo Livro',
|
||||
'books_delete' => 'Excluir Livro',
|
||||
'books_delete_named' => 'Excluir Livro :bookName',
|
||||
|
@ -83,18 +103,18 @@ return [
|
|||
/**
|
||||
* Chapters
|
||||
*/
|
||||
'chapter' => 'Capitulo',
|
||||
'chapter' => 'Capítulo',
|
||||
'chapters' => 'Capítulos',
|
||||
'x_chapters' => ':count Capítulo|:count Capítulos',
|
||||
'chapters_popular' => 'Capítulos Populares',
|
||||
'chapters_new' => 'Novo Capítulo',
|
||||
'chapters_create' => 'Criar novo Capítulo',
|
||||
'chapters_delete' => 'Excluír Capítulo',
|
||||
'chapters_delete_named' => 'Excluir Capítulo :chapterName',
|
||||
'chapters_delete_explain' => 'A ação vai excluír o capítulo de nome \':chapterName\'. Todas as páginas do capítulo serão removidas
|
||||
e adicionadas diretamente ao livro pai.',
|
||||
'chapters_delete_confirm' => 'Tem certeza que deseja excluír o capitulo?',
|
||||
'chapters_delete_explain' => 'A ação vai excluír o capítulo de nome \':chapterName\'. Todas as páginas do capítulo serão removidas e adicionadas diretamente ao livro pai.',
|
||||
'chapters_delete_confirm' => 'Tem certeza que deseja excluír o capítulo?',
|
||||
'chapters_edit' => 'Editar Capítulo',
|
||||
'chapters_edit_named' => 'Editar capitulo :chapterName',
|
||||
'chapters_edit_named' => 'Editar capítulo :chapterName',
|
||||
'chapters_save' => 'Salvar Capítulo',
|
||||
'chapters_move' => 'Mover Capítulo',
|
||||
'chapters_move_named' => 'Mover Capítulo :chapterName',
|
||||
|
@ -103,12 +123,14 @@ return [
|
|||
'chapters_empty' => 'Nenhuma página existente nesse capítulo.',
|
||||
'chapters_permissions_active' => 'Permissões de Capítulo ativadas',
|
||||
'chapters_permissions_success' => 'Permissões de Capítulo atualizadas',
|
||||
'chapters_search_this' => 'Pesquisar este Capítulo',
|
||||
|
||||
/**
|
||||
* Pages
|
||||
*/
|
||||
'page' => 'Página',
|
||||
'pages' => 'Páginas',
|
||||
'x_pages' => ':count Página|:count Páginas',
|
||||
'pages_popular' => 'Páginas Popular',
|
||||
'pages_new' => 'Nova Página',
|
||||
'pages_attachments' => 'Anexos',
|
||||
|
@ -145,11 +167,13 @@ return [
|
|||
'pages_move_success' => 'Pagina movida para ":parentName"',
|
||||
'pages_permissions' => 'Permissões de Página',
|
||||
'pages_permissions_success' => 'Permissões de Página atualizadas',
|
||||
'pages_revision' => 'Revisão',
|
||||
'pages_revisions' => 'Revisões de Página',
|
||||
'pages_revisions_named' => 'Revisões de Página para :pageName',
|
||||
'pages_revision_named' => 'Revisão de Página para :pageName',
|
||||
'pages_revisions_created_by' => 'Criado por',
|
||||
'pages_revisions_date' => 'Data da Revisão',
|
||||
'pages_revisions_number' => '#',
|
||||
'pages_revisions_changelog' => 'Changelog',
|
||||
'pages_revisions_changes' => 'Mudanças',
|
||||
'pages_revisions_current' => 'Versão atual',
|
||||
|
@ -218,8 +242,19 @@ return [
|
|||
/**
|
||||
* Comments
|
||||
*/
|
||||
'comentário' => 'Comentário',
|
||||
'comentários' => 'Comentários',
|
||||
'comment' => 'Comentário',
|
||||
'comments' => 'Comentários',
|
||||
'comment_placeholder' => 'Digite seus comentários aqui',
|
||||
'comment_count' => '{0} Nenhum comentário|{1} 1 Comentário|[2,*] :count Comentários',
|
||||
'comment_save' => 'Salvar comentário',
|
||||
'comment_saving' => 'Salvando comentário...',
|
||||
'comment_deleting' => 'Removendo comentário...',
|
||||
'comment_new' => 'Novo comentário',
|
||||
'comment_created' => 'comentado :createDiff',
|
||||
'comment_updated' => 'Editado :updateDiff por :username',
|
||||
'comment_deleted_success' => 'Comentário removido',
|
||||
'comment_created_success' => 'Comentário adicionado',
|
||||
'comment_updated_success' => 'Comentário editado',
|
||||
'comment_delete_confirm' => 'Você tem certeza de que quer deletar este comentário?',
|
||||
'comment_in_reply_to' => 'Em resposta à :commentId',
|
||||
];
|
|
@ -41,6 +41,7 @@ return [
|
|||
|
||||
// Pages
|
||||
'page_draft_autosave_fail' => 'Falou ao tentar salvar o rascunho. Certifique-se que a conexão de internet está funcional antes de tentar salvar essa página',
|
||||
'page_custom_home_deletion' => 'Não pode deletar uma página que está definida como página inicial',
|
||||
|
||||
// Entities
|
||||
'entity_not_found' => 'Entidade não encontrada',
|
||||
|
@ -60,6 +61,13 @@ return [
|
|||
'role_system_cannot_be_deleted' => 'Esse perfil é um perfil de sistema e não pode ser excluído',
|
||||
'role_registration_default_cannot_delete' => 'Esse perfil não poderá se excluído enquando estiver registrado como o perfil padrão',
|
||||
|
||||
// comments
|
||||
'comment_list' => 'Ocorreu um erro ao buscar os comentários.',
|
||||
'cannot_add_comment_to_draft' => 'Você não pode adicionar comentários a um rascunho.',
|
||||
'comment_add' => 'Ocorreu um erro ao adicionar o comentário.',
|
||||
'comment_delete' => 'Ocorreu um erro ao excluir o comentário.',
|
||||
'empty_comment' => 'Não é possível adicionar um comentário vazio.',
|
||||
|
||||
// Error pages
|
||||
'404_page_not_found' => 'Página não encontrada',
|
||||
'sorry_page_not_found' => 'Desculpe, a página que você está procurando não pôde ser encontrada.',
|
||||
|
@ -67,11 +75,4 @@ return [
|
|||
'error_occurred' => 'Um erro ocorreu',
|
||||
'app_down' => ':appName está fora do ar no momento',
|
||||
'back_soon' => 'Voltaremos em seguida.',
|
||||
|
||||
// comments
|
||||
'comment_list' => 'Ocorreu um erro ao buscar os comentários.',
|
||||
'cannot_add_comment_to_draft' => 'Você não pode adicionar comentários a um rascunho.',
|
||||
'comment_add' => 'Ocorreu um erro ao adicionar o comentário.',
|
||||
'comment_delete' => 'Ocorreu um erro ao excluir o comentário.',
|
||||
'empty_comment' => 'Não é possível adicionar um comentário vazio.',
|
||||
];
|
|
@ -31,6 +31,11 @@ return [
|
|||
'app_logo_desc' => 'A imagem deve ter 43px de altura. <br>Imagens mais largas devem ser reduzidas.',
|
||||
'app_primary_color' => 'Cor primária da Aplicação',
|
||||
'app_primary_color_desc' => 'Esse valor deverá ser Hexadecimal. <br>Deixe em branco para que o Bookstack assuma a cor padrão.',
|
||||
'app_homepage' => 'Página incial',
|
||||
'app_homepage_desc' => 'Selecione a página para ser usada como página inicial em vez da padrão. Permissões da página serão ignoradas.',
|
||||
'app_homepage_default' => 'Escolhida página inicial padrão',
|
||||
'app_disable_comments' => 'Desativar comentários',
|
||||
'app_disable_comments_desc' => 'Desativar comentários em todas as páginas no aplicativo. Os comentários existentes não são exibidos.',
|
||||
|
||||
/**
|
||||
* Registration settings
|
||||
|
@ -91,6 +96,7 @@ return [
|
|||
'users_external_auth_id' => 'ID de Autenticação Externa',
|
||||
'users_password_warning' => 'Preencha os dados abaixo caso queira modificar a sua senha:',
|
||||
'users_system_public' => 'Esse usuário representa quaisquer convidados que visitam o aplicativo. Ele não pode ser usado para login.',
|
||||
'users_books_view_type' => 'Layout preferido para mostrar livros',
|
||||
'users_delete' => 'Excluir Usuário',
|
||||
'users_delete_named' => 'Excluir :userName',
|
||||
'users_delete_warning' => 'A ação vai excluir completamente o usuário de nome \':userName\' do sistema.',
|
||||
|
@ -101,6 +107,7 @@ return [
|
|||
'users_edit_success' => 'Usuário atualizado com sucesso',
|
||||
'users_avatar' => 'Imagem de Usuário',
|
||||
'users_avatar_desc' => 'Essa imagem deve ser um quadrado com aproximadamente 256px de altura e largura.',
|
||||
'users_preferred_language' => 'Linguagem de Preferência',
|
||||
'users_social_accounts' => 'Contas Sociais',
|
||||
'users_social_accounts_info' => 'Aqui você pode conectar outras contas para acesso mais rápido. Desconectar uma conta não retira a possibilidade de acesso usando-a. Para revogar o acesso ao perfil através da conta social, você deverá fazê-lo na sua conta social.',
|
||||
'users_social_connect' => 'Contas conectadas',
|
||||
|
|
|
@ -34,6 +34,8 @@ return [
|
|||
'app_homepage' => 'Домашняя страница приложения',
|
||||
'app_homepage_desc' => 'Выберите страницу, которая будет отображаться на главной странице вместо стандартной. Права на страницы игнорируются для выбранных страниц.',
|
||||
'app_homepage_default' => 'Выбрана домашняя страница по-умолчанию',
|
||||
'app_disable_comments' => 'Отключить комментарии',
|
||||
'app_disable_comments_desc' => 'Отключить комментарии на всех страницах приложения. Существующие комментарии не отображаются.',
|
||||
|
||||
/**
|
||||
* Registration
|
||||
|
|
|
@ -17,7 +17,8 @@ return [
|
|||
'name' => 'Meno',
|
||||
'description' => 'Popis',
|
||||
'role' => 'Rola',
|
||||
|
||||
'cover_image' => 'Obal knihy',
|
||||
'cover_image_description' => 'Tento obrázok by mal byť približne 300 x 170 pixelov.',
|
||||
/**
|
||||
* Actions
|
||||
*/
|
||||
|
@ -43,6 +44,7 @@ return [
|
|||
'no_items' => 'Žiadne položky nie sú dostupné',
|
||||
'back_to_top' => 'Späť nahor',
|
||||
'toggle_details' => 'Prepnúť detaily',
|
||||
'toggle_thumbnails' => 'Prepnúť náhľady',
|
||||
|
||||
/**
|
||||
* Header
|
||||
|
|
|
@ -31,6 +31,8 @@ return [
|
|||
'app_logo_desc' => 'Tento obrázok by mal mať 43px na výšku. <br>Veľké obrázky budú preškálované na menší rozmer.',
|
||||
'app_primary_color' => 'Primárna farba pre aplikáciu',
|
||||
'app_primary_color_desc' => 'Toto by mala byť hodnota v hex tvare. <br>Nechajte prázdne ak chcete použiť prednastavenú farbu.',
|
||||
'app_disable_comments' => 'Zakázať komentáre',
|
||||
'app_disable_comments_desc' => 'Zakázať komentáre na všetkých stránkach aplikácie. Existujúce komentáre sa nezobrazujú.',
|
||||
|
||||
/**
|
||||
* Registration settings
|
||||
|
@ -91,6 +93,7 @@ return [
|
|||
'users_external_auth_id' => 'Externé autentifikačné ID',
|
||||
'users_password_warning' => 'Pole nižšie vyplňte iba ak chcete zmeniť heslo:',
|
||||
'users_system_public' => 'Tento účet reprezentuje každého hosťovského používateľa, ktorý navštívi Vašu inštanciu. Nedá sa pomocou neho prihlásiť a je priradený automaticky.',
|
||||
'users_books_view_type' => 'Preferované rozloženie pre prezeranie kníh',
|
||||
'users_delete' => 'Zmazať používateľa',
|
||||
'users_delete_named' => 'Zmazať používateľa :userName',
|
||||
'users_delete_warning' => ' Toto úplne odstráni používateľa menom \':userName\' zo systému.',
|
||||
|
|
|
@ -17,11 +17,12 @@
|
|||
<div class="card">
|
||||
<h3><i class="zmdi zmdi-plus"></i> {{ trans('entities.books_create') }}</h3>
|
||||
<div class="body">
|
||||
<form action="{{ baseUrl("/books") }}" method="POST">
|
||||
<form action="{{ baseUrl("/books") }}" method="POST" enctype="multipart/form-data">
|
||||
@include('books/form')
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="margin-top large"><br></p>
|
||||
@include('components.image-manager', ['imageType' => 'cover'])
|
||||
@stop
|
|
@ -20,5 +20,5 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('components.image-manager', ['imageType' => 'cover'])
|
||||
@stop
|
|
@ -10,6 +10,26 @@
|
|||
@include('form/textarea', ['name' => 'description'])
|
||||
</div>
|
||||
|
||||
<div class="form-group" collapsible id="logo-control">
|
||||
<div class="collapse-title text-primary" collapsible-trigger>
|
||||
<label for="user-avatar">{{ trans('common.cover_image') }}</label>
|
||||
</div>
|
||||
<div class="collapse-content" collapsible-content>
|
||||
<p class="small">{{ trans('common.cover_image_description') }}</p>
|
||||
|
||||
@include('components.image-picker', [
|
||||
'resizeHeight' => '512',
|
||||
'resizeWidth' => '512',
|
||||
'showRemove' => false,
|
||||
'defaultImage' => baseUrl('/book_default_cover.png'),
|
||||
'currentImage' => @isset($model) ? $model->getBookCover() : baseUrl('/book_default_cover.png') ,
|
||||
'currentId' => @isset($model) ? $model->image_id : 0,
|
||||
'name' => 'image_id',
|
||||
'imageClass' => 'cover'
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group text-right">
|
||||
<a href="{{ isset($book) ? $book->getUrl() : baseUrl('/books') }}" class="button outline">{{ trans('common.cancel') }}</a>
|
||||
<button type="submit" class="button pos">{{ trans('entities.books_save') }}</button>
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
<div class="col-xs-12 col-sm-4 col-md-4 col-lg-4 book-grid-item" data-entity-type="book" data-entity-id="{{$book->id}}">
|
||||
<div class="featured-image-container">
|
||||
<a href="{{$book->getUrl()}}" title="{{$book->name}}">
|
||||
<img width="1600" height="900" src="{{$book->getBookCover()}}" alt="{{$book->name}}">
|
||||
</a>
|
||||
</div>
|
||||
<div class="book-grid-content">
|
||||
<h2><a href="{{$book->getUrl()}}" title="{{$book->name}}" > {{$book->getShortName(35)}} </a></h2>
|
||||
@if(isset($book->searchSnippet))
|
||||
<p >{!! $book->searchSnippet !!}</p>
|
||||
@else
|
||||
<p >{{ $book->getExcerpt(130) }}</p>
|
||||
@endif
|
||||
<div >
|
||||
<span>@include('partials.entity-meta', ['entity' => $book])</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -39,15 +39,29 @@
|
|||
@stop
|
||||
|
||||
@section('body')
|
||||
|
||||
<div class="container small" ng-non-bindable>
|
||||
@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)
|
||||
@foreach($books as $book)
|
||||
@include('books/list-item', ['book' => $book])
|
||||
<hr>
|
||||
@endforeach
|
||||
{!! $books->render() !!}
|
||||
@if($booksViewType === 'list')
|
||||
@foreach($books as $book)
|
||||
@include('books/list-item', ['book' => $book])
|
||||
<hr>
|
||||
@endforeach
|
||||
{!! $books->render() !!}
|
||||
@else
|
||||
<div class="row auto-clear">
|
||||
@foreach($books as $key => $book)
|
||||
@include('books/grid-item', ['book' => $book])
|
||||
@endforeach
|
||||
<div class="col-xs-12">
|
||||
{!! $books->render() !!}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@else
|
||||
<p class="text-muted">{{ trans('entities.books_empty') }}</p>
|
||||
@if(userCan('books-create-all'))
|
||||
|
@ -55,5 +69,4 @@
|
|||
@endif
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@stop
|
|
@ -13,54 +13,5 @@
|
|||
<button class="text-button neg" data-action="remove-image" type="button">{{ trans('common.remove') }}</button>
|
||||
@endif
|
||||
|
||||
<input type="hidden" name="{{$name}}" id="{{$name}}" value="{{ isset($currentId) && ($currentId !== '' && $currentId !== false) ? $currentId : $currentImage}}">
|
||||
<input type="hidden" name="{{$name}}" id="{{$name}}" value="{{ isset($currentId) && ($currentId !== 0 && $currentId !== false) ? $currentId : $currentImage}}">
|
||||
</div>
|
||||
|
||||
<script>
|
||||
(function(){
|
||||
|
||||
var picker = document.querySelector('[image-picker="{{$name}}"]');
|
||||
picker.addEventListener('click', function(event) {
|
||||
if (event.target.nodeName.toLowerCase() !== 'button') return;
|
||||
var button = event.target;
|
||||
var action = button.getAttribute('data-action');
|
||||
var resize = picker.getAttribute('data-resize-height') && picker.getAttribute('data-resize-width');
|
||||
var usingIds = picker.getAttribute('data-current-id') !== '';
|
||||
var resizeCrop = picker.getAttribute('data-resize-crop') !== '';
|
||||
var imageElem = picker.querySelector('img');
|
||||
var input = picker.querySelector('input');
|
||||
|
||||
function setImage(image) {
|
||||
if (image === 'none') {
|
||||
imageElem.src = picker.getAttribute('data-default-image');
|
||||
imageElem.classList.add('none');
|
||||
input.value = 'none';
|
||||
return;
|
||||
}
|
||||
imageElem.src = image.url;
|
||||
input.value = usingIds ? image.id : image.url;
|
||||
imageElem.classList.remove('none');
|
||||
}
|
||||
|
||||
if (action === 'show-image-manager') {
|
||||
window.ImageManager.show((image) => {
|
||||
if (!resize) {
|
||||
setImage(image);
|
||||
return;
|
||||
}
|
||||
var requestString = '/images/thumb/' + image.id + '/' + picker.getAttribute('data-resize-width') + '/' + picker.getAttribute('data-resize-height') + '/' + (resizeCrop ? 'true' : 'false');
|
||||
$.get(window.baseUrl(requestString), resp => {
|
||||
image.url = resp.url;
|
||||
setImage(image);
|
||||
});
|
||||
});
|
||||
} else if (action === 'reset-image') {
|
||||
setImage({id: 0, url: picker.getAttribute('data-default-image')});
|
||||
} else if (action === 'remove-image') {
|
||||
setImage('none');
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
})();
|
||||
</script>
|
|
@ -19,11 +19,11 @@
|
|||
<div v-for="(tag, i) in tags" :key="tag.key" class="card drag-card">
|
||||
<div class="handle" ><i class="zmdi zmdi-menu"></i></div>
|
||||
<div>
|
||||
<autosuggest url="/ajax/tags/suggest/names" type="name" class="outline" :name="getTagFieldName(i, 'name')"
|
||||
<autosuggest url="{{ baseUrl('/ajax/tags/suggest/names') }}" type="name" class="outline" :name="getTagFieldName(i, 'name')"
|
||||
v-model="tag.name" @input="tagChange(tag)" @blur="tagBlur(tag)" placeholder="{{ trans('entities.tag') }}"/>
|
||||
</div>
|
||||
<div>
|
||||
<autosuggest url="/ajax/tags/suggest/values" type="value" class="outline" :name="getTagFieldName(i, 'value')"
|
||||
<autosuggest url="{{ baseUrl('/ajax/tags/suggest/values') }}" type="value" class="outline" :name="getTagFieldName(i, 'value')"
|
||||
v-model="tag.value" @change="tagChange(tag)" @blur="tagBlur(tag)" placeholder="{{ trans('entities.tag_value') }}"/>
|
||||
</div>
|
||||
<div v-show="tags.length !== 1" class="text-center drag-card-action text-neg" @click="removeTag(tag)"><i class="zmdi zmdi-close"></i></div>
|
||||
|
|
|
@ -97,8 +97,7 @@
|
|||
<div class="editor-toolbar">
|
||||
<div class="">{{ trans('entities.pages_md_preview') }}</div>
|
||||
</div>
|
||||
<div class="markdown-display">
|
||||
<div class="page-content"></div>
|
||||
<div class="markdown-display page-content">
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="html"/>
|
||||
|
|
|
@ -148,10 +148,11 @@
|
|||
@include('pages/page-display')
|
||||
|
||||
</div>
|
||||
|
||||
<div class="container small nopad">
|
||||
@include('comments/comments', ['page' => $page])
|
||||
</div>
|
||||
@if ($commentsEnabled)
|
||||
<div class="container small nopad">
|
||||
@include('comments/comments', ['page' => $page])
|
||||
</div>
|
||||
@endif
|
||||
@stop
|
||||
|
||||
@section('scripts')
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
@if(setting('app-custom-head', false))
|
||||
<!-- Custom user content -->
|
||||
{!! setting('app-custom-head') !!}
|
||||
<!-- End custom user content -->
|
||||
@endif
|
|
@ -7,6 +7,7 @@
|
|||
}
|
||||
.button-base, .button, input[type="button"], input[type="submit"] {
|
||||
background-color: {{ setting('app-color') }};
|
||||
border-color: {{ setting('app-color') }};
|
||||
}
|
||||
.button-base:hover, .button:hover, input[type="button"]:hover, input[type="submit"]:hover, .button:focus {
|
||||
background-color: {{ setting('app-color') }};
|
||||
|
|
|
@ -38,6 +38,11 @@
|
|||
<p class="small">{{ trans('settings.app_secure_images_desc') }}</p>
|
||||
@include('components.toggle-switch', ['name' => 'setting-app-secure-images', 'value' => setting('app-secure-images')])
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>{{ trans('settings.app_disable_comments') }}</label>
|
||||
<p class="small">{{ trans('settings.app_disable_comments_desc') }}</p>
|
||||
@include('components.toggle-switch', ['name' => 'setting-app-disable-comments', 'value' => setting('app-disable-comments')])
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="setting-app-editor">{{ trans('settings.app_editor') }}</label>
|
||||
<p class="small">{{ trans('settings.app_editor_desc') }}</p>
|
||||
|
|
|
@ -43,6 +43,13 @@
|
|||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="books-view-type">{{ trans('settings.users_books_view_type') }}</label>
|
||||
<select name="setting[books_view_type]" id="books-view-type">
|
||||
<option @if(setting()->getUser($user, 'books_view_type', 'list') === 'list') selected @endif value="list">List</option>
|
||||
<option @if(setting()->getUser($user, 'books_view_type', 'list') === 'grid') selected @endif value="grid">Grid</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group text-right">
|
||||
|
|
|
@ -135,6 +135,7 @@ Route::group(['middleware' => 'auth'], function () {
|
|||
// Other Pages
|
||||
Route::get('/', 'HomeController@index');
|
||||
Route::get('/home', 'HomeController@index');
|
||||
Route::get('/custom-head-content', 'HomeController@customHeadContent');
|
||||
|
||||
// Settings
|
||||
Route::group(['prefix' => 'settings'], function() {
|
||||
|
|
|
@ -124,6 +124,45 @@ class AuthTest extends BrowserKitTest
|
|||
->press('Create Account')
|
||||
->seePageIs('/register/confirm')
|
||||
->seeInDatabase('users', ['name' => $user->name, 'email' => $user->email, 'email_confirmed' => false]);
|
||||
|
||||
$this->visit('/')->seePageIs('/login')
|
||||
->type($user->email, '#email')
|
||||
->type($user->password, '#password')
|
||||
->press('Log In')
|
||||
->seePageIs('/register/confirm/awaiting')
|
||||
->seeText('Email Address Not Confirmed');
|
||||
}
|
||||
|
||||
public function test_restricted_registration_with_confirmation_disabled()
|
||||
{
|
||||
$this->setSettings(['registration-enabled' => 'true', 'registration-confirmation' => 'false', 'registration-restrict' => 'example.com']);
|
||||
$user = factory(\BookStack\User::class)->make();
|
||||
// Go through registration process
|
||||
$this->visit('/register')
|
||||
->type($user->name, '#name')
|
||||
->type($user->email, '#email')
|
||||
->type($user->password, '#password')
|
||||
->press('Create Account')
|
||||
->seePageIs('/register')
|
||||
->dontSeeInDatabase('users', ['email' => $user->email])
|
||||
->see('That email domain does not have access to this application');
|
||||
|
||||
$user->email = 'barry@example.com';
|
||||
|
||||
$this->visit('/register')
|
||||
->type($user->name, '#name')
|
||||
->type($user->email, '#email')
|
||||
->type($user->password, '#password')
|
||||
->press('Create Account')
|
||||
->seePageIs('/register/confirm')
|
||||
->seeInDatabase('users', ['name' => $user->name, 'email' => $user->email, 'email_confirmed' => false]);
|
||||
|
||||
$this->visit('/')->seePageIs('/login')
|
||||
->type($user->email, '#email')
|
||||
->type($user->password, '#password')
|
||||
->press('Log In')
|
||||
->seePageIs('/register/confirm/awaiting')
|
||||
->seeText('Email Address Not Confirmed');
|
||||
}
|
||||
|
||||
public function test_user_creation()
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
use BookStack\Entity;
|
||||
use BookStack\Role;
|
||||
use BookStack\Services\PermissionService;
|
||||
use BookStack\User;
|
||||
use Illuminate\Contracts\Console\Kernel;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
use Laravel\BrowserKitTesting\TestCase;
|
||||
|
@ -129,15 +130,25 @@ abstract class BrowserKitTest extends TestCase
|
|||
}
|
||||
|
||||
/**
|
||||
* Quick way to create a new user
|
||||
* Get an instance of a user with 'editor' permissions
|
||||
* @param array $attributes
|
||||
* @return mixed
|
||||
*/
|
||||
protected function getEditor($attributes = [])
|
||||
{
|
||||
$user = factory(\BookStack\User::class)->create($attributes);
|
||||
$role = Role::getRole('editor');
|
||||
$user->attachRole($role);;
|
||||
$user = \BookStack\Role::getRole('editor')->users()->first();
|
||||
if (!empty($attributes)) $user->forceFill($attributes)->save();
|
||||
return $user;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an instance of a user with 'viewer' permissions
|
||||
* @return mixed
|
||||
*/
|
||||
protected function getViewer()
|
||||
{
|
||||
$user = \BookStack\Role::getRole('viewer')->users()->first();
|
||||
if (!empty($attributes)) $user->forceFill($attributes)->save();
|
||||
return $user;
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
<?php namespace Tests;
|
||||
|
||||
class CommentSettingTest extends BrowserKitTest {
|
||||
protected $page;
|
||||
|
||||
public function setUp() {
|
||||
parent::setUp();
|
||||
$this->page = \BookStack\Page::first();
|
||||
}
|
||||
|
||||
public function test_comment_disable () {
|
||||
$this->asAdmin();
|
||||
|
||||
$this->setSettings(['app-disable-comments' => 'true']);
|
||||
|
||||
$this->asAdmin()->visit($this->page->getUrl())
|
||||
->pageNotHasElement('.comments-list');
|
||||
}
|
||||
|
||||
public function test_comment_enable () {
|
||||
$this->asAdmin();
|
||||
|
||||
$this->setSettings(['app-disable-comments' => 'false']);
|
||||
|
||||
$this->asAdmin()->visit($this->page->getUrl())
|
||||
->pageHasElement('.comments-list');
|
||||
}
|
||||
}
|
|
@ -11,7 +11,6 @@ class EntityTest extends BrowserKitTest
|
|||
|
||||
public function test_entity_creation()
|
||||
{
|
||||
|
||||
// Test Creation
|
||||
$book = $this->bookCreation();
|
||||
$chapter = $this->chapterCreation($book);
|
||||
|
@ -257,4 +256,25 @@ class EntityTest extends BrowserKitTest
|
|||
->seeInElement('#recently-updated-pages', $page->name);
|
||||
}
|
||||
|
||||
public function test_slug_multi_byte_lower_casing()
|
||||
{
|
||||
$entityRepo = app(EntityRepo::class);
|
||||
$book = $entityRepo->createFromInput('book', [
|
||||
'name' => 'КНИГА'
|
||||
]);
|
||||
|
||||
$this->assertEquals('книга', $book->slug);
|
||||
}
|
||||
|
||||
|
||||
public function test_slug_format()
|
||||
{
|
||||
$entityRepo = app(EntityRepo::class);
|
||||
$book = $entityRepo->createFromInput('book', [
|
||||
'name' => 'PartA / PartB / PartC'
|
||||
]);
|
||||
|
||||
$this->assertEquals('parta-partb-partc', $book->slug);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue