]> BookStack Code Mirror - bookstack/commitdiff
Merge branch 'unicode' of git://github.com/kostasdizas/BookStack into kostasdizas...
authorDan Brown <redacted>
Sun, 18 Aug 2019 17:51:20 +0000 (18:51 +0100)
committerDan Brown <redacted>
Sun, 18 Aug 2019 17:51:20 +0000 (18:51 +0100)
195 files changed:
.env.example.complete
app/Application.php [new file with mode: 0644]
app/Auth/Access/EmailConfirmationService.php
app/Auth/Access/UserInviteService.php [new file with mode: 0644]
app/Auth/Access/UserTokenService.php [new file with mode: 0644]
app/Auth/User.php
app/Config/app.php [moved from config/app.php with 98% similarity]
app/Config/auth.php [moved from config/auth.php with 100% similarity]
app/Config/broadcasting.php [moved from config/broadcasting.php with 100% similarity]
app/Config/cache.php [moved from config/cache.php with 100% similarity]
app/Config/database.php [moved from config/database.php with 100% similarity]
app/Config/debugbar.php [new file with mode: 0644]
app/Config/dompdf.php [moved from config/dompdf.php with 100% similarity]
app/Config/filesystems.php [moved from config/filesystems.php with 88% similarity]
app/Config/mail.php [moved from config/mail.php with 100% similarity]
app/Config/queue.php [moved from config/queue.php with 100% similarity]
app/Config/services.php [moved from config/services.php with 100% similarity]
app/Config/session.php [moved from config/session.php with 100% similarity]
app/Config/setting-defaults.php [moved from config/setting-defaults.php with 100% similarity]
app/Config/snappy.php [moved from config/snappy.php with 100% similarity]
app/Config/view.php [moved from config/view.php with 100% similarity]
app/Entities/Book.php
app/Entities/Bookshelf.php
app/Entities/Chapter.php
app/Entities/Page.php
app/Entities/Repos/EntityRepo.php
app/Entities/Repos/PageRepo.php
app/Exceptions/UserTokenExpiredException.php [new file with mode: 0644]
app/Exceptions/UserTokenNotFoundException.php [new file with mode: 0644]
app/Http/Controllers/Auth/ConfirmEmailController.php [new file with mode: 0644]
app/Http/Controllers/Auth/LoginController.php
app/Http/Controllers/Auth/RegisterController.php
app/Http/Controllers/Auth/UserInviteController.php [new file with mode: 0644]
app/Http/Controllers/HomeController.php
app/Http/Controllers/PageController.php
app/Http/Controllers/PageTemplateController.php [new file with mode: 0644]
app/Http/Controllers/SearchController.php
app/Http/Controllers/UserController.php
app/Http/Middleware/Authenticate.php
app/Http/Middleware/Localization.php
app/Http/Request.php [new file with mode: 0644]
app/Notifications/ConfirmEmail.php
app/Notifications/ResetPassword.php
app/Notifications/UserInvite.php [new file with mode: 0644]
app/Providers/AppServiceProvider.php
app/Providers/PaginationServiceProvider.php
app/Uploads/Attachment.php
app/Uploads/AttachmentService.php
app/Uploads/ImageService.php
app/helpers.php
bootstrap/app.php
database/migrations/2019_07_07_112515_add_template_support.php [new file with mode: 0644]
database/migrations/2019_08_17_140214_add_user_invites_table.php [new file with mode: 0644]
phpunit.xml
public/.htaccess
public/index.php
public/uploads/.gitignore
public/uploads/.htaccess [new file with mode: 0755]
readme.md
resources/assets/icons/chevron-down.svg [new file with mode: 0644]
resources/assets/icons/copy.svg
resources/assets/icons/link.svg
resources/assets/icons/template.svg [new file with mode: 0644]
resources/assets/js/components/entity-permissions-editor.js [new file with mode: 0644]
resources/assets/js/components/index.js
resources/assets/js/components/markdown-editor.js
resources/assets/js/components/new-user-password.js [new file with mode: 0644]
resources/assets/js/components/page-display.js
resources/assets/js/components/template-manager.js [new file with mode: 0644]
resources/assets/js/components/toggle-switch.js
resources/assets/js/components/tri-layout.js
resources/assets/js/components/wysiwyg-editor.js
resources/assets/js/index.js
resources/assets/js/services/animations.js
resources/assets/js/services/translations.js
resources/assets/js/vues/components/dropzone.js
resources/assets/js/vues/page-editor.js
resources/assets/sass/_blocks.scss
resources/assets/sass/_components.scss
resources/assets/sass/_header.scss
resources/assets/sass/_layout.scss
resources/assets/sass/_lists.scss
resources/assets/sass/_pages.scss
resources/assets/sass/_text.scss
resources/assets/sass/_tinymce.scss
resources/lang/de/activities.php
resources/lang/de/auth.php
resources/lang/de/common.php
resources/lang/de/entities.php
resources/lang/de/errors.php
resources/lang/de/settings.php
resources/lang/de/validation.php
resources/lang/en/auth.php
resources/lang/en/entities.php
resources/lang/en/errors.php
resources/lang/en/settings.php
resources/lang/fr/auth.php
resources/lang/fr/common.php
resources/lang/fr/entities.php
resources/lang/fr/settings.php
resources/lang/fr/validation.php
resources/lang/hu/activities.php [new file with mode: 0644]
resources/lang/hu/auth.php [new file with mode: 0644]
resources/lang/hu/common.php [new file with mode: 0644]
resources/lang/hu/components.php [new file with mode: 0644]
resources/lang/hu/entities.php [new file with mode: 0644]
resources/lang/hu/errors.php [new file with mode: 0644]
resources/lang/hu/pagination.php [new file with mode: 0644]
resources/lang/hu/passwords.php [new file with mode: 0644]
resources/lang/hu/settings.php [new file with mode: 0644]
resources/lang/hu/validation.php [new file with mode: 0644]
resources/lang/pt_BR/activities.php
resources/lang/pt_BR/auth.php
resources/lang/pt_BR/common.php
resources/lang/pt_BR/components.php
resources/lang/pt_BR/entities.php
resources/lang/pt_BR/errors.php
resources/lang/pt_BR/pagination.php
resources/lang/pt_BR/passwords.php
resources/lang/pt_BR/settings.php
resources/lang/pt_BR/validation.php
resources/views/auth/forms/login/standard.blade.php
resources/views/auth/invite-set-password.blade.php [new file with mode: 0644]
resources/views/auth/login.blade.php
resources/views/auth/passwords/email.blade.php
resources/views/auth/passwords/reset.blade.php
resources/views/auth/register.blade.php
resources/views/auth/user-unconfirmed.blade.php
resources/views/base.blade.php
resources/views/books/create.blade.php
resources/views/books/form.blade.php
resources/views/books/index.blade.php
resources/views/books/list.blade.php
resources/views/comments/comments.blade.php
resources/views/common/header.blade.php
resources/views/common/home-sidebar.blade.php
resources/views/common/home.blade.php
resources/views/components/expand-toggle.blade.php
resources/views/components/image-manager.blade.php
resources/views/components/page-picker.blade.php
resources/views/components/tag-list.blade.php
resources/views/components/tag-manager.blade.php
resources/views/errors/404.blade.php
resources/views/errors/500.blade.php
resources/views/form/entity-permissions.blade.php
resources/views/form/text.blade.php
resources/views/pages/attachment-manager.blade.php [new file with mode: 0644]
resources/views/pages/edit.blade.php
resources/views/pages/editor-toolbox.blade.php [new file with mode: 0644]
resources/views/pages/form-toolbox.blade.php [deleted file]
resources/views/pages/form.blade.php
resources/views/pages/markdown-editor.blade.php [new file with mode: 0644]
resources/views/pages/pointer.blade.php [new file with mode: 0644]
resources/views/pages/show.blade.php
resources/views/pages/template-manager-list.blade.php [new file with mode: 0644]
resources/views/pages/template-manager.blade.php [new file with mode: 0644]
resources/views/pages/wysiwyg-editor.blade.php [new file with mode: 0644]
resources/views/partials/breadcrumbs.blade.php
resources/views/partials/sort.blade.php
resources/views/partials/view-toggle.blade.php
resources/views/search/all.blade.php
resources/views/settings/index.blade.php
resources/views/settings/maintenance.blade.php
resources/views/settings/navbar.blade.php
resources/views/settings/roles/create.blade.php
resources/views/settings/roles/delete.blade.php
resources/views/settings/roles/edit.blade.php
resources/views/settings/roles/form.blade.php
resources/views/settings/roles/index.blade.php
resources/views/shelves/create.blade.php
resources/views/shelves/form.blade.php
resources/views/shelves/index.blade.php
resources/views/shelves/list.blade.php
resources/views/users/create.blade.php
resources/views/users/delete.blade.php
resources/views/users/edit.blade.php
resources/views/users/form.blade.php
resources/views/users/index.blade.php
resources/views/users/profile.blade.php
resources/views/vendor/notifications/email.blade.php
routes/web.php
tests/Auth/AuthTest.php
tests/Auth/UserInviteTest.php [new file with mode: 0644]
tests/Entity/ExportTest.php
tests/Entity/PageContentTest.php
tests/Entity/PageTemplateTest.php [new file with mode: 0644]
tests/LanguageTest.php
tests/Permissions/RolesTest.php
tests/SharedTestHelpers.php
tests/Unit/ConfigTest.php [new file with mode: 0644]
tests/Unit/HelpersTest.php [deleted file]
tests/Unit/PageRepoTest.php
tests/Unit/UrlTest.php [new file with mode: 0644]
tests/Uploads/ImageTest.php
version

index 37421a419e5485c3f4e6d612bf08236e3a0f2159..829a7509b2a3fa31229017180f776e2347679adb 100644 (file)
@@ -95,6 +95,16 @@ QUEUE_DRIVER=sync
 # Can be 'local', 'local_secure' or 's3'
 STORAGE_TYPE=local
 
+# Image storage system to use
+# Defaults to the value of STORAGE_TYPE if unset.
+# Accepts the same values as STORAGE_TYPE.
+STORAGE_IMAGE_TYPE=local
+
+# Attachment storage system to use
+# Defaults to the value of STORAGE_TYPE if unset.
+# Accepts the same values as STORAGE_TYPE although 'local' will be forced to 'local_secure'.
+STORAGE_ATTACHMENT_TYPE=local_secure
+
 # Amazon S3 storage configuration
 STORAGE_S3_KEY=your-s3-key
 STORAGE_S3_SECRET=your-s3-secret
diff --git a/app/Application.php b/app/Application.php
new file mode 100644 (file)
index 0000000..8c56e9d
--- /dev/null
@@ -0,0 +1,19 @@
+<?php
+
+namespace BookStack;
+
+class Application extends \Illuminate\Foundation\Application
+{
+
+    /**
+     * Get the path to the application configuration files.
+     *
+     * @param  string  $path Optionally, a path to append to the config path
+     * @return string
+     */
+    public function configPath($path = '')
+    {
+        return $this->basePath.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'Config'.($path ? DIRECTORY_SEPARATOR.$path : $path);
+    }
+
+}
\ No newline at end of file
index 4df014116c5c3d1c393e6e4594923c0d65a5d519..a94c54d19b4258c7e6fd771c4fdf71c9aa11df1a 100644 (file)
@@ -1,33 +1,18 @@
 <?php namespace BookStack\Auth\Access;
 
 use BookStack\Auth\User;
-use BookStack\Auth\UserRepo;
 use BookStack\Exceptions\ConfirmationEmailException;
-use BookStack\Exceptions\UserRegistrationException;
 use BookStack\Notifications\ConfirmEmail;
-use Carbon\Carbon;
-use Illuminate\Database\Connection as Database;
 
-class EmailConfirmationService
+class EmailConfirmationService extends UserTokenService
 {
-    protected $db;
-    protected $users;
-
-    /**
-     * EmailConfirmationService constructor.
-     * @param Database $db
-     * @param \BookStack\Auth\UserRepo $users
-     */
-    public function __construct(Database $db, UserRepo $users)
-    {
-        $this->db = $db;
-        $this->users = $users;
-    }
+    protected $tokenTable = 'email_confirmations';
+    protected $expiryTime = 24;
 
     /**
      * Create new confirmation for a user,
      * Also removes any existing old ones.
-     * @param \BookStack\Auth\User $user
+     * @param User $user
      * @throws ConfirmationEmailException
      */
     public function sendConfirmation(User $user)
@@ -36,76 +21,20 @@ class EmailConfirmationService
             throw new ConfirmationEmailException(trans('errors.email_already_confirmed'), '/login');
         }
 
-        $this->deleteConfirmationsByUser($user);
-        $token = $this->createEmailConfirmation($user);
+        $this->deleteByUser($user);
+        $token = $this->createTokenForUser($user);
 
         $user->notify(new ConfirmEmail($token));
     }
 
     /**
-     * Creates a new email confirmation in the database and returns the token.
-     * @param User $user
-     * @return string
+     * Check if confirmation is required in this instance.
+     * @return bool
      */
-    public function createEmailConfirmation(User $user)
+    public function confirmationRequired() : bool
     {
-        $token = $this->getToken();
-        $this->db->table('email_confirmations')->insert([
-            'user_id' => $user->id,
-            'token' => $token,
-            'created_at' => Carbon::now(),
-            'updated_at' => Carbon::now()
-        ]);
-        return $token;
+        return setting('registration-confirmation')
+            || setting('registration-restrict');
     }
 
-    /**
-     * Gets an email confirmation by looking up the token,
-     * Ensures the token has not expired.
-     * @param string $token
-     * @return array|null|\stdClass
-     * @throws UserRegistrationException
-     */
-    public function getEmailConfirmationFromToken($token)
-    {
-        $emailConfirmation = $this->db->table('email_confirmations')->where('token', '=', $token)->first();
-
-        // If not found show error
-        if ($emailConfirmation === null) {
-            throw new UserRegistrationException(trans('errors.email_confirmation_invalid'), '/register');
-        }
-
-        // If more than a day old
-        if (Carbon::now()->subDay()->gt(new Carbon($emailConfirmation->created_at))) {
-            $user = $this->users->getById($emailConfirmation->user_id);
-            $this->sendConfirmation($user);
-            throw new UserRegistrationException(trans('errors.email_confirmation_expired'), '/register/confirm');
-        }
-
-        $emailConfirmation->user = $this->users->getById($emailConfirmation->user_id);
-        return $emailConfirmation;
-    }
-
-    /**
-     * Delete all email confirmations that belong to a user.
-     * @param \BookStack\Auth\User $user
-     * @return mixed
-     */
-    public function deleteConfirmationsByUser(User $user)
-    {
-        return $this->db->table('email_confirmations')->where('user_id', '=', $user->id)->delete();
-    }
-
-    /**
-     * Creates a unique token within the email confirmation database.
-     * @return string
-     */
-    protected function getToken()
-    {
-        $token = str_random(24);
-        while ($this->db->table('email_confirmations')->where('token', '=', $token)->exists()) {
-            $token = str_random(25);
-        }
-        return $token;
-    }
 }
diff --git a/app/Auth/Access/UserInviteService.php b/app/Auth/Access/UserInviteService.php
new file mode 100644 (file)
index 0000000..8e04d7b
--- /dev/null
@@ -0,0 +1,23 @@
+<?php namespace BookStack\Auth\Access;
+
+use BookStack\Auth\User;
+use BookStack\Notifications\UserInvite;
+
+class UserInviteService extends UserTokenService
+{
+    protected $tokenTable = 'user_invites';
+    protected $expiryTime = 336; // Two weeks
+
+    /**
+     * Send an invitation to a user to sign into BookStack
+     * Removes existing invitation tokens.
+     * @param User $user
+     */
+    public function sendInvitation(User $user)
+    {
+        $this->deleteByUser($user);
+        $token = $this->createTokenForUser($user);
+        $user->notify(new UserInvite($token));
+    }
+
+}
diff --git a/app/Auth/Access/UserTokenService.php b/app/Auth/Access/UserTokenService.php
new file mode 100644 (file)
index 0000000..34f3b28
--- /dev/null
@@ -0,0 +1,134 @@
+<?php namespace BookStack\Auth\Access;
+
+use BookStack\Auth\User;
+use BookStack\Exceptions\UserTokenExpiredException;
+use BookStack\Exceptions\UserTokenNotFoundException;
+use Carbon\Carbon;
+use Illuminate\Database\Connection as Database;
+use stdClass;
+
+class UserTokenService
+{
+
+    /**
+     * Name of table where user tokens are stored.
+     * @var string
+     */
+    protected $tokenTable = 'user_tokens';
+
+    /**
+     * Token expiry time in hours.
+     * @var int
+     */
+    protected $expiryTime = 24;
+
+    protected $db;
+
+    /**
+     * UserTokenService constructor.
+     * @param Database $db
+     */
+    public function __construct(Database $db)
+    {
+        $this->db = $db;
+    }
+
+    /**
+     * Delete all email confirmations that belong to a user.
+     * @param User $user
+     * @return mixed
+     */
+    public function deleteByUser(User $user)
+    {
+        return $this->db->table($this->tokenTable)
+            ->where('user_id', '=', $user->id)
+            ->delete();
+    }
+
+    /**
+     * Get the user id from a token, while check the token exists and has not expired.
+     * @param string $token
+     * @return int
+     * @throws UserTokenNotFoundException
+     * @throws UserTokenExpiredException
+     */
+    public function checkTokenAndGetUserId(string $token) : int
+    {
+        $entry = $this->getEntryByToken($token);
+
+        if (is_null($entry)) {
+            throw new UserTokenNotFoundException('Token "' . $token . '" not found');
+        }
+
+        if ($this->entryExpired($entry)) {
+            throw new UserTokenExpiredException("Token of id {$entry->id} has expired.", $entry->user_id);
+        }
+
+        return $entry->user_id;
+    }
+
+    /**
+     * Creates a unique token within the email confirmation database.
+     * @return string
+     */
+    protected function generateToken() : string
+    {
+        $token = str_random(24);
+        while ($this->tokenExists($token)) {
+            $token = str_random(25);
+        }
+        return $token;
+    }
+
+    /**
+     * Generate and store a token for the given user.
+     * @param User $user
+     * @return string
+     */
+    protected function createTokenForUser(User $user) : string
+    {
+        $token = $this->generateToken();
+        $this->db->table($this->tokenTable)->insert([
+            'user_id' => $user->id,
+            'token' => $token,
+            'created_at' => Carbon::now(),
+            'updated_at' => Carbon::now()
+        ]);
+        return $token;
+    }
+
+    /**
+     * Check if the given token exists.
+     * @param string $token
+     * @return bool
+     */
+    protected function tokenExists(string $token) : bool
+    {
+        return $this->db->table($this->tokenTable)
+            ->where('token', '=', $token)->exists();
+    }
+
+    /**
+     * Get a token entry for the given token.
+     * @param string $token
+     * @return object|null
+     */
+    protected function getEntryByToken(string $token)
+    {
+        return $this->db->table($this->tokenTable)
+            ->where('token', '=', $token)
+            ->first();
+    }
+
+    /**
+     * Check if the given token entry has expired.
+     * @param stdClass $tokenEntry
+     * @return bool
+     */
+    protected function entryExpired(stdClass $tokenEntry) : bool
+    {
+        return Carbon::now()->subHours($this->expiryTime)
+            ->gt(new Carbon($tokenEntry->created_at));
+    }
+
+}
\ No newline at end of file
index 259b8eec01375992d3fa4b0f6466397d3f7cbb5a..7ad14d9f0c2a495646eb4a4151f958a4a5e2fbf2 100644 (file)
@@ -3,6 +3,7 @@
 use BookStack\Model;
 use BookStack\Notifications\ResetPassword;
 use BookStack\Uploads\Image;
+use Carbon\Carbon;
 use Illuminate\Auth\Authenticatable;
 use Illuminate\Auth\Passwords\CanResetPassword;
 use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
@@ -10,6 +11,20 @@ use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
 use Illuminate\Database\Eloquent\Relations\BelongsToMany;
 use Illuminate\Notifications\Notifiable;
 
+/**
+ * Class User
+ * @package BookStack\Auth
+ * @property string $id
+ * @property string $name
+ * @property string $email
+ * @property string $password
+ * @property Carbon $created_at
+ * @property Carbon $updated_at
+ * @property bool $email_confirmed
+ * @property int $image_id
+ * @property string $external_auth_id
+ * @property string $system_name
+ */
 class User extends Model implements AuthenticatableContract, CanResetPasswordContract
 {
     use Authenticatable, CanResetPassword, Notifiable;
@@ -168,14 +183,14 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
      */
     public function getAvatar($size = 50)
     {
-        $default = baseUrl('/user_avatar.png');
+        $default = url('/user_avatar.png');
         $imageId = $this->image_id;
         if ($imageId === 0 || $imageId === '0' || $imageId === null) {
             return $default;
         }
 
         try {
-            $avatar = $this->avatar ? baseUrl($this->avatar->getThumb($size, $size, false)) : $default;
+            $avatar = $this->avatar ? url($this->avatar->getThumb($size, $size, false)) : $default;
         } catch (\Exception $err) {
             $avatar = $default;
         }
@@ -197,7 +212,7 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
      */
     public function getEditUrl()
     {
-        return baseUrl('/settings/users/' . $this->id);
+        return url('/settings/users/' . $this->id);
     }
 
     /**
@@ -206,7 +221,7 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
      */
     public function getProfileUrl()
     {
-        return baseUrl('/user/' . $this->id);
+        return url('/user/' . $this->id);
     }
 
     /**
similarity index 98%
rename from config/app.php
rename to app/Config/app.php
index aaeafb98df291e6925d6ade1d283d1fcb9804379..88052e94caf0f56c7d4bbf29e77d5e85b5ac1971 100755 (executable)
@@ -52,7 +52,7 @@ return [
     'locale' => env('APP_LANG', 'en'),
 
     // Locales available
-    'locales' => ['en', 'ar', 'de', 'de_informal', 'es', 'es_AR', 'fr', 'nl', 'pt_BR', 'sk', 'cs', 'sv', 'kr', 'ja', 'pl', 'it', 'ru', 'uk', 'zh_CN', 'zh_TW'],
+    'locales' => ['en', 'ar', 'de', 'de_informal', 'es', 'es_AR', 'fr', 'hu', 'nl', 'pt_BR', 'sk', 'cs', 'sv', 'kr', 'ja', 'pl', 'it', 'ru', 'uk', 'zh_CN', 'zh_TW'],
 
     //  Application Fallback Locale
     'fallback_locale' => 'en',
similarity index 100%
rename from config/auth.php
rename to app/Config/auth.php
similarity index 100%
rename from config/cache.php
rename to app/Config/cache.php
similarity index 100%
rename from config/database.php
rename to app/Config/database.php
diff --git a/app/Config/debugbar.php b/app/Config/debugbar.php
new file mode 100644 (file)
index 0000000..ec942dc
--- /dev/null
@@ -0,0 +1,132 @@
+<?php
+
+/**
+ * Debugbar Configuration Options
+ *
+ * Changes to these config files are not supported by BookStack and may break upon updates.
+ * Configuration should be altered via the `.env` file or environment variables.
+ * Do not edit this file unless you're happy to maintain any changes yourself.
+ */
+
+return [
+
+     // Debugbar is enabled by default, when debug is set to true in app.php.
+     // You can override the value by setting enable to true or false instead of null.
+     //
+     // You can provide an array of URI's that must be ignored (eg. 'api/*')
+    'enabled' => env('DEBUGBAR_ENABLED', false),
+    'except' => [
+        'telescope*'
+    ],
+
+
+     // DebugBar stores data for session/ajax requests.
+     // You can disable this, so the debugbar stores data in headers/session,
+     // but this can cause problems with large data collectors.
+     // By default, file storage (in the storage folder) is used. Redis and PDO
+     // can also be used. For PDO, run the package migrations first.
+    'storage' => [
+        'enabled'    => true,
+        'driver'     => 'file', // redis, file, pdo, custom
+        'path'       => storage_path('debugbar'), // For file driver
+        'connection' => null,   // Leave null for default connection (Redis/PDO)
+        'provider'   => '' // Instance of StorageInterface for custom driver
+    ],
+
+     // Vendor files are included by default, but can be set to false.
+     // This can also be set to 'js' or 'css', to only include javascript or css vendor files.
+     // Vendor files are for css: font-awesome (including fonts) and highlight.js (css files)
+     // and for js: jquery and and highlight.js
+     // So if you want syntax highlighting, set it to true.
+     // jQuery is set to not conflict with existing jQuery scripts.
+    'include_vendors' => true,
+
+     // The Debugbar can capture Ajax requests and display them. If you don't want this (ie. because of errors),
+     // you can use this option to disable sending the data through the headers.
+     // Optionally, you can also send ServerTiming headers on ajax requests for the Chrome DevTools.
+
+    'capture_ajax' => true,
+    'add_ajax_timing' => false,
+
+     // When enabled, the Debugbar shows deprecated warnings for Symfony components
+     // in the Messages tab.
+    'error_handler' => false,
+
+     // The Debugbar can emulate the Clockwork headers, so you can use the Chrome
+     // Extension, without the server-side code. It uses Debugbar collectors instead.
+    'clockwork' => false,
+
+     // Enable/disable DataCollectors
+    'collectors' => [
+        'phpinfo'         => true,  // Php version
+        'messages'        => true,  // Messages
+        'time'            => true,  // Time Datalogger
+        'memory'          => true,  // Memory usage
+        'exceptions'      => true,  // Exception displayer
+        'log'             => true,  // Logs from Monolog (merged in messages if enabled)
+        'db'              => true,  // Show database (PDO) queries and bindings
+        'views'           => true,  // Views with their data
+        'route'           => true,  // Current route information
+        'auth'            => true, // Display Laravel authentication status
+        'gate'            => true, // Display Laravel Gate checks
+        'session'         => true,  // Display session data
+        'symfony_request' => true,  // Only one can be enabled..
+        'mail'            => true,  // Catch mail messages
+        'laravel'         => false, // Laravel version and environment
+        'events'          => false, // All events fired
+        'default_request' => false, // Regular or special Symfony request logger
+        'logs'            => false, // Add the latest log messages
+        'files'           => false, // Show the included files
+        'config'          => false, // Display config settings
+        'cache'           => false, // Display cache events
+    ],
+
+     // Configure some DataCollectors
+    'options' => [
+        'auth' => [
+            'show_name' => true,   // Also show the users name/email in the debugbar
+        ],
+        'db' => [
+            'with_params'       => true,   // Render SQL with the parameters substituted
+            'backtrace'         => true,   // Use a backtrace to find the origin of the query in your files.
+            'timeline'          => false,  // Add the queries to the timeline
+            'explain' => [                 // Show EXPLAIN output on queries
+                'enabled' => false,
+                'types' => ['SELECT'],     // ['SELECT', 'INSERT', 'UPDATE', 'DELETE']; for MySQL 5.6.3+
+            ],
+            'hints'             => true,    // Show hints for common mistakes
+        ],
+        'mail' => [
+            'full_log' => false
+        ],
+        'views' => [
+            'data' => false,    //Note: Can slow down the application, because the data can be quite large..
+        ],
+        'route' => [
+            'label' => true  // show complete route on bar
+        ],
+        'logs' => [
+            'file' => null
+        ],
+        'cache' => [
+            'values' => true // collect cache values
+        ],
+    ],
+
+     // Inject Debugbar into the response
+     // Usually, the debugbar is added just before </body>, by listening to the
+     // Response after the App is done. If you disable this, you have to add them
+     // in your template yourself. See http://phpdebugbar.com/docs/rendering.html
+    'inject' => true,
+
+     // DebugBar route prefix
+     // Sometimes you want to set route prefix to be used by DebugBar to load
+     // its resources from. Usually the need comes from misconfigured web server or
+     // from trying to overcome bugs like this: http://trac.nginx.org/nginx/ticket/97
+    'route_prefix' => '_debugbar',
+
+     // DebugBar route domain
+     // By default DebugBar route served from the same domain that request served.
+     // To override default domain, specify it as a non-empty value.
+    'route_domain' => env('APP_URL', '') === 'http://bookstack.dev' ? '' : env('APP_URL', ''),
+];
similarity index 100%
rename from config/dompdf.php
rename to app/Config/dompdf.php
similarity index 88%
rename from config/filesystems.php
rename to app/Config/filesystems.php
index 13198a5052e83b02ad0cf3f939b89229f48a93a0..bd7d28300abae17112857ead07d3d000c4fd823b 100644 (file)
@@ -14,6 +14,12 @@ return [
     // Options: local, local_secure, s3
     'default' => env('STORAGE_TYPE', 'local'),
 
+    // Filesystem to use specifically for image uploads.
+    'images' => env('STORAGE_IMAGE_TYPE', env('STORAGE_TYPE', 'local')),
+
+    // Filesystem to use specifically for file attachments.
+    'attachments' => env('STORAGE_ATTACHMENT_TYPE', env('STORAGE_TYPE', 'local')),
+
     // Storage URL
     // This is the url to where the storage is located for when using an external
     // file storage service, such as s3, to store publicly accessible assets.
similarity index 100%
rename from config/mail.php
rename to app/Config/mail.php
similarity index 100%
rename from config/queue.php
rename to app/Config/queue.php
similarity index 100%
rename from config/services.php
rename to app/Config/services.php
similarity index 100%
rename from config/session.php
rename to app/Config/session.php
similarity index 100%
rename from config/snappy.php
rename to app/Config/snappy.php
similarity index 100%
rename from config/view.php
rename to app/Config/view.php
index decdde9dcf026b7e8c67d8c05b15affbcc96a015..7d3d5e4ae98bf0e670c436dba1df93fb7c86d92b 100644 (file)
@@ -25,9 +25,9 @@ class Book extends Entity
     public function getUrl($path = false)
     {
         if ($path !== false) {
-            return baseUrl('/books/' . urlencode($this->slug) . '/' . trim($path, '/'));
+            return url('/books/' . urlencode($this->slug) . '/' . trim($path, '/'));
         }
-        return baseUrl('/books/' . urlencode($this->slug));
+        return url('/books/' . urlencode($this->slug));
     }
 
     /**
@@ -44,7 +44,7 @@ class Book extends Entity
         }
 
         try {
-            $cover = $this->cover ? baseUrl($this->cover->getThumb($width, $height, false)) : $default;
+            $cover = $this->cover ? url($this->cover->getThumb($width, $height, false)) : $default;
         } catch (\Exception $err) {
             $cover = $default;
         }
index c8f8b990cde9e019b48d354ef86f1fecb1f178fa..db6685688b3bcd2e6c449338f7ac9e83eef58803 100644 (file)
@@ -39,9 +39,9 @@ class Bookshelf extends Entity
     public function getUrl($path = false)
     {
         if ($path !== false) {
-            return baseUrl('/shelves/' . urlencode($this->slug) . '/' . trim($path, '/'));
+            return url('/shelves/' . urlencode($this->slug) . '/' . trim($path, '/'));
         }
-        return baseUrl('/shelves/' . urlencode($this->slug));
+        return url('/shelves/' . urlencode($this->slug));
     }
 
     /**
@@ -59,7 +59,7 @@ class Bookshelf extends Entity
         }
 
         try {
-            $cover = $this->cover ? baseUrl($this->cover->getThumb($width, $height, false)) : $default;
+            $cover = $this->cover ? url($this->cover->getThumb($width, $height, false)) : $default;
         } catch (\Exception $err) {
             $cover = $default;
         }
index 93640475893085adff2cf8e543fb95b662b1c214..b204f1903034663e755a6ca85bb38cf7f26683f3 100644 (file)
@@ -42,10 +42,13 @@ class Chapter extends Entity
     public function getUrl($path = false)
     {
         $bookSlug = $this->getAttribute('bookSlug') ? $this->getAttribute('bookSlug') : $this->book->slug;
+        $fullPath = '/books/' . urlencode($bookSlug) . '/chapter/' . urlencode($this->slug);
+
         if ($path !== false) {
-            return baseUrl('/books/' . urlencode($bookSlug) . '/chapter/' . urlencode($this->slug) . '/' . trim($path, '/'));
+            $fullPath .= '/' . trim($path, '/');
         }
-        return baseUrl('/books/' . urlencode($bookSlug) . '/chapter/' . urlencode($this->slug));
+
+        return url($fullPath);
     }
 
     /**
index 1c2cc5cff69c29daa5385d963bc89ab2ad4612ff..c32417418b7c0a2f0cd2e61f8b4856af17c476c5 100644 (file)
@@ -96,10 +96,10 @@ class Page extends Entity
         $idComponent = $this->draft ? $this->id : urlencode($this->slug);
 
         if ($path !== false) {
-            return baseUrl('/books/' . urlencode($bookSlug) . $midText . $idComponent . '/' . trim($path, '/'));
+            return url('/books/' . urlencode($bookSlug) . $midText . $idComponent . '/' . trim($path, '/'));
         }
 
-        return baseUrl('/books/' . urlencode($bookSlug) . $midText . $idComponent);
+        return url('/books/' . urlencode($bookSlug) . $midText . $idComponent);
     }
 
     /**
index 4edd61723a2cdc8af71f51d7eafda0b0487aa264..7ca25b785286cb7f4e5e44ccbb4216c1c1881c4e 100644 (file)
@@ -760,13 +760,19 @@ class EntityRepo
         $xPath = new DOMXPath($doc);
 
         // Remove standard script tags
-        $scriptElems = $xPath->query('//body//*//script');
+        $scriptElems = $xPath->query('//script');
         foreach ($scriptElems as $scriptElem) {
             $scriptElem->parentNode->removeChild($scriptElem);
         }
 
+        // Remove data or JavaScript iFrames
+        $badIframes = $xPath->query('//*[contains(@src, \'data:\')] | //*[contains(@src, \'javascript:\')]');
+        foreach ($badIframes as $badIframe) {
+            $badIframe->parentNode->removeChild($badIframe);
+        }
+
         // Remove 'on*' attributes
-        $onAttributes = $xPath->query('//body//*/@*[starts-with(name(), \'on\')]');
+        $onAttributes = $xPath->query('//@*[starts-with(name(), \'on\')]');
         foreach ($onAttributes as $attr) {
             /** @var \DOMAttr $attr*/
             $attrName = $attr->nodeName;
index e6cb309e7978a9d8eafacf617797eaba4c73de68..ed142eb611b53f3d715722ded3bf12bdb2e4455f 100644 (file)
@@ -9,6 +9,7 @@ use Carbon\Carbon;
 use DOMDocument;
 use DOMElement;
 use DOMXPath;
+use Illuminate\Support\Collection;
 
 class PageRepo extends EntityRepo
 {
@@ -69,6 +70,10 @@ class PageRepo extends EntityRepo
             $this->tagRepo->saveTagsToEntity($page, $input['tags']);
         }
 
+        if (isset($input['template']) && userCan('templates-manage')) {
+            $page->template = ($input['template'] === 'true');
+        }
+
         // Update with new details
         $userId = user()->id;
         $page->fill($input);
@@ -85,8 +90,9 @@ class PageRepo extends EntityRepo
         $this->userUpdatePageDraftsQuery($page, $userId)->delete();
 
         // Save a revision after updating
-        if ($oldHtml !== $input['html'] || $oldName !== $input['name'] || $input['summary'] !== null) {
-            $this->savePageRevision($page, $input['summary']);
+        $summary = $input['summary'] ?? null;
+        if ($oldHtml !== $input['html'] || $oldName !== $input['name'] || $summary !== null) {
+            $this->savePageRevision($page, $summary);
         }
 
         $this->searchService->indexEntity($page);
@@ -300,6 +306,10 @@ class PageRepo extends EntityRepo
             $this->tagRepo->saveTagsToEntity($draftPage, $input['tags']);
         }
 
+        if (isset($input['template']) && userCan('templates-manage')) {
+            $draftPage->template = ($input['template'] === 'true');
+        }
+
         $draftPage->slug = $this->findSuitableSlug('page', $draftPage->name, false, $draftPage->book->id);
         $draftPage->html = $this->formatHtml($input['html']);
         $draftPage->text = $this->pageToPlainText($draftPage);
@@ -424,9 +434,7 @@ class PageRepo extends EntityRepo
 
         $tree = collect($headers)->map(function($header) {
             $text = trim(str_replace("\xc2\xa0", '', $header->nodeValue));
-            if (mb_strlen($text) > 30) {
-                $text = mb_substr($text, 0, 27) . '...';
-            }
+            $text = mb_substr($text, 0, 100);
 
             return [
                 'nodeName' => strtolower($header->nodeName),
@@ -438,10 +446,10 @@ class PageRepo extends EntityRepo
             return mb_strlen($header['text']) > 0;
         });
 
-        // Normalise headers if only smaller headers have been used
-        $minLevel = $tree->pluck('level')->min();
-        $tree = $tree->map(function ($header) use ($minLevel) {
-            $header['level'] -= ($minLevel - 2);
+        // Shift headers if only smaller headers have been used
+        $levelChange = ($tree->pluck('level')->min() - 1);
+        $tree = $tree->map(function ($header) use ($levelChange) {
+            $header['level'] -= ($levelChange);
             return $header;
         });
 
@@ -525,4 +533,29 @@ class PageRepo extends EntityRepo
 
         return $this->publishPageDraft($copyPage, $pageData);
     }
+
+    /**
+     * Get pages that have been marked as templates.
+     * @param int $count
+     * @param int $page
+     * @param string $search
+     * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator
+     */
+    public function getPageTemplates(int $count = 10, int $page = 1,  string $search = '')
+    {
+        $query = $this->entityQuery('page')
+            ->where('template', '=', true)
+            ->orderBy('name', 'asc')
+            ->skip( ($page - 1) * $count)
+            ->take($count);
+
+        if ($search) {
+            $query->where('name', 'like', '%' . $search . '%');
+        }
+
+        $paginator = $query->paginate($count, ['*'], 'page', $page);
+        $paginator->withPath('/templates');
+
+        return $paginator;
+    }
 }
diff --git a/app/Exceptions/UserTokenExpiredException.php b/app/Exceptions/UserTokenExpiredException.php
new file mode 100644 (file)
index 0000000..203e08c
--- /dev/null
@@ -0,0 +1,19 @@
+<?php namespace BookStack\Exceptions;
+
+class UserTokenExpiredException extends \Exception {
+
+    public $userId;
+
+    /**
+     * UserTokenExpiredException constructor.
+     * @param string $message
+     * @param int $userId
+     */
+    public function __construct(string $message, int $userId)
+    {
+        $this->userId = $userId;
+        parent::__construct($message);
+    }
+
+
+}
\ No newline at end of file
diff --git a/app/Exceptions/UserTokenNotFoundException.php b/app/Exceptions/UserTokenNotFoundException.php
new file mode 100644 (file)
index 0000000..08c1fd8
--- /dev/null
@@ -0,0 +1,3 @@
+<?php namespace BookStack\Exceptions;
+
+class UserTokenNotFoundException extends \Exception {}
\ No newline at end of file
diff --git a/app/Http/Controllers/Auth/ConfirmEmailController.php b/app/Http/Controllers/Auth/ConfirmEmailController.php
new file mode 100644 (file)
index 0000000..3e240b9
--- /dev/null
@@ -0,0 +1,118 @@
+<?php
+
+namespace BookStack\Http\Controllers\Auth;
+
+use BookStack\Auth\Access\EmailConfirmationService;
+use BookStack\Auth\UserRepo;
+use BookStack\Exceptions\ConfirmationEmailException;
+use BookStack\Exceptions\UserTokenExpiredException;
+use BookStack\Exceptions\UserTokenNotFoundException;
+use BookStack\Http\Controllers\Controller;
+use Exception;
+use Illuminate\Http\RedirectResponse;
+use Illuminate\Http\Request;
+use Illuminate\Routing\Redirector;
+use Illuminate\View\View;
+
+class ConfirmEmailController extends Controller
+{
+    protected $emailConfirmationService;
+    protected $userRepo;
+
+    /**
+     * Create a new controller instance.
+     *
+     * @param EmailConfirmationService $emailConfirmationService
+     * @param UserRepo $userRepo
+     */
+    public function __construct(EmailConfirmationService $emailConfirmationService, UserRepo $userRepo)
+    {
+        $this->emailConfirmationService = $emailConfirmationService;
+        $this->userRepo = $userRepo;
+        parent::__construct();
+    }
+
+
+    /**
+     * Show the page to tell the user to check their email
+     * and confirm their address.
+     */
+    public function show()
+    {
+        return view('auth.register-confirm');
+    }
+
+    /**
+     * Shows a notice that a user's email address has not been confirmed,
+     * Also has the option to re-send the confirmation email.
+     * @return View
+     */
+    public function showAwaiting()
+    {
+        return view('auth.user-unconfirmed');
+    }
+
+    /**
+     * Confirms an email via a token and logs the user into the system.
+     * @param $token
+     * @return RedirectResponse|Redirector
+     * @throws ConfirmationEmailException
+     * @throws Exception
+     */
+    public function confirm($token)
+    {
+        try {
+            $userId = $this->emailConfirmationService->checkTokenAndGetUserId($token);
+        } catch (Exception $exception) {
+
+            if ($exception instanceof UserTokenNotFoundException) {
+                session()->flash('error', trans('errors.email_confirmation_invalid'));
+                return redirect('/register');
+            }
+
+            if ($exception instanceof UserTokenExpiredException) {
+                $user = $this->userRepo->getById($exception->userId);
+                $this->emailConfirmationService->sendConfirmation($user);
+                session()->flash('error', trans('errors.email_confirmation_expired'));
+                return redirect('/register/confirm');
+            }
+
+            throw $exception;
+        }
+
+        $user = $this->userRepo->getById($userId);
+        $user->email_confirmed = true;
+        $user->save();
+
+        auth()->login($user);
+        session()->flash('success', trans('auth.email_confirm_success'));
+        $this->emailConfirmationService->deleteByUser($user);
+
+        return redirect('/');
+    }
+
+
+    /**
+     * Resend the confirmation email
+     * @param Request $request
+     * @return View
+     */
+    public function resend(Request $request)
+    {
+        $this->validate($request, [
+            'email' => 'required|email|exists:users,email'
+        ]);
+        $user = $this->userRepo->getByEmail($request->get('email'));
+
+        try {
+            $this->emailConfirmationService->sendConfirmation($user);
+        } catch (Exception $e) {
+            session()->flash('error', trans('auth.email_confirm_send_error'));
+            return redirect('/register/confirm');
+        }
+
+        session()->flash('success', trans('auth.email_confirm_resent'));
+        return redirect('/register/confirm');
+    }
+
+}
index 78a8d33c0aed8ae342a5a80d86b4c2015ef02158..c739fd9a337387a973ba12d119059f84cf27cd07 100644 (file)
@@ -53,8 +53,8 @@ class LoginController extends Controller
         $this->socialAuthService = $socialAuthService;
         $this->ldapService = $ldapService;
         $this->userRepo = $userRepo;
-        $this->redirectPath = baseUrl('/');
-        $this->redirectAfterLogout = baseUrl('/login');
+        $this->redirectPath = url('/');
+        $this->redirectAfterLogout = url('/login');
         parent::__construct();
     }
 
@@ -106,9 +106,7 @@ class LoginController extends Controller
             $this->ldapService->syncGroups($user, $request->get($this->username()));
         }
 
-        $path = session()->pull('url.intended', '/');
-        $path = baseUrl($path, true);
-        return redirect($path);
+        return redirect()->intended('/');
     }
 
     /**
index d57105b6293385c4dd6ef163196b908f9b9ac7cf..c411f2363210999c6b44e578a19024b734e85fba 100644 (file)
@@ -2,17 +2,22 @@
 
 namespace BookStack\Http\Controllers\Auth;
 
+use BookStack\Auth\Access\EmailConfirmationService;
+use BookStack\Auth\Access\SocialAuthService;
 use BookStack\Auth\SocialAccount;
 use BookStack\Auth\User;
 use BookStack\Auth\UserRepo;
+use BookStack\Exceptions\SocialDriverNotConfigured;
 use BookStack\Exceptions\SocialSignInAccountNotUsed;
 use BookStack\Exceptions\SocialSignInException;
 use BookStack\Exceptions\UserRegistrationException;
 use BookStack\Http\Controllers\Controller;
 use Exception;
 use Illuminate\Foundation\Auth\RegistersUsers;
+use Illuminate\Http\RedirectResponse;
 use Illuminate\Http\Request;
 use Illuminate\Http\Response;
+use Illuminate\Routing\Redirector;
 use Laravel\Socialite\Contracts\User as SocialUser;
 use Validator;
 
@@ -46,18 +51,18 @@ class RegisterController extends Controller
     /**
      * Create a new controller instance.
      *
-     * @param \BookStack\Auth\Access\SocialAuthService $socialAuthService
-     * @param \BookStack\Auth\EmailConfirmationService $emailConfirmationService
-     * @param \BookStack\Auth\UserRepo $userRepo
+     * @param SocialAuthService $socialAuthService
+     * @param EmailConfirmationService $emailConfirmationService
+     * @param UserRepo $userRepo
      */
-    public function __construct(\BookStack\Auth\Access\SocialAuthService $socialAuthService, \BookStack\Auth\Access\EmailConfirmationService $emailConfirmationService, UserRepo $userRepo)
+    public function __construct(SocialAuthService $socialAuthService, EmailConfirmationService $emailConfirmationService, UserRepo $userRepo)
     {
         $this->middleware('guest')->only(['getRegister', 'postRegister', 'socialRegister']);
         $this->socialAuthService = $socialAuthService;
         $this->emailConfirmationService = $emailConfirmationService;
         $this->userRepo = $userRepo;
-        $this->redirectTo = baseUrl('/');
-        $this->redirectPath = baseUrl('/');
+        $this->redirectTo = url('/');
+        $this->redirectPath = url('/');
         parent::__construct();
     }
 
@@ -101,8 +106,8 @@ class RegisterController extends Controller
 
     /**
      * Handle a registration request for the application.
-     * @param Request|\Illuminate\Http\Request $request
-     * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
+     * @param Request|Request $request
+     * @return RedirectResponse|Redirector
      * @throws UserRegistrationException
      */
     public function postRegister(Request $request)
@@ -117,7 +122,7 @@ class RegisterController extends Controller
     /**
      * Create a new user instance after a valid registration.
      * @param  array  $data
-     * @return \BookStack\Auth\User
+     * @return User
      */
     protected function create(array $data)
     {
@@ -133,7 +138,7 @@ class RegisterController extends Controller
      * @param array $userData
      * @param bool|false|SocialAccount $socialAccount
      * @param bool $emailVerified
-     * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
+     * @return RedirectResponse|Redirector
      * @throws UserRegistrationException
      */
     protected function registerUser(array $userData, $socialAccount = false, $emailVerified = false)
@@ -153,7 +158,7 @@ class RegisterController extends Controller
             $newUser->socialAccounts()->save($socialAccount);
         }
 
-        if ((setting('registration-confirmation') || $registrationRestrict) && !$emailVerified) {
+        if ($this->emailConfirmationService->confirmationRequired() && !$emailVerified) {
             $newUser->save();
 
             try {
@@ -170,72 +175,12 @@ class RegisterController extends Controller
         return redirect($this->redirectPath());
     }
 
-    /**
-     * Show the page to tell the user to check their email
-     * and confirm their address.
-     */
-    public function getRegisterConfirmation()
-    {
-        return view('auth.register-confirm');
-    }
-
-    /**
-     * Confirms an email via a token and logs the user into the system.
-     * @param $token
-     * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
-     * @throws UserRegistrationException
-     */
-    public function confirmEmail($token)
-    {
-        $confirmation = $this->emailConfirmationService->getEmailConfirmationFromToken($token);
-        $user = $confirmation->user;
-        $user->email_confirmed = true;
-        $user->save();
-        auth()->login($user);
-        session()->flash('success', trans('auth.email_confirm_success'));
-        $this->emailConfirmationService->deleteConfirmationsByUser($user);
-        return redirect($this->redirectPath);
-    }
-
-    /**
-     * Shows a notice that a user's email address has not been confirmed,
-     * Also has the option to re-send the confirmation email.
-     * @return \Illuminate\View\View
-     */
-    public function showAwaitingConfirmation()
-    {
-        return view('auth.user-unconfirmed');
-    }
-
-    /**
-     * Resend the confirmation email
-     * @param Request $request
-     * @return \Illuminate\View\View
-     */
-    public function resendConfirmation(Request $request)
-    {
-        $this->validate($request, [
-            'email' => 'required|email|exists:users,email'
-        ]);
-        $user = $this->userRepo->getByEmail($request->get('email'));
-
-        try {
-            $this->emailConfirmationService->sendConfirmation($user);
-        } catch (Exception $e) {
-            session()->flash('error', trans('auth.email_confirm_send_error'));
-            return redirect('/register/confirm');
-        }
-
-        session()->flash('success', trans('auth.email_confirm_resent'));
-        return redirect('/register/confirm');
-    }
-
     /**
      * Redirect to the social site for authentication intended to register.
      * @param $socialDriver
      * @return mixed
      * @throws UserRegistrationException
-     * @throws \BookStack\Exceptions\SocialDriverNotConfigured
+     * @throws SocialDriverNotConfigured
      */
     public function socialRegister($socialDriver)
     {
@@ -248,10 +193,10 @@ class RegisterController extends Controller
      * The callback for social login services.
      * @param $socialDriver
      * @param Request $request
-     * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
+     * @return RedirectResponse|Redirector
      * @throws SocialSignInException
      * @throws UserRegistrationException
-     * @throws \BookStack\Exceptions\SocialDriverNotConfigured
+     * @throws SocialDriverNotConfigured
      */
     public function socialCallback($socialDriver, Request $request)
     {
@@ -292,7 +237,7 @@ class RegisterController extends Controller
     /**
      * Detach a social account from a user.
      * @param $socialDriver
-     * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
+     * @return RedirectResponse|Redirector
      */
     public function detachSocialAccount($socialDriver)
     {
@@ -303,7 +248,7 @@ class RegisterController extends Controller
      * Register a new user after a registration callback.
      * @param string $socialDriver
      * @param SocialUser $socialUser
-     * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
+     * @return RedirectResponse|Redirector
      * @throws UserRegistrationException
      */
     protected function socialRegisterCallback(string $socialDriver, SocialUser $socialUser)
diff --git a/app/Http/Controllers/Auth/UserInviteController.php b/app/Http/Controllers/Auth/UserInviteController.php
new file mode 100644 (file)
index 0000000..5d9373f
--- /dev/null
@@ -0,0 +1,106 @@
+<?php
+
+namespace BookStack\Http\Controllers\Auth;
+
+use BookStack\Auth\Access\UserInviteService;
+use BookStack\Auth\UserRepo;
+use BookStack\Exceptions\UserTokenExpiredException;
+use BookStack\Exceptions\UserTokenNotFoundException;
+use BookStack\Http\Controllers\Controller;
+use Exception;
+use Illuminate\Contracts\View\Factory;
+use Illuminate\Http\RedirectResponse;
+use Illuminate\Http\Request;
+use Illuminate\Routing\Redirector;
+use Illuminate\View\View;
+
+class UserInviteController extends Controller
+{
+    protected $inviteService;
+    protected $userRepo;
+
+    /**
+     * Create a new controller instance.
+     *
+     * @param UserInviteService $inviteService
+     * @param UserRepo $userRepo
+     */
+    public function __construct(UserInviteService $inviteService, UserRepo $userRepo)
+    {
+        $this->inviteService = $inviteService;
+        $this->userRepo = $userRepo;
+        $this->middleware('guest');
+        parent::__construct();
+    }
+
+    /**
+     * Show the page for the user to set the password for their account.
+     * @param string $token
+     * @return Factory|View|RedirectResponse
+     * @throws Exception
+     */
+    public function showSetPassword(string $token)
+    {
+        try {
+            $this->inviteService->checkTokenAndGetUserId($token);
+        } catch (Exception $exception) {
+            return $this->handleTokenException($exception);
+        }
+
+        return view('auth.invite-set-password', [
+            'token' => $token,
+        ]);
+    }
+
+    /**
+     * Sets the password for an invited user and then grants them access.
+     * @param string $token
+     * @param Request $request
+     * @return RedirectResponse|Redirector
+     * @throws Exception
+     */
+    public function setPassword(string $token, Request $request)
+    {
+        $this->validate($request, [
+            'password' => 'required|min:6'
+        ]);
+
+        try {
+            $userId = $this->inviteService->checkTokenAndGetUserId($token);
+        } catch (Exception $exception) {
+            return $this->handleTokenException($exception);
+        }
+
+        $user = $this->userRepo->getById($userId);
+        $user->password = bcrypt($request->get('password'));
+        $user->email_confirmed = true;
+        $user->save();
+
+        auth()->login($user);
+        session()->flash('success', trans('auth.user_invite_success', ['appName' => setting('app-name')]));
+        $this->inviteService->deleteByUser($user);
+
+        return redirect('/');
+    }
+
+    /**
+     * Check and validate the exception thrown when checking an invite token.
+     * @param Exception $exception
+     * @return RedirectResponse|Redirector
+     * @throws Exception
+     */
+    protected function handleTokenException(Exception $exception)
+    {
+        if ($exception instanceof UserTokenNotFoundException) {
+            return redirect('/');
+        }
+
+        if ($exception instanceof UserTokenExpiredException) {
+            session()->flash('error', trans('errors.invite_token_expired'));
+            return redirect('/password/email');
+        }
+
+        throw $exception;
+    }
+
+}
index ba93bfe6517ddd7a29664aa0eee45976217d98e3..d2c75f95622fee3d8278629dd75b3390268dcb38 100644 (file)
@@ -91,35 +91,6 @@ class HomeController extends Controller
         return view('common.home', $commonData);
     }
 
-    /**
-     * 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();
-        $cacheKey = 'GLOBAL_TRANSLATIONS_' . $locale;
-
-        if (cache()->has($cacheKey) && config('app.env') !== 'development') {
-            $resp = cache($cacheKey);
-        } else {
-            $translations = [
-                // Get only translations which might be used in JS
-                'common' => trans('common'),
-                'components' => trans('components'),
-                'entities' => trans('entities'),
-                'errors' => trans('errors')
-            ];
-            $resp = 'window.translations = ' . json_encode($translations);
-            cache()->put($cacheKey, $resp, 120);
-        }
-
-        return response($resp, 200, [
-            'Content-Type' => 'application/javascript'
-        ]);
-    }
-
     /**
      * Get custom head HTML, Used in ajax calls to show in editor.
      * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
index 16a7d5a5e45df6df1094bfa14df63fb17cb278f3..8819510a6d4388bd600e0c89bee5e9038a09fbda 100644 (file)
@@ -110,11 +110,14 @@ class PageController extends Controller
         $this->setPageTitle(trans('entities.pages_edit_draft'));
 
         $draftsEnabled = $this->signedIn;
+        $templates = $this->pageRepo->getPageTemplates(10);
+
         return view('pages.edit', [
             'page' => $draft,
             'book' => $draft->book,
             'isDraft' => true,
-            'draftsEnabled' => $draftsEnabled
+            'draftsEnabled' => $draftsEnabled,
+            'templates' => $templates,
         ]);
     }
 
@@ -239,11 +242,14 @@ class PageController extends Controller
         }
 
         $draftsEnabled = $this->signedIn;
+        $templates = $this->pageRepo->getPageTemplates(10);
+
         return view('pages.edit', [
             'page' => $page,
             'book' => $page->book,
             'current' => $page,
-            'draftsEnabled' => $draftsEnabled
+            'draftsEnabled' => $draftsEnabled,
+            'templates' => $templates,
         ]);
     }
 
@@ -541,7 +547,7 @@ class PageController extends Controller
     public function showRecentlyUpdated()
     {
         // TODO - Still exist?
-        $pages = $this->pageRepo->getRecentlyUpdatedPaginated('page', 20)->setPath(baseUrl('/pages/recently-updated'));
+        $pages = $this->pageRepo->getRecentlyUpdatedPaginated('page', 20)->setPath(url('/pages/recently-updated'));
         return view('pages.detailed-listing', [
             'title' => trans('entities.recently_updated_pages'),
             'pages' => $pages
diff --git a/app/Http/Controllers/PageTemplateController.php b/app/Http/Controllers/PageTemplateController.php
new file mode 100644 (file)
index 0000000..0594335
--- /dev/null
@@ -0,0 +1,63 @@
+<?php
+
+namespace BookStack\Http\Controllers;
+
+use BookStack\Entities\Repos\PageRepo;
+use BookStack\Exceptions\NotFoundException;
+use Illuminate\Http\Request;
+
+class PageTemplateController extends Controller
+{
+    protected $pageRepo;
+
+    /**
+     * PageTemplateController constructor.
+     * @param $pageRepo
+     */
+    public function __construct(PageRepo $pageRepo)
+    {
+        $this->pageRepo = $pageRepo;
+        parent::__construct();
+    }
+
+    /**
+     * Fetch a list of templates from the system.
+     * @param Request $request
+     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
+     */
+    public function list(Request $request)
+    {
+        $page = $request->get('page', 1);
+        $search = $request->get('search', '');
+        $templates = $this->pageRepo->getPageTemplates(10, $page, $search);
+
+        if ($search) {
+            $templates->appends(['search' => $search]);
+        }
+
+        return view('pages.template-manager-list', [
+            'templates' => $templates
+        ]);
+    }
+
+    /**
+     * Get the content of a template.
+     * @param $templateId
+     * @return \Illuminate\Contracts\Routing\ResponseFactory|\Symfony\Component\HttpFoundation\Response
+     * @throws NotFoundException
+     */
+    public function get($templateId)
+    {
+        $page = $this->pageRepo->getById('page', $templateId);
+
+        if (!$page->template) {
+            throw new NotFoundException();
+        }
+
+        return response()->json([
+            'html' => $page->html,
+            'markdown' => $page->markdown,
+        ]);
+    }
+
+}
index 4bcf7b40eff4db0c207f7741438a4da9b52bd113..1691ee9b0bf937f338436305baa8b9beea3bb24f 100644 (file)
@@ -48,7 +48,7 @@ class SearchController extends Controller
         $this->setPageTitle(trans('entities.search_for_term', ['term' => $searchTerm]));
 
         $page = intval($request->get('page', '0')) ?: 1;
-        $nextPageLink = baseUrl('/search?term=' . urlencode($searchTerm) . '&page=' . ($page+1));
+        $nextPageLink = url('/search?term=' . urlencode($searchTerm) . '&page=' . ($page+1));
 
         $results = $this->searchService->searchEntities($searchTerm, 'all', $page, 20);
 
index 8191fbfe276226ab70bed45825d470b353905b88..c9d2560ba0fff4cf9cb4360579ad71c3afd1c591 100644 (file)
@@ -1,6 +1,7 @@
 <?php namespace BookStack\Http\Controllers;
 
 use BookStack\Auth\Access\SocialAuthService;
+use BookStack\Auth\Access\UserInviteService;
 use BookStack\Auth\User;
 use BookStack\Auth\UserRepo;
 use BookStack\Exceptions\UserUpdateException;
@@ -13,18 +14,21 @@ class UserController extends Controller
 
     protected $user;
     protected $userRepo;
+    protected $inviteService;
     protected $imageRepo;
 
     /**
      * UserController constructor.
      * @param User $user
      * @param UserRepo $userRepo
+     * @param UserInviteService $inviteService
      * @param ImageRepo $imageRepo
      */
-    public function __construct(User $user, UserRepo $userRepo, ImageRepo $imageRepo)
+    public function __construct(User $user, UserRepo $userRepo, UserInviteService $inviteService, ImageRepo $imageRepo)
     {
         $this->user = $user;
         $this->userRepo = $userRepo;
+        $this->inviteService = $inviteService;
         $this->imageRepo = $imageRepo;
         parent::__construct();
     }
@@ -75,8 +79,10 @@ class UserController extends Controller
         ];
 
         $authMethod = config('auth.method');
-        if ($authMethod === 'standard') {
-            $validationRules['password'] = 'required|min:5';
+        $sendInvite = ($request->get('send_invite', 'false') === 'true');
+
+        if ($authMethod === 'standard' && !$sendInvite) {
+            $validationRules['password'] = 'required|min:6';
             $validationRules['password-confirm'] = 'required|same:password';
         } elseif ($authMethod === 'ldap') {
             $validationRules['external_auth_id'] = 'required';
@@ -86,13 +92,17 @@ class UserController extends Controller
         $user = $this->user->fill($request->all());
 
         if ($authMethod === 'standard') {
-            $user->password = bcrypt($request->get('password'));
+            $user->password = bcrypt($request->get('password', str_random(32)));
         } elseif ($authMethod === 'ldap') {
             $user->external_auth_id = $request->get('external_auth_id');
         }
 
         $user->save();
 
+        if ($sendInvite) {
+            $this->inviteService->sendInvitation($user);
+        }
+
         if ($request->filled('roles')) {
             $roles = $request->get('roles');
             $this->userRepo->setUserRoles($user, $roles);
@@ -139,14 +149,19 @@ class UserController extends Controller
         $this->validate($request, [
             'name'             => 'min:2',
             'email'            => 'min:2|email|unique:users,email,' . $id,
-            'password'         => 'min:5|required_with:password_confirm',
+            'password'         => 'min:6|required_with:password_confirm',
             'password-confirm' => 'same:password|required_with:password',
             'setting'          => 'array',
             'profile_image'    => $this->imageRepo->getImageValidationRules(),
         ]);
 
         $user = $this->userRepo->getById($id);
-        $user->fill($request->all());
+        $user->fill($request->except(['email']));
+
+        // Email updates
+        if (userCan('users-manage') && $request->filled('email')) {
+            $user->email = $request->get('email');
+        }
 
         // Role updates
         if (userCan('users-manage') && $request->filled('roles')) {
index 1a33843675a97266095cd6c2cb96918369652c9d..d840a9b2e05477c8fca1550dad9e9e81adaa8c2c 100644 (file)
@@ -41,7 +41,7 @@ class Authenticate
             if ($request->ajax()) {
                 return response('Unauthorized.', 401);
             } else {
-                return redirect()->guest(baseUrl('/login'));
+                return redirect()->guest(url('/login'));
             }
         }
 
index 753fe438e0dbf8422ed3c647fa97cb63f1eae988..29a4369548b4af622c9b60ee3f8b376c162b7e49 100644 (file)
@@ -31,12 +31,10 @@ class Localization
         'nl' => 'nl_NL',
         'pl' => 'pl_PL',
         'pt_BR' => 'pt_BR',
-        'pt_BR' => 'pt_BR',
         'ru' => 'ru',
         'sk' => 'sk_SK',
         'sv' => 'sv_SE',
         'uk' => 'uk_UA',
-        'uk' => 'uk_UA',
         'zh_CN' => 'zh_CN',
         'zh_TW' => 'zh_TW',
     ];
diff --git a/app/Http/Request.php b/app/Http/Request.php
new file mode 100644 (file)
index 0000000..bd2761a
--- /dev/null
@@ -0,0 +1,26 @@
+<?php namespace BookStack\Http;
+
+use Illuminate\Http\Request as LaravelRequest;
+
+class Request extends LaravelRequest
+{
+
+    /**
+     * Override the default request methods to get the scheme and host
+     * to set the custom APP_URL, if set.
+     * @return \Illuminate\Config\Repository|mixed|string
+     */
+    public function getSchemeAndHttpHost()
+    {
+        $base = config('app.url', null);
+
+        if ($base) {
+            $base = trim($base, '/');
+        } else {
+            $base = $this->getScheme().'://'.$this->getHttpHost();
+        }
+
+        return $base;
+    }
+
+}
\ No newline at end of file
index 7ecadc298f1f4042a7b887584ca6820bec7bb926..229408f5cf9827533a8307727beac5e4768185c7 100644 (file)
@@ -26,6 +26,6 @@ class ConfirmEmail extends MailNotification
                 ->subject(trans('auth.email_confirm_subject', $appName))
                 ->greeting(trans('auth.email_confirm_greeting', $appName))
                 ->line(trans('auth.email_confirm_text'))
-                ->action(trans('auth.email_confirm_action'), baseUrl('/register/confirm/' . $this->token));
+                ->action(trans('auth.email_confirm_action'), url('/register/confirm/' . $this->token));
     }
 }
index 305a7da72dc50236dd82cc8bbd935f891cf8fb27..20875276400f0403d1a9a063459e37195a2cd475 100644 (file)
@@ -29,7 +29,7 @@ class ResetPassword extends MailNotification
             return $this->newMailMessage()
             ->subject(trans('auth.email_reset_subject', ['appName' => setting('app-name')]))
             ->line(trans('auth.email_reset_text'))
-            ->action(trans('auth.reset_password'), baseUrl('password/reset/' . $this->token))
+            ->action(trans('auth.reset_password'), url('password/reset/' . $this->token))
             ->line(trans('auth.email_reset_not_requested'));
     }
 }
diff --git a/app/Notifications/UserInvite.php b/app/Notifications/UserInvite.php
new file mode 100644 (file)
index 0000000..b01911b
--- /dev/null
@@ -0,0 +1,31 @@
+<?php namespace BookStack\Notifications;
+
+class UserInvite extends MailNotification
+{
+    public $token;
+
+    /**
+     * Create a new notification instance.
+     * @param string $token
+     */
+    public function __construct($token)
+    {
+        $this->token = $token;
+    }
+
+    /**
+     * Get the mail representation of the notification.
+     *
+     * @param  mixed  $notifiable
+     * @return \Illuminate\Notifications\Messages\MailMessage
+     */
+    public function toMail($notifiable)
+    {
+        $appName = ['appName' => setting('app-name')];
+        return $this->newMailMessage()
+                ->subject(trans('auth.user_invite_email_subject', $appName))
+                ->greeting(trans('auth.user_invite_email_greeting', $appName))
+                ->line(trans('auth.user_invite_email_text'))
+                ->action(trans('auth.user_invite_email_action'), url('/register/invite/' . $this->token));
+    }
+}
index 9b91ba126c5878801a82f71f201a9dbbb753706a..a2fc673f488fc1de45bb27a0f4a48e2790bc9cf6 100644 (file)
@@ -9,10 +9,10 @@ use BookStack\Entities\Page;
 use BookStack\Settings\Setting;
 use BookStack\Settings\SettingService;
 use Illuminate\Database\Eloquent\Relations\Relation;
-use Illuminate\Http\UploadedFile;
 use Illuminate\Support\Facades\View;
 use Illuminate\Support\ServiceProvider;
 use Schema;
+use URL;
 use Validator;
 
 class AppServiceProvider extends ServiceProvider
@@ -24,6 +24,9 @@ class AppServiceProvider extends ServiceProvider
      */
     public function boot()
     {
+        // Set root URL
+        URL::forceRootUrl(config('app.url'));
+
         // Custom validation methods
         Validator::extend('image_extension', function ($attribute, $value, $parameters, $validator) {
             $validImageExtensions = ['png', 'jpg', 'jpeg', 'bmp', 'gif', 'tiff', 'webp'];
@@ -40,6 +43,14 @@ class AppServiceProvider extends ServiceProvider
             return "<?php echo icon($expression); ?>";
         });
 
+        Blade::directive('exposeTranslations', function($expression) {
+            return "<?php \$__env->startPush('translations'); ?>" .
+                "<?php foreach({$expression} as \$key): ?>" .
+                '<meta name="translation" key="<?php echo e($key); ?>" value="<?php echo e(trans($key)); ?>">' . "\n" .
+                "<?php endforeach; ?>" .
+                '<?php $__env->stopPush(); ?>';
+        });
+
         // Allow longer string lengths after upgrade to utf8mb4
         Schema::defaultStringLength(191);
 
index 3a695c5e3dd285c327b74cbdca521e4522ae30b0..1c982b82eacd26610861d49cfdcf71bc1e5a02c3 100644 (file)
@@ -18,7 +18,7 @@ class PaginationServiceProvider extends IlluminatePaginationServiceProvider
         });
 
         Paginator::currentPathResolver(function () {
-            return baseUrl($this->app['request']->path());
+            return url($this->app['request']->path());
         });
 
         Paginator::currentPageResolver(function ($pageName = 'page') {
index eb9a0fe68e02b60eb605911e12d6c8ca40e3fa87..8720d3c098e74eb96c0890dc174089de43f8be70 100644 (file)
@@ -37,6 +37,6 @@ class Attachment extends Ownable
         if ($this->external && strpos($this->path, 'http') !== 0) {
             return $this->path;
         }
-        return baseUrl('/attachments/' . $this->id);
+        return url('/attachments/' . $this->id);
     }
 }
index e613642c4f3dd8699a7c3f0c37b2c5394e468700..6e875a1e7a35c9cec514ccd3e21316ef04980019 100644 (file)
@@ -13,7 +13,7 @@ class AttachmentService extends UploadService
      */
     protected function getStorage()
     {
-        $storageType = config('filesystems.default');
+        $storageType = config('filesystems.attachments');
 
         // Override default location if set to local public to ensure not visible.
         if ($storageType === 'local') {
index 8eefbaf9dd3468521d388addb292c7285ffd9b16..860230d00f914169969e40d00efdca77e6f0845d 100644 (file)
@@ -45,9 +45,9 @@ class ImageService extends UploadService
      */
     protected function getStorage($type = '')
     {
-        $storageType = config('filesystems.default');
+        $storageType = config('filesystems.images');
 
-        // Override default location if set to local public to ensure not visible.
+        // Ensure system images (App logo) are uploaded to a public space
         if ($type === 'system' && $storageType === 'local_secure') {
             $storageType = 'local';
         }
@@ -417,7 +417,7 @@ class ImageService extends UploadService
         $isLocal = strpos(trim($uri), 'http') !== 0;
 
         // Attempt to find local files even if url not absolute
-        $base = baseUrl('/');
+        $base = url('/');
         if (!$isLocal && strpos($uri, $base) === 0) {
             $isLocal = true;
             $uri = str_replace($base, '', $uri);
@@ -442,7 +442,12 @@ class ImageService extends UploadService
             return null;
         }
 
-        return 'data:image/' . pathinfo($uri, PATHINFO_EXTENSION) . ';base64,' . base64_encode($imageData);
+        $extension = pathinfo($uri, PATHINFO_EXTENSION);
+        if ($extension === 'svg') {
+            $extension = 'svg+xml';
+        }
+
+        return 'data:image/' . $extension . ';base64,' . base64_encode($imageData);
     }
 
     /**
@@ -458,7 +463,7 @@ class ImageService extends UploadService
             // Get the standard public s3 url if s3 is set as storage type
             // Uses the nice, short URL if bucket name has no periods in otherwise the longer
             // region-based url will be used to prevent http issues.
-            if ($storageUrl == false && config('filesystems.default') === 's3') {
+            if ($storageUrl == false && config('filesystems.images') === 's3') {
                 $storageDetails = config('filesystems.disks.s3');
                 if (strpos($storageDetails['bucket'], '.') === false) {
                     $storageUrl = 'https://' . $storageDetails['bucket'] . '.s3.amazonaws.com';
@@ -469,7 +474,7 @@ class ImageService extends UploadService
             $this->storageUrl = $storageUrl;
         }
 
-        $basePath = ($this->storageUrl == false) ? baseUrl('/') : $this->storageUrl;
+        $basePath = ($this->storageUrl == false) ? url('/') : $this->storageUrl;
         return rtrim($basePath, '/') . $filePath;
     }
 }
index 8cb3fa3f4a22be3725da7510cdf448eb6a8a7e76..9bbfcfbf0fc6535a25cec4750d90006c48d444ea 100644 (file)
@@ -1,8 +1,9 @@
 <?php
 
 use BookStack\Auth\Permissions\PermissionService;
-use BookStack\Entities\Entity;
+use BookStack\Auth\User;
 use BookStack\Ownable;
+use BookStack\Settings\SettingService;
 
 /**
  * Get the path to a versioned file.
@@ -11,7 +12,7 @@ use BookStack\Ownable;
  * @return string
  * @throws Exception
  */
-function versioned_asset($file = '')
+function versioned_asset($file = '') : string
 {
     static $version = null;
 
@@ -26,17 +27,17 @@ function versioned_asset($file = '')
     }
 
     $path = $file . '?version=' . urlencode($version) . $additional;
-    return baseUrl($path);
+    return url($path);
 }
 
 /**
  * Helper method to get the current User.
  * Defaults to public 'Guest' user if not logged in.
- * @return \BookStack\Auth\User
+ * @return User
  */
-function user()
+function user() : User
 {
-    return auth()->user() ?: \BookStack\Auth\User::getDefault();
+    return auth()->user() ?: User::getDefault();
 }
 
 /**
@@ -63,9 +64,9 @@ function hasAppAccess() : bool
  * that particular item.
  * @param string $permission
  * @param Ownable $ownable
- * @return mixed
+ * @return bool
  */
-function userCan(string $permission, Ownable $ownable = null)
+function userCan(string $permission, Ownable $ownable = null) : bool
 {
     if ($ownable === null) {
         return user() && user()->can($permission);
@@ -83,7 +84,7 @@ function userCan(string $permission, Ownable $ownable = null)
  * @param string|null $entityClass
  * @return bool
  */
-function userCanOnAny(string $permission, string $entityClass = null)
+function userCanOnAny(string $permission, string $entityClass = null) : bool
 {
     $permissionService = app(PermissionService::class);
     return $permissionService->checkUserHasPermissionOnAnything($permission, $entityClass);
@@ -93,83 +94,27 @@ function userCanOnAny(string $permission, string $entityClass = null)
  * Helper to access system settings.
  * @param $key
  * @param bool $default
- * @return bool|string|\BookStack\Settings\SettingService
+ * @return bool|string|SettingService
  */
 function setting($key = null, $default = false)
 {
-    $settingService = resolve(\BookStack\Settings\SettingService::class);
+    $settingService = resolve(SettingService::class);
     if (is_null($key)) {
         return $settingService;
     }
     return $settingService->get($key, $default);
 }
 
-/**
- * Helper to create url's relative to the applications root path.
- * @param string $path
- * @param bool $forceAppDomain
- * @return string
- */
-function baseUrl($path, $forceAppDomain = false)
-{
-    $isFullUrl = strpos($path, 'http') === 0;
-    if ($isFullUrl && !$forceAppDomain) {
-        return $path;
-    }
-
-    $path = trim($path, '/');
-    $base = rtrim(config('app.url'), '/');
-
-    // Remove non-specified domain if forced and we have a domain
-    if ($isFullUrl && $forceAppDomain) {
-        if (!empty($base) && strpos($path, $base) === 0) {
-            $path = mb_substr($path, mb_strlen($base));
-        } else {
-            $explodedPath = explode('/', $path);
-            $path = implode('/', array_splice($explodedPath, 3));
-        }
-    }
-
-    // Return normal url path if not specified in config
-    if (config('app.url') === '') {
-        return url($path);
-    }
-
-    return $base . '/' . ltrim($path, '/');
-}
-
-/**
- * Get an instance of the redirector.
- * Overrides the default laravel redirect helper.
- * Ensures it redirects even when the app is in a subdirectory.
- *
- * @param  string|null  $to
- * @param  int     $status
- * @param  array   $headers
- * @param  bool    $secure
- * @return \Illuminate\Routing\Redirector|\Illuminate\Http\RedirectResponse
- */
-function redirect($to = null, $status = 302, $headers = [], $secure = null)
-{
-    if (is_null($to)) {
-        return app('redirect');
-    }
-
-    $to = baseUrl($to);
-
-    return app('redirect')->to($to, $status, $headers, $secure);
-}
-
 /**
  * Get a path to a theme resource.
  * @param string $path
- * @return string|boolean
+ * @return string
  */
-function theme_path($path = '')
+function theme_path($path = '') : string
 {
     $theme = config('view.theme');
     if (!$theme) {
-        return false;
+        return '';
     }
 
     return base_path('themes/' . $theme .($path ? DIRECTORY_SEPARATOR.$path : $path));
@@ -241,5 +186,5 @@ function sortUrl($path, $data, $overrideData = [])
         return $path;
     }
 
-    return baseUrl($path . '?' . implode('&', $queryStringSections));
+    return url($path . '?' . implode('&', $queryStringSections));
 }
index 371f93913b7a409ce03e33cf084b286d54e009ff..516980cc10c745783b9668fcf7d144ffa683556b 100644 (file)
@@ -11,7 +11,7 @@
 |
 */
 
-$app = new Illuminate\Foundation\Application(
+$app = new \BookStack\Application(
     realpath(__DIR__.'/../')
 );
 
diff --git a/database/migrations/2019_07_07_112515_add_template_support.php b/database/migrations/2019_07_07_112515_add_template_support.php
new file mode 100644 (file)
index 0000000..a545081
--- /dev/null
@@ -0,0 +1,54 @@
+<?php
+
+use Carbon\Carbon;
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class AddTemplateSupport extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('pages', function (Blueprint $table) {
+            $table->boolean('template')->default(false);
+            $table->index('template');
+        });
+
+        // Create new templates-manage permission and assign to admin role
+        $adminRoleId = DB::table('roles')->where('system_name', '=', 'admin')->first()->id;
+        $permissionId = DB::table('role_permissions')->insertGetId([
+            'name' => 'templates-manage',
+            'display_name' => 'Manage Page Templates',
+            'created_at' => Carbon::now()->toDateTimeString(),
+            'updated_at' => Carbon::now()->toDateTimeString()
+        ]);
+        DB::table('permission_role')->insert([
+            'role_id' => $adminRoleId,
+            'permission_id' => $permissionId
+        ]);
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('pages', function (Blueprint $table) {
+            $table->dropColumn('template');
+        });
+
+        // Remove templates-manage permission
+        $templatesManagePermission = DB::table('role_permissions')
+            ->where('name', '=', 'templates_manage')->first();
+
+        DB::table('permission_role')->where('permission_id', '=', $templatesManagePermission->id)->delete();
+        DB::table('role_permissions')->where('name', '=', 'templates_manage')->delete();
+    }
+}
diff --git a/database/migrations/2019_08_17_140214_add_user_invites_table.php b/database/migrations/2019_08_17_140214_add_user_invites_table.php
new file mode 100644 (file)
index 0000000..23bd698
--- /dev/null
@@ -0,0 +1,33 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class AddUserInvitesTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('user_invites', function (Blueprint $table) {
+            $table->increments('id');
+            $table->integer('user_id')->index();
+            $table->string('token')->index();
+            $table->nullableTimestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('user_invites');
+    }
+}
index 804afcf5d3ed2ab681792aaffbea10e168a0e1ce..53722a71b4e193a9a1949322c3581bfacc293c08 100644 (file)
@@ -34,6 +34,8 @@
         <env name="AVATAR_URL" value=""/>
         <env name="LDAP_VERSION" value="3"/>
         <env name="STORAGE_TYPE" value="local"/>
+        <env name="STORAGE_ATTACHMENT_TYPE" value="local"/>
+        <env name="STORAGE_IMAGE_TYPE" value="local"/>
         <env name="GITHUB_APP_ID" value="aaaaaaaaaaaaaa"/>
         <env name="GITHUB_APP_SECRET" value="aaaaaaaaaaaaaa"/>
         <env name="GITHUB_AUTO_REGISTER" value=""/>
index 8eb2dd0ddfa5f7b57bd0f351684dfa2e4e3ac0d3..0d55354ec6fb756086be2bcace7be11078064f29 100644 (file)
@@ -1,6 +1,6 @@
 <IfModule mod_rewrite.c>
     <IfModule mod_negotiation.c>
-        Options -MultiViews
+        Options -MultiViews -Indexes
     </IfModule>
 
     RewriteEngine On
index ad378d7e071ae46d8873169bac808b874615536b..8205764728cdb1dc6bd8bdfb78f20ebec5525ac3 100644 (file)
@@ -34,6 +34,7 @@ require __DIR__.'/../bootstrap/init.php';
 */
 
 $app = require_once __DIR__.'/../bootstrap/app.php';
+$app->alias('request', \BookStack\Http\Request::class);
 
 /*
 |--------------------------------------------------------------------------
@@ -50,7 +51,7 @@ $app = require_once __DIR__.'/../bootstrap/app.php';
 $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
 
 $response = $kernel->handle(
-    $request = Illuminate\Http\Request::capture()
+    $request = \BookStack\Http\Request::capture()
 );
 
 $response->send();
index c96a04f008ee21e260b28f7701595ed59e2839e3..cb7328e1934841ba2afd78b3b7ceb100961337bb 100755 (executable)
@@ -1,2 +1,3 @@
 *
-!.gitignore
\ No newline at end of file
+!.gitignore
+!.htaccess
\ No newline at end of file
diff --git a/public/uploads/.htaccess b/public/uploads/.htaccess
new file mode 100755 (executable)
index 0000000..45552cb
--- /dev/null
@@ -0,0 +1 @@
+Options -Indexes
\ No newline at end of file
index 07bebff0557f459e35776acc157de7ae60235779..62e2aa65d8abf959721ab412cec07a524f9e6888 100644 (file)
--- a/readme.md
+++ b/readme.md
@@ -3,6 +3,7 @@
 [![GitHub release](https://img.shields.io/github/release/BookStackApp/BookStack.svg)](https://github.com/BookStackApp/BookStack/releases/latest)
 [![license](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/BookStackApp/BookStack/blob/master/LICENSE)
 [![Build Status](https://travis-ci.org/BookStackApp/BookStack.svg)](https://travis-ci.org/BookStackApp/BookStack)
+[![Discord](https://img.shields.io/static/v1?label=Chat&message=Discord&color=738adb&logo=discord)](https://discord.gg/ztkBqR2)
 
 A platform for storing and organising information and documentation. General information and documentation for BookStack can be found at https://www.bookstackapp.com/.
 
@@ -24,9 +25,7 @@ In regards to development philosophy, BookStack has a relaxed, open & positive a
 
 Below is a high-level road map view for BookStack to provide a sense of direction of where the project is going. This can change at any point and does not reflect many features and improvements that will also be included as part of the journey along this road map. For more granular detail of what will be included in upcoming releases you can review the project milestones as defined in the "Release Process" section below.
 
-- **Design Revamp** *[(In Progress)](https://github.com/BookStackApp/BookStack/pull/1153)*
-    - *A more organised modern design to clean things up, make BookStack more efficient to use and increase mobile usability.*
-- **Platform REST API**
+- **Platform REST API** *(In Design)*
     - *A REST API covering, at minimum, control of core content models (Books, Chapters, Pages) for automation and platform extension.*
 - **Editor Alignment & Review**
     - *Review the page editors with goal of achieving increased interoperability & feature parity while also considering collaborative editing potential.*
@@ -65,7 +64,7 @@ npm run production
 npm run dev
 ```
 
-BookStack has many integration tests that use Laravel's built-in testing capabilities which makes use of PHPUnit. To use you will need PHPUnit 6 installed and accessible via command line, Directly running the composer-installed version will not work. There is a `mysql_testing` database defined within the app config which is what is used by PHPUnit. This database is set with the following database name, user name and password defined as `bookstack-test`. You will have to create that database and credentials before testing.
+BookStack has many integration tests that use Laravel's built-in testing capabilities which makes use of PHPUnit. There is a `mysql_testing` database defined within the app config which is what is used by PHPUnit. This database is set with the database name, user name and password all defined as `bookstack-test`. You will have to create that database and that set of credentials before testing.
 
 The testing database will also need migrating and seeding beforehand. This can be done with the following commands:
 
@@ -74,7 +73,7 @@ php artisan migrate --database=mysql_testing
 php artisan db:seed --class=DummyContentSeeder --database=mysql_testing
 ```
 
-Once done you can run `phpunit` in the application root directory to run all tests.
+Once done you can run `php vendor/bin/phpunit` in the application root directory to run all tests.
 
 ## Translations
 
diff --git a/resources/assets/icons/chevron-down.svg b/resources/assets/icons/chevron-down.svg
new file mode 100644 (file)
index 0000000..f08dfaf
--- /dev/null
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7.41 8L12 12.58 16.59 8 18 9.41l-6 6-6-6z"/><path d="M0 0h24v24H0z" fill="none"/></svg>
\ No newline at end of file
index 45e34a39bdb3db169569ef0e89d49fc4824d771d..3a52e2314a6f88c42b04f590602bf2d583ecb6e4 100644 (file)
@@ -1,4 +1,3 @@
 <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
-    <path d="M0 0h24v24H0z" fill="none"/>
     <path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"/>
 </svg>
\ No newline at end of file
index 94eea0ed877d18877aa75e67fedb6239fdf1f2ca..3e8be1ce7da2bff861bbeae974d9ea631bddc20a 100644 (file)
@@ -1,4 +1,3 @@
 <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
-    <path d="M0 0h24v24H0z" fill="none"/>
     <path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/>
 </svg>
\ No newline at end of file
diff --git a/resources/assets/icons/template.svg b/resources/assets/icons/template.svg
new file mode 100644 (file)
index 0000000..7c14212
--- /dev/null
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 4h7V2H4c-1.1 0-2 .9-2 2v7h2zm16-2h-7v2h7v7h2V4c0-1.1-.9-2-2-2zm0 18h-7v2h7c1.1 0 2-.9 2-2v-7h-2zM4 13H2v7c0 1.1.9 2 2 2h7v-2H4zM16.475 15.356h-8.95v-2.237h8.95zm0-4.475h-8.95V8.644h8.95z"/></svg>
\ No newline at end of file
diff --git a/resources/assets/js/components/entity-permissions-editor.js b/resources/assets/js/components/entity-permissions-editor.js
new file mode 100644 (file)
index 0000000..a821792
--- /dev/null
@@ -0,0 +1,20 @@
+
+class EntityPermissionsEditor {
+
+  constructor(elem) {
+    this.permissionsTable = elem.querySelector('[permissions-table]');
+
+    // Handle toggle all event
+    this.restrictedCheckbox = elem.querySelector('[name=restricted]');
+    this.restrictedCheckbox.addEventListener('change', this.updateTableVisibility.bind(this));
+  }
+
+  updateTableVisibility() {
+    this.permissionsTable.style.display =
+      this.restrictedCheckbox.checked
+        ? null
+        : 'none';
+  }
+}
+
+export default EntityPermissionsEditor;
\ No newline at end of file
index c9fd630778a46694c7b7535e0742ee69ff9dade1..14cf08ae2da41014e4703c57bfae6f79c4dc1c9e 100644 (file)
@@ -26,6 +26,9 @@ import permissionsTable from "./permissions-table";
 import customCheckbox from "./custom-checkbox";
 import bookSort from "./book-sort";
 import settingAppColorPicker from "./setting-app-color-picker";
+import entityPermissionsEditor from "./entity-permissions-editor";
+import templateManager from "./template-manager";
+import newUserPassword from "./new-user-password";
 
 const componentMapping = {
     'dropdown': dropdown,
@@ -56,6 +59,9 @@ const componentMapping = {
     'custom-checkbox': customCheckbox,
     'book-sort': bookSort,
     'setting-app-color-picker': settingAppColorPicker,
+    'entity-permissions-editor': entityPermissionsEditor,
+    'template-manager': templateManager,
+    'new-user-password': newUserPassword,
 };
 
 window.components = {};
index b0e4d693a4e499810ad5bb40e549815095a9b8ec..7cb56eef831ee5fb75636a1f91345a505dd528a8 100644 (file)
@@ -91,6 +91,7 @@ class MarkdownEditor {
         });
 
         this.codeMirrorSetup();
+        this.listenForBookStackEditorEvents();
     }
 
     // Update the input content and render the display.
@@ -461,6 +462,37 @@ class MarkdownEditor {
         })
     }
 
+    listenForBookStackEditorEvents() {
+
+        function getContentToInsert({html, markdown}) {
+            return markdown || html;
+        }
+
+        // Replace editor content
+        window.$events.listen('editor::replace', (eventContent) => {
+            const markdown = getContentToInsert(eventContent);
+            this.cm.setValue(markdown);
+        });
+
+        // Append editor content
+        window.$events.listen('editor::append', (eventContent) => {
+            const cursorPos = this.cm.getCursor('from');
+            const markdown = getContentToInsert(eventContent);
+            const content = this.cm.getValue() + '\n' + markdown;
+            this.cm.setValue(content);
+            this.cm.setCursor(cursorPos.line, cursorPos.ch);
+        });
+
+        // Prepend editor content
+        window.$events.listen('editor::prepend', (eventContent) => {
+            const cursorPos = this.cm.getCursor('from');
+            const markdown = getContentToInsert(eventContent);
+            const content = markdown + '\n' + this.cm.getValue();
+            this.cm.setValue(content);
+            const prependLineCount = markdown.split('\n').length;
+            this.cm.setCursor(cursorPos.line + prependLineCount, cursorPos.ch);
+        });
+    }
 }
 
 export default MarkdownEditor ;
diff --git a/resources/assets/js/components/new-user-password.js b/resources/assets/js/components/new-user-password.js
new file mode 100644 (file)
index 0000000..9c4c21c
--- /dev/null
@@ -0,0 +1,28 @@
+
+class NewUserPassword {
+
+    constructor(elem) {
+        this.elem = elem;
+        this.inviteOption = elem.querySelector('input[name=send_invite]');
+
+        if (this.inviteOption) {
+            this.inviteOption.addEventListener('change', this.inviteOptionChange.bind(this));
+            this.inviteOptionChange();
+        }
+    }
+
+    inviteOptionChange() {
+        const inviting = (this.inviteOption.value === 'true');
+        const passwordBoxes = this.elem.querySelectorAll('input[type=password]');
+        for (const input of passwordBoxes) {
+            input.disabled = inviting;
+        }
+        const container = this.elem.querySelector('#password-input-container');
+        if (container) {
+            container.style.display = inviting ? 'none' : 'block';
+        }
+    }
+
+}
+
+export default NewUserPassword;
\ No newline at end of file
index b2c05ebc68b1e25faffca1f7467c4a6ffa566efd..2be1c1c48b8cc93f5ac147b64023cf910eabc3fa 100644 (file)
@@ -23,8 +23,11 @@ class PageDisplay {
         const sidebarPageNav = document.querySelector('.sidebar-page-nav');
         if (sidebarPageNav) {
             DOM.onChildEvent(sidebarPageNav, 'a', 'click', (event, child) => {
+                event.preventDefault();
                 window.components['tri-layout'][0].showContent();
-                this.goToText(child.getAttribute('href').substr(1));
+                const contentId = child.getAttribute('href').substr(1);
+                this.goToText(contentId);
+                window.history.pushState(null, null, '#' + contentId);
             });
         }
     }
diff --git a/resources/assets/js/components/template-manager.js b/resources/assets/js/components/template-manager.js
new file mode 100644 (file)
index 0000000..b966762
--- /dev/null
@@ -0,0 +1,85 @@
+import * as DOM from "../services/dom";
+
+class TemplateManager {
+
+    constructor(elem) {
+        this.elem = elem;
+        this.list = elem.querySelector('[template-manager-list]');
+        this.searching = false;
+
+        // Template insert action buttons
+        DOM.onChildEvent(this.elem, '[template-action]', 'click', this.handleTemplateActionClick.bind(this));
+
+        // Template list pagination click
+        DOM.onChildEvent(this.elem, '.pagination a', 'click', this.handlePaginationClick.bind(this));
+
+        // Template list item content click
+        DOM.onChildEvent(this.elem, '.template-item-content', 'click', this.handleTemplateItemClick.bind(this));
+
+        this.setupSearchBox();
+    }
+
+    handleTemplateItemClick(event, templateItem) {
+        const templateId = templateItem.closest('[template-id]').getAttribute('template-id');
+        this.insertTemplate(templateId, 'replace');
+    }
+
+    handleTemplateActionClick(event, actionButton) {
+        event.stopPropagation();
+
+        const action = actionButton.getAttribute('template-action');
+        const templateId = actionButton.closest('[template-id]').getAttribute('template-id');
+        this.insertTemplate(templateId, action);
+    }
+
+    async insertTemplate(templateId, action = 'replace') {
+        const resp = await window.$http.get(`/templates/${templateId}`);
+        const eventName = 'editor::' + action;
+        window.$events.emit(eventName, resp.data);
+    }
+
+    async handlePaginationClick(event, paginationLink) {
+        event.preventDefault();
+        const paginationUrl = paginationLink.getAttribute('href');
+        const resp = await window.$http.get(paginationUrl);
+        this.list.innerHTML = resp.data;
+    }
+
+    setupSearchBox() {
+        const searchBox = this.elem.querySelector('.search-box');
+        const input = searchBox.querySelector('input');
+        const submitButton = searchBox.querySelector('button');
+        const cancelButton = searchBox.querySelector('button.search-box-cancel');
+
+        async function performSearch() {
+            const searchTerm = input.value;
+            const resp = await window.$http.get(`/templates`, {
+                search: searchTerm
+            });
+            cancelButton.style.display = searchTerm ? 'block' : 'none';
+            this.list.innerHTML = resp.data;
+        }
+        performSearch = performSearch.bind(this);
+
+        // Searchbox enter press
+        searchBox.addEventListener('keypress', event => {
+            if (event.key === 'Enter') {
+                event.preventDefault();
+                performSearch();
+            }
+        });
+
+        // Submit button press
+        submitButton.addEventListener('click', event => {
+            performSearch();
+        });
+
+        // Cancel button press
+        cancelButton.addEventListener('click', event => {
+            input.value = '';
+            performSearch();
+        });
+    }
+}
+
+export default TemplateManager;
\ No newline at end of file
index 3dd1ce85ccb4bd3d94983e34605a2651d3d47be0..b9b96afc5d07728d992e9cd49eab9e29a6df1f2a 100644 (file)
@@ -11,6 +11,11 @@ class ToggleSwitch {
 
     stateChange() {
         this.input.value = (this.checkbox.checked ? 'true' : 'false');
+
+        // Dispatch change event from hidden input so they can be listened to
+        // like a normal checkbox.
+        const changeEvent = new Event('change');
+        this.input.dispatchEvent(changeEvent);
     }
 
 }
index 5cd49b74fa67ddcc3f0928919e88cc18f7599040..905ca03b1020d566859366d6e2ecc8e851edc784 100644 (file)
@@ -74,14 +74,14 @@ class TriLayout {
      * Used by the page-display component.
      */
     showContent() {
-        this.showTab('content');
+        this.showTab('content', false);
     }
 
     /**
      * Show the given tab
      * @param tabName
      */
-    showTab(tabName) {
+    showTab(tabName, scroll = true) {
         this.scrollCache[this.lastTabShown] = document.documentElement.scrollTop;
 
         // Set tab status
@@ -96,12 +96,14 @@ class TriLayout {
         this.elem.classList.toggle('show-info', showInfo);
 
         // Set the scroll position from cache
-        const pageHeader = document.querySelector('header');
-        const defaultScrollTop = pageHeader.getBoundingClientRect().bottom;
-        document.documentElement.scrollTop = this.scrollCache[tabName] || defaultScrollTop;
-        setTimeout(() => {
+        if (scroll) {
+            const pageHeader = document.querySelector('header');
+            const defaultScrollTop = pageHeader.getBoundingClientRect().bottom;
             document.documentElement.scrollTop = this.scrollCache[tabName] || defaultScrollTop;
-        }, 50);
+            setTimeout(() => {
+                document.documentElement.scrollTop = this.scrollCache[tabName] || defaultScrollTop;
+            }, 50);
+        }
 
         this.lastTabShown = tabName;
     }
index eb9f025a749d91edf62fbad3d8be131892523120..be0aaf18a1ebc742cd1adabe4b413e3466cbcaab 100644 (file)
@@ -378,6 +378,27 @@ function customHrPlugin() {
 }
 
 
+function listenForBookStackEditorEvents(editor) {
+
+    // Replace editor content
+    window.$events.listen('editor::replace', ({html}) => {
+        editor.setContent(html);
+    });
+
+    // Append editor content
+    window.$events.listen('editor::append', ({html}) => {
+        const content = editor.getContent() + html;
+        editor.setContent(content);
+    });
+
+    // Prepend editor content
+    window.$events.listen('editor::prepend', ({html}) => {
+        const content = html + editor.getContent();
+        editor.setContent(content);
+    });
+
+}
+
 class WysiwygEditor {
 
     constructor(elem) {
@@ -553,6 +574,10 @@ class WysiwygEditor {
                     editor.focus();
                 }
 
+                listenForBookStackEditorEvents(editor);
+
+                // TODO - Update to standardise across both editors
+                // Use events within listenForBookStackEditorEvents instead (Different event signature)
                 window.$events.listen('editor-html-update', html => {
                     editor.setContent(html);
                     editor.selection.select(editor.getBody(), true);
index c23615a88ef8849ebf9177d6b3016fa36b813686..e0c7b34e5a85d5c22e57236c04346c95b7041a38 100644 (file)
@@ -16,7 +16,7 @@ window.$events = eventManager;
 // Translation setup
 // Creates a global function with name 'trans' to be used in the same way as Laravel's translation system
 import Translations from "./services/translations"
-const translator = new Translations(window.translations);
+const translator = new Translations();
 window.trans = translator.get.bind(translator);
 window.trans_choice = translator.getPlural.bind(translator);
 
index 5cb90b70c77cf13048ae82a4ec64df56977e58f0..8a3e9a57b4ac1a22a932981296570468f4a960f9 100644 (file)
@@ -1,3 +1,18 @@
+/**
+ * Fade out the given element.
+ * @param {Element} element
+ * @param {Number} animTime
+ * @param {Function|null} onComplete
+ */
+export function fadeOut(element, animTime = 400, onComplete = null) {
+    animateStyles(element, {
+        opacity: ['1', '0']
+    }, animTime, () => {
+        element.style.display = 'none';
+        if (onComplete) onComplete();
+    });
+}
+
 /**
  * Hide the element by sliding the contents upwards.
  * @param {Element} element
index 06b44a58010ffe264174669f79e239a3a5982e19..645286c08b9238ef8842846a80594cce7733ff51 100644 (file)
@@ -10,7 +10,20 @@ class Translator {
      * @param translations
      */
     constructor(translations) {
-        this.store = translations;
+        this.store = new Map();
+        this.parseTranslations();
+    }
+
+    /**
+     * Parse translations out of the page and place into the store.
+     */
+    parseTranslations() {
+        const translationMetaTags = document.querySelectorAll('meta[name="translation"]');
+        for (let tag of translationMetaTags) {
+            const key = tag.getAttribute('key');
+            const value = tag.getAttribute('value');
+            this.store.set(key, value);
+        }
     }
 
     /**
@@ -20,7 +33,7 @@ class Translator {
      * @returns {*}
      */
     get(key, replacements) {
-        let text = this.getTransText(key);
+        const text = this.getTransText(key);
         return this.performReplacements(text, replacements);
     }
 
@@ -33,26 +46,26 @@ class Translator {
      * @returns {*}
      */
     getPlural(key, count, replacements) {
-        let text = this.getTransText(key);
-        let splitText = text.split('|');
+        const text = this.getTransText(key);
+        const splitText = text.split('|');
+        const exactCountRegex = /^{([0-9]+)}/;
+        const rangeRegex = /^\[([0-9]+),([0-9*]+)]/;
         let result = null;
-        let exactCountRegex = /^{([0-9]+)}/;
-        let rangeRegex = /^\[([0-9]+),([0-9*]+)]/;
 
-        for (let i = 0, len = splitText.length; i < len; i++) {
-            let t = splitText[i];
+        for (const i = 0, len = splitText.length; i < len; i++) {
+            const t = splitText[i];
 
             // Parse exact matches
-            let exactMatches = t.match(exactCountRegex);
+            const exactMatches = t.match(exactCountRegex);
             if (exactMatches !== null && Number(exactMatches[1]) === count) {
                 result = t.replace(exactCountRegex, '').trim();
                 break;
             }
 
             // Parse range matches
-            let rangeMatches = t.match(rangeRegex);
+            const rangeMatches = t.match(rangeRegex);
             if (rangeMatches !== null) {
-                let rangeStart = Number(rangeMatches[1]);
+                const rangeStart = Number(rangeMatches[1]);
                 if (rangeStart <= count && (rangeMatches[2] === '*' || Number(rangeMatches[2]) >= count)) {
                     result = t.replace(rangeRegex, '').trim();
                     break;
@@ -74,14 +87,10 @@ class Translator {
      * @returns {String|Object}
      */
     getTransText(key) {
-        let splitKey = key.split('.');
-        let value = splitKey.reduce((a, b) => {
-            return a !== undefined ? a[b] : a;
-        }, this.store);
+        const value = this.store.get(key);
 
         if (value === undefined) {
-            console.log(`Translation with key "${key}" does not exist`);
-            value = key;
+            console.warn(`Translation with key "${key}" does not exist`);
         }
 
         return value;
@@ -95,10 +104,10 @@ class Translator {
      */
     performReplacements(string, replacements) {
         if (!replacements) return string;
-        let replaceMatches = string.match(/:([\S]+)/g);
+        const replaceMatches = string.match(/:([\S]+)/g);
         if (replaceMatches === null) return string;
         replaceMatches.forEach(match => {
-            let key = match.substring(1);
+            const key = match.substring(1);
             if (typeof replacements[key] === 'undefined') return;
             string = string.replace(match, replacements[key]);
         });
index 9d3d22b4dd2fdf7668299a1c65a1799db0e46366..751cca330020c8d3cf3ffeba6e70e84d33774779 100644 (file)
@@ -1,4 +1,5 @@
 import DropZone from "dropzone";
+import { fadeOut } from "../../services/animations";
 
 const template = `
     <div class="dropzone-container">
@@ -8,7 +9,6 @@ const template = `
 
 const props = ['placeholder', 'uploadUrl', 'uploadedTo'];
 
-// TODO - Remove jQuery usage
 function mounted() {
    const container = this.$el;
    const _this = this;
@@ -37,7 +37,7 @@ function mounted() {
 
             dz.on('success', function (file, data) {
                 _this.$emit('success', {file, data});
-                $(file.previewElement).fadeOut(400, function () {
+                fadeOut(file.previewElement, 800, () => {
                     dz.removeFile(file);
                 });
             });
@@ -46,7 +46,8 @@ function mounted() {
                 _this.$emit('error', {file, errorMessage, xhr});
 
                 function setMessage(message) {
-                    $(file.previewElement).find('[data-dz-errormessage]').text(message);
+                    const messsageEl = file.previewElement.querySelector('[data-dz-errormessage]');
+                    messsageEl.textContent = message;
                 }
 
                 if (xhr && xhr.status === 413) {
index 864a3a9064912b203658959391b7ca16534c6efb..fbf2857a428fe42058c304737e4a7327c17f56ea 100644 (file)
@@ -69,8 +69,8 @@ let methods = {
         autoSave = window.setInterval(() => {
             // Return if manually saved recently to prevent bombarding the server
             if (Date.now() - lastSave < (1000 * autoSaveFrequency)/2) return;
-            let newTitle = document.getElementById('name').value.trim();
-            let newHtml = this.editorHTML;
+            const newTitle = document.getElementById('name').value.trim();
+            const newHtml = this.editorHTML;
 
             if (newTitle !== currentContent.title || newHtml !== currentContent.html) {
                 currentContent.html = newHtml;
@@ -84,18 +84,18 @@ let methods = {
     saveDraft() {
         if (!this.draftsEnabled) return;
 
-        let data = {
+        const data = {
             name: document.getElementById('name').value.trim(),
             html: this.editorHTML
         };
 
         if (this.editorType === 'markdown') data.markdown = this.editorMarkdown;
 
-        let url = window.baseUrl(`/ajax/page/${this.pageId}/save-draft`);
+        const url = window.baseUrl(`/ajax/page/${this.pageId}/save-draft`);
         window.$http.put(url, data).then(response => {
             draftErroring = false;
             if (!this.isNewDraft) this.isUpdateDraft = true;
-            this.draftNotifyChange(`${response.data.message } ${Dates.utcTimeStampToLocalTime(response.data.timestamp)}`);
+            this.draftNotifyChange(`${response.data.message} ${Dates.utcTimeStampToLocalTime(response.data.timestamp)}`);
             lastSave = Date.now();
         }, errorRes => {
             if (draftErroring) return;
index 032b1cbeb1c467983eaf8da8b1e02c5b0c38d0f2..5f11c235532865e3c3325264e69e4ccf104ead61 100644 (file)
   line-height: 1;
 }
 
+.card.border-card {
+  border: 1px solid #DDD;
+}
+
 .card.drag-card {
   border: 1px solid #DDD;
   border-radius: 4px;
index 039ac4dc8d8c3580c7f0374025ac6aa43a0692e3..0b683c6e315f3f9f6bdd70e0b8313621a353fc24 100644 (file)
@@ -655,4 +655,32 @@ body.flexbox-support #entity-selector-wrap .popup-body .form-group {
 }
 .permissions-table tr:hover [permissions-table-toggle-all-in-row] {
   display: inline;
+}
+
+.template-item {
+  cursor: pointer;
+  position: relative;
+  &:hover, .template-item-actions button:hover {
+    background-color: #F2F2F2;
+  }
+  .template-item-actions {
+    position: absolute;
+    top: 0;
+    right: 0;
+    width: 50px;
+    height: 100%;
+    display: flex;
+    flex-direction: column;
+    border-left: 1px solid #DDD;
+  }
+  .template-item-actions button {
+    cursor: pointer;
+    flex: 1;
+    background: #FFF;
+    border: 0;
+    border-top: 1px solid #DDD;
+  }
+  .template-item-actions button:first-child {
+    border-top: 0;
+  }
 }
\ No newline at end of file
index c4ca4607adf76a641477d51f31952d1452527db1..adb014f4a956b135255982d0ea71830138ab3ece 100644 (file)
@@ -16,7 +16,7 @@ header .grid {
 header {
   position: relative;
   display: block;
-  z-index: 6;
+  z-index: 11;
   top: 0;
   background-color: $primary-dark;
   color: #fff;
index d9fff3c41caeecad7118f7c4d1c46108c265e978..b282b12e272c45455b4123527236d24fe27bacd2 100644 (file)
@@ -219,12 +219,19 @@ body.flexbox {
 @include smaller-than($xxl) {
   .tri-layout-container {
     grid-template-areas:  "c b b"
-    "a b b";
+    "a b b"
+    ". b b";
     grid-template-columns: 1fr 3fr;
-    grid-template-rows: max-content min-content;
+    grid-template-rows: min-content min-content 1fr;
     padding-right: $-l;
   }
 }
+@include between($l, $xxl) {
+  .tri-layout-left {
+    position: sticky;
+    top: $-m;
+  }
+}
 @include larger-than($xxl) {
   .tri-layout-left-contents, .tri-layout-right-contents {
     padding: $-m;
index cafbfa78154ba6fb4625eda5ec9167eb4c4fd8ff..c413bcd8eecf6fd2c7e1bfae8b4b89777962286e 100644 (file)
     padding-left: $nav-indent;
   }
   .h2 {
-    padding-left: $nav-indent;
+    padding-left: $nav-indent * 1.5;
   }
   .h3 {
     padding-left: $nav-indent * 2;
index c58f6ef476e55cac1498e5dc41ba09b4ac21ecc7..be0cc381c828cca940afb1f505937763f08a5f7a 100755 (executable)
   }
 }
 
+body.mce-fullscreen .page-editor .edit-area {
+  z-index: 12;
+}
+
 @include smaller-than($s) {
   .page-edit-toolbar {
     overflow-x: scroll;
 }
 .pointer {
   border: 1px solid #CCC;
-  display: inline-block;
+  display: flex;
+  align-items: center;
+  justify-items: center;
   padding: $-s $-s;
   border-radius: 4px;
-  box-shadow: 0 0 8px 1px rgba(212, 209, 209, 0.35);
+  box-shadow: 0 0 12px 1px rgba(212, 209, 209, 0.3);
   position: absolute;
   top: -60px;
   background-color:#FFF;
     border-right: 1px solid #CCC;
     z-index: 56;
   }
-  input {
-    background-color: #FFF;
-    border: 1px solid #DDD;
-    color: #666;
-    width: 172px;
-    z-index: 40;
-  }
   input, button, a {
     position: relative;
     border-radius: 0;
     vertical-align: top;
     padding: 5px 16px;
   }
-  > i {
-    color: #888;
-    font-size: 18px;
-    padding-top: 4px;
+  input {
+    background-color: #FFF;
+    border: 1px solid #DDD;
+    color: #666;
+    width: 172px;
+    z-index: 40;
+    padding: 5px 10px;
   }
   span.icon {
+    fill: #444;
     cursor: pointer;
     user-select: none;
+    display: inline-block;
+    line-height: 1;
   }
   .input-group .button {
     line-height: 1;
     box-shadow: none;
   }
   a.button {
-    margin: 0 0 0 0;
-
-    &:hover {
-      fill: #fff;
-    }
+    margin: 0;
+    color: #FFF;
   }
   .svg-icon {
     width: 1.2em;
     display: block;
     cursor: pointer;
     padding: $-s $-m;
-    font-size: 13.5px;
+    font-size: 16px;
     line-height: 1.6;
     border-bottom: 1px solid rgba(255, 255, 255, 0.3);
   }
index 1a613898e1e6b24613e3625c1dea73fac91dbc20..f1d165a47f991ddb94e31f20bcf88a86b9fa94fe 100644 (file)
@@ -329,6 +329,12 @@ li.checkbox-item, li.task-list-item {
   overflow-wrap: break-word;
 }
 
+.limit-text {
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+}
+
 /**
  * Grouping
  */
index 1596feb76d91a014a7683221359142cffef639f1..4c50f14d2f020ed371b0e88a9ccdb4cb2fb5e10a 100644 (file)
@@ -47,6 +47,8 @@
       display: flex !important;
       flex-direction: column;
       align-items: stretch;
+      -webkit-overflow-scrolling:touch;
+      overflow:auto;
       iframe {
         flex: 1;
       }
index be2eb54b82a8285177dfa6130e25dc1086fe08b7..35b2c9f8a50a3fd5a04e4384e8977bfa97d7340e 100644 (file)
@@ -17,7 +17,6 @@ return [
     'page_restore'                => 'stellt Seite wieder her',
     'page_restore_notification'   => 'Die Seite wurde erfolgreich wiederhergestellt.',
     'page_move'                   => 'verschiebt Seite',
-    'page_move_notification'      => 'Die Seite wurde erfolgreich verschoben.',
 
     // Chapters
     'chapter_create'              => 'erstellt Kapitel',
index 7b1ebec6e78f65f148e53bfa6336d64525681106..46d4070b8c1e47d06df0d3656c61b7ec465e8824 100644 (file)
@@ -30,6 +30,8 @@ return [
     'remember_me' => 'Angemeldet bleiben',
     'ldap_email_hint' => 'Bitte geben Sie eine E-Mail-Adresse ein, um diese mit dem Account zu nutzen.',
     'create_account' => 'Account registrieren',
+    'already_have_account' => 'Bereits ein Konto erstellt?',
+    'dont_have_account' => 'Noch kein Konto erstellt?',
     'social_login' => 'Mit Sozialem Netzwerk anmelden',
     'social_registration' => 'Mit Sozialem Netzwerk registrieren',
     'social_registration_text' => 'Mit einer dieser Dienste registrieren oder anmelden',
index 5579a488aea2fd7371ec69865aceb6d793241c8c..97b48ce4d623849c75b75814af36a20b358596e8 100644 (file)
@@ -10,6 +10,7 @@ return [
     'save' => 'Speichern',
     'continue' => 'Weiter',
     'select' => 'Auswählen',
+    'toggle_all' => 'Alle umschalten',
     'more' => 'Mehr',
 
     /**
@@ -26,6 +27,7 @@ return [
      */
     'actions' => 'Aktionen',
     'view' => 'Anzeigen',
+    'view_all' => 'Alle anzeigen',
     'create' => 'Anlegen',
     'update' => 'Aktualisieren',
     'edit' => 'Bearbeiten',
@@ -40,6 +42,11 @@ return [
     'remove' => 'Entfernen',
     'add' => 'Hinzufügen',
 
+    // Sort Options
+    'sort_name' => 'Name',
+    'sort_created_at' => 'Erstellungsdatum',
+    'sort_updated_at' => 'Aktualisierungsdatum',
+
     /**
      * Misc
      */
@@ -52,6 +59,7 @@ return [
     'details' => 'Details',
     'grid_view' => 'Gitteransicht',
     'list_view' => 'Listenansicht',
+    'default' => 'Voreinstellung',
 
     /**
      * Header
@@ -59,6 +67,10 @@ return [
     'view_profile' => 'Profil ansehen',
     'edit_profile' => 'Profil bearbeiten',
 
+    // Layout tabs
+    'tab_info' => 'Info',
+    'tab_content' => 'Inhalt',
+
     /**
      * Email Content
      */
index 07a92e2c7aac8acc1e6bfe12a9ab66ecc676b6b5..d674195434a3f1143facc2e909db74bd73d112de 100644 (file)
@@ -8,6 +8,7 @@ return [
     'recently_updated_pages' => 'Kürzlich aktualisierte Seiten',
     'recently_created_chapters' => 'Kürzlich angelegte Kapitel',
     'recently_created_books' => 'Kürzlich angelegte Bücher',
+    'recently_created_shelves' => 'Kürzlich angelegte Regale',
     'recently_update' => 'Kürzlich aktualisiert',
     'recently_viewed' => 'Kürzlich angesehen',
     'recent_activity' => 'Kürzliche Aktivität',
@@ -49,28 +50,32 @@ return [
     'search_content_type' => 'Inhaltstyp',
     'search_exact_matches' => 'Exakte Treffer',
     'search_tags' => 'Nach Schlagwort suchen',
+    'search_options' => 'Optionen',
     'search_viewed_by_me' => 'Schon von mir angesehen',
     'search_not_viewed_by_me' => 'Noch nicht von mir angesehen',
     'search_permissions_set' => 'Berechtigungen gesetzt',
     'search_created_by_me' => 'Von mir erstellt',
     'search_updated_by_me' => 'Von mir aktualisiert',
+    'search_date_options' => 'Datums Optionen',
     'search_updated_before' => 'Aktualisiert vor',
     'search_updated_after' => 'Aktualisiert nach',
     'search_created_before' => 'Erstellt vor',
     'search_created_after' => 'Erstellt nach',
     'search_set_date' => 'Datum auswählen',
     'search_update' => 'Suche aktualisieren',
-    
+
     /*
      * Shelves
      */
     'shelf' => 'Regal',
     'shelves' => 'Regale',
+    'x_shelves' => ':count Regal|:count Regale',
     'shelves_long' => 'Bücherregal',
     'shelves_empty' => 'Es wurden noch keine Regale angelegt',
     'shelves_create' => 'Erzeuge ein Regal',
     'shelves_popular' => 'Beliebte Regale',
     'shelves_new' => 'Kürzlich erstellte Regale',
+    'shelves_new_action' => 'Neues Regal',
     'shelves_popular_empty' => 'Die beliebtesten Regale werden hier angezeigt.',
     'shelves_new_empty' => 'Die neusten Regale werden hier angezeigt.',
     'shelves_save' => 'Regal speichern',
@@ -92,7 +97,7 @@ return [
     'shelves_copy_permissions' => 'Berechtigungen kopieren',
     'shelves_copy_permissions_explain' => 'Hiermit werden die Berechtigungen des aktuellen Regals auf alle enthaltenen Bücher übertragen. Überprüfen Sie vor der Aktivierung, ob alle Berechtigungsänderungen am aktuellen Regal gespeichert wurden.',
     'shelves_copy_permission_success' => 'Regal-Berechtigungen wurden zu :count Büchern kopiert',
-    
+
     /**
      * Books
      */
@@ -103,6 +108,7 @@ return [
     'books_popular' => 'Beliebte Bücher',
     'books_recent' => 'Kürzlich angesehene Bücher',
     'books_new' => 'Neue Bücher',
+    'books_new_action' => 'Neues Buch',
     'books_popular_empty' => 'Die beliebtesten Bücher werden hier angezeigt.',
     'books_new_empty' => 'Die neusten Bücher werden hier angezeigt.',
     'books_create' => 'Neues Buch erstellen',
@@ -118,7 +124,6 @@ return [
     'books_permissions_updated' => 'Buch-Berechtigungen aktualisiert',
     'books_empty_contents' => 'Es sind noch keine Seiten oder Kapitel zu diesem Buch hinzugefügt worden.',
     'books_empty_create_page' => 'Neue Seite anlegen',
-    'books_empty_or' => 'oder',
     'books_empty_sort_current_book' => 'Aktuelles Buch sortieren',
     'books_empty_add_chapter' => 'Neues Kapitel hinzufügen',
     'books_permissions_active' => 'Buch-Berechtigungen aktiv',
@@ -126,6 +131,11 @@ return [
     'books_navigation' => 'Buchnavigation',
     'books_sort' => 'Buchinhalte sortieren',
     'books_sort_named' => 'Buch ":bookName" sortieren',
+    'books_sort_name' => 'Sortieren nach Namen',
+    'books_sort_created' => 'Sortieren nach Erstellungsdatum',
+    'books_sort_updated' => 'Sortieren nach Aktualisierungsdatum',
+    'books_sort_chapters_first' => 'Kapitel zuerst',
+    'books_sort_chapters_last' => 'Kapitel zuletzt',
     'books_sort_show_other' => 'Andere Bücher anzeigen',
     'books_sort_save' => 'Neue Reihenfolge speichern',
     /**
@@ -232,6 +242,7 @@ return [
     'page_tags' => 'Seiten-Schlagwörter',
     'chapter_tags' => 'Kapitel-Schlagwörter',
     'book_tags' => 'Buch-Schlagwörter',
+    'shelf_tags' => 'Regal-Schlagwörter',
     'tag' => 'Schlagwort',
     'tags' =>  'Schlagwörter',
     'tag_value' => 'Inhalt (Optional)',
@@ -270,6 +281,7 @@ return [
     'profile_not_created_pages' => ':userName hat noch keine Seiten erstellt.',
     'profile_not_created_chapters' => ':userName hat noch keine Kapitel erstellt.',
     'profile_not_created_books' => ':userName hat noch keine Bücher erstellt.',
+    'profile_not_created_shelves' => ':userName hat noch keine Regale erstellt.',
     /**
      * Comments
      */
@@ -294,6 +306,7 @@ return [
      * Revision
      */
     'revision_delete_confirm' => 'Sind Sie sicher, dass Sie diese Revision löschen wollen?',
+    'revision_restore_confirm' => 'Sind Sie sicher, dass Sie diese Revision wiederherstellen wollen? Der aktuelle Seiteninhalt wird ersetzt.',
     'revision_delete_success' => 'Revision gelöscht',
     'revision_cannot_delete_latest' => 'Die letzte Version kann nicht gelöscht werden.'
 ];
index dc95d1d2bf896b14f8a1a3c65c014a45124769e9..362641bc88489194335036961acf97f522c69c93 100644 (file)
@@ -30,6 +30,7 @@ return [
     'cannot_get_image_from_url' => 'Bild konnte nicht von der URL :url geladen werden.',
     'cannot_create_thumbs' => 'Der Server kann keine Vorschau-Bilder erzeugen. Bitte prüfen Sie, ob die GD PHP-Erweiterung installiert ist.',
     'server_upload_limit' => 'Der Server verbietet das Hochladen von Dateien mit dieser Dateigröße. Bitte versuchen Sie es mit einer kleineren Datei.',
+    'uploaded'  => 'Der Server verbietet das Hochladen von Dateien mit dieser Dateigröße. Bitte versuchen Sie es mit einer kleineren Datei.',
     'image_upload_error' => 'Beim Hochladen des Bildes trat ein Fehler auf.',
     'image_upload_type_error' => 'Der Bildtyp der hochgeladenen Datei ist ungültig.',
     'file_upload_timeout' => 'Der Upload der Datei ist abgelaufen.',
@@ -43,6 +44,7 @@ return [
     // Entities
     'entity_not_found' => 'Eintrag nicht gefunden',
     'book_not_found' => 'Buch nicht gefunden',
+    'bookshelf_not_found' => 'Regal nicht gefunden',
     'page_not_found' => 'Seite nicht gefunden',
     'chapter_not_found' => 'Kapitel nicht gefunden',
     'selected_book_not_found' => 'Das gewählte Buch wurde nicht gefunden.',
@@ -55,6 +57,8 @@ return [
     'role_cannot_be_edited' => 'Diese Rolle kann nicht bearbeitet werden.',
     'role_system_cannot_be_deleted' => 'Dies ist eine Systemrolle und kann nicht gelöscht werden',
     'role_registration_default_cannot_delete' => 'Diese Rolle kann nicht gelöscht werden, solange sie als Standardrolle für neue Registrierungen gesetzt ist',
+    'role_cannot_remove_only_admin' => 'Dieser Benutzer ist der einzige Benutzer, welchem die Administratorrolle zugeordnet ist. Ordnen Sie die Administratorrolle einem anderen Benutzer zu, bevor Sie versuchen, sie hier zu entfernen.',
+
     // Comments
     'comment_list' => 'Beim Abrufen der Kommentare ist ein Fehler aufgetreten.',
     'cannot_add_comment_to_draft' => 'Du kannst keine Kommentare zu einem Entwurf hinzufügen.',
index 0a8d50d051fe2a7a8a9c02af02f872dea3d31be7..11050924ec5159b4d1b33826ca0ef17e32cf1f90 100644 (file)
@@ -11,10 +11,16 @@ return [
     /**
      * App settings
      */
-    'app_settings' => 'Anwendungseinstellungen',
+    'app_customization' => 'Personalisierung',
+    'app_features_security' => 'Funktionen & Sicherheit',
     'app_name' => 'Anwendungsname',
     'app_name_desc' => 'Dieser Name wird im Header und in E-Mails angezeigt.',
     'app_name_header' => 'Anwendungsname im Header anzeigen?',
+    'app_public_access' => 'Öffentlicher Zugriff',
+    'app_public_access_desc' => 'Wenn Sie diese Option aktivieren, können Besucher, die nicht angemeldet sind, auf Inhalte in Ihrer BookStack-Instanz zugreifen.',
+    'app_public_access_desc_guest' => 'Der Zugang für öffentliche Besucher kann über den Benutzer "Guest" gesteuert werden.',
+    'app_public_access_toggle' => 'Öffentlichen Zugriff erlauben',
+
     'app_public_viewing' => 'Öffentliche Ansicht erlauben?',
     'app_secure_images' => 'Erhöhte Sicherheit für hochgeladene Bilder aktivieren?',
     'app_secure_images_desc' => 'Aus Leistungsgründen sind alle Bilder öffentlich sichtbar. Diese Option fügt zufällige, schwer zu eratene, Zeichenketten zu Bild-URLs hinzu. Stellen sie sicher, dass Verzeichnisindizes deaktiviert sind, um einen einfachen Zugriff zu verhindern.',
@@ -28,22 +34,25 @@ return [
     'app_primary_color_desc' => "Dies sollte ein HEX Wert sein.\nWenn Sie nicht eingeben, wird die Anwendung auf die Standardfarbe zurückgesetzt.",
     'app_homepage' => 'Startseite der Anwendung',
     'app_homepage_desc' => 'Wählen Sie eine Seite als Startseite aus, die statt der Standardansicht angezeigt werden soll. Seitenberechtigungen werden für die ausgewählten Seiten ignoriert.',
-    'app_homepage_default' => 'Ausgewählte Startseite',
-    'app_homepage_books' => 'Oder wähle die Buch-Übersicht als Startseite. Das wird die Seiten-Auswahl überschreiben.',
+    'app_homepage_select' => 'Wählen Sie eine Seite aus',
     'app_disable_comments' => 'Kommentare deaktivieren',
+    'app_disable_comments_toggle' => 'Kommentare deaktivieren',
     'app_disable_comments_desc' => 'Deaktiviert Kommentare über alle Seiten in der Anwendung. Vorhandene Kommentare werden nicht angezeigt.',
     /**
      * Registration settings
      */
     'reg_settings' => 'Registrierungseinstellungen',
-    'reg_allow' => 'Registrierung erlauben?',
+    'reg_enable' => 'Registrierung erlauben?',
+    'reg_enable_toggle' => 'Registrierung erlauben',
+    'reg_enable_desc' => 'Wenn die Registrierung erlaubt ist, kann sich der Benutzer als Anwendungsbenutzer anmelden. Bei der Registrierung erhält er eine einzige, voreingestellte Benutzerrolle.',
     'reg_default_role' => 'Standard-Benutzerrolle nach Registrierung',
-    'reg_confirm_email' => 'Bestätigung per E-Mail erforderlich?',
+    'reg_email_confirmation' => 'Bestätigung per E-Mail',
+    'reg_email_confirmation_toggle' => 'Bestätigung per E-Mail erforderlich',
     'reg_confirm_email_desc' => 'Falls die Einschränkung für Domains genutzt wird, ist die Bestätigung per E-Mail zwingend erforderlich und der untenstehende Wert wird ignoriert.',
     'reg_confirm_restrict_domain' => 'Registrierung auf bestimmte Domains einschränken',
     'reg_confirm_restrict_domain_desc' => "Fügen sie eine durch Komma getrennte Liste von Domains hinzu, auf die die Registrierung eingeschränkt werden soll. Benutzern wird eine E-Mail gesendet, um ihre E-Mail Adresse zu bestätigen, bevor sie diese Anwendung nutzen können.\nHinweis: Benutzer können ihre E-Mail Adresse nach erfolgreicher Registrierung ändern.",
     'reg_confirm_restrict_domain_placeholder' => 'Keine Einschränkung gesetzt',
-    
+
     /**
      * Maintenance settings
      */
@@ -74,6 +83,7 @@ return [
     'role_details' => 'Rollendetails',
     'role_name' => 'Rollenname',
     'role_desc' => 'Kurzbeschreibung der Rolle',
+    'role_external_auth_id' => 'Externe Authentifizierungs-IDs',
     'role_system' => 'System-Berechtigungen',
     'role_manage_users' => 'Benutzer verwalten',
     'role_manage_roles' => 'Rollen und Rollen-Berechtigungen verwalten',
@@ -82,6 +92,7 @@ return [
     'role_manage_settings' => 'Globaleinstellungen verwalten',
     'role_asset' => 'Berechtigungen',
     'role_asset_desc' => 'Diese Berechtigungen gelten für den Standard-Zugriff innerhalb des Systems. Berechtigungen für Bücher, Kapitel und Seiten überschreiben diese Berechtigungenen.',
+    'role_asset_admins' => 'Administratoren erhalten automatisch Zugriff auf alle Inhalte, aber diese Optionen können Oberflächenoptionen ein- oder ausblenden.',
     'role_all' => 'Alle',
     'role_own' => 'Eigene',
     'role_controlled_by_asset' => 'Berechtigungen werden vom Uploadziel bestimmt',
@@ -96,8 +107,15 @@ return [
     'user_profile' => 'Benutzerprofil',
     'users_add_new' => 'Benutzer hinzufügen',
     'users_search' => 'Benutzer suchen',
+    'users_details' => 'Benutzerdetails',
+    'users_details_desc' => 'Legen Sie für diesen Benutzer einen Anzeigenamen und eine E-Mail-Adresse fest. Die E-Mail-Adresse wird bei der Anmeldung verwendet.',
+    'users_details_desc_no_email' => 'Legen Sie für diesen Benutzer einen Anzeigenamen fest, damit andere ihn erkennen können.',
     'users_role' => 'Benutzerrollen',
+    'users_role_desc' => 'Wählen Sie aus, welchen Rollen dieser Benutzer zugeordnet werden soll. Wenn ein Benutzer mehreren Rollen zugeordnet ist, werden die Berechtigungen dieser Rollen gestapelt und er erhält alle Fähigkeiten der zugewiesenen Rollen.',
+    'users_password' => 'Benutzerpasswort',
+    'users_password_desc' => 'Legen Sie ein Passwort fest, mit dem Sie sich anmelden möchten. Diese muss mindestens 5 Zeichen lang sein.',
     'users_external_auth_id' => 'Externe Authentifizierungs-ID',
+    'users_external_auth_id_desc' => 'Dies ist die ID, die verwendet wird, um diesen Benutzer bei der Kommunikation mit Ihrem LDAP-System abzugleichen.',
     'users_password_warning' => 'Füllen Sie die folgenden Felder nur aus, wenn Sie Ihr Passwort ändern möchten:',
     'users_system_public' => 'Dieser Benutzer repräsentiert alle unangemeldeten Benutzer, die diese Seite betrachten. Er kann nicht zum Anmelden benutzt werden, sondern wird automatisch zugeordnet.',
     'users_delete' => 'Benutzer löschen',
@@ -111,6 +129,7 @@ return [
     'users_avatar' => 'Benutzer-Bild',
     'users_avatar_desc' => 'Das Bild sollte eine Auflösung von 256x256px haben.',
     'users_preferred_language' => 'Bevorzugte Sprache',
+    'users_preferred_language_desc' => 'Diese Option ändert die Sprache, die für die Benutzeroberfläche der Anwendung verwendet wird. Dies hat keinen Einfluss auf von Benutzern erstellte Inhalte.',
     'users_social_accounts' => 'Social-Media Konten',
     'users_social_accounts_info' => 'Hier können Sie andere Social-Media-Konten für eine schnellere und einfachere Anmeldung verknüpfen. Wenn Sie ein Social-Media Konto lösen, bleibt der Zugriff erhalten. Entfernen Sie in diesem Falle die Berechtigung in Ihren Profil-Einstellungen des verknüpften Social-Media-Kontos.',
     'users_social_connect' => 'Social-Media-Konto verknüpfen',
index 5ac4b1b2735061345bc12a3df4168ba42589b137..84faeebb770cca2ec98c1fba560f184bc17d726f 100644 (file)
@@ -38,6 +38,7 @@ return [
     'filled'               => ':attribute ist erforderlich.',
     'exists'               => ':attribute ist ungültig.',
     'image'                => ':attribute muss ein Bild sein.',
+    'image_extension'      => ':attribute muss eine gültige und unterstützte Bild-Dateiendung haben.',
     'in'                   => ':attribute ist ungültig.',
     'integer'              => ':attribute muss eine Zahl sein.',
     'ip'                   => ':attribute muss eine valide IP-Adresse sein.',
@@ -54,6 +55,7 @@ return [
         'string'  => ':attribute muss mindestens :min Zeichen lang sein.',
         'array'   => ':attribute muss mindesten :min Elemente enthalten.',
     ],
+    'no_double_extension'  => ':attribute darf nur eine gültige Dateiendung',
     'not_in'               => ':attribute ist ungültig.',
     'numeric'              => ':attribute muss eine Zahl sein.',
     'regex'                => ':attribute ist in einem ungültigen Format.',
@@ -74,6 +76,7 @@ return [
     'timezone'             => ':attribute muss eine valide zeitzone sein.',
     'unique'               => ':attribute wird bereits verwendet.',
     'url'                  => ':attribute ist kein valides Format.',
+    'uploaded'             => 'Die Datei konnte nicht hochgeladen werden. Der Server akzeptiert möglicherweise keine Dateien dieser Größe.',
 
     /*
     |--------------------------------------------------------------------------
@@ -90,6 +93,9 @@ return [
         'attribute-name' => [
             'rule-name' => 'custom-message',
         ],
+        'password-confirm' => [
+            'required_with' => 'Passwortbestätigung erforderlich',
+        ],
     ],
 
     /*
index 1065945c0b0a55b89b70103fa2cfe554847aa65c..37346097f234d73e8fc9845fa9d652694a7d3f2d 100644 (file)
@@ -64,4 +64,14 @@ return [
     'email_not_confirmed_click_link' => 'Please click the link in the email that was sent shortly after you registered.',
     'email_not_confirmed_resend' => 'If you cannot find the email you can re-send the confirmation email by submitting the form below.',
     'email_not_confirmed_resend_button' => 'Resend Confirmation Email',
+
+    // User Invite
+    'user_invite_email_subject' => 'You have been invited to join :appName!',
+    'user_invite_email_greeting' => 'An account has been created for you on :appName.',
+    'user_invite_email_text' => 'Click the button below to set an account password and gain access:',
+    'user_invite_email_action' => 'Set Account Password',
+    'user_invite_page_welcome' => 'Welcome to :appName!',
+    'user_invite_page_text' => 'To finalise your account and gain access you need to set a password which will be used to log-in to :appName on future visits.',
+    'user_invite_page_confirm_button' => 'Confirm Password',
+    'user_invite_success' => 'Password set, you now have access to :appName!'
 ];
\ No newline at end of file
index f6df7e71b308db293da1844e3aa8682794f08ffc..3208a6dfcc212f339b47e9a573933cd3c7233137 100644 (file)
@@ -233,6 +233,7 @@ return [
     ],
     'pages_draft_discarded' => 'Draft discarded, The editor has been updated with the current page content',
     'pages_specific' => 'Specific Page',
+    'pages_is_template' => 'Page Template',
 
     // Editor Sidebar
     'page_tags' => 'Page Tags',
@@ -269,6 +270,12 @@ return [
     'attachments_file_uploaded' => 'File successfully uploaded',
     'attachments_file_updated' => 'File successfully updated',
     'attachments_link_attached' => 'Link successfully attached to page',
+    'templates' => 'Templates',
+    'templates_set_as_template' => 'Page is a template',
+    'templates_explain_set_as_template' => 'You can set this page as a template so its contents be utilized when creating other pages. Other users will be able to use this template if they have view permissions for this page.',
+    'templates_replace_content' => 'Replace page content',
+    'templates_append_content' => 'Append to page content',
+    'templates_prepend_content' => 'Prepend to page content',
 
     // Profile View
     'profile_user_for_x' => 'User for :time',
index b91a0c3e11c96cfdc6f85d4f9940c472476610b2..c3b47744d31f5fc63081ec6d50136511721941c1 100644 (file)
@@ -27,6 +27,7 @@ return [
     'social_account_register_instructions' => 'If you do not yet have an account, You can register an account using the :socialAccount option.',
     'social_driver_not_found' => 'Social driver not found',
     'social_driver_not_configured' => 'Your :socialAccount social settings are not configured correctly.',
+    'invite_token_expired' => 'This invitation link has expired. You can instead try to reset your account password.',
 
     // System
     'path_not_writable' => 'File path :filePath could not be uploaded to. Ensure it is writable to the server.',
index 4d70aa62663e678903b6b0554577c0668101bd52..bb542a588895b9cbedc1e2b2900d3883f64869f3 100755 (executable)
@@ -85,6 +85,7 @@ return [
     'role_manage_roles' => 'Manage roles & role permissions',
     'role_manage_entity_permissions' => 'Manage all book, chapter & page permissions',
     'role_manage_own_entity_permissions' => 'Manage permissions on own book, chapter & pages',
+    'role_manage_page_templates' => 'Manage page templates',
     'role_manage_settings' => 'Manage app settings',
     'role_asset' => 'Asset Permissions',
     'role_asset_desc' => 'These permissions control default access to the assets within the system. Permissions on Books, Chapters and Pages will override these permissions.',
@@ -108,7 +109,9 @@ return [
     'users_role' => 'User Roles',
     'users_role_desc' => 'Select which roles this user will be assigned to. If a user is assigned to multiple roles the permissions from those roles will stack and they will receive all abilities of the assigned roles.',
     'users_password' => 'User Password',
-    'users_password_desc' => 'Set a password used to log-in to the application. This must be at least 5 characters long.',
+    'users_password_desc' => 'Set a password used to log-in to the application. This must be at least 6 characters long.',
+    'users_send_invite_text' => 'You can choose to send this user an invitation email which allows them to set their own password otherwise you can set their password yourself.',
+    'users_send_invite_option' => 'Send user invite email',
     'users_external_auth_id' => 'External Authentication ID',
     'users_external_auth_id_desc' => 'This is the ID used to match this user when communicating with your LDAP system.',
     'users_password_warning' => 'Only fill the below if you would like to change your password.',
@@ -126,7 +129,7 @@ return [
     'users_preferred_language' => 'Preferred Language',
     'users_preferred_language_desc' => 'This option will change the language used for the user-interface of the application. This will not affect any user-created content.',
     'users_social_accounts' => 'Social Accounts',
-    'users_social_accounts_info' => 'Here you can connect your other accounts for quicker and easier login. Disconnecting an account here does not previously authorized access. Revoke access from your profile settings on the connected social account.',
+    'users_social_accounts_info' => 'Here you can connect your other accounts for quicker and easier login. Disconnecting an account here does not revoke previously authorized access. Revoke access from your profile settings on the connected social account.',
     'users_social_connect' => 'Connect Account',
     'users_social_disconnect' => 'Disconnect Account',
     'users_social_connected' => ':socialAccount account was successfully attached to your profile.',
@@ -156,7 +159,8 @@ return [
         'ru' => 'Русский',
         'uk' => 'Українська',
         'zh_CN' => '简体中文',
-        'zh_TW' => '繁體中文'
+       'zh_TW' => '繁體中文',
+       'hu' => 'Magyar'
     ]
     //!////////////////////////////////
 ];
index 934dd56da36895819f572961ec83df5eac53d315..c9ce6a4d74d18fb0d725236f6dfa45613ca9378b 100644 (file)
@@ -32,6 +32,8 @@ return [
     'remember_me' => 'Se souvenir de moi',
     'ldap_email_hint' => "Merci d'entrer une adresse e-mail pour ce compte",
     'create_account' => 'Créer un compte',
+    'already_have_account' => 'Vous avez déjà un compte?',
+    'dont_have_account' => 'Vous n\'avez pas de compte?',
     'social_login' => 'Social Login',
     'social_registration' => 'Enregistrement Social',
     'social_registration_text' => "S'inscrire et se connecter avec un réseau social",
@@ -73,4 +75,4 @@ return [
     'email_not_confirmed_click_link' => 'Merci de cliquer sur le lien dans l\'e-mail qui vous a été envoyé après l\'enregistrement.',
     'email_not_confirmed_resend' => 'Si vous ne retrouvez plus l\'e-mail, vous pouvez renvoyer un e-mail de confirmation en utilisant le formulaire ci-dessous.',
     'email_not_confirmed_resend_button' => 'Renvoyez l\'e-mail de confirmation',
-];
\ No newline at end of file
+];
index 3bff2841b83c40deebabceda90a24bf1410cfcf1..1cf6e716f87f3e3962adae680ed868e96528ace6 100644 (file)
@@ -10,6 +10,7 @@ return [
     'save' => 'Enregistrer',
     'continue' => 'Continuer',
     'select' => 'Sélectionner',
+    'toggle_all' => 'Tout sélectionner',
     'more' => 'Montrer plus',
 
     /**
@@ -19,13 +20,14 @@ return [
     'description' => 'Description',
     'role' => 'Rôle',
     'cover_image' => 'Image de couverture',
-    'cover_image_description' => 'Cette image doit être environ 300x170px.',
+    'cover_image_description' => 'Cette image doit être environ 440x250px.',
     
     /**
      * Actions
      */
     'actions' => 'Actions',
     'view' => 'Voir',
+    'view_all' => 'Tout afficher',
     'create' => 'Créer',
     'update' => 'Modifier',
     'edit' => 'Editer',
@@ -40,6 +42,13 @@ return [
     'remove' => 'Enlever',
     'add' => 'Ajouter',
 
+    /**
+     * Sort Options
+     */
+    'sort_name' => 'Nom',
+    'sort_created_at' => 'Date de création',
+    'sort_updated_at' => 'Date de mise à jour',
+
     /**
      * Misc
      */
@@ -65,4 +74,4 @@ return [
      */
     'email_action_help' => 'Si vous rencontrez des problèmes pour cliquer sur le bouton ":actionText", copiez et collez l\'adresse ci-dessous dans votre navigateur :',
     'email_rights' => 'Tous droits réservés',
-];
\ No newline at end of file
+];
index b07a5c465e348e72c673aeaaeea5171c6fe6f89d..4ba1a36e3df9ceb8b059e61c16b43bff91f85e9c 100644 (file)
@@ -9,6 +9,7 @@ return [
     'recently_updated_pages' => 'Pages mises à jour récemment',
     'recently_created_chapters' => 'Chapitres créés récemment',
     'recently_created_books' => 'Livres créés récemment',
+    'recently_created_shelves' => 'Étagères créés récemment',
     'recently_update' => 'Mis à jour récemment',
     'recently_viewed' => 'Vus récemment',
     'recent_activity' => 'Activité récente',
@@ -71,11 +72,13 @@ return [
      */
     'shelf' => 'Étagère',
     'shelves' => 'Étagères',
+    'x_shelves' => ':count Étagère|:count Étagères',
     'shelves_long' => 'Étagères',
     'shelves_empty' => 'Aucune étagère n\'a été créée',
     'shelves_create' => 'Créer une nouvelle étagère',
     'shelves_popular' => 'Étagères populaires',
     'shelves_new' => 'Nouvelles Étagères',
+    'shelves_new_action' => 'Nouvelle Étagère',
     'shelves_popular_empty' => 'Les étagères les plus populaires apparaîtront ici.',
     'shelves_new_empty' => 'Les étagères les plus récentes apparaitront ici.',
     'shelves_save' => 'Enregistrer l\'étagère',
@@ -108,6 +111,7 @@ return [
     'books_popular' => 'Livres populaires',
     'books_recent' => 'Livres récents',
     'books_new' => 'Nouveaux livres',
+    'books_new_action' => 'Nouveau livre',
     'books_popular_empty' => 'Les livres les plus populaires apparaîtront ici.',
     'books_new_empty' => 'Les livres les plus récents apparaitront ici.',
     'books_create' => 'Créer un nouveau livre',
@@ -131,6 +135,11 @@ return [
     'books_navigation' => 'Navigation dans le livre',
     'books_sort' => 'Trier les contenus du livre',
     'books_sort_named' => 'Trier le livre :bookName',
+    'books_sort_name' => 'Trier par le nom',
+    'books_sort_created' => 'Trier par la date de création',
+    'books_sort_updated' => 'Trier par la date de mise à jour',
+    'books_sort_chapters_first' => 'Les chapitres en premier',
+    'books_sort_chapters_last' => 'Les chapitres en dernier',
     'books_sort_show_other' => 'Afficher d\'autres livres',
     'books_sort_save' => 'Enregistrer l\'ordre',
 
@@ -281,6 +290,7 @@ return [
     'profile_not_created_pages' => ':userName n\'a pas créé de page',
     'profile_not_created_chapters' => ':userName n\'a pas créé de chapitre',
     'profile_not_created_books' => ':userName n\'a pas créé de livre',
+    'profile_not_created_shelves' => ':userName n\'a pas créé d\'étagère',
 
     /**
      * Comments
@@ -308,4 +318,4 @@ return [
     'revision_delete_confirm' => 'Êtes-vous sûr de vouloir supprimer cette révision?',
     'revision_delete_success' => 'Révision supprimée',
     'revision_cannot_delete_latest' => 'Impossible de supprimer la dernière révision.'
-];
\ No newline at end of file
+];
index 4251fe87dcd0e58f27fef2ed287b49cc9da459be..f978114c5671ab558f03554bad8ed597429e3c58 100644 (file)
@@ -16,12 +16,18 @@ return [
      * App settings
      */
 
-    'app_settings' => 'Préférences de l\'application',
+    'app_customization' => 'Personnalisation',
+    'app_features_security' => 'Fonctionnalités et sécurité',
     'app_name' => 'Nom de l\'application',
     'app_name_desc' => 'Ce nom est affiché dans l\'en-tête et les e-mails.',
     'app_name_header' => 'Afficher le nom dans l\'en-tête ?',
+    'app_public_access' => 'Accès public',
+    'app_public_access_desc' => 'L\'activation de cette option permettra aux visiteurs, qui ne sont pas connectés, d\'accéder au contenu de votre instance BookStack.',
+    'app_public_access_desc_guest' => 'L\'accès pour les visiteurs publics peut être contrôlé par l\'utilisateur "Guest".',
+    'app_public_access_toggle' => 'Autoriser l\'accès public',
     'app_public_viewing' => 'Accepter le visionnage public des pages ?',
     'app_secure_images' => 'Activer l\'ajout d\'image sécurisé ?',
+    'app_secure_images_toggle' => 'Activer l\'ajout d\'image sécurisé',
     'app_secure_images_desc' => 'Pour des questions de performances, toutes les images sont publiques. Cette option ajoute une chaîne aléatoire difficile à deviner dans les URLs des images.',
     'app_editor' => 'Editeur des pages',
     'app_editor_desc' => 'Sélectionnez l\'éditeur qui sera utilisé pour modifier les pages.',
@@ -35,6 +41,7 @@ return [
     'app_homepage_desc' => 'Choisissez une page à afficher sur la page d\'accueil au lieu de la vue par défaut. Les permissions sont ignorées pour les pages sélectionnées.',
     'app_homepage_select' => 'Choisissez une page',
     'app_disable_comments' => 'Désactiver les commentaires',
+    'app_disable_comments_toggle' => '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.',
     
     /**
@@ -42,9 +49,12 @@ return [
      */
 
     'reg_settings' => 'Préférence pour l\'inscription',
-    'reg_allow' => 'Accepter l\'inscription ?',
+    'reg_enable' => 'Activer l\'inscription',
+    'reg_enable_toggle' => 'Activer l\'inscription',
+    'reg_enable_desc' => 'Lorsque l\'inscription est activée, l\'utilisateur pourra s\'enregistrer en tant qu\'utilisateur de l\'application. Lors de l\'inscription, ils se voient attribuer un rôle par défaut.',
     'reg_default_role' => 'Rôle par défaut lors de l\'inscription',
-    'reg_confirm_email' => 'Obliger la confirmation par e-mail ?',
+    'reg_email_confirmation' => 'Confirmation de l\'e-mail',
+    'reg_email_confirmation_toggle' => 'Obliger la confirmation par e-mail ?',
     'reg_confirm_email_desc' => 'Si la restriction de domaine est activée, la confirmation sera automatiquement obligatoire et cette valeur sera ignorée.',
     'reg_confirm_restrict_domain' => 'Restreindre l\'inscription à un domaine',
     'reg_confirm_restrict_domain_desc' => 'Entrez une liste de domaines acceptés lors de l\'inscription, séparés par une virgule. Les utilisateurs recevront un e-mail de confirmation à cette adresse. <br> Les utilisateurs pourront changer leur adresse après inscription s\'ils le souhaitent.',
@@ -107,8 +117,15 @@ return [
     'user_profile' => 'Profil d\'utilisateur',
     'users_add_new' => 'Ajouter un nouvel utilisateur',
     'users_search' => 'Chercher les utilisateurs',
-    'users_role' => 'Rôles des utilisateurs',
+    'users_details' => 'Informations de l\'utilisateur',
+    'users_details_desc' => 'Définissez un nom et une adresse e-mail pour cet utilisateur. L\'adresse e-mail sera utilisée pour se connecter à l\'application.',
+    'users_details_desc_no_email' => 'Définissez un nom d\'affichage pour cet utilisateur afin que les autres puissent le reconnaître.',
+    'users_role' => 'Rôles de l\'utilisateur',
+    'users_role_desc' => 'Sélectionnez les rôles auxquels cet utilisateur sera affecté. Si un utilisateur est affecté à plusieurs rôles, les permissions de ces rôles s\'empileront et ils recevront toutes les capacités des rôles affectés.',
+    'users_password' => 'Mot de passe de l\'utilisateur',
+    'users_password_desc' => 'Définissez un mot de passe utilisé pour vous connecter à l\'application. Il doit comporter au moins 5 caractères.',
     'users_external_auth_id' => 'Identifiant d\'authentification externe',
+    'users_external_auth_id_desc' => 'Il s\'agit de l\'identifiant utilisé pour appairer cet utilisateur lors de la communication avec votre système LDAP.',
     'users_password_warning' => 'Remplissez ce formulaire 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_delete' => 'Supprimer un utilisateur',
@@ -122,6 +139,7 @@ return [
     'users_avatar' => 'Avatar de l\'utilisateur',
     'users_avatar_desc' => 'Cette image doit être un carré d\'environ 256px.',
     'users_preferred_language' => 'Langue préférée',
+    'users_preferred_language_desc' => 'Cette option changera la langue utilisée pour l\'interface utilisateur de l\'application. Ceci n\'affectera aucun contenu créé par l\'utilisateur.',
     'users_social_accounts' => 'Comptes sociaux',
     'users_social_accounts_info' => 'Vous pouvez connecter des réseaux sociaux à votre compte pour vous connecter plus rapidement. Déconnecter un compte n\'enlèvera pas les accès autorisés précédemment sur votre compte de réseau social.',
     'users_social_connect' => 'Connecter le compte',
index 9204f4e2d35c27ad8fb61e050d74bbe589a77a76..4be55df4ff35b240cb446ef700bea86d5989b57c 100644 (file)
@@ -38,6 +38,7 @@ return [
     'filled'               => ':attribute est un champ requis.',
     'exists'               => 'L\'attribut :attribute est invalide.',
     'image'                => ':attribute doit être une image.',
+    'image_extension'      => ':attribute doit avoir une extension d\'image valide et supportée.',
     'in'                   => 'L\'attribut :attribute est invalide.',
     'integer'              => ':attribute doit être un chiffre entier.',
     'ip'                   => ':attribute doit être une adresse IP valide.',
@@ -54,6 +55,7 @@ return [
         'string'  => ':attribute doit contenir au moins :min caractères.',
         'array'   => ':attribute doit contenir au moins :min éléments.',
     ],
+    'no_double_extension'  => ':attribute ne doit avoir qu\'une seule extension de fichier.',
     'not_in'               => 'L\'attribut sélectionné :attribute est invalide.',
     'numeric'              => ':attribute doit être un nombre.',
     'regex'                => ':attribute a un format invalide.',
@@ -74,6 +76,7 @@ return [
     'timezone'             => ':attribute doit être une zone valide.',
     'unique'               => ':attribute est déjà utilisé.',
     'url'                  => ':attribute a un format invalide.',
+    'uploaded'             => 'Le fichier n\'a pas pu être envoyé. Le serveur peut ne pas accepter des fichiers de cette taille.',
 
     /*
     |--------------------------------------------------------------------------
diff --git a/resources/lang/hu/activities.php b/resources/lang/hu/activities.php
new file mode 100644 (file)
index 0000000..575e9e5
--- /dev/null
@@ -0,0 +1,48 @@
+<?php
+/**
+ * Activity text strings.
+ * Is used for all the text within activity logs & notifications.
+ */
+return [
+
+    // Pages
+    'page_create'                 => 'létrehozta az oldalt:',
+    'page_create_notification'    => 'Oldal sikeresen létrehozva',
+    'page_update'                 => 'frissítette az oldalt:',
+    'page_update_notification'    => 'Oldal sikeresen frissítve',
+    'page_delete'                 => 'törölte az oldalt:',
+    'page_delete_notification'    => 'Oldal sikeresen törölve',
+    'page_restore'                => 'visszaállította az oldalt:',
+    'page_restore_notification'   => 'Oldal sikeresen visszaállítva',
+    'page_move'                   => 'áthelyezte az oldalt:',
+
+    // Chapters
+    'chapter_create'              => 'létrehozta a fejezetet:',
+    'chapter_create_notification' => 'Fejezet sikeresen létrehozva',
+    'chapter_update'              => 'frissítette a fejezetet:',
+    'chapter_update_notification' => 'Fejezet sikeresen frissítve',
+    'chapter_delete'              => 'törölte a fejezetet:',
+    'chapter_delete_notification' => 'Fejezet sikeresen törölve',
+    'chapter_move'                => 'áthelyezte a fejezetet:',
+
+    // Books
+    'book_create'                 => 'létrehozott egy könyvet:',
+    'book_create_notification'    => 'Könyv sikeresen létrehozva',
+    'book_update'                 => 'frissítette a könyvet:',
+    'book_update_notification'    => 'Könyv sikeresen frissítve',
+    'book_delete'                 => 'törölte a könyvet:',
+    'book_delete_notification'    => 'Könyv sikeresen törölve',
+    'book_sort'                   => 'átrendezte a könyvet:',
+    'book_sort_notification'      => 'Könyv sikeresen újrarendezve',
+
+    // Bookshelves
+    'bookshelf_create'            => 'létrehozta a könyvespolcot:',
+    'bookshelf_create_notification'    => 'Könyvespolc sikeresen létrehozva',
+    'bookshelf_update'                 => 'frissítette a könyvespolcot:',
+    'bookshelf_update_notification'    => 'Könyvespolc sikeresen frissítve',
+    'bookshelf_delete'                 => 'törölte a könyvespolcot:',
+    'bookshelf_delete_notification'    => 'Könyvespolc sikeresen törölve',
+
+    // Other
+    'commented_on'                => 'megjegyzést fűzött hozzá:',
+];
diff --git a/resources/lang/hu/auth.php b/resources/lang/hu/auth.php
new file mode 100644 (file)
index 0000000..1a7ba0b
--- /dev/null
@@ -0,0 +1,67 @@
+<?php
+/**
+ * Authentication Language Lines
+ * The following language lines are used during authentication for various
+ * messages that we need to display to the user.
+ */
+return [
+
+    'failed' => 'Ezek a hitelesítő adatok nem egyeznek a rögzítettekkel.',
+    'throttle' => 'Túl sok bejelentkezési próbálkozás. :seconds múlva lehet újra megpróbálni.',
+
+    // Login & Register
+    'sign_up' => 'Regisztráció',
+    'log_in' => 'Bejelentkezés',
+    'log_in_with' => 'Bejelentkezés ezzel: :socialDriver',
+    'sign_up_with' => 'Regisztráció ezzel: :socialDriver',
+    'logout' => 'Kijelentkezés',
+
+    'name' => 'Név',
+    'username' => 'Felhasználónév',
+    'email' => 'Email',
+    'password' => 'Jelszó',
+    'password_confirm' => 'Jelszó megerősítése',
+    'password_hint' => 'Öt karakternél hosszabbnak kell lennie',
+    'forgot_password' => 'Elfelejtett jelszó?',
+    'remember_me' => 'Emlékezzen rám',
+    'ldap_email_hint' => 'A fiókhoz használt email cím megadása.',
+    'create_account' => 'Fiók létrehozása',
+    'already_have_account' => 'Korábban volt beállítva fiók?',
+    'dont_have_account' => 'Még nincs beállítva fiók?',
+    'social_login' => 'Közösségi bejelentkezés',
+    'social_registration' => 'Közösségi regisztráció',
+    'social_registration_text' => 'Regisztráció és bejelentkezés másik szolgáltatással.',
+
+    'register_thanks' => 'Köszönjük a regisztrációt!',
+    'register_confirm' => 'Ellenőrizni kell a megadott email címet és a megerősítő gombra kell kattintani :appName eléréséhez.',
+    'registrations_disabled' => 'A regisztráció jelenleg le van tiltva',
+    'registration_email_domain_invalid' => 'Ebből az email tartományról nem lehet hozzáférni ehhez az alkalmazáshoz',
+    'register_success' => 'Köszönjük a regisztrációt! A regisztráció és a bejelentkezés megtörtént.',
+
+
+    // Password Reset
+    'reset_password' => 'Jelszó visszaállítása',
+    'reset_password_send_instructions' => 'Meg kell adni az email címet amire egy jelszó visszaállító hivatkozás lesz elküldve.',
+    'reset_password_send_button' => 'Visszaállító hivatkozás elküldése',
+    'reset_password_sent_success' => 'Jelszó visszaállító hivatkozás elküldve :email címre.',
+    'reset_password_success' => 'A jelszó sikeresen visszaállítva.',
+    'email_reset_subject' => ':appName jelszó visszaállítása',
+    'email_reset_text' => 'Ezt az emailt azért küldtük mert egy jelszó visszaállításra vonatkozó kérést kaptunk ebből a fiókból.',
+    'email_reset_not_requested' => 'Ha nem történt jelszó visszaállításra vonatkozó kérés, akkor nincs szükség további intézkedésre.',
+
+
+    // Email Confirmation
+    'email_confirm_subject' => ':appName alklamazásban beállított email címet meg kell erősíteni',
+    'email_confirm_greeting' => ':appName köszöni a csatlakozást!',
+    'email_confirm_text' => 'Az email címet a lenti gombra kattintva lehet megerősíteni:',
+    'email_confirm_action' => 'Email megerősítése',
+    'email_confirm_send_error' => 'Az email megerősítés kötelező, de a rendszer nem tudta elküldeni az emailt. Fel kell venni a kapcsolatot az adminisztrátorral és meg kell győződni róla, hogy az email beállítások megfelelőek.',
+    'email_confirm_success' => 'Az email cím megerősítve!',
+    'email_confirm_resent' => 'Megerősítő email újraküldve. Ellenőrizni kell a bejövő üzeneteket.',
+
+    'email_not_confirmed' => 'Az email cím nincs megerősítve',
+    'email_not_confirmed_text' => 'Az email cím még nincs megerősítve.',
+    'email_not_confirmed_click_link' => 'Rá kell kattintani a regisztráció után nem sokkal elküldött emailben található hivatkozásra.',
+    'email_not_confirmed_resend' => 'Ha nem érkezik meg a megerősítő email, a lenti űrlap beküldésével újra lehet küldeni.',
+    'email_not_confirmed_resend_button' => 'Megerősítő email újraküldése',
+];
\ No newline at end of file
diff --git a/resources/lang/hu/common.php b/resources/lang/hu/common.php
new file mode 100644 (file)
index 0000000..4e72d5f
--- /dev/null
@@ -0,0 +1,70 @@
+<?php
+/**
+ * Common elements found throughout many areas of BookStack.
+ */
+return [
+
+    // Buttons
+    'cancel' => 'Mégsem',
+    'confirm' => 'Megerősítés',
+    'back' => 'Vissza',
+    'save' => 'Mentés',
+    'continue' => 'Tovább',
+    'select' => 'Kiválasztás',
+    'toggle_all' => 'Összes átkapcsolása',
+    'more' => 'Több',
+
+    // Form Labels
+    'name' => 'Név',
+    'description' => 'Leírás',
+    'role' => 'Szerepkör',
+    'cover_image' => 'Borítókép',
+    'cover_image_description' => 'A kép méretének kb. 440x250px-nek kell lennie.',
+    
+    // Actions
+    'actions' => 'Műveletek',
+    'view' => 'Megtekintés',
+    'view_all' => 'Összes megtekintése',
+    'create' => 'Létrehozás',
+    'update' => 'Frissítés',
+    'edit' => 'Szerkesztés',
+    'sort' => 'Rendezés',
+    'move' => 'Áthelyezés',
+    'copy' => 'Másolás',
+    'reply' => 'Válasz',
+    'delete' => 'Törlés',
+    'search' => 'Keresés',
+    'search_clear' => 'Keresés törlése',
+    'reset' => 'Visszaállítás',
+    'remove' => 'Eltávolítás',
+    'add' => 'Hozzáadás',
+
+    // Sort Options
+    'sort_name' => 'Név',
+    'sort_created_at' => 'Létrehozás dátuma',
+    'sort_updated_at' => 'Frissítés dátuma',
+
+    // Misc
+    'deleted_user' => 'Törölt felhasználó',
+    'no_activity' => 'Nincs megjeleníthető aktivitás',
+    'no_items' => 'Nincsenek elérhető elemek',
+    'back_to_top' => 'Oldal eleje',
+    'toggle_details' => 'Részletek átkapcsolása',
+    'toggle_thumbnails' => 'Bélyegképek átkapcsolása',
+    'details' => 'Részletek',
+    'grid_view' => 'Rács nézet',
+    'list_view' => 'Lista nézet',
+    'default' => 'Alapértelmezés szerinti',
+
+    // Header
+    'view_profile' => 'Profil megtekintése',
+    'edit_profile' => 'Profil szerkesztése',
+
+    // Layout tabs
+    'tab_info' => 'Információ',
+    'tab_content' => 'Tartalom',
+
+    // Email Content
+    'email_action_help' => 'Probléma esetén a lenti ":actionText" gombra kell kattintani, majd ki kell másolni a lenti webcímet és be kell illeszteni egy böngészőbe:',
+    'email_rights' => 'Minden jog fenntartva',
+];
diff --git a/resources/lang/hu/components.php b/resources/lang/hu/components.php
new file mode 100644 (file)
index 0000000..1f98df2
--- /dev/null
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Text used in custom JavaScript driven components.
+ */
+return [
+
+    // Image Manager
+    'image_select' => 'Kép kiválasztása',
+    'image_all' => 'Összes',
+    'image_all_title' => 'Összes kép megtekintése',
+    'image_book_title' => 'A könyv feltöltött képek megtekintése',
+    'image_page_title' => 'Az oldalra feltöltött képek megtekintése',
+    'image_search_hint' => 'Keresés kép neve alapján',
+    'image_uploaded' => 'Feltöltve ekkor: :uploadedDate',
+    'image_load_more' => 'Több betöltése',
+    'image_image_name' => 'Kép neve',
+    'image_delete_used' => 'Ez a kép a lenti oldalakon van használatban.',
+    'image_delete_confirm' => 'A kép törléséhez ismét rá kell kattintani a törlésre.',
+    'image_select_image' => 'Kép kiválasztása',
+    'image_dropzone' => 'Képek feltöltése ejtéssel vagy kattintással',
+    'images_deleted' => 'Képek törölve',
+    'image_preview' => 'Kép előnézete',
+    'image_upload_success' => 'Kép sikeresen feltöltve',
+    'image_update_success' => 'Kép részletei sikeresen frissítve',
+    'image_delete_success' => 'Kép sikeresen törölve',
+    'image_upload_remove' => 'Eltávolítás',
+
+    // Code Editor
+    'code_editor' => 'Kód szerkesztése',
+    'code_language' => 'Kód nyelve',
+    'code_content' => 'Kód tartalom',
+    'code_save' => 'Kód mentése',
+];
diff --git a/resources/lang/hu/entities.php b/resources/lang/hu/entities.php
new file mode 100644 (file)
index 0000000..5bd865d
--- /dev/null
@@ -0,0 +1,305 @@
+<?php
+/**
+ * Text used for 'Entities' (Document Structure Elements) such as
+ * Books, Shelves, Chapters & Pages
+ */
+return [
+
+    // Shared
+    'recently_created' => 'Legutóbb létrehozott',
+    'recently_created_pages' => 'Legutóbb létrehozott oldalak',
+    'recently_updated_pages' => 'Legutóbb frissített oldalak',
+    'recently_created_chapters' => 'Legutóbb létrehozott fejezetek',
+    'recently_created_books' => 'Legutóbb létrehozott könyvek',
+    'recently_created_shelves' => 'Legutóbb létrehozott polcok',
+    'recently_update' => 'Legutóbb frissített',
+    'recently_viewed' => 'Legutóbb megtekintett',
+    'recent_activity' => 'Legutóbbi tevékenység',
+    'create_now' => 'Létrehozás most',
+    'revisions' => 'Változatok',
+    'meta_revision' => 'Változat #:revisionCount',
+    'meta_created' => 'Létrehozva :timeLength',
+    'meta_created_name' => ':user hozta létre :timeLength',
+    'meta_updated' => 'Frissítve :timeLength',
+    'meta_updated_name' => ':user frissítette :timeLength',
+    'entity_select' => 'Entitás kiválasztása',
+    'images' => 'Képek',
+    'my_recent_drafts' => 'Legutóbbi vázlataim',
+    'my_recently_viewed' => 'Általam legutóbb megtekintett',
+    'no_pages_viewed' => 'Még nincsenek általam megtekintett oldalak',
+    'no_pages_recently_created' => 'Nincsenek legutóbb létrehozott oldalak',
+    'no_pages_recently_updated' => 'Nincsenek legutóbb frissített oldalak',
+    'export' => 'Exportálás',
+    'export_html' => 'Webfájlt tartalmaz',
+    'export_pdf' => 'PDF fájl',
+    'export_text' => 'Egyszerű szövegfájl',
+
+    // Permissions and restrictions
+    'permissions' => 'Jogosultságok',
+    'permissions_intro' => 'Ha engedélyezett, ezek a jogosultságok elsőbbséget élveznek bármely beállított szerepkör jogosultsággal szemben.',
+    'permissions_enable' => 'Egyéni jogosultságok engedélyezése',
+    'permissions_save' => 'Jogosultságok mentése',
+
+    // Search
+    'search_results' => 'Keresési eredmények',
+    'search_total_results_found' => ':count találat|összesen :count találat',
+    'search_clear' => 'Keresés törlése',
+    'search_no_pages' => 'Nincsenek a keresésnek megfelelő oldalak',
+    'search_for_term' => ':term keresése',
+    'search_more' => 'További eredmények',
+    'search_filters' => 'Keresési szűrők',
+    'search_content_type' => 'Tartalomtípus',
+    'search_exact_matches' => 'Pontos egyezések',
+    'search_tags' => 'Címke keresések',
+    'search_options' => 'Beállítások',
+    'search_viewed_by_me' => 'Általam megtekintett',
+    'search_not_viewed_by_me' => 'Általam nem megtekintett',
+    'search_permissions_set' => 'Jogosultságok beállítva',
+    'search_created_by_me' => 'Általam létrehozott',
+    'search_updated_by_me' => 'Általam frissített',
+    'search_date_options' => 'Dátum beállítások',
+    'search_updated_before' => 'Frissítve ez előtt',
+    'search_updated_after' => 'Frissítve ez után',
+    'search_created_before' => 'Létrehozva ez előtt',
+    'search_created_after' => 'Létrehozva ez után',
+    'search_set_date' => 'Dátum beállítása',
+    'search_update' => 'Keresés frissítése',
+
+    // Shelves
+    'shelf' => 'Polc',
+    'shelves' => 'Polcok',
+    'x_shelves' => ':count polc|:count polcok',
+    'shelves_long' => 'Könyvespolcok',
+    'shelves_empty' => 'Nincsenek könyvespolcok létrehozva',
+    'shelves_create' => 'Új polc létrehozása',
+    'shelves_popular' => 'Népszerű polcok',
+    'shelves_new' => 'Új polcok',
+    'shelves_new_action' => 'Új polc',
+    'shelves_popular_empty' => 'A legnépszerűbb polcok itt fognak megjelenni.',
+    'shelves_new_empty' => 'A legutoljára létrehozott polcok itt fognak megjelenni.',
+    'shelves_save' => 'Polc mentése',
+    'shelves_books' => 'Könyvek ezen a polcon',
+    'shelves_add_books' => 'Könyvek hozzáadása ehhez a polchoz',
+    'shelves_drag_books' => 'Könyveket áthúzással lehet elhelyezni ezen a polcon',
+    'shelves_empty_contents' => 'Ehhez a polchoz nincsenek könyvek rendelve',
+    'shelves_edit_and_assign' => 'Polc szerkesztése könyvek hozzárendeléséhez',
+    'shelves_edit_named' => ':name könyvespolc szerkesztése',
+    'shelves_edit' => 'Könyvespolc szerkesztése',
+    'shelves_delete' => 'Könyvespolc törlése',
+    'shelves_delete_named' => ':name könyvespolc törlése',
+    'shelves_delete_explain' => "':name'. nevű könyvespolc ezzel le lesz törölve. A benne található könyvek nem lesznek törölve.",
+    'shelves_delete_confirmation' => 'Biztosan törölhető ez a könyvespolc?',
+    'shelves_permissions' => 'Könyvespolc jogosultság',
+    'shelves_permissions_updated' => 'Könyvespolc jogosultságok frissítve',
+    'shelves_permissions_active' => 'Könyvespolc jogosultságok aktívak',
+    'shelves_copy_permissions_to_books' => 'Jogosultság másolása könyvekre',
+    'shelves_copy_permissions' => 'Jogosultság másolása',
+    'shelves_copy_permissions_explain' => 'Ez alkalmazni fogja ennek a könyvespolcnak az aktuális jogosultság beállításait az összes benne található könyvön. Aktiválás előtt ellenőrizni kell, hogy a könyvespolc jogosultságain végzett összes módosítás el lett mentve.',
+    'shelves_copy_permission_success' => 'Könyvespolc jogosultságok átmásolva :count könyvre',
+
+    // Books
+    'book' => 'Könyv',
+    'books' => 'Könyvek',
+    'x_books' => ':count könyv|:count könyv',
+    'books_empty' => 'Nincsenek könyvek létrehozva',
+    'books_popular' => 'Népszerű könyvek',
+    'books_recent' => 'Legutóbbi könyvek',
+    'books_new' => 'Új könyvek',
+    'books_new_action' => 'Új könyv',
+    'books_popular_empty' => 'A legnépszerűbb könyvek itt fognak megjelenni.',
+    'books_new_empty' => 'A legutoljára létrehozott könyvek itt fognak megjelenni.',
+    'books_create' => 'Új könyv létrehozása',
+    'books_delete' => 'Könyv törlése',
+    'books_delete_named' => ':bookName könyv törlése',
+    'books_delete_explain' => '\':bookName\' nevű könyv törölve lesz. Minden oldal és fejezet el lesz távolítva.',
+    'books_delete_confirmation' => 'Biztosan törölhető ez a könyv?',
+    'books_edit' => 'Könyv szerkesztése',
+    'books_edit_named' => ':bookName könyv szerkesztése',
+    'books_form_book_name' => 'Könyv neve',
+    'books_save' => 'Könyv mentése',
+    'books_permissions' => 'Könyv jogosultságok',
+    'books_permissions_updated' => 'Könyv jogosultságok frissítve',
+    'books_empty_contents' => 'Ehhez a könyvhöz nincsenek oldalak vagy fejezetek létrehozva.',
+    'books_empty_create_page' => 'Új oldal létrehozása',
+    'books_empty_sort_current_book' => 'Aktuális könyv rendezése',
+    'books_empty_add_chapter' => 'Fejezet hozzáadása',
+    'books_permissions_active' => 'Könyv jogosultságok aktívak',
+    'books_search_this' => 'Keresés ebben a könyvben',
+    'books_navigation' => 'Könyv navigáció',
+    'books_sort' => 'Könyv tartalmak rendezése',
+    'books_sort_named' => ':bookName könyv rendezése',
+    'books_sort_name' => 'Rendezés név szerint',
+    'books_sort_created' => 'Rendezés létrehozás dátuma szerint',
+    'books_sort_updated' => 'Rendezés frissítés dátuma szerint',
+    'books_sort_chapters_first' => 'Fejezetek elől',
+    'books_sort_chapters_last' => 'Fejezetek hátul',
+    'books_sort_show_other' => 'Egyéb könyvek mutatása',
+    'books_sort_save' => 'Új elrendezés mentése',
+
+    // Chapters
+    'chapter' => 'Fejezet',
+    'chapters' => 'Fejezetek',
+    'x_chapters' => ':count fejezet|:count fejezetek',
+    'chapters_popular' => 'Népszerű fejezetek',
+    'chapters_new' => 'Új fejezet',
+    'chapters_create' => 'Új fejezet létrehozása',
+    'chapters_delete' => 'Fejezet törlése',
+    'chapters_delete_named' => ':chapterName fejezet törlése',
+    'chapters_delete_explain' => '\':chapterName\' nevű fejezet törölve lesz. Minden oldal el lesz távolítva és közvetlenül a szülő könyvhöz lesz hozzáadva.',
+    'chapters_delete_confirm' => 'Biztosan törölhető ez a fejezet?',
+    'chapters_edit' => 'Fejezet szerkesztése',
+    'chapters_edit_named' => ':chapterName fejezet szerkesztése',
+    'chapters_save' => 'Fejezet mentése',
+    'chapters_move' => 'Fejezet áthelyezése',
+    'chapters_move_named' => ':chapterName fejezet áthelyezése',
+    'chapter_move_success' => 'Fejezet áthelyezve :bookName könyvbe',
+    'chapters_permissions' => 'Fejezet jogosultságok',
+    'chapters_empty' => 'Jelenleg nincsenek oldalak ebben a fejezetben.',
+    'chapters_permissions_active' => 'Fejezet jogosultságok aktívak',
+    'chapters_permissions_success' => 'Fejezet jogosultságok frissítve',
+    'chapters_search_this' => 'Keresés ebben a fejezetben',
+
+    // Pages
+    'page' => 'Oldal',
+    'pages' => 'Oldalak',
+    'x_pages' => ':count oldal|:count oldalak',
+    'pages_popular' => 'Népszerű oldalak',
+    'pages_new' => 'Új oldal',
+    'pages_attachments' => 'Csatolmányok',
+    'pages_navigation' => 'Oldal navigáció',
+    'pages_delete' => 'Oldal törlése',
+    'pages_delete_named' => ':pageName oldal törlése',
+    'pages_delete_draft_named' => ':pageName vázlat oldal törlése',
+    'pages_delete_draft' => 'Vázlat oldal törlése',
+    'pages_delete_success' => 'Oldal törölve',
+    'pages_delete_draft_success' => 'Vázlat oldal törölve',
+    'pages_delete_confirm' => 'Biztosan törölhető ez az oldal?',
+    'pages_delete_draft_confirm' => 'Biztosan törölhető ez a vázlatoldal?',
+    'pages_editing_named' => ':pageName oldal szerkesztése',
+    'pages_edit_toggle_header' => 'Fejléc átkapcsolása',
+    'pages_edit_save_draft' => 'Vázlat mentése',
+    'pages_edit_draft' => 'Oldal vázlat szerkesztése',
+    'pages_editing_draft' => 'Vázlat szerkesztése',
+    'pages_editing_page' => 'Oldal szerkesztése',
+    'pages_edit_draft_save_at' => 'Vázlat elmentve:',
+    'pages_edit_delete_draft' => 'Vázlat törlése',
+    'pages_edit_discard_draft' => 'Vázlat elvetése',
+    'pages_edit_set_changelog' => 'Változásnapló beállítása',
+    'pages_edit_enter_changelog_desc' => 'A végrehajtott módosítások rövid leírása',
+    'pages_edit_enter_changelog' => 'Változásnapló megadása',
+    'pages_save' => 'Oldal mentése',
+    'pages_title' => 'Oldal címe',
+    'pages_name' => 'Oldal neve',
+    'pages_md_editor' => 'Szerkesztő',
+    'pages_md_preview' => 'Előnézet',
+    'pages_md_insert_image' => 'Kép beillesztése',
+    'pages_md_insert_link' => 'Entitás hivatkozás beillesztése',
+    'pages_md_insert_drawing' => 'Rajz beillesztése',
+    'pages_not_in_chapter' => 'Az oldal nincs fejezetben',
+    'pages_move' => 'Oldal áthelyezése',
+    'pages_move_success' => 'Oldal áthelyezve ide: ":parentName"',
+    'pages_copy' => 'Oldal másolása',
+    'pages_copy_desination' => 'Másolás célja',
+    'pages_copy_success' => 'Oldal sikeresen lemásolva',
+    'pages_permissions' => 'Oldal jogosultságok',
+    'pages_permissions_success' => 'Oldal jogosultságok frissítve',
+    'pages_revision' => 'Változat',
+    'pages_revisions' => 'Oldal változatai',
+    'pages_revisions_named' => ':pageName oldal változatai',
+    'pages_revision_named' => ':pageName oldal változata',
+    'pages_revisions_created_by' => 'Létrehozta:',
+    'pages_revisions_date' => 'Változat dátuma',
+    'pages_revisions_number' => '#',
+    'pages_revisions_numbered' => 'Változat #:id',
+    'pages_revisions_numbered_changes' => '#:id változat módosításai',
+    'pages_revisions_changelog' => 'Változásnapló',
+    'pages_revisions_changes' => 'Módosítások',
+    'pages_revisions_current' => 'Aktuális verzió',
+    'pages_revisions_preview' => 'Előnézet',
+    'pages_revisions_restore' => 'Visszaállítás',
+    'pages_revisions_none' => 'Ennek az oldalnak nincsenek változatai',
+    'pages_copy_link' => 'Hivatkozás másolása',
+    'pages_edit_content_link' => 'Tartalom szerkesztése',
+    'pages_permissions_active' => 'Oldal jogosultságok aktívak',
+    'pages_initial_revision' => 'Kezdeti közzététel',
+    'pages_initial_name' => 'Új oldal',
+    'pages_editing_draft_notification' => 'A jelenleg szerkesztett vázlat legutóbb ekkor volt elmentve: :timeDiff.',
+    'pages_draft_edited_notification' => 'Ezt az oldalt azóta már frissítették. Javasolt ennek a vázlatnak az elvetése.',
+    'pages_draft_edit_active' => [
+        'start_a' => ':count felhasználók kezdte el szerkeszteni ezt az oldalt',
+        'start_b' => ':userName elkezdte szerkeszteni ezt az oldalt',
+        'time_a' => 'mióta az oldal utoljára frissítve volt',
+        'time_b' => 'az utolsó :minCount percben',
+        'message' => ':start :time. Ügyeljen arra, hogy ne írjuk felül egymás frissítéseit!',
+    ],
+    'pages_draft_discarded' => 'Vázlat elvetve, a szerkesztő frissítve lesz az oldal aktuális tartalmával',
+    'pages_specific' => 'Egy bizonyos oldal',
+
+    // Editor Sidebar
+    'page_tags' => 'Oldal címkék',
+    'chapter_tags' => 'Fejezet címkék',
+    'book_tags' => 'Könyv címkék',
+    'shelf_tags' => 'Polc címkék',
+    'tag' => 'Címke',
+    'tags' =>  'Címkék',
+    'tag_value' => 'Címke érték (nem kötelező)',
+    'tags_explain' => "Címkék hozzáadása a tartalom jobb kategorizálásához.\nA mélyebb szervezettség megvalósításához hozzá lehet rendelni egy értéket a címkéhez.",
+    'tags_add' => 'Másik címke hozzáadása',
+    'attachments' => 'Csatolmányok',
+    'attachments_explain' => 'Az oldalon megjelenő fájlok feltöltése vagy hivatkozások csatolása. Az oldal oldalsávjában fognak megjelenni.',
+    'attachments_explain_instant_save' => 'Az itt történt módosítások azonnal el lesznek mentve.',
+    'attachments_items' => 'Csatolt elemek',
+    'attachments_upload' => 'Fájlfeltöltés',
+    'attachments_link' => 'Hivatkozás csatolása',
+    'attachments_set_link' => 'Hivatkozás beállítása',
+    'attachments_delete_confirm' => 'A csatolmány törléséhez ismét rá kell kattintani a törlésre.',
+    'attachments_dropzone' => 'Fájlok csatolása ejtéssel vagy kattintással',
+    'attachments_no_files' => 'Nincsenek fájlok feltöltve',
+    'attachments_explain_link' => 'Fájl feltöltése helyett hozzá lehet kapcsolni egy hivatkozást. Ez egy hivatkozás lesz egy másik oldalra vagy egy fájlra a felhőben.',
+    'attachments_link_name' => 'Hivatkozás neve',
+    'attachment_link' => 'Csatolmány hivatkozás',
+    'attachments_link_url' => 'Hivatkozás fájlra',
+    'attachments_link_url_hint' => 'Weboldal vagy fájl webcíme',
+    'attach' => 'Csatolás',
+    'attachments_edit_file' => 'Fájl szerkesztése',
+    'attachments_edit_file_name' => 'Fájl neve',
+    'attachments_edit_drop_upload' => 'Feltöltés és felülírás ejtéssel vagy kattintással',
+    'attachments_order_updated' => 'Csatolmány sorrend frissítve',
+    'attachments_updated_success' => 'Csatolmány részletei frissítve',
+    'attachments_deleted' => 'Csatolmány törölve',
+    'attachments_file_uploaded' => 'Fájl sikeresen feltöltve',
+    'attachments_file_updated' => 'Fájl sikeresen frissítve',
+    'attachments_link_attached' => 'Hivatkozás sikeresen hozzácsatolva az oldalhoz',
+
+    // Profile View
+    'profile_user_for_x' => 'Felhasználó ez óta: :time',
+    'profile_created_content' => 'Létrehozott tartalom',
+    'profile_not_created_pages' => ':userName még nem hozott létre oldalt',
+    'profile_not_created_chapters' => ':userName még nem hozott létre fejezetet',
+    'profile_not_created_books' => ':userName még nem hozott létre könyvet',
+    'profile_not_created_shelves' => ':userName még nem hozott létre polcot',
+
+    // Comments
+    'comment' => 'Megjegyzés',
+    'comments' => 'Megjegyzések',
+    'comment_add' => 'Megjegyzés hozzáadása',
+    'comment_placeholder' => 'Megjegyzés írása',
+    'comment_count' => '{0} Nincs megjegyzés|{1} 1 megjegyzés|[2,*] :count megjegyzés',
+    'comment_save' => 'Megjegyzés mentése',
+    'comment_saving' => 'Megjegyzés mentése...',
+    'comment_deleting' => 'Megjegyzés törlése...',
+    'comment_new' => 'Új megjegyzés',
+    'comment_created' => 'megjegyzést fűzött hozzá :createDiff',
+    'comment_updated' => 'Frissítve :updateDiff :username által',
+    'comment_deleted_success' => 'Megjegyzés törölve',
+    'comment_created_success' => 'Megjegyzés hozzáadva',
+    'comment_updated_success' => 'Megjegyzés frissítve',
+    'comment_delete_confirm' => 'Biztosan törölhető ez a megjegyzés?',
+    'comment_in_reply_to' => 'Válasz erre: :commentId',
+
+    // Revision
+    'revision_delete_confirm' => 'Biztosan törölhető ez a változat?',
+    'revision_restore_confirm' => 'Biztosan visszaállítható ez a változat? A oldal jelenlegi tartalma le lesz cserélve.',
+    'revision_delete_success' => 'Változat törölve',
+    'revision_cannot_delete_latest' => 'A legutolsó változat nem törölhető.'
+];
\ No newline at end of file
diff --git a/resources/lang/hu/errors.php b/resources/lang/hu/errors.php
new file mode 100644 (file)
index 0000000..6791428
--- /dev/null
@@ -0,0 +1,84 @@
+<?php
+/**
+ * Text shown in error messaging.
+ */
+return [
+
+    // Permissions
+    'permission' => 'Nincs jogosultság a kért oldal eléréséhez.',
+    'permissionJson' => 'Nincs jogosultság a kért művelet végrehajtásához.',
+
+    // Auth
+    'error_user_exists_different_creds' => ':email címmel már létezik felhasználó, de más hitelesítő adatokkal.',
+    'email_already_confirmed' => 'Az email cím már meg van erősítve, meg lehet próbálni a bejelentkezést.',
+    'email_confirmation_invalid' => 'A megerősítő vezérjel nem érvényes vagy használva volt. Meg kell próbálni újraregisztrálni.',
+    'email_confirmation_expired' => 'A megerősítő vezérjel lejárt. Egy új megerősítő email lett elküldve.',
+    'ldap_fail_anonymous' => 'Nem sikerült az LDAP elérése névtelen csatlakozással',
+    'ldap_fail_authed' => 'Az LDAP hozzáférés nem sikerült a megadott DN és jelszó beállításokkal',
+    'ldap_extension_not_installed' => 'LDAP PHP kiterjesztés nincs telepítve',
+    'ldap_cannot_connect' => 'Nem lehet kapcsolódni az LDAP kiszolgálóhoz, a kezdeti kapcsolatfelvétel nem sikerült',
+    'social_no_action_defined' => 'Nincs művelet meghatározva',
+    'social_login_bad_response' => "Hiba történt :socialAccount bejelentkezés közben:\n:error",
+    'social_account_in_use' => ':socialAccount fiók már használatban van. :socialAccount opción keresztül érdemes megpróbálni a bejelentkezést.',
+    'social_account_email_in_use' => ':email email cím már használatban van. Ha már van fiók létrehozva, :egy socialAccount fiókot hozzá lehet csatolni a profil beállításainál.',
+    'social_account_existing' => ':socialAccount már hozzá van kapcsolva a fiókhoz.',
+    'social_account_already_used_existing' => ':socialAccount fiókot már egy másik felhasználó használja.',
+    'social_account_not_used' => ':socialAccount fiók nincs felhasználóhoz kapcsolva. A hozzákapcsolást a profil oldalon lehet elvégezni. ',
+    'social_account_register_instructions' => ':socialAccount beállítása használatával is lehet fiókot regisztrálni, ha még nem volt fiók létrehozva.',
+    'social_driver_not_found' => 'Közösségi meghajtó nem található',
+    'social_driver_not_configured' => ':socialAccount közösségi beállítások nem megfelelőek.',
+
+    // System
+    'path_not_writable' => ':filePath elérési út nem tölthető fel. Ellenőrizni kell, hogy az útvonal a kiszolgáló számára írható.',
+    'cannot_get_image_from_url' => 'Nem lehet lekérni a képet innen: :url',
+    'cannot_create_thumbs' => 'A kiszolgáló nem tud létrehozni bélyegképeket. Ellenőrizni kell, hogy telepítve van-a a GD PHP kiterjesztés.',
+    'server_upload_limit' => 'A kiszolgáló nem engedélyez ilyen méretű feltöltéseket. Kisebb fájlmérettel kell próbálkozni.',
+    'uploaded'  => 'A kiszolgáló nem engedélyez ilyen méretű feltöltéseket. Kisebb fájlmérettel kell próbálkozni.',
+    'image_upload_error' => 'Hiba történt a kép feltöltése közben',
+    'image_upload_type_error' => 'A feltöltött kép típusa érvénytelen',
+    'file_upload_timeout' => 'A fáj feltöltése időtúllépést okozott.',
+
+    // Attachments
+    'attachment_page_mismatch' => 'Oldal eltárás csatolmány frissítése közben',
+    'attachment_not_found' => 'Csatolmány nem található',
+
+    // Pages
+    'page_draft_autosave_fail' => 'Nem sikerült a vázlat mentése. Mentés előtt meg kell róla győződni, hogy van internetkapcsolat',
+    'page_custom_home_deletion' => 'Nem lehet oldalt törölni ha kezdőlapnak van beállítva',
+
+    // Entities
+    'entity_not_found' => 'Entitás nem található',
+    'bookshelf_not_found' => 'Könyvespolc nem található',
+    'book_not_found' => 'Könyv nem található',
+    'page_not_found' => 'Oldal nem található',
+    'chapter_not_found' => 'Fejezet nem található',
+    'selected_book_not_found' => 'A kiválasztott könyv nem található',
+    'selected_book_chapter_not_found' => 'A kiválasztott könyv vagy fejezet nem található',
+    'guests_cannot_save_drafts' => 'Vendégek nem menthetnek el vázlatokat',
+
+    // Users
+    'users_cannot_delete_only_admin' => 'Nem lehet törölni az egyetlen adminisztrátort',
+    'users_cannot_delete_guest' => 'A vendég felhasználót nem lehet törölni',
+
+    // Roles
+    'role_cannot_be_edited' => 'Ezt a szerepkört nem lehet szerkeszteni',
+    'role_system_cannot_be_deleted' => 'Ez a szerepkör egy rendszer szerepkör ezért nem törölhető',
+    'role_registration_default_cannot_delete' => 'Ezt a szerepkört nem lehet törölni amíg alapértelmezés szerinti regisztrációs szerepkörnek van beállítva',
+    'role_cannot_remove_only_admin' => 'Ez a felhasználó az egyetlen, az adminisztrátor szerepkörhöz rendelt felhasználó. Eltávolítása előtt az adminisztrátor szerepkört át kell ruházni egy másik felhasználóra.',
+
+    // Comments
+    'comment_list' => 'Hiba történt a megjegyzések lekérése közben.',
+    'cannot_add_comment_to_draft' => 'Vázlathoz nem lehet megjegyzéseket fűzni.',
+    'comment_add' => 'Hiba történt a megjegyzés hozzáadása / frissítése közben.',
+    'comment_delete' => 'Hiba történt a megjegyzés törlése közben.',
+    'empty_comment' => 'Üres megjegyzést nem lehet hozzáadni.',
+
+    // Error pages
+    '404_page_not_found' => 'Oldal nem található',
+    'sorry_page_not_found' => 'Sajnáljuk, a keresett oldal nem található.',
+    'return_home' => 'Vissza a kezdőlapra',
+    'error_occurred' => 'Hiba örtént',
+    'app_down' => ':appName jelenleg nem üzemel',
+    'back_soon' => 'Hamarosan újra elérhető lesz.',
+
+];
diff --git a/resources/lang/hu/pagination.php b/resources/lang/hu/pagination.php
new file mode 100644 (file)
index 0000000..87be04c
--- /dev/null
@@ -0,0 +1,12 @@
+<?php
+/**
+ * Pagination Language Lines
+ * The following language lines are used by the paginator library to build
+ * the simple pagination links.
+ */
+return [
+
+    'previous' => '&laquo; Előző',
+    'next'     => 'Következő &raquo;',
+
+];
diff --git a/resources/lang/hu/passwords.php b/resources/lang/hu/passwords.php
new file mode 100644 (file)
index 0000000..bacc08b
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+/**
+ * Password Reminder Language Lines
+ * The following language lines are the default lines which match reasons
+ * that are given by the password broker for a password update attempt has failed.
+ */
+return [
+
+    'password' => 'A jelszónak legalább hat karakterből kell állnia és egyeznie kell a megerősítéssel.',
+    'user' => "Nem található felhasználó ezzel az e-mail címmel.",
+    'token' => 'Ez a jelszó visszaállító vezérjel érvénytelen.',
+    'sent' => 'E-mailben elküldtük a jelszó visszaállító hivatkozást!',
+    'reset' => 'A jelszó visszaállítva!',
+
+];
diff --git a/resources/lang/hu/settings.php b/resources/lang/hu/settings.php
new file mode 100644 (file)
index 0000000..efebb4a
--- /dev/null
@@ -0,0 +1,161 @@
+<?php
+/**
+ * Settings text strings
+ * Contains all text strings used in the general settings sections of BookStack
+ * including users and roles.
+ */
+return [
+
+    // Common Messages
+    'settings' => 'Beállítások',
+    'settings_save' => 'Beállítások mentése',
+    'settings_save_success' => 'Beállítások elmentve',
+
+    // App Settings
+    'app_customization' => 'Személyre szabás',
+    'app_features_security' => 'Jellemzők és biztonság',
+    'app_name' => 'Alkalmazás neve',
+    'app_name_desc' => 'Ez a név meg fog jelenni a fejlécben és minden a rendszer által küldött emailben.',
+    'app_name_header' => 'Név mutatása a fejlécben',
+    'app_public_access' => 'Nyilvános hozzáférés',
+    'app_public_access_desc' => 'Ha engedélyezett, a nem bejelentkezett felhasználók is hozzá tudnak férni a BookStack példány tartalmaihoz.',
+    'app_public_access_desc_guest' => 'A nyilvános látogatók hozzáférése a "Guest" felhasználón keresztül irányítható.',
+    'app_public_access_toggle' => 'Nyilvános hozzáférés engedélyezése',
+    'app_public_viewing' => 'Nyilvános megtekintés engedélyezve?',
+    'app_secure_images' => 'Magasabb biztonságú képfeltöltés',
+    'app_secure_images_toggle' => 'Magasabb biztonságú képfeltöltés engedélyezése',
+    'app_secure_images_desc' => 'Teljesítmény optimalizálási okokból minden kép nyilvános. Ez a beállítás egy véletlenszerű, nehezen kitalálható karakterláncot illeszt a képek útvonalának elejére. Meg kell győződni róla, hogy a könnyű hozzáférés megakadályozása érdekében a könyvtár indexek nincsenek engedélyezve.',
+    'app_editor' => 'Oldalszerkesztő',
+    'app_editor_desc' => 'Annak kiválasztása, hogy a felhasználók melyik szerkesztőt használhatják az oldalak szerkesztéséhez.',
+    'app_custom_html' => 'Egyéni HTML fejléc tartalom',
+    'app_custom_html_desc' => 'Az itt hozzáadott bármilyen tartalom be lesz illesztve minden oldal <head> szekciójának aljára. Ez hasznos a stílusok felülírásához van analitikai kódok hozzáadásához.',
+    'app_logo' => 'Alkalmazás logó',
+    'app_logo_desc' => 'A képnek 43px magasnak kell lennie.<br>A nagy képek át lesznek méretezve.',
+    'app_primary_color' => 'Alkalmazás elsődleges színe',
+    'app_primary_color_desc' => 'Hexadecimális értéknek kell lennie.<br>Az alapértelmezés szerinti szín visszaállításához üresen kell hagyni.',
+    'app_homepage' => 'Alkalmazás kezdőlapja',
+    'app_homepage_desc' => 'A kezdőlapon az alapértelmezés szerinti nézet helyett megjelenő nézet kiválasztása. A kiválasztott oldalakon figyelmen kívül lesznek hagyva az oldal engedélyek.',
+    'app_homepage_select' => 'Egy oldal kiválasztása',
+    'app_disable_comments' => 'Megjegyzések letiltása',
+    'app_disable_comments_toggle' => 'Megjegyzések letiltása',
+    'app_disable_comments_desc' => 'Megjegyzések letiltása az alkalmazás összes oldalán.<br>A már létező megjegyzések el lesznek rejtve.',
+
+    // Registration Settings
+    'reg_settings' => 'Regisztráció',
+    'reg_enable' => 'Regisztráció engedélyezése',
+    'reg_enable_toggle' => 'Regisztráció engedélyezése',
+    'reg_enable_desc' => 'Ha a regisztráció engedélyezett, akkor a felhasználó képes lesz bejelentkezni mint az alkalmazás egy felhasználója. Regisztráció után egy egyszerű, alapértelmezés szerinti felhasználói szerepkör lesz hozzárendelve.',
+    'reg_default_role' => 'Regisztráció utáni alapértelmezett felhasználói szerepkör',
+    'reg_email_confirmation' => 'Email megerősítés',
+    'reg_email_confirmation_toggle' => 'Email megerősítés szükséges',
+    'reg_confirm_email_desc' => 'Ha a tartomány korlátozás be van állítva, akkor email megerősítés szükséges és ez a beállítás figyelmen kívül lesz hagyva.',
+    'reg_confirm_restrict_domain' => 'Tartomány korlátozás',
+    'reg_confirm_restrict_domain_desc' => 'Azoknak az email tartományoknak a vesszővel elválasztott listája, melyekre a regisztráció korlátozva lesz. A felhasználók egy emailt fognak kapni, hogy megerősítsék az email címüket mielőtt használni kezdhetnék az alkalmazást.<br>Fontos tudni, hogy a felhasználók a sikeres regisztráció után megváltoztathatják az email címüket.',
+    'reg_confirm_restrict_domain_placeholder' => 'Nincs beállítva korlátozás',
+
+    // Maintenance settings
+    'maint' => 'Karbantartás',
+    'maint_image_cleanup' => 'Képek tisztítása',
+    'maint_image_cleanup_desc' => "Végigolvassa az oldalakat és a tartalmak változatait, hogy leellenőrizze jelenleg mely képek és rajzok vannak használatban, és mely képek szerepelnek többször. A futtatása előtt feltétlen készíteni kell egy teljes adatbázis és lemezkép mentést.",
+    'maint_image_cleanup_ignore_revisions' => 'Képek figyelmen kívül hagyása a változatokban',
+    'maint_image_cleanup_run' => 'Tisztítás futtatása',
+    'maint_image_cleanup_warning' => ':count potenciálisan nem használt képet találtam. Biztosan törölhetőek ezek a képek?',
+    'maint_image_cleanup_success' => ':count potenciálisan nem használt kép megtalálva és törölve!',
+    'maint_image_cleanup_nothing_found' => 'Nincsenek nem használt képek, semmi sem lett törölve!',
+
+    // Role Settings
+    'roles' => 'Szerepkörök',
+    'role_user_roles' => 'Felhasználói szerepkörök',
+    'role_create' => 'Új szerepkör létrehozása',
+    'role_create_success' => 'Szerepkör sikeresen létrehozva',
+    'role_delete' => 'Szerepkör törlése',
+    'role_delete_confirm' => 'Ez törölni fogja \':roleName\' szerepkört.',
+    'role_delete_users_assigned' => 'Ehhez a szerepkörhöz :userCount felhasználó van hozzárendelve. Ha a felhasználókat át kell helyezni ebből a szerepkörből, akkor ki kell választani egy új szerepkört.',
+    'role_delete_no_migration' => "Nincs felhasználó áthelyezés",
+    'role_delete_sure' => 'Biztosan törölhető ez a szerepkör?',
+    'role_delete_success' => 'Szerepkör sikeresen törölve',
+    'role_edit' => 'Szerepkör szerkesztése',
+    'role_details' => 'Szerepkör részletei',
+    'role_name' => 'Szerepkör neve',
+    'role_desc' => 'Szerepkör rövid leírása',
+    'role_external_auth_id' => 'Külső hitelesítés azonosítók',
+    'role_system' => 'Rendszer jogosultságok',
+    'role_manage_users' => 'Felhasználók kezelése',
+    'role_manage_roles' => 'Szerepkörök és szerepkör engedélyek kezelése',
+    'role_manage_entity_permissions' => 'Minden könyv, fejezet és oldalengedély kezelése',
+    'role_manage_own_entity_permissions' => 'Saját könyv, fejezet és oldalak engedélyeinek kezelése',
+    'role_manage_settings' => 'Alkalmazás beállításainak kezelése',
+    'role_asset' => 'Eszköz jogosultságok',
+    'role_asset_desc' => 'Ezek a jogosultság vezérlik a alapértelmezés szerinti hozzáférést a rendszerben található eszközökhöz. A könyvek, fejezetek és oldalak jogosultságai felülírják ezeket a jogosultságokat.',
+    'role_asset_admins' => 'Az adminisztrátorok automatikusan hozzáférést kapnak minden tartalomhoz, de ezek a beállítások megjeleníthetnek vagy elrejthetnek felhasználói felület beállításokat.',
+    'role_all' => 'Összes',
+    'role_own' => 'Saját',
+    'role_controlled_by_asset' => 'Az általuk feltöltött eszköz által ellenőrzött',
+    'role_save' => 'Szerepkör mentése',
+    'role_update_success' => 'Szerepkör sikeresen frissítve',
+    'role_users' => 'Felhasználók ebben a szerepkörben',
+    'role_users_none' => 'Jelenleg nincsenek felhasználók hozzárendelve ehhez a szerepkörhöz',
+
+    // Users
+    'users' => 'Felhasználók',
+    'user_profile' => 'Felhasználói profil',
+    'users_add_new' => 'Új felhasználó hozzáadása',
+    'users_search' => 'Felhasználók keresése',
+    'users_details' => 'Felhasználó részletei',
+    'users_details_desc' => 'Egy megjelenítendő név és email cím beállítása ennek a felhasználónak. Az email cím az alkalmazásba történő bejelentkezéshez lesz használva.',
+    'users_details_desc_no_email' => 'Egy megjelenítendő név beállítása ennek a felhasználónak amiről mások felismerik.',
+    'users_role' => 'Felhasználói szerepkörök',
+    'users_role_desc' => 'A felhasználó melyik szerepkörhöz lesz rendelve. Ha a felhasználó több szerepkörhöz van rendelve, akkor ezeknek a szerepköröknek a jogosultságai összeadódnak, és a a felhasználó a hozzárendelt szerepkörök minden képességét megkapja.',
+    'users_password' => 'Felhasználó jelszava',
+    'users_password_desc' => 'Az alkalmazásba bejelentkezéshez használható jelszó beállítása. Legalább 5 karakter hosszúnak kell lennie.',
+    'users_external_auth_id' => 'Külső hitelesítés azonosítója',
+    'users_external_auth_id_desc' => 'Ez az azonosító lesz használva a felhasználó ellenőrzéséhez mikor az LDAP rendszerrel kommunikál.',
+    'users_password_warning' => 'A lenti mezőket csak a jelszó módosításához kell kitölteni.',
+    'users_system_public' => 'Ez a felhasználó bármelyik, a példányt megtekintő felhasználót képviseli. Nem lehet vele bejelentkezni de automatikusan hozzá lesz rendelve.',
+    'users_delete' => 'Felhasználó törlése',
+    'users_delete_named' => ':userName felhasználó törlése',
+    'users_delete_warning' => '\':userName\' felhasználó teljesen törölve lesz a rendszerből.',
+    'users_delete_confirm' => 'Biztosan törölhető ez a felhasználó?',
+    'users_delete_success' => 'Felhasználó sikeresen eltávolítva',
+    'users_edit' => 'Felhasználó szerkesztése',
+    'users_edit_profile' => 'Profil szerkesztése',
+    'users_edit_success' => 'Felhasználó sikeresen frissítve',
+    'users_avatar' => 'Avatar használata',
+    'users_avatar_desc' => 'A felhasználót ábrázoló kép kiválasztása. Kb. 256px méretű négyzetes képnek kell lennie.',
+    'users_preferred_language' => 'Előnyben részesített nyelv',
+    'users_preferred_language_desc' => 'Ez a beállítás megváltoztatja az alkalmazás felhasználói felületén használt nyelvet. Nincs hatása a felhasználók által létrehozott tartalomra.',
+    'users_social_accounts' => 'Közösségi fiókok',
+    'users_social_accounts_info' => 'Itt lehet egyéb fiókokat hozzákapcsolni a gyorsabb és könnyebb bejelentkezés érdekében. Itt olyan fiókot lehet lecsatlakoztatni, melynek korábban nem volt engedélyezett hozzáférése. Visszavonja a hozzáférést a csatlakoztatott szociális fiók profilbeállításaiból.',
+    'users_social_connect' => 'Fiók csatlakoztatása',
+    'users_social_disconnect' => 'Fiók lecsatlakoztatása',
+    'users_social_connected' => ':socialAccount fiók sikeresen csatlakoztatva a profilhoz.',
+    'users_social_disconnected' => ':socialAccount fiók sikeresen lecsatlakoztatva a profilról.',
+
+    //! Since these labels are already localized this array does not need to be
+    //! translated in the language-specific files.
+    //! DELETE BELOW IF COPIED FROM EN
+    //!////////////////////////////////
+    'language_select' => [
+        'en' => 'English',
+        'ar' => 'العربية',
+        'de' => 'Deutsch (Sie)',
+        'de_informal' => 'Deutsch (Du)',
+        'es' => 'Español',
+        'es_AR' => 'Español Argentina',
+        'fr' => 'Français',
+        'nl' => 'Nederlands',
+        'pt_BR' => 'Português do Brasil',
+        'sk' => 'Slovensky',
+        'cs' => 'Česky',
+        'sv' => 'Svenska',
+        'kr' => '한국어',
+        'ja' => '日本語',
+        'pl' => 'Polski',
+        'it' => 'Italian',
+        'ru' => 'Русский',
+        'uk' => 'Українська',
+        'zh_CN' => '简体中文',
+        'zh_TW' => '繁體中文'
+    ]
+    //!////////////////////////////////
+];
diff --git a/resources/lang/hu/validation.php b/resources/lang/hu/validation.php
new file mode 100644 (file)
index 0000000..68a4446
--- /dev/null
@@ -0,0 +1,85 @@
+<?php
+/**
+ * Validation Lines
+ * The following language lines contain the default error messages used by
+ * the validator class. Some of these rules have multiple versions such
+ * as the size rules. Feel free to tweak each of these messages here.
+ */
+return [
+
+    // Standard laravel validation lines
+    'accepted'             => ':attribute elfogadott kell legyen.',
+    'active_url'           => ':attribute nem érvényes webcím.',
+    'after'                => ':attribute dátumnak :date utáninak kell lennie.',
+    'alpha'                => ':attribute csak betűket tartalmazhat.',
+    'alpha_dash'           => ':attribute csak betűket, számokat és kötőjeleket tartalmazhat.',
+    'alpha_num'            => ':attribute csak betűket és számokat tartalmazhat.',
+    'array'                => ':attribute tömb kell legyen.',
+    'before'               => ':attribute dátumnak :date előttinek kell lennie.',
+    'between'              => [
+        'numeric' => ':attribute értékének :min és :max között kell lennie.',
+        'file'    => ':attribute értékének :min és :max kilobájt között kell lennie.',
+        'string'  => ':attribute hosszának :min és :max karakter között kell lennie.',
+        'array'   => ':attribute mennyiségének :min és :max elem között kell lennie.',
+    ],
+    'boolean'              => ':attribute mezőnek igaznak vagy hamisnak kell lennie.',
+    'confirmed'            => ':attribute megerősítés nem egyezik.',
+    'date'                 => ':attribute nem érvényes dátum.',
+    'date_format'          => ':attribute nem egyezik :format formátummal.',
+    'different'            => ':attribute és :other értékének különböznie kell.',
+    'digits'               => ':attribute :digits számból kell álljon.',
+    'digits_between'       => ':attribute hosszának :min és :max számjegy között kell lennie.',
+    'email'                => ':attribute érvényes email cím kell legyen.',
+    'filled'               => ':attribute mező kötelező.',
+    'exists'               => 'A kiválasztott :attribute érvénytelen.',
+    'image'                => ':attribute kép kell legyen.',
+    'image_extension'      => 'A :attribute kép kiterjesztése érvényes és támogatott kell legyen.',
+    'in'                   => 'A kiválasztott :attribute érvénytelen.',
+    'integer'              => ':attribute egész szám kell legyen.',
+    'ip'                   => ':attribute érvényes IP cím kell legyen.',
+    'max'                  => [
+        'numeric' => ':attribute nem lehet nagyobb mint :max.',
+        'file'    => ':attribute nem lehet nagyobb mint :max kilobájt.',
+        'string'  => ':attribute nem lehet nagyobb mint :max karakter.',
+        'array'   => ':attribute mennyisége nem lehet több mint :max elem.',
+    ],
+    'mimes'                => 'A :attribute típusa csak :values lehet.',
+    'min'                  => [
+        'numeric' => ':attribute legalább :min kell legyen.',
+        'file'    => ':attribute legalább :min kilobájt kell legyen.',
+        'string'  => ':attribute legalább :min karakter kell legyen.',
+        'array'   => ':attribute legalább :min elem kell legyen.',
+    ],
+    'no_double_extension'  => ':attribute csak egy fájlkiterjesztéssel rendelkezhet.',
+    'not_in'               => 'A kiválasztott :attribute érvénytelen.',
+    'numeric'              => ':attribute szám kell legyen.',
+    'regex'                => ':attribute formátuma érvénytelen.',
+    'required'             => ':attribute mező kötelező.',
+    'required_if'          => ':attribute mező kötelező ha :other értéke :value.',
+    'required_with'        => ':attribute mező kötelező ha :values be van állítva.',
+    'required_with_all'    => ':attribute mező kötelező ha van :value.',
+    'required_without'     => ':attribute mező kötelező ha :values nincs beállítva.',
+    'required_without_all' => ':attribute mező kötelező ha egyik :values sincs beállítva.',
+    'same'                 => ':attribute és :other értékének egyeznie kell.',
+    'size'                 => [
+        'numeric' => ':attribute :size méretű kell legyen.',
+        'file'    => ':attribute :size kilobájt méretű kell legyen.',
+        'string'  => ':attribute :size karakter kell legyen.',
+        'array'   => ':attribute : size elemet kell tartalmazzon.',
+    ],
+    'string'               => ':attribute karaktersorozatnak kell legyen.',
+    'timezone'             => ':attribute érvényes zóna kell legyen.',
+    'unique'               => ':attribute már elkészült.',
+    'url'                  => ':attribute formátuma érvénytelen.',
+    'uploaded'             => 'A fájlt nem lehet feltölteni. A kiszolgáló nem fogad el ilyen méretű fájlokat.',
+
+    // Custom validation lines
+    'custom' => [
+        'password-confirm' => [
+            'required_with' => 'Jelszó megerősítés szükséges',
+        ],
+    ],
+
+    // Custom validation attributes
+    'attributes' => [],
+];
index 03ff80c9fc4e1dc09c4c57ab4a4022da3cbb2d94..91417cc8b97f08e31bcb466552c674a811533a0d 100644 (file)
@@ -1,12 +1,10 @@
 <?php
-
+/**
+ * Activity text strings.
+ * Is used for all the text within activity logs & notifications.
+ */
 return [
-
-    /**
-     * Activity text strings.
-     * Is used for all the text within activity logs & notifications.
-     */
-
+    
     // Pages
     'page_create'                 => 'página criada',
     'page_create_notification'    => 'Página criada com sucesso',
index 73228f21a2c2afd3db439c261bf0faf8889b3d73..20dc690af868ba79c3defc33ed1b2e006ed522c1 100644 (file)
@@ -1,21 +1,15 @@
 <?php
+/**
+ * Authentication Language Lines
+ * The following language lines are used during authentication for various
+ * messages that we need to display to the user.
+ */
 return [
-    /*
-    |--------------------------------------------------------------------------
-    | Authentication Language Lines
-    |--------------------------------------------------------------------------
-    |
-    | The following language lines are used during authentication for various
-    | messages that we need to display to the user. You are free to modify
-    | these language lines according to your application's requirements.
-    |
-    */
+
     'failed' => 'As credenciais fornecidas não puderam ser validadas em nossos registros..',
     'throttle' => 'Muitas tentativas de login. Por favor, tente novamente em :seconds segundos.',
 
-    /**
-     * Login & Register
-     */
+    // Login & Register
     'sign_up' => 'Registrar-se',
     'log_in' => 'Entrar',
     'log_in_with' => 'Entrar com :socialDriver',
@@ -32,6 +26,8 @@ return [
     'remember_me' => 'Lembrar de mim',
     'ldap_email_hint' => 'Por favor, digite um e-mail para essa conta.',
     'create_account' => 'Criar conta',
+    'already_have_account' => 'Você já possui uma conta?',
+    'dont_have_account' => 'Não possui uma conta?',
     'social_login' => 'Login social',
     'social_registration' => 'Registro social',
     'social_registration_text' => 'Registre e entre usando outro serviço.',
@@ -43,23 +39,18 @@ return [
     'register_success' => 'Obrigado por se registrar! Você agora encontra-se registrado e logado..',
 
 
-    /**
-     * Password Reset
-     */
+    // Password Reset
     'reset_password' => 'Resetar senha',
     'reset_password_send_instructions' => 'Digite seu e-mail abaixo e o sistema enviará uma mensagem com o link de reset de senha.',
     'reset_password_send_button' => 'Enviar o link de reset de senha',
     'reset_password_sent_success' => 'Um link de reset de senha foi enviado para :email.',
     'reset_password_success' => 'Sua senha foi resetada com sucesso.',
-
     'email_reset_subject' => 'Resetar a senha de :appName',
     'email_reset_text' => 'Você recebeu esse e-mail pois recebemos uma solicitação de reset de senha para sua conta.',
     'email_reset_not_requested' => 'Caso não tenha sido você a solicitar o reset de senha, ignore esse e-mail.',
 
 
-    /**
-     * Email Confirmation
-     */
+    // Email Confirmation
     'email_confirm_subject' => 'Confirme seu e-mail para :appName',
     'email_confirm_greeting' => 'Obrigado por se registrar em :appName!',
     'email_confirm_text' => 'Por favor, confirme seu endereço de e-mail clicando no botão abaixo:',
index 0741541eb01fb58297aa282ff7467aa2438cd816..c6750a9540e47770dfdf3f926fd696b4496c1e60 100644 (file)
@@ -1,31 +1,30 @@
 <?php
+/**
+ * Common elements found throughout many areas of BookStack.
+ */
 return [
 
-    /**
-     * Buttons
-     */
+    // Buttons
     'cancel' => 'Cancelar',
     'confirm' => 'Confirmar',
     'back' => 'Voltar',
     'save' => 'Salvar',
     'continue' => 'Continuar',
     'select' => 'Selecionar',
+    'toggle_all' => 'Alternar Tudo',
     'more' => 'Mais',
 
-    /**
-     * Form Labels
-     */
+    // Form Labels
     'name' => 'Nome',
     'description' => 'Descrição',
     'role' => 'Regra',
     'cover_image' => 'Imagem de capa',
     'cover_image_description' => 'Esta imagem deve ser aproximadamente 300x170px.',
     
-    /**
-     * Actions
-     */
+    // Actions
     'actions' => 'Ações',
     'view' => 'Visualizar',
+    'view_all' => 'Ver Tudo',
     'create' => 'Criar',
     'update' => 'Atualizar',
     'edit' => 'Editar',
@@ -40,9 +39,12 @@ return [
     'remove' => 'Remover',
     'add' => 'Adicionar',
 
-    /**
-     * Misc
-     */
+    // Sort Options
+    'sort_name' => 'Nome',
+    'sort_created_at' => 'Data de Criação',
+    'sort_updated_at' => 'Data de Atualização',
+
+    // Misc
     'deleted_user' => 'Usuário excluído',
     'no_activity' => 'Nenhuma atividade a mostrar',
     'no_items' => 'Nenhum item disponível',
@@ -54,15 +56,15 @@ return [
     'list_view' => 'Visualização em Lista',
     'default' => 'Padrão',
 
-    /**
-     * Header
-     */
+    // Header
     'view_profile' => 'Visualizar Perfil',
     'edit_profile' => 'Editar Perfil',
 
-    /**
-     * Email Content
-     */
+    // Layout tabs
+    'tab_info' => 'Info',
+    'tab_content' => 'Conteúdo',
+
+    // Email Content
     'email_action_help' => 'Se você estiver tendo problemas ao clicar o botão ":actionText", copie e cole a URL abaixo no seu navegador:',
     'email_rights' => 'Todos os direitos reservados',
 ];
\ No newline at end of file
index 4ea4d88c50523b9c2e4c9f314f22a1421a6c68a5..b9f1c3a38b456219e4be5f166b0e72dbe31e111c 100644 (file)
@@ -1,9 +1,10 @@
 <?php
+/**
+ * Text used in custom JavaScript driven components.
+ */
 return [
 
-    /**
-     * Image Manager
-     */
+    // Image Manager
     'image_select' => 'Selecionar imagem',
     'image_all' => 'Todos',
     'image_all_title' => 'Visualizar todas as imagens',
@@ -24,9 +25,7 @@ return [
     'image_delete_success' => 'Imagem excluída com sucesso',
     'image_upload_remove' => 'Remover',
 
-    /**
-     * Code editor
-     */
+    // Code editor
     'code_editor' => 'Editar Código',
     'code_language' => 'Linguagem do Código',
     'code_content' => 'Código',
index 9e6678146a3e79e8f96e7e6ecef239f080b0e1b1..7ce5ef01ef89fc24d977bf6dc67a75cf9244ae98 100644 (file)
@@ -1,17 +1,20 @@
 <?php
+/**
+ * Text used for 'Entities' (Document Structure Elements) such as
+ * Books, Shelves, Chapters & Pages
+ */
 return [
 
-    /**
-     * Shared
-     */
-    'recently_created' => 'Recentemente criado',
-    'recently_created_pages' => 'Páginas recentemente criadas',
-    'recently_updated_pages' => 'Páginas recentemente atualizadas',
-    'recently_created_chapters' => 'Capítulos recentemente criados',
-    'recently_created_books' => 'Livros recentemente criados',
-    'recently_update' => 'Recentemente atualizado',
-    'recently_viewed' => 'Recentemente visualizado',
-    'recent_activity' => 'Atividade recente',
+    // Shared
+    'recently_created' => 'Recentemente Criado',
+    'recently_created_pages' => 'Páginas Recentemente Criadas',
+    'recently_updated_pages' => 'Páginas Recentemente Atualizadas',
+    'recently_created_chapters' => 'Capítulos Recentemente Criados',
+    'recently_created_books' => 'Livros Recentemente Criados',
+    'recently_created_shelves' => 'Prateleiras Recentemente Criadas',
+    'recently_update' => 'Recentemente Atualizado',
+    'recently_viewed' => 'Recentemente Visualizado',
+    'recent_activity' => 'Atividade Recente',
     'create_now' => 'Criar um agora',
     'revisions' => 'Revisões',
     'meta_revision' => 'Revisão #:revisionCount',
@@ -31,17 +34,13 @@ return [
     'export_pdf' => 'Arquivo PDF',
     'export_text' => 'Arquivo Texto',
 
-    /**
-     * Permissions and restrictions
-     */
+    // Permissions and restrictions
     'permissions' => 'Permissões',
     'permissions_intro' => 'Uma vez habilitado, as permissões terão prioridade sobre outro conjunto de permissões.',
     'permissions_enable' => 'Habilitar Permissões Customizadas',
     'permissions_save' => 'Salvar Permissões',
 
-    /**
-     * Search
-     */
+    // Search
     'search_results' => 'Resultado(s) da Pesquisa',
     'search_total_results_found' => ':count resultado encontrado|:count resultados encontrados',
     'search_clear' => 'Limpar Pesquisa',
@@ -66,16 +65,16 @@ return [
     'search_set_date' => 'Definir data',
     'search_update' => 'Refazer Pesquisa',
 
-    /**
-     * Shelves
-     */
+    // Shelves
     'shelf' => 'Prateleira',
     'shelves' => 'Prateleiras',
+    'x_shelves' => ':count Prateleira|:count Prateleiras',
     'shelves_long' => 'Prateleiras de Livros',
     'shelves_empty' => 'Nenhuma prateleira foi criada',
-    'shelves_create' => 'Criar nova Prateleira',
-    'shelves_popular' => 'Prateleiras populares',
-    'shelves_new' => 'Prateleiras novas',
+    'shelves_create' => 'Criar Nova Prateleira',
+    'shelves_popular' => 'Prateleiras Populares',
+    'shelves_new' => 'Prateleiras Novas',
+    'shelves_new_action' => 'Nova Prateleira',
     'shelves_popular_empty' => 'As prateleiras mais populares aparecerão aqui.',
     'shelves_new_empty' => 'As prateleiras criadas mais recentemente aparecerão aqui.',
     'shelves_save' => 'Salvar Prateleira',
@@ -98,16 +97,15 @@ return [
     'shelves_copy_permissions_explain' => 'Isto aplicará as configurações de permissões atuais desta prateleira de livros a todos os livros contidos nela. Antes de ativar, assegure-se de que quaisquer alterações nas permissões desta prateleira de livros tenham sido salvas.',
     'shelves_copy_permission_success' => 'Permissões da prateleira de livros copiada para :count livros',
 
-    /**
-     * Books
-     */
+    // 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' => 'Livros Populares',
+    'books_recent' => 'Livros Recentes',
+    'books_new' => 'Livros Novos',
+    'books_new_action' => 'Novo Livro',
     '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',
@@ -123,45 +121,45 @@ return [
     'books_permissions_updated' => 'Permissões do Livro Atualizadas',
     'books_empty_contents' => 'Nenhuma página ou capítulo criado para esse livro.',
     'books_empty_create_page' => 'Criar uma nova página',
-    'books_empty_or' => 'ou',
     'books_empty_sort_current_book' => 'Ordenar o livro atual',
     'books_empty_add_chapter' => 'Adicionar um capítulo',
-    'books_permissions_active' => 'Permissões do Livro ativadas',
+    'books_permissions_active' => 'Permissões do Livro Ativadas',
     'books_search_this' => 'Pesquisar esse livro',
     'books_navigation' => 'Navegação do Livro',
-    'books_sort' => 'Ordenar conteúdos do Livro',
+    'books_sort' => 'Ordenar Conteúdos do Livro',
     'books_sort_named' => 'Ordenar Livro :bookName',
-    'books_sort_show_other' => 'Mostrar outros livros',
-    'books_sort_save' => 'Salvar nova ordenação',
+    'books_sort_name' => 'Ordernar por Nome',
+    'books_sort_created' => 'Ordenar por Data de Criação',
+    'books_sort_updated' => 'Ordenar por Data de Atualização',
+    'books_sort_chapters_first' => 'Capítulos Primeiro',
+    'books_sort_chapters_last' => 'Capítulos por Último',
+    'books_sort_show_other' => 'Mostrar Outros Livros',
+    'books_sort_save' => 'Salvar Nova Ordenação',
 
-    /**
-     * Chapters
-     */
+    // Chapters
     '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_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 capítulo?',
     'chapters_edit' => 'Editar Capítulo',
-    'chapters_edit_named' => 'Editar capítulo :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',
     'chapter_move_success' => 'Capítulo movido para :bookName',
     'chapters_permissions' => 'Permissões do Capítulo',
     '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_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
-     */
+    // Pages
     'page' => 'Página',
     'pages' => 'Páginas',
     'x_pages' => ':count Página|:count Páginas',
@@ -178,7 +176,6 @@ return [
     'pages_delete_confirm' => 'Tem certeza que deseja excluir a página?',
     'pages_delete_draft_confirm' => 'Tem certeza que deseja excluir o rascunho de página?',
     'pages_editing_named' => 'Editando a Página :pageName',
-    'pages_edit_toggle_header' => 'Alternar cabeçalho',
     'pages_edit_save_draft' => 'Salvar Rascunho',
     'pages_edit_draft' => 'Editar rascunho de Página',
     'pages_editing_draft' => 'Editando Rascunho',
@@ -212,7 +209,9 @@ return [
     'pages_revisions_created_by' => 'Criado por',
     'pages_revisions_date' => 'Data da Revisão',
     'pages_revisions_number' => '#',
+    'pages_revisions_numbered' => 'Revisão #:id',
     'pages_revisions_changelog' => 'Changelog',
+    'pages_revisions_numbered_changes' => 'Alterações da Revisão #:id',
     'pages_revisions_changes' => 'Mudanças',
     'pages_revisions_current' => 'Versão atual',
     'pages_revisions_preview' => 'Preview',
@@ -235,9 +234,7 @@ return [
     'pages_draft_discarded' => 'Rascunho descartado. O editor foi atualizado com a página atualizada',
     'pages_specific' => 'Página Específica',
 
-    /**
-     * Editor sidebar
-     */
+    // Editor sidebar
     'page_tags' => 'Tags de Página',
     'chapter_tags' => 'Tags de Capítulo',
     'book_tags' => 'Tags de Livro',
@@ -273,18 +270,15 @@ return [
     'attachments_file_updated' => 'Arquivo atualizado com sucesso',
     'attachments_link_attached' => 'Link anexado com sucesso à página',
 
-    /**
-     * Profile View
-     */
+    // Profile View
     'profile_user_for_x' => 'Usuário por :time',
     'profile_created_content' => 'Conteúdo Criado',
     'profile_not_created_pages' => ':userName não criou páginas',
     'profile_not_created_chapters' => ':userName não criou capítulos',
     'profile_not_created_books' => ':userName não criou livros',
+    'profile_not_created_shelves' => ':userName não criou prateleiras',
 
-    /**
-     * Comments
-     */
+    // Comments
     'comment' => 'Comentário',
     'comments' => 'Comentários',
     'comment_add' => 'Adicionar Comentário',
@@ -302,10 +296,9 @@ return [
     'comment_delete_confirm' => 'Você tem certeza de que quer deletar este comentário?',
     'comment_in_reply_to' => 'Em resposta à :commentId',
 
-    /**
-     * Revision
-     */
+    // Revision
     'revision_delete_confirm' => 'Tem certeza de que deseja excluir esta revisão?',
+    'revision_restore_confirm' => 'Tem certeza que deseja restaurar esta revisão? O conteúdo atual da página será substituído.',
     'revision_delete_success' => 'Revisão excluída',
     'revision_cannot_delete_latest' => 'Não é possível excluir a revisão mais recente.'
 ];
\ No newline at end of file
index 023254182a2660cc7b87b48d91e749fa4c2f6691..c5b1a9f9213a24c21e73e0d53d86d59dd4aedc06 100644 (file)
@@ -1,11 +1,9 @@
 <?php
-
+/**
+ * Text shown in error messaging.
+ */
 return [
 
-    /**
-     * Error text strings.
-     */
-
     // Permissions
     'permission' => 'Você não tem permissões para acessar a página requerida.',
     'permissionJson' => 'Você não tem permissão para realizar a ação requerida.',
@@ -66,6 +64,7 @@ return [
     'role_cannot_be_edited' => 'Esse perfil não pode ser editado',
     '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',
+    'role_cannot_remove_only_admin' => 'Este usuário é o único usuário atribuído ao perfil de administrador. Atribua o perfil de administrador a outro usuário antes de tentar removê-lo aqui.',
 
     // comments
     'comment_list' => 'Ocorreu um erro ao buscar os comentários.',
@@ -81,4 +80,5 @@ return [
     'error_occurred' => 'Um erro ocorreu',
     'app_down' => ':appName está fora do ar no momento',
     'back_soon' => 'Voltaremos em seguida.',
+    
 ];
index 6a32f34ac013545cedb0201b413ed331b7b71d84..3ae5dd3e0f65482f58e21237bd07dcb771b11549 100644 (file)
@@ -1,18 +1,11 @@
 <?php
-
+/**
+ * Pagination Language Lines
+ * The following language lines are used by the paginator library to build
+ * the simple pagination links.
+ */
 return [
 
-    /*
-    |--------------------------------------------------------------------------
-    | Pagination Language Lines
-    |--------------------------------------------------------------------------
-    |
-    | The following language lines are used by the paginator library to build
-    | the simple pagination links. You are free to change them to anything
-    | you want to customize your views to better match your application.
-    |
-    */
-
     'previous' => '&laquo; Anterior',
     'next'     => 'Próximo &raquo;',
 
index f75c24ea5475f5ca80f6143653a74337c6afda72..61a49f57a1f0d240ee5cc28dc0d396cdda5b27c5 100644 (file)
@@ -1,18 +1,11 @@
 <?php
-
+/**
+ * Password Reminder Language Lines
+ * The following language lines are the default lines which match reasons
+ * that are given by the password broker for a password update attempt has failed.
+ */
 return [
 
-    /*
-    |--------------------------------------------------------------------------
-    | Password Reminder Language Lines
-    |--------------------------------------------------------------------------
-    |
-    | The following language lines are the default lines which match reasons
-    | that are given by the password broker for a password update attempt
-    | has failed, such as for an invalid token or invalid new password.
-    |
-    */
-
     'password' => 'Senhas devem ter ao menos 6 caraceres e combinar com os atributos mínimos para a senha.',
     'user' => "Não pudemos encontrar um usuário com o e-mail fornecido.",
     'token' => 'O token de reset de senha é inválido.',
index aab2c2591f77f379241867f18269c38c713a706e..4bb8f37e0752023f2824e07509514b01ec1c7c8e 100644 (file)
@@ -1,32 +1,35 @@
 <?php
-
+/**
+ * Settings text strings
+ * Contains all text strings used in the general settings sections of BookStack
+ * including users and roles.
+ */
 return [
 
-    /**
-     * Settings text strings
-     * Contains all text strings used in the general settings sections of BookStack
-     * including users and roles.
-     */
-
+    // Common Messages
     'settings' => 'Configurações',
     'settings_save' => 'Salvar Configurações',
     'settings_save_success' => 'Configurações Salvas',
 
-    /**
-     * App settings
-     */
-
-    'app_settings' => 'Configurações do App',
+    // App Settings
+    'app_customization' => 'Customização',
+    'app_features_security' => 'Recursos & Segurança',
     'app_name' => 'Nome da Aplicação',
     'app_name_desc' => 'Esse nome será mostrado no cabeçalho e em e-mails.',
     'app_name_header' => 'Mostrar o nome da Aplicação no cabeçalho?',
+    'app_public_access' => 'Acesso Público',
+    'app_public_access_desc' => 'Habilitar esta opção irá permitir que visitantes, que não estão logados, acessem o conteúdo em sua instância do BookStack.',
+    'app_public_access_desc_guest' => 'O acesso de visitantes públicos pode ser controlado através do usuário "Convidado".',
+    'app_public_access_toggle' => 'Permitir acesso público',
     'app_public_viewing' => 'Permitir visualização pública?',
     'app_secure_images' => 'Permitir upload de imagens com maior segurança?',
+    'app_secure_images_toggle' => 'Habilitar uploads de imagem de maior segurança',
     'app_secure_images_desc' => 'Por questões de performance, todas as imagens são públicas. Essa opção adiciona uma string randômica na frente da imagem. Certifique-se de que os índices do diretórios permitem o acesso fácil.',
     'app_editor' => 'Editor de Página',
     'app_editor_desc' => 'Selecione qual editor a ser usado pelos usuários para editar páginas.',
     'app_custom_html' => 'Conteúdo para tag HTML HEAD customizado',
     'app_custom_html_desc' => 'Quaisquer conteúdos aqui inseridos serão inseridos no final da seção <head> do HTML de cada página. Essa é uma maneira útil de sobrescrever estilos e adicionar códigos de análise de site.',
+    'app_custom_html_disabled_notice' => 'O conteúdo personalizado do head do HTML está desabilitado nesta página de configurações para garantir que quaisquer alterações significativas possam ser revertidas.',
     'app_logo' => 'Logo da Aplicação',
     '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',
@@ -34,26 +37,24 @@ return [
     '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_select' => 'Selecione uma página',
-    'app_disable_comments' => 'Desativar comentários',
+    'app_disable_comments' => 'Desativar Comentários',
+    'app_disable_comments_toggle' => '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
-     */
-
-    'reg_settings' => 'Parâmetros de Registro',
-    'reg_allow' => 'Permitir Registro?',
+    // Registration settings
+    'reg_settings' => 'Registro',
+    'reg_enable' => 'Habilitar Registro',
+    'reg_enable_toggle' => 'Habilitar registro',
+    'reg_enable_desc' => 'Quando o registro é habilitado, o usuário poderá se registrar como usuário do aplicativo. No registro, eles recebem um único perfil padrão.',
     'reg_default_role' => 'Perfil padrão para usuários após o registro',
-    'reg_confirm_email' => 'Requerer confirmação por e-mail?',
+    'reg_email_confirmation' => 'Confirmação de E-mail',
+    'reg_email_confirmation_toggle' => 'Requer confirmação de e-mail',
     'reg_confirm_email_desc' => 'Se restrições de domínio são usadas a confirmação por e-mail será requerida e o valor abaixo será ignorado.',
     'reg_confirm_restrict_domain' => 'Restringir registro ao domínio',
     'reg_confirm_restrict_domain_desc' => 'Entre com uma lista de domínios de e-mails separados por vírgula para os quais você deseja restringir os registros. Será enviado um e-mail de confirmação para o usuário validar o e-mail antes de ser permitido interação com a aplicação. <br> Note que os usuários serão capazes de alterar o e-mail cadastrado após o sucesso na confirmação do registro.',
     'reg_confirm_restrict_domain_placeholder' => 'Nenhuma restrição configurada',
 
-    /**
-     * Maintenance settings
-     */
-
+    // Maintenance settings
     'maint' => 'Manutenção',
     'maint_image_cleanup' => 'Limpeza de Imagens',
     'maint_image_cleanup_desc' => "Examina páginas & revisa o conteúdo para verificar quais imagens e desenhos estão atualmente em uso e quais imagens são redundantes. Certifique-se de criar um backup completo do banco de dados e imagens antes de executar isso.",
@@ -63,10 +64,7 @@ return [
     'maint_image_cleanup_success' => ':count imagens potencialmente não utilizadas foram encontradas e excluídas!',
     'maint_image_cleanup_nothing_found' => 'Nenhuma imagem não utilizada foi encontrada, nada foi excluído!',
 
-    /**
-     * Role settings
-     */
-
+    // Role settings
     'roles' => 'Perfis',
     'role_user_roles' => 'Perfis de Usuário',
     'role_create' => 'Criar novo Perfil',
@@ -99,16 +97,20 @@ return [
     'role_users' => 'Usuários neste Perfil',
     'role_users_none' => 'Nenhum usuário está atualmente atrelado a esse Perfil',
 
-    /**
-     * Users
-     */
-
+    // Users
     'users' => 'Usuários',
-    'user_profile' => 'Perfil de Usuário',
+    'user_profile' => 'Perfil do Usuário',
     'users_add_new' => 'Adicionar Novo Usuário',
     'users_search' => 'Pesquisar Usuários',
-    'users_role' => 'Perfis de Usuário',
+    'users_details' => 'Detalhes do Usuário',
+    'users_details_desc' => 'Defina um nome de exibição e um endereço de e-mail para este usuário. O endereço de e-mail será usado para fazer login na aplicação.',
+    'users_details_desc_no_email' => 'Defina um nome de exibição para este usuário para que outros usuários possam reconhecê-lo',
+    'users_role' => 'Perfis do Usuário',
+    'users_role_desc' => 'Selecione os perfis para os quais este usuário será atribuído. Se um usuário for atribuído a multiplos perfis, as permissões destes perfis serão empilhadas e eles receberão todas as habilidades dos perfis atribuídos.',
+    'users_password' => 'Senha do Usuário',
+    'users_password_desc' => 'Defina uma senha usada para fazer login na aplicação. Esta deve ter pelo menos 5 caracteres.',
     'users_external_auth_id' => 'ID de Autenticação Externa',
+    'users_external_auth_id_desc' => 'Este é o ID usado para corresponder a este usuário ao se comunicar com seu sistema LDAP.',
     '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_delete' => 'Excluir Usuário',
@@ -122,12 +124,14 @@ return [
     '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_preferred_language_desc' => 'Esta opção irá alterar o idioma usado para a interface de usuário da aplicação. Isto não afetará nenhum conteúdo criado pelo usuário.',
     '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',
     'users_social_disconnect' => 'Desconectar Conta',
     'users_social_connected' => 'Conta :socialAccount foi conectada com sucesso ao seu perfil.',
     'users_social_disconnected' => 'Conta :socialAccount foi desconectada com sucesso de seu perfil.',
+
 ];
 
 
index 451dbe99caa398c112d9c02962c3ba32705a8904..3d4b51f036560a917b535d6d4b3569296a1eb7e5 100644 (file)
@@ -1,18 +1,13 @@
 <?php
-
+/**
+ * Validation Lines
+ * The following language lines contain the default error messages used by
+ * the validator class. Some of these rules have multiple versions such
+ * as the size rules. Feel free to tweak each of these messages here.
+ */
 return [
 
-    /*
-    |--------------------------------------------------------------------------
-    | Validation Language Lines
-    |--------------------------------------------------------------------------
-    |
-    | The following language lines contain the default error messages used by
-    | the validator class. Some of these rules have multiple versions such
-    | as the size rules. Feel free to tweak each of these messages here.
-    |
-    */
-
+    // Standard laravel validation lines
     'accepted'             => 'O :attribute deve ser aceito.',
     'active_url'           => 'O :attribute não é uma URL válida.',
     'after'                => 'O :attribute deve ser uma data posterior à data :date.',
@@ -38,6 +33,7 @@ return [
     'filled'               => 'O campo :attribute é requerido.',
     'exists'               => 'O atributo :attribute selecionado não é válido.',
     'image'                => 'O campo :attribute deve ser uma imagem.',
+    'image_extension'      => 'O campo :attribute deve ter uma extensão de imagem válida & suportada.',
     'in'                   => 'The selected :attribute is invalid.',
     'integer'              => 'O campo :attribute deve ser um número inteiro.',
     'ip'                   => 'O campo :attribute deve ser um IP válido.',
@@ -54,6 +50,7 @@ return [
         'string'  => 'O valor para o campo :attribute não deve ter menos que :min caracteres.',
         'array'   => 'O valor para o campo :attribute não deve ter menos que :min itens.',
     ],
+    'no_double_extension'  => 'O campo :attribute deve ter apenas uma extensão de arquivo.',
     'not_in'               => 'O campo selecionado :attribute é inválido.',
     'numeric'              => 'O campo :attribute deve ser um número.',
     'regex'                => 'O formato do campo :attribute é inválido.',
@@ -74,35 +71,15 @@ return [
     'timezone'             => 'O campo :attribute deve conter uma timezone válida.',
     'unique'               => 'Já existe um campo/dado de nome :attribute.',
     'url'                  => 'O formato da URL :attribute é inválido.',
+    'uploaded'             => 'O arquivo não pôde ser carregado. O servidor pode não aceitar arquivos deste tamanho.',
 
-    /*
-    |--------------------------------------------------------------------------
-    | Custom Validation Language Lines
-    |--------------------------------------------------------------------------
-    |
-    | Here you may specify custom validation messages for attributes using the
-    | convention "attribute.rule" to name the lines. This makes it quick to
-    | specify a specific custom language line for a given attribute rule.
-    |
-    */
-
+    // Custom validation lines
     'custom' => [
         'password-confirm' => [
             'required_with' => 'Confirmação de senha requerida',
         ],
     ],
 
-    /*
-    |--------------------------------------------------------------------------
-    | Custom Validation Attributes
-    |--------------------------------------------------------------------------
-    |
-    | The following language lines are used to swap attribute place-holders
-    | with something more reader friendly such as E-Mail Address instead
-    | of "email". This simply helps us make messages a little cleaner.
-    |
-    */
-
+    // Custom validation attributes
     'attributes' => [],
-
 ];
index ea63cf7ac1ba764725e7442e5ccd5a5de5534448..dc6081637f784f9a7823d9443eca91d51a0e7f85 100644 (file)
@@ -7,6 +7,6 @@
     <label for="password">{{ trans('auth.password') }}</label>
     @include('form.password', ['name' => 'password', 'tabindex' => 1])
     <span class="block small mt-s">
-        <a href="{{ baseUrl('/password/email') }}">{{ trans('auth.forgot_password') }}</a>
+        <a href="{{ url('/password/email') }}">{{ trans('auth.forgot_password') }}</a>
     </span>
 </div>
diff --git a/resources/views/auth/invite-set-password.blade.php b/resources/views/auth/invite-set-password.blade.php
new file mode 100644 (file)
index 0000000..807bd41
--- /dev/null
@@ -0,0 +1,27 @@
+@extends('simple-layout')
+
+@section('content')
+
+    <div class="container very-small mt-xl">
+        <div class="card content-wrap auto-height">
+            <h1 class="list-heading">{{ trans('auth.user_invite_page_welcome', ['appName' => setting('app-name')]) }}</h1>
+            <p>{{ trans('auth.user_invite_page_text', ['appName' => setting('app-name')]) }}</p>
+
+            <form action="{{ url('/register/invite/' . $token) }}" method="POST" class="stretch-inputs">
+                {!! csrf_field() !!}
+
+                <div class="form-group">
+                    <label for="password">{{ trans('auth.password') }}</label>
+                    @include('form.password', ['name' => 'password', 'placeholder' => trans('auth.password_hint')])
+                </div>
+
+                <div class="text-right">
+                    <button class="button primary">{{ trans('auth.user_invite_page_confirm_button') }}</button>
+                </div>
+
+            </form>
+
+        </div>
+    </div>
+
+@stop
index a0e5f716c37d85e8b9999719016ce8a1d9f6239b..76aa3a6e952201e0219bf62a6c239c376fe32d92 100644 (file)
@@ -9,7 +9,7 @@
         <div class="card content-wrap auto-height">
             <h1 class="list-heading">{{ title_case(trans('auth.log_in')) }}</h1>
 
-            <form action="{{ baseUrl('/login') }}" method="POST" id="login-form" class="mt-l">
+            <form action="{{ url('/login') }}" method="POST" id="login-form" class="mt-l">
                 {!! csrf_field() !!}
 
                 <div class="stretch-inputs">
@@ -38,7 +38,7 @@
                 <hr class="my-l">
                 @foreach($socialDrivers as $driver => $name)
                     <div>
-                        <a id="social-login-{{$driver}}" class="button outline block svg" href="{{ baseUrl("/login/service/" . $driver) }}">
+                        <a id="social-login-{{$driver}}" class="button outline block svg" href="{{ url("/login/service/" . $driver) }}">
                             @icon('auth/' . $driver)
                             {{ trans('auth.log_in_with', ['socialDriver' => $name]) }}
                         </a>
@@ -49,7 +49,7 @@
             @if(setting('registration-enabled', false))
                 <div class="text-center pb-s">
                     <hr class="my-l">
-                    <a href="{{ baseUrl('/register') }}">{{ trans('auth.dont_have_account') }}</a>
+                    <a href="{{ url('/register') }}">{{ trans('auth.dont_have_account') }}</a>
                 </div>
             @endif
         </div>
index de4edff0a8e479da8999a802727d7d76c6f1cb72..864b4e7d26b3940f6a4491f5519007126ebc587f 100644 (file)
@@ -7,7 +7,7 @@
 
             <p class="text-muted small">{{ trans('auth.reset_password_send_instructions') }}</p>
 
-            <form action="{{ baseUrl("/password/email") }}" method="POST" class="stretch-inputs">
+            <form action="{{ url("/password/email") }}" method="POST" class="stretch-inputs">
                 {!! csrf_field() !!}
 
                 <div class="form-group">
index fa6ad5b9a327b6cd0945709f27c31616a21913f8..227b39079d75879b517311c7999dd7071b041c21 100644 (file)
@@ -6,7 +6,7 @@
         <div class="card content-wrap auto-height">
             <h1 class="list-heading">{{ trans('auth.reset_password') }}</h1>
 
-            <form action="{{ baseUrl("/password/reset") }}" method="POST" class="stretch-inputs">
+            <form action="{{ url("/password/reset") }}" method="POST" class="stretch-inputs">
                 {!! csrf_field() !!}
                 <input type="hidden" name="token" value="{{ $token }}">
 
index 38904f63bb7ce880d3b5a80ae0731227f63bc83d..9cf34f501e0170571ac6ca2971c3a988889256e3 100644 (file)
@@ -8,7 +8,7 @@
         <div class="card content-wrap auto-height">
             <h1 class="list-heading">{{ title_case(trans('auth.sign_up')) }}</h1>
 
-            <form action="{{ baseUrl("/register") }}" method="POST" class="mt-l stretch-inputs">
+            <form action="{{ url("/register") }}" method="POST" class="mt-l stretch-inputs">
                 {!! csrf_field() !!}
 
                 <div class="form-group">
@@ -28,7 +28,7 @@
 
                 <div class="grid half collapse-xs gap-xl v-center mt-m">
                     <div class="text-small">
-                        <a href="{{ baseUrl('/login') }}">{{ trans('auth.already_have_account') }}</a>
+                        <a href="{{ url('/login') }}">{{ trans('auth.already_have_account') }}</a>
                     </div>
                     <div class="from-group text-right">
                         <button class="button primary">{{ trans('auth.create_account') }}</button>
@@ -42,7 +42,7 @@
                 <hr class="my-l">
                 @foreach($socialDrivers as $driver => $name)
                     <div>
-                        <a id="social-register-{{$driver}}" class="button block outline svg" href="{{ baseUrl("/register/service/" . $driver) }}">
+                        <a id="social-register-{{$driver}}" class="button block outline svg" href="{{ url("/register/service/" . $driver) }}">
                             @icon('auth/' . $driver)
                             {{ trans('auth.sign_up_with', ['socialDriver' => $name]) }}
                         </a>
index 54bf6eda3314ac73d4b07b3de18d645e1f40dfe1..2142a5dcb4afead277b8da223ef58059ec639d29 100644 (file)
@@ -13,7 +13,7 @@
                 {{ trans('auth.email_not_confirmed_resend') }}
             </p>
 
-            <form action="{{ baseUrl("/register/confirm/resend") }}" method="POST" class="stretch-inputs">
+            <form action="{{ url("/register/confirm/resend") }}" method="POST" class="stretch-inputs">
                 {!! csrf_field() !!}
                 <div class="form-group">
                     <label for="email">{{ trans('auth.email') }}</label>
index 971a903401b5a8e2cfbdb38e5d2a8cd39a907a1e..456923c4ed5e221420d22c64e6be99bb0b630f71 100644 (file)
@@ -6,21 +6,24 @@
     <!-- Meta -->
     <meta name="viewport" content="width=device-width">
     <meta name="token" content="{{ csrf_token() }}">
-    <meta name="base-url" content="{{ baseUrl('/') }}">
+    <meta name="base-url" content="{{ url('/') }}">
     <meta charset="utf-8">
 
     <!-- Styles and Fonts -->
     <link rel="stylesheet" href="{{ versioned_asset('dist/styles.css') }}">
     <link rel="stylesheet" media="print" href="{{ versioned_asset('dist/print-styles.css') }}">
 
-    <!-- Scripts -->
-    <script src="{{ baseUrl('/translations') }}"></script>
-
     @yield('head')
+
+    <!-- Custom Styles & Head Content -->
     @include('partials.custom-styles')
     @include('partials.custom-head')
 
     @stack('head')
+
+    <!-- Translations for JS -->
+    @stack('translations')
+
 </head>
 <body class="@yield('body-class')">
 
index 40b781441ddda044dc8f59c6f6a4079fe3321277..65958e137e8aa357fb1613115e86edade88c8566 100644 (file)
@@ -27,7 +27,7 @@
 
         <div class="content-wrap card">
             <h1 class="list-heading">{{ trans('entities.books_create') }}</h1>
-            <form action="{{ isset($bookshelf) ? $bookshelf->getUrl('/create-book') : baseUrl('/books') }}" method="POST" enctype="multipart/form-data">
+            <form action="{{ isset($bookshelf) ? $bookshelf->getUrl('/create-book') : url('/books') }}" method="POST" enctype="multipart/form-data">
                 @include('books.form')
             </form>
         </div>
index 4edec240a03e9a961bca643f45c5ba5a518058c0..5d3f11e2e86e85c12ba78ac360a6a19807df610f 100644 (file)
@@ -18,8 +18,8 @@
         <p class="small">{{ trans('common.cover_image_description') }}</p>
 
         @include('components.image-picker', [
-            'defaultImage' => baseUrl('/book_default_cover.png'),
-            'currentImage' => (isset($model) && $model->cover) ? $model->getBookCover() : baseUrl('/book_default_cover.png') ,
+            'defaultImage' => url('/book_default_cover.png'),
+            'currentImage' => (isset($model) && $model->cover) ? $model->getBookCover() : url('/book_default_cover.png') ,
             'name' => 'image',
             'imageClass' => 'cover'
         ])
@@ -36,6 +36,6 @@
 </div>
 
 <div class="form-group text-right">
-    <a href="{{ isset($book) ? $book->getUrl() : baseUrl('/books') }}" class="button outline">{{ trans('common.cancel') }}</a>
+    <a href="{{ isset($book) ? $book->getUrl() : url('/books') }}" class="button outline">{{ trans('common.cancel') }}</a>
     <button type="submit" class="button primary">{{ trans('entities.books_save') }}</button>
 </div>
\ No newline at end of file
index 61d99848955188c3d1e9905ad235277442461429..b9bd987a9c723224eddd35272a5f2ea2a61aa900 100644 (file)
@@ -37,7 +37,7 @@
         <h5>{{ trans('common.actions') }}</h5>
         <div class="icon-list text-primary">
             @if($currentUser->can('book-create-all'))
-                <a href="{{ baseUrl("/create-book") }}" class="icon-list-item">
+                <a href="{{ url("/create-book") }}" class="icon-list-item">
                     <span>@icon('add')</span>
                     <span>{{ trans('entities.books_create') }}</span>
                 </a>
index 93d927ec7cf0a4f5e214dc0702e88d8a7686c2c7..84578e3a59ba5851ca4224143ccf9c96c8e6b10a 100644 (file)
@@ -28,7 +28,7 @@
     @else
         <p class="text-muted">{{ trans('entities.books_empty') }}</p>
         @if(userCan('books-create-all'))
-            <a href="{{ baseUrl("/create-book") }}" class="text-pos">@icon('edit'){{ trans('entities.create_now') }}</a>
+            <a href="{{ url("/create-book") }}" class="text-pos">@icon('edit'){{ trans('entities.create_now') }}</a>
         @endif
     @endif
 </div>
\ No newline at end of file
index cfc89340daf6aa738212b0034985dfaecb86a0d9..99b21b9b263a8e51c1c0c042a7f30c6008003d14 100644 (file)
@@ -1,4 +1,12 @@
 <div page-comments page-id="{{ $page->id }}" class="comments-list">
+
+    @exposeTranslations([
+        'entities.comment_updated_success',
+        'entities.comment_deleted_success',
+        'entities.comment_created_success',
+        'entities.comment_count',
+    ])
+
     <div comment-count-bar class="grid half left-focus v-center no-row-gap">
         <h5 comments-title>{{ trans_choice('entities.comment_count', count($page->comments), ['count' => count($page->comments)]) }}</h5>
         @if (count($page->comments) === 0)
index 734789899b1e804f65efc8ea2fecbbbc040fbef4..a5336c3f86216e4eb8b6739cd6a597a77668193d 100644 (file)
@@ -2,9 +2,9 @@
     <div class="grid mx-l">
 
         <div>
-            <a href="{{ baseUrl('/') }}" class="logo">
+            <a href="{{ url('/') }}" class="logo">
                 @if(setting('app-logo', '') !== 'none')
-                    <img class="logo-image" src="{{ setting('app-logo', '') === '' ? baseUrl('/logo.png') : baseUrl(setting('app-logo', '')) }}" alt="Logo">
+                    <img class="logo-image" src="{{ setting('app-logo', '') === '' ? url('/logo.png') : url(setting('app-logo', '')) }}" alt="Logo">
                 @endif
                 @if (setting('app-name-header'))
                     <span class="logo-text">{{ setting('app-name') }}</span>
@@ -15,7 +15,7 @@
 
         <div class="header-search hide-under-l">
             @if (hasAppAccess())
-            <form action="{{ baseUrl('/search') }}" method="GET" class="search-box">
+            <form action="{{ url('/search') }}" method="GET" class="search-box">
                 <button id="header-search-box-button" type="submit">@icon('search') </button>
                 <input id="header-search-box-input" type="text" name="term" tabindex="2" placeholder="{{ trans('common.search') }}" value="{{ isset($searchTerm) ? $searchTerm : '' }}">
             </form>
             <div class="header-links">
                 <div class="links text-center">
                     @if (hasAppAccess())
-                        <a class="hide-over-l" href="{{ baseUrl('/search') }}">@icon('search'){{ trans('common.search') }}</a>
+                        <a class="hide-over-l" href="{{ url('/search') }}">@icon('search'){{ trans('common.search') }}</a>
                         @if(userCanOnAny('view', \BookStack\Entities\Bookshelf::class) || userCan('bookshelf-view-all') || userCan('bookshelf-view-own'))
-                            <a href="{{ baseUrl('/shelves') }}">@icon('bookshelf'){{ trans('entities.shelves') }}</a>
+                            <a href="{{ url('/shelves') }}">@icon('bookshelf'){{ trans('entities.shelves') }}</a>
                         @endif
-                        <a href="{{ baseUrl('/books') }}">@icon('books'){{ trans('entities.books') }}</a>
+                        <a href="{{ url('/books') }}">@icon('books'){{ trans('entities.books') }}</a>
                         @if(signedInUser() && userCan('settings-manage'))
-                            <a href="{{ baseUrl('/settings') }}">@icon('settings'){{ trans('settings.settings') }}</a>
+                            <a href="{{ url('/settings') }}">@icon('settings'){{ trans('settings.settings') }}</a>
                         @endif
                         @if(signedInUser() && userCan('users-manage') && !userCan('settings-manage'))
-                            <a href="{{ baseUrl('/settings/users') }}">@icon('users'){{ trans('settings.users') }}</a>
+                            <a href="{{ url('/settings/users') }}">@icon('users'){{ trans('settings.users') }}</a>
                         @endif
                     @endif
 
                     @if(!signedInUser())
                         @if(setting('registration-enabled', false))
-                            <a href="{{ baseUrl('/register') }}">@icon('new-user') {{ trans('auth.sign_up') }}</a>
+                            <a href="{{ url('/register') }}">@icon('new-user') {{ trans('auth.sign_up') }}</a>
                         @endif
-                        <a href="{{ baseUrl('/login') }}">@icon('login') {{ trans('auth.log_in') }}</a>
+                        <a href="{{ url('/login') }}">@icon('login') {{ trans('auth.log_in') }}</a>
                     @endif
                 </div>
                 @if(signedInUser())
                         </span>
                         <ul class="dropdown-menu">
                             <li>
-                                <a href="{{ baseUrl("/user/{$currentUser->id}") }}">@icon('user'){{ trans('common.view_profile') }}</a>
+                                <a href="{{ url("/user/{$currentUser->id}") }}">@icon('user'){{ trans('common.view_profile') }}</a>
                             </li>
                             <li>
-                                <a href="{{ baseUrl("/settings/users/{$currentUser->id}") }}">@icon('edit'){{ trans('common.edit_profile') }}</a>
+                                <a href="{{ url("/settings/users/{$currentUser->id}") }}">@icon('edit'){{ trans('common.edit_profile') }}</a>
                             </li>
                             <li>
-                                <a href="{{ baseUrl('/logout') }}">@icon('logout'){{ trans('auth.logout') }}</a>
+                                <a href="{{ url('/logout') }}">@icon('logout'){{ trans('auth.logout') }}</a>
                             </li>
                         </ul>
                     </div>
index 07eda2cff997ac848a1c7f63b1720d8ce6226212..12adda618905a59033b8b40cd6326ee2ab26cf05 100644 (file)
@@ -15,7 +15,7 @@
 </div>
 
 <div class="mb-xl">
-    <h5><a class="no-color" href="{{ baseUrl("/pages/recently-updated") }}">{{ trans('entities.recently_updated_pages') }}</a></h5>
+    <h5><a class="no-color" href="{{ url("/pages/recently-updated") }}">{{ trans('entities.recently_updated_pages') }}</a></h5>
     <div id="recently-updated-pages">
         @include('partials.entity-list', [
         'entities' => $recentlyUpdatedPages,
index 2f0189f872c3ef86f61f4c66a64c8db2bd60935a..cd27ff5687e006fffa598cb30f4e2243601e4243 100644 (file)
@@ -34,7 +34,7 @@
 
             <div>
                 <div id="recent-pages" class="card mb-xl">
-                    <h3 class="card-title"><a class="no-color" href="{{ baseUrl("/pages/recently-updated") }}">{{ trans('entities.recently_updated_pages') }}</a></h3>
+                    <h3 class="card-title"><a class="no-color" href="{{ url("/pages/recently-updated") }}">{{ trans('entities.recently_updated_pages') }}</a></h3>
                     <div id="recently-updated-pages" class="px-m">
                         @include('partials.entity-list', [
                         'entities' => $recentlyUpdatedPages,
index e8b2220e5cb981445a3666e629b9cfee0863968e..28af63caf3969fb2087729bdd8e1112305f5b4c1 100644 (file)
@@ -4,7 +4,7 @@ $key - Unique key for checking existing stored state.
 --}}
 <?php $isOpen = setting()->getForCurrentUser('section_expansion#'. $key); ?>
 <a expand-toggle="{{ $target }}"
-   expand-toggle-update-endpoint="{{ baseUrl('/settings/users/'. $currentUser->id .'/update-expansion-preference/' . $key) }}"
+   expand-toggle-update-endpoint="{{ url('/settings/users/'. $currentUser->id .'/update-expansion-preference/' . $key) }}"
    expand-toggle-is-open="{{ $isOpen ? 'yes' : 'no' }}"
    class="text-muted icon-list-item text-primary">
     <span>@icon('expand-text')</span>
index 7c9084ad102fa1b2690517c950d413a5cc59be0a..6781bca5fbbdd462b359336e934adbc3330c08a1 100644 (file)
@@ -1,4 +1,13 @@
 <div id="image-manager" image-type="{{ $imageType }}" uploaded-to="{{ $uploaded_to ?? 0 }}">
+
+    @exposeTranslations([
+        'components.image_delete_success',
+        'components.image_upload_success',
+        'errors.server_upload_limit',
+        'components.image_upload_remove',
+        'components.file_upload_timeout',
+    ])
+
     <div overlay v-cloak @click="hide">
         <div class="popup-body" @click.stop="">
 
index 7a3285fa76afe1215c1939c639056e6f53193b8f..e24ea49f1c82a7a374f8c8cf0c51392a40cac943 100644 (file)
@@ -3,7 +3,7 @@
 <div page-picker>
     <div class="input-base">
         <span @if($value) style="display: none" @endif page-picker-default class="text-muted italic">{{ $placeholder }}</span>
-        <a @if(!$value) style="display: none" @endif href="{{ baseUrl('/link/' . $value) }}" target="_blank" class="text-page" page-picker-display>#{{$value}}, {{$value ? \BookStack\Entities\Page::find($value)->name : '' }}</a>
+        <a @if(!$value) style="display: none" @endif href="{{ url('/link/' . $value) }}" target="_blank" class="text-page" page-picker-display>#{{$value}}, {{$value ? \BookStack\Entities\Page::find($value)->name : '' }}</a>
     </div>
     <br>
     <input type="hidden" value="{{$value}}" name="{{$name}}" id="{{$name}}">
index 1d1cc2d806153baa00d770e3ca05b4735fb5177b..f7a9c6c48623c36d92f9e0434532a1388f5753c7 100644 (file)
@@ -1,6 +1,6 @@
 @foreach($entity->tags as $tag)
     <div class="tag-item primary-background-light">
-        <div class="tag-name"><a href="{{ baseUrl('/search?term=%5B' . urlencode($tag->name) .'%5D') }}">@icon('tag'){{ $tag->name }}</a></div>
-        @if($tag->value) <div class="tag-value"><a href="{{ baseUrl('/search?term=%5B' . urlencode($tag->name) .'%3D' . urlencode($tag->value) . '%5D') }}">{{$tag->value}}</a></div> @endif
+        <div class="tag-name"><a href="{{ url('/search?term=%5B' . urlencode($tag->name) .'%5D') }}">@icon('tag'){{ $tag->name }}</a></div>
+        @if($tag->value) <div class="tag-value"><a href="{{ url('/search?term=%5B' . urlencode($tag->name) .'%3D' . urlencode($tag->value) . '%5D') }}">{{$tag->value}}</a></div> @endif
     </div>
 @endforeach
\ No newline at end of file
index 5ae3831986bc8aa8eeee34a09f72275f63f4811a..31585dc41aedb8bede78dba2fd7d6b5d43fa4803 100644 (file)
@@ -7,11 +7,11 @@
             <div v-for="(tag, i) in tags" :key="tag.key" class="card drag-card">
                 <div class="handle" >@icon('grip')</div>
                 <div>
-                    <autosuggest url="{{ baseUrl('/ajax/tags/suggest/names') }}" type="name" class="outline" :name="getTagFieldName(i, 'name')"
+                    <autosuggest url="{{ url('/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="{{ baseUrl('/ajax/tags/suggest/values') }}" type="value" class="outline" :name="getTagFieldName(i, 'value')"
+                    <autosuggest url="{{ url('/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)">@icon('close')</div>
index 228c51520e7d92c47a94cf1ef5bbebd3fb1af054..c1937ff23e5ce0311ac7247e8bb7a4e57813625f 100644 (file)
@@ -10,7 +10,7 @@
                 <h5>{{ trans('errors.sorry_page_not_found') }}</h5>
             </div>
             <div class="text-right">
-                <a href="{{ baseUrl('/') }}" class="button outline">{{ trans('errors.return_home') }}</a>
+                <a href="{{ url('/') }}" class="button outline">{{ trans('errors.return_home') }}</a>
             </div>
         </div>
 
index 3745f2292f733ce4c18f1af01d6f9e0130c7c288..8c6822767a1f823e67782a3d0a0fb96ad89cd8e2 100644 (file)
@@ -7,7 +7,7 @@
             <h3 class="text-muted">{{ trans('errors.error_occurred') }}</h3>
             <div class="body">
                 <h5>{{ $message ?? 'An unknown error occurred' }}</h5>
-                <p><a href="{{ baseUrl('/') }}" class="button outline">{{ trans('errors.return_home') }}</a></p>
+                <p><a href="{{ url('/') }}" class="button outline">{{ trans('errors.return_home') }}</a></p>
             </div>
         </div>
     </div>
index 6bb4b51ada62824b103fce9604b43209db24ebc4..b3e148e21c14578f9e7827c3bcd83d9b7ef9096d 100644 (file)
@@ -1,4 +1,4 @@
-<form action="{{ $model->getUrl('/permissions') }}" method="POST">
+<form action="{{ $model->getUrl('/permissions') }}" method="POST" entity-permissions-editor>
     {!! csrf_field() !!}
     <input type="hidden" name="_method" value="PUT">
 
@@ -11,7 +11,7 @@
         ])
     </div>
 
-    <table permissions-table class="table permissions-table toggle-switch-list">
+    <table permissions-table class="table permissions-table toggle-switch-list" style="{{ !$model->restricted ? 'display: none' : '' }}">
         <tr>
             <th>{{ trans('common.role') }}</th>
             <th @if($model->isA('page')) colspan="3" @else colspan="4" @endif>
index 948a55cbc10a2b6e3f68e16626f8a0ff785394a8..909e87286247daaba449ebfc7ae320ba24346660 100644 (file)
@@ -1,6 +1,7 @@
 <input type="text" id="{{ $name }}" name="{{ $name }}"
        @if($errors->has($name)) class="text-neg" @endif
        @if(isset($placeholder)) placeholder="{{$placeholder}}" @endif
+       @if(isset($disabled) && $disabled) disabled="disabled" @endif
        @if(isset($tabindex)) tabindex="{{$tabindex}}" @endif
        @if(isset($model) || old($name)) value="{{ old($name) ? old($name) : $model->$name}}" @endif>
 @if($errors->has($name))
diff --git a/resources/views/pages/attachment-manager.blade.php b/resources/views/pages/attachment-manager.blade.php
new file mode 100644 (file)
index 0000000..7b16c6b
--- /dev/null
@@ -0,0 +1,99 @@
+<div toolbox-tab-content="files" id="attachment-manager" page-id="{{ $page->id ?? 0 }}">
+
+    @exposeTranslations([
+    'entities.attachments_file_uploaded',
+    'entities.attachments_file_updated',
+    'entities.attachments_link_attached',
+    'entities.attachments_updated_success',
+    'errors.server_upload_limit',
+    'components.image_upload_remove',
+    'components.file_upload_timeout',
+    ])
+
+    <h4>{{ trans('entities.attachments') }}</h4>
+    <div class="px-l files">
+
+        <div id="file-list" v-show="!fileToEdit">
+            <p class="text-muted small">{{ trans('entities.attachments_explain') }} <span class="text-warn">{{ trans('entities.attachments_explain_instant_save') }}</span></p>
+
+            <div class="tab-container">
+                <div class="nav-tabs">
+                    <div @click="tab = 'list'" :class="{selected: tab === 'list'}" class="tab-item">{{ trans('entities.attachments_items') }}</div>
+                    <div @click="tab = 'file'" :class="{selected: tab === 'file'}" class="tab-item">{{ trans('entities.attachments_upload') }}</div>
+                    <div @click="tab = 'link'" :class="{selected: tab === 'link'}" class="tab-item">{{ trans('entities.attachments_link') }}</div>
+                </div>
+                <div v-show="tab === 'list'">
+                    <draggable style="width: 100%;" :options="{handle: '.handle'}" @change="fileSortUpdate" :list="files" element="div">
+                        <div v-for="(file, index) in files" :key="file.id" class="card drag-card">
+                            <div class="handle">@icon('grip')</div>
+                            <div class="py-s">
+                                <a :href="getFileUrl(file)" target="_blank" v-text="file.name"></a>
+                                <div v-if="file.deleting">
+                                    <span class="text-neg small">{{ trans('entities.attachments_delete_confirm') }}</span>
+                                    <br>
+                                    <span class="text-primary small" @click="file.deleting = false;">{{ trans('common.cancel') }}</span>
+                                </div>
+                            </div>
+                            <div @click="startEdit(file)" class="drag-card-action text-center text-primary">@icon('edit')</div>
+                            <div @click="deleteFile(file)" class="drag-card-action text-center text-neg">@icon('close')</div>
+                        </div>
+                    </draggable>
+                    <p class="small text-muted" v-if="files.length === 0">
+                        {{ trans('entities.attachments_no_files') }}
+                    </p>
+                </div>
+                <div v-show="tab === 'file'">
+                    <dropzone placeholder="{{ trans('entities.attachments_dropzone') }}" :upload-url="getUploadUrl()" :uploaded-to="pageId" @success="uploadSuccess"></dropzone>
+                </div>
+                <div v-show="tab === 'link'" @keypress.enter.prevent="attachNewLink(file)">
+                    <p class="text-muted small">{{ trans('entities.attachments_explain_link') }}</p>
+                    <div class="form-group">
+                        <label for="attachment-via-link">{{ trans('entities.attachments_link_name') }}</label>
+                        <input type="text" placeholder="{{ trans('entities.attachments_link_name') }}" v-model="file.name">
+                        <p class="small text-neg" v-for="error in errors.link.name" v-text="error"></p>
+                    </div>
+                    <div class="form-group">
+                        <label for="attachment-via-link">{{ trans('entities.attachments_link_url') }}</label>
+                        <input type="text"  placeholder="{{ trans('entities.attachments_link_url_hint') }}" v-model="file.link">
+                        <p class="small text-neg" v-for="error in errors.link.link" v-text="error"></p>
+                    </div>
+                    <button @click.prevent="attachNewLink(file)" class="button primary">{{ trans('entities.attach') }}</button>
+
+                </div>
+            </div>
+
+        </div>
+
+        <div id="file-edit" v-if="fileToEdit" @keypress.enter.prevent="updateFile(fileToEdit)">
+            <h5>{{ trans('entities.attachments_edit_file') }}</h5>
+
+            <div class="form-group">
+                <label for="attachment-name-edit">{{ trans('entities.attachments_edit_file_name') }}</label>
+                <input type="text" id="attachment-name-edit" placeholder="{{ trans('entities.attachments_edit_file_name') }}" v-model="fileToEdit.name">
+                <p class="small text-neg" v-for="error in errors.edit.name" v-text="error"></p>
+            </div>
+
+            <div class="tab-container">
+                <div class="nav-tabs">
+                    <div @click="editTab = 'file'" :class="{selected: editTab === 'file'}" class="tab-item">{{ trans('entities.attachments_upload') }}</div>
+                    <div @click="editTab = 'link'" :class="{selected: editTab === 'link'}" class="tab-item">{{ trans('entities.attachments_set_link') }}</div>
+                </div>
+                <div v-if="editTab === 'file'">
+                    <dropzone :upload-url="getUploadUrl(fileToEdit)" :uploaded-to="pageId" placeholder="{{ trans('entities.attachments_edit_drop_upload') }}" @success="uploadSuccessUpdate"></dropzone>
+                    <br>
+                </div>
+                <div v-if="editTab === 'link'">
+                    <div class="form-group">
+                        <label for="attachment-link-edit">{{ trans('entities.attachments_link_url') }}</label>
+                        <input type="text" id="attachment-link-edit" placeholder="{{ trans('entities.attachment_link') }}" v-model="fileToEdit.link">
+                        <p class="small text-neg" v-for="error in errors.edit.link" v-text="error"></p>
+                    </div>
+                </div>
+            </div>
+
+            <button type="button" class="button outline" @click="cancelEdit">{{ trans('common.back') }}</button>
+            <button @click.enter.prevent="updateFile(fileToEdit)" class="button primary">{{ trans('common.save') }}</button>
+        </div>
+
+    </div>
+</div>
\ No newline at end of file
index c12bd6b4d2b78e769c1b000b1c9df8d94b0e988f..cfb66fdd0e34ad87827be468764670b230bc2a3b 100644 (file)
@@ -1,7 +1,7 @@
 @extends('base')
 
 @section('head')
-    <script src="{{ baseUrl('/libs/tinymce/tinymce.min.js?ver=4.9.4') }}"></script>
+    <script src="{{ url('/libs/tinymce/tinymce.min.js?ver=4.9.4') }}"></script>
 @stop
 
 @section('body-class', 'flexbox')
 
     <div class="flex-fill flex">
         <form action="{{ $page->getUrl() }}" autocomplete="off" data-page-id="{{ $page->id }}" method="POST" class="flex flex-fill">
+            {{ csrf_field() }}
+
             @if(!isset($isDraft))
                 <input type="hidden" name="_method" value="PUT">
             @endif
             @include('pages.form', ['model' => $page])
-            @include('pages.form-toolbox')
+            @include('pages.editor-toolbox')
         </form>
     </div>
     
diff --git a/resources/views/pages/editor-toolbox.blade.php b/resources/views/pages/editor-toolbox.blade.php
new file mode 100644 (file)
index 0000000..3ce4cfb
--- /dev/null
@@ -0,0 +1,32 @@
+<div editor-toolbox class="floating-toolbox">
+
+    <div class="tabs primary-background-light">
+        <span toolbox-toggle>@icon('caret-left-circle')</span>
+        <span toolbox-tab-button="tags" title="{{ trans('entities.page_tags') }}" class="active">@icon('tag')</span>
+        @if(userCan('attachment-create-all'))
+            <span toolbox-tab-button="files" title="{{ trans('entities.attachments') }}">@icon('attach')</span>
+        @endif
+        <span toolbox-tab-button="templates" title="{{ trans('entities.templates') }}">@icon('template')</span>
+    </div>
+
+    <div toolbox-tab-content="tags">
+        <h4>{{ trans('entities.page_tags') }}</h4>
+        <div class="px-l">
+            @include('components.tag-manager', ['entity' => $page, 'entityType' => 'page'])
+        </div>
+    </div>
+
+    @if(userCan('attachment-create-all'))
+        @include('pages.attachment-manager', ['page' => $page])
+    @endif
+
+    <div toolbox-tab-content="templates">
+        <h4>{{ trans('entities.templates') }}</h4>
+
+        <div class="px-l">
+            @include('pages.template-manager', ['page' => $page, 'templates' => $templates])
+        </div>
+
+    </div>
+
+</div>
diff --git a/resources/views/pages/form-toolbox.blade.php b/resources/views/pages/form-toolbox.blade.php
deleted file mode 100644 (file)
index e515c0b..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-
-<div editor-toolbox class="floating-toolbox">
-
-    <div class="tabs primary-background-light">
-        <span toolbox-toggle>@icon('caret-left-circle')</span>
-        <span toolbox-tab-button="tags" title="{{ trans('entities.page_tags') }}" class="active">@icon('tag')</span>
-        @if(userCan('attachment-create-all'))
-            <span toolbox-tab-button="files" title="{{ trans('entities.attachments') }}">@icon('attach')</span>
-        @endif
-    </div>
-
-    <div toolbox-tab-content="tags">
-        <h4>{{ trans('entities.page_tags') }}</h4>
-        <div class="px-l">
-            @include('components.tag-manager', ['entity' => $page, 'entityType' => 'page'])
-        </div>
-    </div>
-
-    @if(userCan('attachment-create-all'))
-        <div toolbox-tab-content="files" id="attachment-manager" page-id="{{ $page->id ?? 0 }}">
-            <h4>{{ trans('entities.attachments') }}</h4>
-            <div class="px-l files">
-
-                <div id="file-list" v-show="!fileToEdit">
-                    <p class="text-muted small">{{ trans('entities.attachments_explain') }} <span class="text-warn">{{ trans('entities.attachments_explain_instant_save') }}</span></p>
-
-                    <div class="tab-container">
-                        <div class="nav-tabs">
-                            <div @click="tab = 'list'" :class="{selected: tab === 'list'}" class="tab-item">{{ trans('entities.attachments_items') }}</div>
-                            <div @click="tab = 'file'" :class="{selected: tab === 'file'}" class="tab-item">{{ trans('entities.attachments_upload') }}</div>
-                            <div @click="tab = 'link'" :class="{selected: tab === 'link'}" class="tab-item">{{ trans('entities.attachments_link') }}</div>
-                        </div>
-                        <div v-show="tab === 'list'">
-                            <draggable style="width: 100%;" :options="{handle: '.handle'}" @change="fileSortUpdate" :list="files" element="div">
-                                <div v-for="(file, index) in files" :key="file.id" class="card drag-card">
-                                    <div class="handle">@icon('grip')</div>
-                                    <div class="py-s">
-                                        <a :href="getFileUrl(file)" target="_blank" v-text="file.name"></a>
-                                        <div v-if="file.deleting">
-                                            <span class="text-neg small">{{ trans('entities.attachments_delete_confirm') }}</span>
-                                            <br>
-                                            <span class="text-primary small" @click="file.deleting = false;">{{ trans('common.cancel') }}</span>
-                                        </div>
-                                    </div>
-                                    <div @click="startEdit(file)" class="drag-card-action text-center text-primary">@icon('edit')</div>
-                                    <div @click="deleteFile(file)" class="drag-card-action text-center text-neg">@icon('close')</div>
-                                </div>
-                            </draggable>
-                            <p class="small text-muted" v-if="files.length === 0">
-                                {{ trans('entities.attachments_no_files') }}
-                            </p>
-                        </div>
-                        <div v-show="tab === 'file'">
-                            <dropzone placeholder="{{ trans('entities.attachments_dropzone') }}" :upload-url="getUploadUrl()" :uploaded-to="pageId" @success="uploadSuccess"></dropzone>
-                        </div>
-                        <div v-show="tab === 'link'" @keypress.enter.prevent="attachNewLink(file)">
-                            <p class="text-muted small">{{ trans('entities.attachments_explain_link') }}</p>
-                            <div class="form-group">
-                                <label for="attachment-via-link">{{ trans('entities.attachments_link_name') }}</label>
-                                <input type="text" placeholder="{{ trans('entities.attachments_link_name') }}" v-model="file.name">
-                                <p class="small text-neg" v-for="error in errors.link.name" v-text="error"></p>
-                            </div>
-                            <div class="form-group">
-                                <label for="attachment-via-link">{{ trans('entities.attachments_link_url') }}</label>
-                                <input type="text"  placeholder="{{ trans('entities.attachments_link_url_hint') }}" v-model="file.link">
-                                <p class="small text-neg" v-for="error in errors.link.link" v-text="error"></p>
-                            </div>
-                            <button @click.prevent="attachNewLink(file)" class="button primary">{{ trans('entities.attach') }}</button>
-
-                        </div>
-                    </div>
-
-                </div>
-
-                <div id="file-edit" v-if="fileToEdit" @keypress.enter.prevent="updateFile(fileToEdit)">
-                    <h5>{{ trans('entities.attachments_edit_file') }}</h5>
-
-                    <div class="form-group">
-                        <label for="attachment-name-edit">{{ trans('entities.attachments_edit_file_name') }}</label>
-                        <input type="text" id="attachment-name-edit" placeholder="{{ trans('entities.attachments_edit_file_name') }}" v-model="fileToEdit.name">
-                        <p class="small text-neg" v-for="error in errors.edit.name" v-text="error"></p>
-                    </div>
-
-                    <div class="tab-container">
-                        <div class="nav-tabs">
-                            <div @click="editTab = 'file'" :class="{selected: editTab === 'file'}" class="tab-item">{{ trans('entities.attachments_upload') }}</div>
-                            <div @click="editTab = 'link'" :class="{selected: editTab === 'link'}" class="tab-item">{{ trans('entities.attachments_set_link') }}</div>
-                        </div>
-                        <div v-if="editTab === 'file'">
-                            <dropzone :upload-url="getUploadUrl(fileToEdit)" :uploaded-to="pageId" placeholder="{{ trans('entities.attachments_edit_drop_upload') }}" @success="uploadSuccessUpdate"></dropzone>
-                            <br>
-                        </div>
-                        <div v-if="editTab === 'link'">
-                            <div class="form-group">
-                                <label for="attachment-link-edit">{{ trans('entities.attachments_link_url') }}</label>
-                                <input type="text" id="attachment-link-edit" placeholder="{{ trans('entities.attachment_link') }}" v-model="fileToEdit.link">
-                                <p class="small text-neg" v-for="error in errors.edit.link" v-text="error"></p>
-                            </div>
-                        </div>
-                    </div>
-
-                    <button type="button" class="button outline" @click="cancelEdit">{{ trans('common.back') }}</button>
-                    <button @click.enter.prevent="updateFile(fileToEdit)" class="button primary">{{ trans('common.save') }}</button>
-                </div>
-
-            </div>
-        </div>
-    @endif
-
-</div>
index e9af4a4dd5c36eada09c1bcb0282b413349abf38..380718dd7f6a53e87a5d4636e75d54fd3d0ccd5d 100644 (file)
@@ -1,4 +1,3 @@
-
 <div class="page-editor flex-fill flex" id="page-editor"
      drafts-enabled="{{ $draftsEnabled ? 'true' : 'false' }}"
      drawio-enabled="{{ config('services.drawio') ? 'true' : 'false' }}"
@@ -8,7 +7,14 @@
      page-new-draft="{{ $model->draft ?? 0 }}"
      page-update-draft="{{ $model->isDraft ?? 0 }}">
 
-    {{ csrf_field() }}
+    @exposeTranslations([
+        'entities.pages_editing_draft',
+        'entities.pages_editing_page',
+        'errors.page_draft_autosave_fail',
+        'entities.pages_editing_page',
+        'entities.pages_draft_discarded',
+        'entities.pages_edit_set_changelog',
+    ])
 
     {{--Header Bar--}}
     <div class="primary-background-light toolbar page-edit-toolbar">
 
         {{--WYSIWYG Editor--}}
         @if(setting('app-editor') === 'wysiwyg')
-            <div wysiwyg-editor class="flex-fill flex">
-                <textarea id="html-editor"  name="html" rows="5" v-pre
-                    @if($errors->has('html')) class="text-neg" @endif>@if(isset($model) || old('html')){{htmlspecialchars( old('html') ? old('html') : $model->html)}}@endif</textarea>
-            </div>
-
-            @if($errors->has('html'))
-                <div class="text-neg text-small">{{ $errors->first('html') }}</div>
-            @endif
+            @include('pages.wysiwyg-editor', ['model' => $model])
         @endif
 
         {{--Markdown Editor--}}
         @if(setting('app-editor') === 'markdown')
-            <div v-pre id="markdown-editor" markdown-editor class="flex-fill flex code-fill">
-
-                <div class="markdown-editor-wrap active">
-                    <div class="editor-toolbar">
-                        <span class="float left editor-toolbar-label">{{ trans('entities.pages_md_editor') }}</span>
-                        <div class="float right buttons">
-                            @if(config('services.drawio'))
-                                <button class="text-button" type="button" data-action="insertDrawing">@icon('drawing'){{ trans('entities.pages_md_insert_drawing') }}</button>
-                                &nbsp;|&nbsp
-                            @endif
-                            <button class="text-button" type="button" data-action="insertImage">@icon('image'){{ trans('entities.pages_md_insert_image') }}</button>
-                            &nbsp;|&nbsp;
-                            <button class="text-button" type="button" data-action="insertLink">@icon('link'){{ trans('entities.pages_md_insert_link') }}</button>
-                        </div>
-                    </div>
-
-                    <div markdown-input class="flex flex-fill">
-                        <textarea  id="markdown-editor-input"  name="markdown" rows="5"
-                            @if($errors->has('markdown')) class="text-neg" @endif>@if(isset($model) || old('markdown')){{htmlspecialchars( old('markdown') ? old('markdown') : ($model->markdown === '' ? $model->html : $model->markdown))}}@endif</textarea>
-                    </div>
-
-                </div>
-
-                <div class="markdown-editor-wrap">
-                    <div class="editor-toolbar">
-                        <div class="editor-toolbar-label">{{ trans('entities.pages_md_preview') }}</div>
-                    </div>
-                    <div class="markdown-display page-content">
-                    </div>
-                </div>
-                <input type="hidden" name="html"/>
-
-            </div>
-
-
-
-            @if($errors->has('markdown'))
-                <div class="text-neg text-small">{{ $errors->first('markdown') }}</div>
-            @endif
+            @include('pages.markdown-editor', ['model' => $model])
         @endif
 
     </div>
diff --git a/resources/views/pages/markdown-editor.blade.php b/resources/views/pages/markdown-editor.blade.php
new file mode 100644 (file)
index 0000000..87bde33
--- /dev/null
@@ -0,0 +1,42 @@
+<div v-pre id="markdown-editor" markdown-editor class="flex-fill flex code-fill">
+    @exposeTranslations([
+        'errors.image_upload_error',
+    ])
+
+    <div class="markdown-editor-wrap active">
+        <div class="editor-toolbar">
+            <span class="float left editor-toolbar-label">{{ trans('entities.pages_md_editor') }}</span>
+            <div class="float right buttons">
+                @if(config('services.drawio'))
+                    <button class="text-button" type="button" data-action="insertDrawing">@icon('drawing'){{ trans('entities.pages_md_insert_drawing') }}</button>
+                    &nbsp;|&nbsp
+                @endif
+                <button class="text-button" type="button" data-action="insertImage">@icon('image'){{ trans('entities.pages_md_insert_image') }}</button>
+                &nbsp;|&nbsp;
+                <button class="text-button" type="button" data-action="insertLink">@icon('link'){{ trans('entities.pages_md_insert_link') }}</button>
+            </div>
+        </div>
+
+        <div markdown-input class="flex flex-fill">
+                        <textarea  id="markdown-editor-input"  name="markdown" rows="5"
+                                   @if($errors->has('markdown')) class="text-neg" @endif>@if(isset($model) || old('markdown')){{htmlspecialchars( old('markdown') ? old('markdown') : ($model->markdown === '' ? $model->html : $model->markdown))}}@endif</textarea>
+        </div>
+
+    </div>
+
+    <div class="markdown-editor-wrap">
+        <div class="editor-toolbar">
+            <div class="editor-toolbar-label">{{ trans('entities.pages_md_preview') }}</div>
+        </div>
+        <div class="markdown-display page-content">
+        </div>
+    </div>
+    <input type="hidden" name="html"/>
+
+</div>
+
+
+
+@if($errors->has('markdown'))
+    <div class="text-neg text-small">{{ $errors->first('markdown') }}</div>
+@endif
\ No newline at end of file
diff --git a/resources/views/pages/pointer.blade.php b/resources/views/pages/pointer.blade.php
new file mode 100644 (file)
index 0000000..d4aca5d
--- /dev/null
@@ -0,0 +1,13 @@
+<div class="pointer-container" id="pointer">
+    <div class="pointer anim {{ userCan('page-update', $page) ? 'is-page-editable' : ''}}" >
+        <span class="icon mr-xxs">@icon('link') @icon('include', ['style' => 'display:none;'])</span>
+        <div class="input-group inline block">
+            <input readonly="readonly" type="text" id="pointer-url" placeholder="url">
+            <button class="button outline icon" data-clipboard-target="#pointer-url" type="button" title="{{ trans('entities.pages_copy_link') }}">@icon('copy')</button>
+        </div>
+        @if(userCan('page-update', $page))
+            <a href="{{ $page->getUrl('/edit') }}" id="pointer-edit" data-edit-href="{{ $page->getUrl('/edit') }}"
+               class="button outline icon heading-edit-icon ml-s px-s" title="{{ trans('entities.pages_edit_content_link')}}">@icon('edit')</a>
+        @endif
+    </div>
+</div>
\ No newline at end of file
index ff4db2eec4a84df6b787c7f129e1f3cfe262b61e..86b0d3f88d39020f7f5f03c34e8b8473f66c309d 100644 (file)
     </div>
 
     <div class="content-wrap card">
-        <div class="page-content flex" page-display="{{ $page->id }}">
-
-            <div class="pointer-container" id="pointer">
-                <div class="pointer anim {{ userCan('page-update', $page) ? 'is-page-editable' : ''}}" >
-                    <span class="icon text-primary">@icon('link') @icon('include', ['style' => 'display:none;'])</span>
-                    <span class="input-group">
-                    <input readonly="readonly" type="text" id="pointer-url" placeholder="url">
-                    <button class="button icon" data-clipboard-target="#pointer-url" type="button" title="{{ trans('entities.pages_copy_link') }}">@icon('copy')</button>
-                </span>
-                    @if(userCan('page-update', $page))
-                        <a href="{{ $page->getUrl('/edit') }}" id="pointer-edit" data-edit-href="{{ $page->getUrl('/edit') }}"
-                           class="button icon heading-edit-icon" title="{{ trans('entities.pages_edit_content_link')}}">@icon('edit')</a>
-                    @endif
-                </div>
-            </div>
-
+        <div class="page-content" page-display="{{ $page->id }}">
+            @include('pages.pointer', ['page' => $page])
             @include('pages.page-display')
         </div>
     </div>
@@ -70,7 +56,7 @@
                 <div class="sidebar-page-nav menu">
                     @foreach($pageNav as $navItem)
                         <li class="page-nav-item h{{ $navItem['level'] }}">
-                            <a href="{{ $navItem['link'] }}">{{ $navItem['text'] }}</a>
+                            <a href="{{ $navItem['link'] }}" class="limit-text block">{{ $navItem['text'] }}</a>
                             <div class="primary-background sidebar-page-nav-bullet"></div>
                         </li>
                     @endforeach
                     @endif
                 </div>
             @endif
+
+            @if($page->template)
+                <div>
+                    @icon('template'){{ trans('entities.pages_is_template') }}
+                </div>
+            @endif
         </div>
     </div>
 
diff --git a/resources/views/pages/template-manager-list.blade.php b/resources/views/pages/template-manager-list.blade.php
new file mode 100644 (file)
index 0000000..68899c8
--- /dev/null
@@ -0,0 +1,20 @@
+{{ $templates->links() }}
+
+@foreach($templates as $template)
+    <div class="card template-item border-card p-m mb-m" draggable="true" template-id="{{ $template->id }}">
+        <div class="template-item-content" title="{{ trans('entities.templates_replace_content') }}">
+            <div>{{ $template->name }}</div>
+            <div class="text-muted">{{ trans('entities.meta_updated', ['timeLength' => $template->updated_at->diffForHumans()]) }}</div>
+        </div>
+        <div class="template-item-actions">
+            <button type="button"
+                    title="{{ trans('entities.templates_prepend_content') }}"
+                    template-action="prepend">@icon('chevron-up')</button>
+            <button type="button"
+                    title="{{ trans('entities.templates_append_content') }}"
+                    template-action="append">@icon('chevron-down')</button>
+        </div>
+    </div>
+@endforeach
+
+{{ $templates->links() }}
\ No newline at end of file
diff --git a/resources/views/pages/template-manager.blade.php b/resources/views/pages/template-manager.blade.php
new file mode 100644 (file)
index 0000000..fbdb70a
--- /dev/null
@@ -0,0 +1,25 @@
+<div template-manager>
+    @if(userCan('templates-manage'))
+        <p class="text-muted small mb-none">
+            {{ trans('entities.templates_explain_set_as_template') }}
+        </p>
+        @include('components.toggle-switch', [
+               'name' => 'template',
+               'value' => old('template', $page->template ? 'true' : 'false') === 'true',
+               'label' => trans('entities.templates_set_as_template')
+        ])
+        <hr>
+    @endif
+
+    @if(count($templates) > 0)
+        <div class="search-box flexible mb-m">
+            <input type="text" name="template-search" placeholder="{{ trans('common.search') }}">
+            <button type="button">@icon('search')</button>
+            <button class="search-box-cancel text-neg hidden" type="button">@icon('close')</button>
+        </div>
+    @endif
+
+    <div template-manager-list>
+        @include('pages.template-manager-list', ['templates' => $templates])
+    </div>
+</div>
\ No newline at end of file
diff --git a/resources/views/pages/wysiwyg-editor.blade.php b/resources/views/pages/wysiwyg-editor.blade.php
new file mode 100644 (file)
index 0000000..f9a0f03
--- /dev/null
@@ -0,0 +1,13 @@
+<div wysiwyg-editor class="flex-fill flex">
+
+    @exposeTranslations([
+        'errors.image_upload_error',
+    ])
+
+    <textarea id="html-editor"  name="html" rows="5" v-pre
+          @if($errors->has('html')) class="text-neg" @endif>@if(isset($model) || old('html')){{htmlspecialchars( old('html') ? old('html') : $model->html)}}@endif</textarea>
+</div>
+
+@if($errors->has('html'))
+    <div class="text-neg text-small">{{ $errors->first('html') }}</div>
+@endif
\ No newline at end of file
index df5d1aa049fce72ba44a9e45a1a8ac73b826f8a6..28c7196ee490c9e0e8a0039f984e200b00e128d6 100644 (file)
@@ -3,7 +3,7 @@
 
     {{-- Show top level books item --}}
     @if (count($crumbs) > 0 && array_first($crumbs) instanceof  \BookStack\Entities\Book)
-        <a href="{{  baseUrl('/books')  }}" class="text-book icon-list-item outline-hover">
+        <a href="{{  url('/books')  }}" class="text-book icon-list-item outline-hover">
             <span>@icon('books')</span>
             <span>{{ trans('entities.books') }}</span>
         </a>
@@ -12,7 +12,7 @@
 
     {{-- Show top level shelves item --}}
     @if (count($crumbs) > 0 && array_first($crumbs) instanceof  \BookStack\Entities\Bookshelf)
-        <a href="{{  baseUrl('/shelves')  }}" class="text-bookshelf icon-list-item outline-hover">
+        <a href="{{  url('/shelves')  }}" class="text-bookshelf icon-list-item outline-hover">
             <span>@icon('bookshelf')</span>
             <span>{{ trans('entities.shelves') }}</span>
         </a>
         @endif
 
         @if (is_string($crumb))
-            <a href="{{  baseUrl($key)  }}">
+            <a href="{{  url($key)  }}">
                 {{ $crumb }}
             </a>
         @elseif (is_array($crumb))
-            <a href="{{  baseUrl($key)  }}" class="icon-list-item outline-hover">
+            <a href="{{  url($key)  }}" class="icon-list-item outline-hover">
                 <span>@icon($crumb['icon'])</span>
                 <span>{{ $crumb['text'] }}</span>
             </a>
index 9544bcee1e3d828763d96b0870eb11ce088282a1..38145df219f4c9d7c70d7a2a5d47f4273b12c287 100644 (file)
@@ -4,7 +4,7 @@
 ?>
 <div class="list-sort-container" list-sort-control>
     <div class="list-sort-label">{{ trans('common.sort') }}</div>
-    <form action="{{ baseUrl("/settings/users/{$currentUser->id}/change-sort/{$type}") }}" method="post">
+    <form action="{{ url("/settings/users/{$currentUser->id}/change-sort/{$type}") }}" method="post">
 
         {!! csrf_field() !!}
         {!! method_field('PATCH') !!}
index 9eb00e1d95261d0b977ca44a8f900bd3d4fa8618..9f911c88231d1775366263e0e29766705690df94 100644 (file)
@@ -1,5 +1,5 @@
 <div>
-    <form action="{{ baseUrl("/settings/users/{$currentUser->id}/switch-${type}-view") }}" method="POST" class="inline">
+    <form action="{{ url("/settings/users/{$currentUser->id}/switch-${type}-view") }}" method="POST" class="inline">
         {!! csrf_field() !!}
         {!! method_field('PATCH') !!}
         <input type="hidden" value="{{ $view === 'list'? 'grid' : 'list' }}" name="view_type">
index 03c0b93e71a9acdc5fe11c4e5aa02fa06a377c9f..7a2cf65bd35694f39ecdf8c60e9dce3905cd4901 100644 (file)
             <div>
                 <div v-pre class="card content-wrap">
                     <h1 class="list-heading">{{ trans('entities.search_results') }}</h1>
-                    <form action="{{ baseUrl('/search') }}" method="GET"  class="search-box flexible hide-over-l">
+                    <form action="{{ url('/search') }}" method="GET"  class="search-box flexible hide-over-l">
                         <input value="{{$searchTerm}}" type="text" name="term" placeholder="{{ trans('common.search') }}">
                         <button type="submit">@icon('search')</button>
                         <button v-if="searching" v-cloak class="search-box-cancel text-neg" v-on:click="clearSearch" type="button">@icon('close')</button>
index 4aa88b047859d1ad75111af0eaecc530eb671f6e..510e3af1bb662f3a95f966a9d7d886684bbb724c 100644 (file)
@@ -15,7 +15,7 @@
 
         <div class="card content-wrap auto-height">
             <h2 class="list-heading">{{ trans('settings.app_features_security') }}</h2>
-            <form action="{{ baseUrl("/settings") }}" method="POST">
+            <form action="{{ url("/settings") }}" method="POST">
                 {!! csrf_field() !!}
 
                 <div class="setting-list">
@@ -27,7 +27,7 @@
                             <p class="small">{!! trans('settings.app_public_access_desc') !!}</p>
                             @if(userCan('users-manage'))
                                 <p class="small mb-none">
-                                    <a href="{{ baseUrl($guestUser->getEditUrl()) }}">{!! trans('settings.app_public_access_desc_guest') !!}</a>
+                                    <a href="{{ url($guestUser->getEditUrl()) }}">{!! trans('settings.app_public_access_desc_guest') !!}</a>
                                 </p>
                             @endif
                         </div>
@@ -79,7 +79,7 @@
 
         <div class="card content-wrap auto-height">
             <h2 class="list-heading">{{ trans('settings.app_customization') }}</h2>
-            <form action="{{ baseUrl("/settings") }}" method="POST" enctype="multipart/form-data">
+            <form action="{{ url("/settings") }}" method="POST" enctype="multipart/form-data">
                 {!! csrf_field() !!}
 
                 <div class="setting-list">
                             @include('components.image-picker', [
                                      'removeName' => 'setting-app-logo',
                                      'removeValue' => 'none',
-                                     'defaultImage' => baseUrl('/logo.png'),
+                                     'defaultImage' => url('/logo.png'),
                                      'currentImage' => setting('app-logo'),
                                      'name' => 'app_logo',
                                      'imageClass' => 'logo-image',
 
         <div class="card content-wrap auto-height">
             <h2 class="list-heading">{{ trans('settings.reg_settings') }}</h2>
-            <form action="{{ baseUrl("/settings") }}" method="POST">
+            <form action="{{ url("/settings") }}" method="POST">
                 {!! csrf_field() !!}
 
                 <div class="setting-list">
index c3ca8c96fbf95102e0a88de8422036fdacfff3cf..6be49cdf2c94479d077ef2258f36bcdd08d1183c 100644 (file)
@@ -21,7 +21,7 @@
                 <p class="small text-muted">{{ trans('settings.maint_image_cleanup_desc') }}</p>
             </div>
             <div>
-                <form method="POST" action="{{ baseUrl('/settings/maintenance/cleanup-images') }}">
+                <form method="POST" action="{{ url('/settings/maintenance/cleanup-images') }}">
                     {!! csrf_field()  !!}
                     <input type="hidden" name="_method" value="DELETE">
                     <div>
index ddbaa3f2a865db53fea0cfd47c0ce1d33133f9dc..51fda5b9031e57f967e895b4b7ab6761f0e65fd4 100644 (file)
@@ -1,13 +1,13 @@
 
 <div class="active-link-list">
     @if($currentUser->can('settings-manage'))
-        <a href="{{ baseUrl('/settings') }}" @if($selected == 'settings') class="active" @endif>@icon('settings'){{ trans('settings.settings') }}</a>
-        <a href="{{ baseUrl('/settings/maintenance') }}" @if($selected == 'maintenance') class="active" @endif>@icon('spanner'){{ trans('settings.maint') }}</a>
+        <a href="{{ url('/settings') }}" @if($selected == 'settings') class="active" @endif>@icon('settings'){{ trans('settings.settings') }}</a>
+        <a href="{{ url('/settings/maintenance') }}" @if($selected == 'maintenance') class="active" @endif>@icon('spanner'){{ trans('settings.maint') }}</a>
     @endif
     @if($currentUser->can('users-manage'))
-        <a href="{{ baseUrl('/settings/users') }}" @if($selected == 'users') class="active" @endif>@icon('users'){{ trans('settings.users') }}</a>
+        <a href="{{ url('/settings/users') }}" @if($selected == 'users') class="active" @endif>@icon('users'){{ trans('settings.users') }}</a>
     @endif
     @if($currentUser->can('user-roles-manage'))
-        <a href="{{ baseUrl('/settings/roles') }}" @if($selected == 'roles') class="active" @endif>@icon('lock-open'){{ trans('settings.roles') }}</a>
+        <a href="{{ url('/settings/roles') }}" @if($selected == 'roles') class="active" @endif>@icon('lock-open'){{ trans('settings.roles') }}</a>
     @endif
 </div>
\ No newline at end of file
index 80a6fc3820d1bffb5c671652d02e0e56f409d391..df902133f3ee514858ae703df5e52b5ab10f934b 100644 (file)
@@ -8,7 +8,7 @@
             @include('settings.navbar', ['selected' => 'roles'])
         </div>
 
-        <form action="{{ baseUrl("/settings/roles/new") }}" method="POST">
+        <form action="{{ url("/settings/roles/new") }}" method="POST">
             @include('settings.roles.form', ['title' => trans('settings.role_create')])
         </form>
     </div>
index a2ea0d7281cd22fb30988048f2965cf0a067315d..e0075fa8ad27d5a4811ec6aa89ac7c25b56ee113 100644 (file)
@@ -12,7 +12,7 @@
 
             <p>{{ trans('settings.role_delete_confirm', ['roleName' => $role->display_name]) }}</p>
 
-            <form action="{{ baseUrl("/settings/roles/delete/{$role->id}") }}" method="POST">
+            <form action="{{ url("/settings/roles/delete/{$role->id}") }}" method="POST">
                 {!! csrf_field() !!}
                 <input type="hidden" name="_method" value="DELETE">
 
@@ -31,7 +31,7 @@
                     </div>
                     <div>
                         <div class="form-group text-right">
-                            <a href="{{ baseUrl("/settings/roles/{$role->id}") }}" class="button outline">{{ trans('common.cancel') }}</a>
+                            <a href="{{ url("/settings/roles/{$role->id}") }}" class="button outline">{{ trans('common.cancel') }}</a>
                             <button type="submit" class="button primary">{{ trans('common.confirm') }}</button>
                         </div>
                     </div>
index a7b81322977c59eb48780d4fd8a8b13a2e23e3ea..0f83bdb0becca1370a8a3085055cf376e2a0b1e3 100644 (file)
@@ -7,7 +7,7 @@
             @include('settings.navbar', ['selected' => 'roles'])
         </div>
 
-        <form action="{{ baseUrl("/settings/roles/{$role->id}") }}" method="POST">
+        <form action="{{ url("/settings/roles/{$role->id}") }}" method="POST">
             <input type="hidden" name="_method" value="PUT">
             @include('settings.roles.form', ['model' => $role, 'title' => trans('settings.role_edit'), 'icon' => 'edit'])
         </form>
index 6d723086714bbc844cdd49ab672571c037324c2c..a9933a7a6c5d749a7dc9612a5b8790b574e53f95 100644 (file)
@@ -38,6 +38,7 @@
                 <div>@include('settings.roles.checkbox', ['permission' => 'user-roles-manage', 'label' => trans('settings.role_manage_roles')])</div>
                 <div>@include('settings.roles.checkbox', ['permission' => 'restrictions-manage-all', 'label' => trans('settings.role_manage_entity_permissions')])</div>
                 <div>@include('settings.roles.checkbox', ['permission' => 'restrictions-manage-own', 'label' => trans('settings.role_manage_own_entity_permissions')])</div>
+                <div>@include('settings.roles.checkbox', ['permission' => 'templates-manage', 'label' => trans('settings.role_manage_page_templates')])</div>
                 <div>@include('settings.roles.checkbox', ['permission' => 'settings-manage', 'label' => trans('settings.role_manage_settings')])</div>
             </div>
         </div>
     </div>
 
     <div class="form-group text-right">
-        <a href="{{ baseUrl("/settings/roles") }}" class="button outline">{{ trans('common.cancel') }}</a>
+        <a href="{{ url("/settings/roles") }}" class="button outline">{{ trans('common.cancel') }}</a>
         @if (isset($role) && $role->id)
-            <a href="{{ baseUrl("/settings/roles/delete/{$role->id}") }}" class="button outline">{{ trans('settings.role_delete') }}</a>
+            <a href="{{ url("/settings/roles/delete/{$role->id}") }}" class="button outline">{{ trans('settings.role_delete') }}</a>
         @endif
         <button type="submit" class="button primary">{{ trans('settings.role_save') }}</button>
     </div>
                     </div>
                     <div>
                         @if(userCan('users-manage') || $currentUser->id == $user->id)
-                            <a href="{{ baseUrl("/settings/users/{$user->id}") }}">
+                            <a href="{{ url("/settings/users/{$user->id}") }}">
                                 @endif
                                 {{ $user->name }}
                                 @if(userCan('users-manage') || $currentUser->id == $user->id)
index 8eae235daf8a471906ed8d21edeb94f23e7c53a2..47cd8c920fffa07909215e12e8f8d3d5d8dedee9 100644 (file)
@@ -14,7 +14,7 @@
                 <h1 class="list-heading">{{ trans('settings.role_user_roles') }}</h1>
 
                 <div class="text-right">
-                    <a href="{{ baseUrl("/settings/roles/new") }}" class="button outline">{{ trans('settings.role_create') }}</a>
+                    <a href="{{ url("/settings/roles/new") }}" class="button outline">{{ trans('settings.role_create') }}</a>
                 </div>
             </div>
 
@@ -26,7 +26,7 @@
                 </tr>
                 @foreach($roles as $role)
                     <tr>
-                        <td><a href="{{ baseUrl("/settings/roles/{$role->id}") }}">{{ $role->display_name }}</a></td>
+                        <td><a href="{{ url("/settings/roles/{$role->id}") }}">{{ $role->display_name }}</a></td>
                         <td>{{ $role->description }}</td>
                         <td class="text-center">{{ $role->users->count() }}</td>
                     </tr>
index 706e15d07faafcb6f3f6855c8671375d79e46cb5..aee1c5a4299bfe6352dfec6d550c6f982abcde9a 100644 (file)
@@ -19,7 +19,7 @@
 
         <div class="card content-wrap">
             <h1 class="list-heading">{{ trans('entities.shelves_create') }}</h1>
-            <form action="{{ baseUrl("/shelves") }}" method="POST" enctype="multipart/form-data">
+            <form action="{{ url("/shelves") }}" method="POST" enctype="multipart/form-data">
                 @include('shelves.form', ['shelf' => null, 'books' => $books])
             </form>
         </div>
index 5803275df7b25b869071ecdb7c9426bc1cbff5e9..1d152a143459aa411ad6535213ff41b371c6e199 100644 (file)
@@ -47,8 +47,8 @@
         <p class="small">{{ trans('common.cover_image_description') }}</p>
 
         @include('components.image-picker', [
-            'defaultImage' => baseUrl('/book_default_cover.png'),
-            'currentImage' => (isset($shelf) && $shelf->cover) ? $shelf->getBookCover() : baseUrl('/book_default_cover.png') ,
+            'defaultImage' => url('/book_default_cover.png'),
+            'currentImage' => (isset($shelf) && $shelf->cover) ? $shelf->getBookCover() : url('/book_default_cover.png') ,
             'name' => 'image',
             'imageClass' => 'cover'
         ])
@@ -65,6 +65,6 @@
 </div>
 
 <div class="form-group text-right">
-    <a href="{{ isset($shelf) ? $shelf->getUrl() : baseUrl('/shelves') }}" class="button outline">{{ trans('common.cancel') }}</a>
+    <a href="{{ isset($shelf) ? $shelf->getUrl() : url('/shelves') }}" class="button outline">{{ trans('common.cancel') }}</a>
     <button type="submit" class="button primary">{{ trans('entities.shelves_save') }}</button>
 </div>
\ No newline at end of file
index 8cf959b1e49529092107324fff48e9e74bc8185e..98f97f1331b8c9985dd6f869759ac0116571c510 100644 (file)
@@ -10,7 +10,7 @@
         <h5>{{ trans('common.actions') }}</h5>
         <div class="icon-list text-primary">
             @if($currentUser->can('bookshelf-create-all'))
-                <a href="{{ baseUrl("/create-shelf") }}" class="icon-list-item">
+                <a href="{{ url("/create-shelf") }}" class="icon-list-item">
                     <span>@icon('add')</span>
                     <span>{{ trans('entities.shelves_new_action') }}</span>
                 </a>
index 70787f7e805ce9990d5403dadff7b58538d774a5..3f8c266e992b83e23cd261d3860a0d0e6973541e 100644 (file)
@@ -31,7 +31,7 @@
     @else
         <p class="text-muted">{{ trans('entities.shelves_empty') }}</p>
         @if(userCan('bookshelf-create-all'))
-            <a href="{{ baseUrl("/create-shelf") }}" class="button outline">@icon('edit'){{ trans('entities.create_now') }}</a>
+            <a href="{{ url("/create-shelf") }}" class="button outline">@icon('edit'){{ trans('entities.create_now') }}</a>
         @endif
     @endif
 
index cd5d75f8fb9b9da6a7d3e0c0569cab7485c7fb7d..b9f404bb712c9d0674f36ee5ebe51528b572d393 100644 (file)
@@ -11,7 +11,7 @@
         <div class="card content-wrap">
             <h1 class="list-heading">{{ trans('settings.users_add_new') }}</h1>
 
-            <form action="{{ baseUrl("/settings/users/create") }}" method="post">
+            <form action="{{ url("/settings/users/create") }}" method="post">
                 {!! csrf_field() !!}
 
                 <div class="setting-list">
@@ -19,7 +19,7 @@
                 </div>
 
                 <div class="form-group text-right">
-                    <a href="{{  baseUrl($currentUser->can('users-manage') ? "/settings/users" : "/") }}" class="button outline">{{ trans('common.cancel') }}</a>
+                    <a href="{{  url($currentUser->can('users-manage') ? "/settings/users" : "/") }}" class="button outline">{{ trans('common.cancel') }}</a>
                     <button class="button primary" type="submit">{{ trans('common.save') }}</button>
                 </div>
 
index 15ad7a9ec66df6678ed3777f261bb55f7e6dedf2..aa9811bf5fb190013cf20da1facacae8a9ad3373 100644 (file)
             <div class="grid half">
                 <p class="text-neg"><strong>{{ trans('settings.users_delete_confirm') }}</strong></p>
                 <div>
-                    <form action="{{ baseUrl("/settings/users/{$user->id}") }}" method="POST" class="text-right">
+                    <form action="{{ url("/settings/users/{$user->id}") }}" method="POST" class="text-right">
                         {!! csrf_field() !!}
 
                         <input type="hidden" name="_method" value="DELETE">
-                        <a href="{{ baseUrl("/settings/users/{$user->id}") }}" class="button outline">{{ trans('common.cancel') }}</a>
+                        <a href="{{ url("/settings/users/{$user->id}") }}" class="button outline">{{ trans('common.cancel') }}</a>
                         <button type="submit" class="button primary">{{ trans('common.confirm') }}</button>
                     </form>
                 </div>
index 377500193dc7d3b910667224a31e8645585a83e9..92a36c943aa1d25e2d12f4147e686179010ce29c 100644 (file)
@@ -9,7 +9,7 @@
 
         <div class="card content-wrap">
             <h1 class="list-heading">{{ $user->id === $currentUser->id ? trans('settings.users_edit_profile') : trans('settings.users_edit') }}</h1>
-            <form action="{{ baseUrl("/settings/users/{$user->id}") }}" method="post" enctype="multipart/form-data">
+            <form action="{{ url("/settings/users/{$user->id}") }}" method="post" enctype="multipart/form-data">
                 {!! csrf_field() !!}
                 <input type="hidden" name="_method" value="PUT">
 
@@ -26,7 +26,7 @@
                                 'resizeHeight' => '512',
                                 'resizeWidth' => '512',
                                 'showRemove' => false,
-                                'defaultImage' => baseUrl('/user_avatar.png'),
+                                'defaultImage' => url('/user_avatar.png'),
                                 'currentImage' => $user->getAvatar(80),
                                 'currentId' => $user->image_id,
                                 'name' => 'profile_image',
@@ -54,9 +54,9 @@
                 </div>
 
                 <div class="text-right">
-                    <a href="{{  baseUrl($currentUser->can('users-manage') ? "/settings/users" : "/") }}" class="button outline">{{ trans('common.cancel') }}</a>
+                    <a href="{{  url($currentUser->can('users-manage') ? "/settings/users" : "/") }}" class="button outline">{{ trans('common.cancel') }}</a>
                     @if($authMethod !== 'system')
-                        <a href="{{ baseUrl("/settings/users/{$user->id}/delete") }}" class="button outline">{{ trans('settings.users_delete') }}</a>
+                        <a href="{{ url("/settings/users/{$user->id}/delete") }}" class="button outline">{{ trans('settings.users_delete') }}</a>
                     @endif
                     <button class="button primary" type="submit">{{ trans('common.save') }}</button>
                 </div>
@@ -74,9 +74,9 @@
                                 <div>@icon('auth/'. $driver, ['style' => 'width: 56px;height: 56px;'])</div>
                                 <div>
                                     @if($user->hasSocialAccount($driver))
-                                        <a href="{{ baseUrl("/login/service/{$driver}/detach") }}" class="button small outline">{{ trans('settings.users_social_disconnect') }}</a>
+                                        <a href="{{ url("/login/service/{$driver}/detach") }}" class="button small outline">{{ trans('settings.users_social_disconnect') }}</a>
                                     @else
-                                        <a href="{{ baseUrl("/login/service/{$driver}") }}" class="button small outline">{{ trans('settings.users_social_connect') }}</a>
+                                        <a href="{{ url("/login/service/{$driver}") }}" class="button small outline">{{ trans('settings.users_social_connect') }}</a>
                                     @endif
                                 </div>
                             </div>
index 96beb7b2f97888bde380b582225b247bb8bc3040..32b717ec8c2ec4db4ef10211f54f0b1aab30f054 100644 (file)
@@ -19,7 +19,7 @@
         <div>
             @if($authMethod !== 'ldap' || userCan('users-manage'))
                 <label for="email">{{ trans('auth.email') }}</label>
-                @include('form.text', ['name' => 'email'])
+                @include('form.text', ['name' => 'email', 'disabled' => !userCan('users-manage')])
             @endif
         </div>
     </div>
 @endif
 
 @if($authMethod === 'standard')
-    <div>
+    <div new-user-password>
         <label class="setting-list-label">{{ trans('settings.users_password') }}</label>
-        <p class="small">{{ trans('settings.users_password_desc') }}</p>
-        @if(isset($model))
+
+        @if(!isset($model))
             <p class="small">
-                {{ trans('settings.users_password_warning') }}
+                {{ trans('settings.users_send_invite_text') }}
             </p>
+
+            @include('components.toggle-switch', [
+                'name' => 'send_invite',
+                'value' => old('send_invite', 'true') === 'true',
+                'label' => trans('settings.users_send_invite_option')
+            ])
+
         @endif
-        <div class="grid half mt-m gap-xl">
-            <div>
-                <label for="password">{{ trans('auth.password') }}</label>
-                @include('form.password', ['name' => 'password'])
-            </div>
-            <div>
-                <label for="password-confirm">{{ trans('auth.password_confirm') }}</label>
-                @include('form.password', ['name' => 'password-confirm'])
+
+        <div id="password-input-container" @if(!isset($model)) style="display: none;" @endif>
+            <p class="small">{{ trans('settings.users_password_desc') }}</p>
+            @if(isset($model))
+                <p class="small">
+                    {{ trans('settings.users_password_warning') }}
+                </p>
+            @endif
+            <div class="grid half mt-m gap-xl">
+                <div>
+                    <label for="password">{{ trans('auth.password') }}</label>
+                    @include('form.password', ['name' => 'password'])
+                </div>
+                <div>
+                    <label for="password-confirm">{{ trans('auth.password_confirm') }}</label>
+                    @include('form.password', ['name' => 'password-confirm'])
+                </div>
             </div>
         </div>
+
     </div>
 @endif
\ No newline at end of file
index af6b4d4f93e70d25c81a7dfff0af76e2479503c1..72db240758f228c7b56d045125b2b01140ec0323 100644 (file)
@@ -14,7 +14,7 @@
 
                 <div class="text-right">
                     <div class="block inline mr-s">
-                        <form method="get" action="{{ baseUrl("/settings/users") }}">
+                        <form method="get" action="{{ url("/settings/users") }}">
                             @foreach(collect($listDetails)->except('search') as $name => $val)
                                 <input type="hidden" name="{{ $name }}" value="{{ $val }}">
                             @endforeach
@@ -22,7 +22,7 @@
                         </form>
                     </div>
                     @if(userCan('users-manage'))
-                        <a href="{{ baseUrl("/settings/users/create") }}" style="margin-top: 0;" class="outline button">{{ trans('settings.users_add_new') }}</a>
+                        <a href="{{ url("/settings/users/create") }}" style="margin-top: 0;" class="outline button">{{ trans('settings.users_add_new') }}</a>
                     @endif
                 </div>
             </div>
@@ -43,7 +43,7 @@
                         <td class="text-center" style="line-height: 0;"><img class="avatar med" src="{{ $user->getAvatar(40)}}" alt="{{ $user->name }}"></td>
                         <td>
                             @if(userCan('users-manage') || $currentUser->id == $user->id)
-                                <a href="{{ baseUrl("/settings/users/{$user->id}") }}">
+                                <a href="{{ url("/settings/users/{$user->id}") }}">
                                     @endif
                                     {{ $user->name }} <br> <span class="text-muted">{{ $user->email }}</span>
                                     @if(userCan('users-manage') || $currentUser->id == $user->id)
@@ -52,7 +52,7 @@
                         </td>
                         <td>
                             @foreach($user->roles as $index => $role)
-                                <small><a href="{{ baseUrl("/settings/roles/{$role->id}") }}">{{$role->display_name}}</a>@if($index !== count($user->roles) -1),@endif</small>
+                                <small><a href="{{ url("/settings/roles/{$role->id}") }}">{{$role->display_name}}</a>@if($index !== count($user->roles) -1),@endif</small>
                             @endforeach
                         </td>
                     </tr>
index e2689790f185516d5d34408ba21dca05c138f3f0..f817e328f410ae6358314b17dc9903ec23bebfd1 100644 (file)
@@ -60,7 +60,7 @@
                     <h2 id="recent-pages" class="list-heading">
                         {{ trans('entities.recently_created_pages') }}
                         @if (count($recentlyCreated['pages']) > 0)
-                            <a href="{{ baseUrl('/search?term=' . urlencode('{created_by:'.$user->id.'} {type:page}') ) }}" class="text-small ml-s">{{ trans('common.view_all') }}</a>
+                            <a href="{{ url('/search?term=' . urlencode('{created_by:'.$user->id.'} {type:page}') ) }}" class="text-small ml-s">{{ trans('common.view_all') }}</a>
                         @endif
                     </h2>
                     @if (count($recentlyCreated['pages']) > 0)
@@ -74,7 +74,7 @@
                     <h2 id="recent-chapters" class="list-heading">
                         {{ trans('entities.recently_created_chapters') }}
                         @if (count($recentlyCreated['chapters']) > 0)
-                            <a href="{{ baseUrl('/search?term=' . urlencode('{created_by:'.$user->id.'} {type:chapter}') ) }}" class="text-small ml-s">{{ trans('common.view_all') }}</a>
+                            <a href="{{ url('/search?term=' . urlencode('{created_by:'.$user->id.'} {type:chapter}') ) }}" class="text-small ml-s">{{ trans('common.view_all') }}</a>
                         @endif
                     </h2>
                     @if (count($recentlyCreated['chapters']) > 0)
@@ -88,7 +88,7 @@
                     <h2 id="recent-books" class="list-heading">
                         {{ trans('entities.recently_created_books') }}
                         @if (count($recentlyCreated['books']) > 0)
-                            <a href="{{ baseUrl('/search?term=' . urlencode('{created_by:'.$user->id.'} {type:book}') ) }}" class="text-small ml-s">{{ trans('common.view_all') }}</a>
+                            <a href="{{ url('/search?term=' . urlencode('{created_by:'.$user->id.'} {type:book}') ) }}" class="text-small ml-s">{{ trans('common.view_all') }}</a>
                         @endif
                     </h2>
                     @if (count($recentlyCreated['books']) > 0)
                     <h2 id="recent-shelves" class="list-heading">
                         {{ trans('entities.recently_created_shelves') }}
                         @if (count($recentlyCreated['shelves']) > 0)
-                            <a href="{{ baseUrl('/search?term=' . urlencode('{created_by:'.$user->id.'} {type:bookshelf}') ) }}" class="text-small ml-s">{{ trans('common.view_all') }}</a>
+                            <a href="{{ url('/search?term=' . urlencode('{created_by:'.$user->id.'} {type:bookshelf}') ) }}" class="text-small ml-s">{{ trans('common.view_all') }}</a>
                         @endif
                     </h2>
                     @if (count($recentlyCreated['shelves']) > 0)
index 8d63fedfdec4afecd40581e7c6462fc3a8a9babc..1b14adb28780a66a51be82f1ac76f2c97181ed10 100644 (file)
@@ -83,7 +83,7 @@ $style = [
                                 <!-- Logo -->
                                 <tr>
                                     <td style="{{ $style['email-masthead'] }}">
-                                        <a style="{{ $fontFamily }} {{ $style['email-masthead_name'] }}" href="{{ baseUrl('/') }}" target="_blank">
+                                        <a style="{{ $fontFamily }} {{ $style['email-masthead_name'] }}" href="{{ url('/') }}" target="_blank">
                                             {{ setting('app-name') }}
                                         </a>
                                     </td>
@@ -186,7 +186,7 @@ $style = [
                                                 <td style="{{ $fontFamily }} {{ $style['email-footer_cell'] }}">
                                                     <p style="{{ $style['paragraph-sub'] }}">
                                                         &copy; {{ date('Y') }}
-                                                        <a style="{{ $style['anchor'] }}" href="{{ baseUrl('/') }}" target="_blank">{{ setting('app-name') }}</a>.
+                                                        <a style="{{ $style['anchor'] }}" href="{{ url('/') }}" target="_blank">{{ setting('app-name') }}</a>.
                                                         {{ trans('common.email_rights') }}
                                                     </p>
                                                 </td>
index 25d7ab6928585ddfe9672136f33311dd9660bc13..d9fdc7455586ca00feb76abd964ffc8d73a73184 100644 (file)
@@ -1,6 +1,5 @@
 <?php
 
-Route::get('/translations', 'HomeController@getTranslations');
 Route::get('/robots.txt', 'HomeController@getRobots');
 
 // Authenticated routes...
@@ -159,6 +158,9 @@ Route::group(['middleware' => 'auth'], function () {
     Route::get('/search/chapter/{bookId}', 'SearchController@searchChapter');
     Route::get('/search/entity/siblings', 'SearchController@searchSiblings');
 
+    Route::get('/templates', 'PageTemplateController@list');
+    Route::get('/templates/{templateId}', 'PageTemplateController@get');
+
     // Other Pages
     Route::get('/', 'HomeController@index');
     Route::get('/home', 'HomeController@index');
@@ -209,12 +211,16 @@ Route::get('/login', 'Auth\LoginController@getLogin');
 Route::post('/login', 'Auth\LoginController@login');
 Route::get('/logout', 'Auth\LoginController@logout');
 Route::get('/register', 'Auth\RegisterController@getRegister');
-Route::get('/register/confirm', 'Auth\RegisterController@getRegisterConfirmation');
-Route::get('/register/confirm/awaiting', 'Auth\RegisterController@showAwaitingConfirmation');
-Route::post('/register/confirm/resend', 'Auth\RegisterController@resendConfirmation');
-Route::get('/register/confirm/{token}', 'Auth\RegisterController@confirmEmail');
+Route::get('/register/confirm', 'Auth\ConfirmEmailController@show');
+Route::get('/register/confirm/awaiting', 'Auth\ConfirmEmailController@showAwaiting');
+Route::post('/register/confirm/resend', 'Auth\ConfirmEmailController@resend');
+Route::get('/register/confirm/{token}', 'Auth\ConfirmEmailController@confirm');
 Route::post('/register', 'Auth\RegisterController@postRegister');
 
+// User invitation routes
+Route::get('/register/invite/{token}', 'Auth\UserInviteController@showSetPassword');
+Route::post('/register/invite/{token}', 'Auth\UserInviteController@setPassword');
+
 // Password reset link request routes...
 Route::get('/password/email', 'Auth\ForgotPasswordController@showLinkRequestForm');
 Route::post('/password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail');
index 0399f2b818e809121ea45a4cc5fa0d04087d9d87..3d36d85b2e65d926de8c85b9781579eab2cc4f2c 100644 (file)
@@ -341,7 +341,7 @@ class AuthTest extends BrowserKitTest
         $page = Page::query()->first();
 
         $this->visit($page->getUrl())
-            ->seePageUrlIs(baseUrl('/login'));
+            ->seePageUrlIs(url('/login'));
         $this->login('[email protected]', 'password')
             ->seePageUrlIs($page->getUrl());
     }
diff --git a/tests/Auth/UserInviteTest.php b/tests/Auth/UserInviteTest.php
new file mode 100644 (file)
index 0000000..3312626
--- /dev/null
@@ -0,0 +1,111 @@
+<?php namespace Tests;
+
+
+use BookStack\Auth\Access\UserInviteService;
+use BookStack\Auth\User;
+use BookStack\Notifications\UserInvite;
+use Carbon\Carbon;
+use DB;
+use Notification;
+
+class UserInviteTest extends TestCase
+{
+
+    public function test_user_creation_creates_invite()
+    {
+        Notification::fake();
+        $admin = $this->getAdmin();
+
+        $this->actingAs($admin)->post('/settings/users/create', [
+            'name' => 'Barry',
+            'email' => '[email protected]',
+            'send_invite' => 'true',
+        ]);
+
+        $newUser = User::query()->where('email', '=', '[email protected]')->orderBy('id', 'desc')->first();
+
+        Notification::assertSentTo($newUser, UserInvite::class);
+        $this->assertDatabaseHas('user_invites', [
+            'user_id' => $newUser->id
+        ]);
+    }
+
+    public function test_invite_set_password()
+    {
+        Notification::fake();
+        $user = $this->getViewer();
+        $inviteService = app(UserInviteService::class);
+
+        $inviteService->sendInvitation($user);
+        $token = DB::table('user_invites')->where('user_id', '=', $user->id)->first()->token;
+
+        $setPasswordPageResp = $this->get('/register/invite/' . $token);
+        $setPasswordPageResp->assertSuccessful();
+        $setPasswordPageResp->assertSee('Welcome to BookStack!');
+        $setPasswordPageResp->assertSee('Password');
+        $setPasswordPageResp->assertSee('Confirm Password');
+
+        $setPasswordResp = $this->followingRedirects()->post('/register/invite/' . $token, [
+            'password' => 'my test password',
+        ]);
+        $setPasswordResp->assertSee('Password set, you now have access to BookStack!');
+        $newPasswordValid = auth()->validate([
+            'email' => $user->email,
+            'password' => 'my test password'
+        ]);
+        $this->assertTrue($newPasswordValid);
+        $this->assertDatabaseMissing('user_invites', [
+            'user_id' => $user->id
+        ]);
+    }
+
+    public function test_invite_set_has_password_validation()
+    {
+        Notification::fake();
+        $user = $this->getViewer();
+        $inviteService = app(UserInviteService::class);
+
+        $inviteService->sendInvitation($user);
+        $token = DB::table('user_invites')->where('user_id', '=', $user->id)->first()->token;
+
+        $shortPassword = $this->followingRedirects()->post('/register/invite/' . $token, [
+            'password' => 'mypas',
+        ]);
+        $shortPassword->assertSee('The password must be at least 6 characters.');
+
+        $noPassword = $this->followingRedirects()->post('/register/invite/' . $token, [
+            'password' => '',
+        ]);
+        $noPassword->assertSee('The password field is required.');
+
+        $this->assertDatabaseHas('user_invites', [
+            'user_id' => $user->id
+        ]);
+    }
+
+    public function test_non_existent_invite_token_redirects_to_home()
+    {
+        $setPasswordPageResp = $this->get('/register/invite/' . str_random(12));
+        $setPasswordPageResp->assertRedirect('/');
+
+        $setPasswordResp = $this->post('/register/invite/' . str_random(12), ['password' => 'Password Test']);
+        $setPasswordResp->assertRedirect('/');
+    }
+
+    public function test_token_expires_after_two_weeks()
+    {
+        Notification::fake();
+        $user = $this->getViewer();
+        $inviteService = app(UserInviteService::class);
+
+        $inviteService->sendInvitation($user);
+        $tokenEntry = DB::table('user_invites')->where('user_id', '=', $user->id)->first();
+        DB::table('user_invites')->update(['created_at' => Carbon::now()->subDays(14)->subHour(1)]);
+
+        $setPasswordPageResp = $this->get('/register/invite/' . $tokenEntry->token);
+        $setPasswordPageResp->assertRedirect('/password/email');
+        $setPasswordPageResp->assertSessionHas('error', 'This invitation link has expired. You can instead try to reset your account password.');
+    }
+
+
+}
\ No newline at end of file
index 683f23674d66ed6997c947c2d2fe409b67994f86..e3a74f64d1d2c306df662071b369beadfd9bfbac 100644 (file)
@@ -3,6 +3,7 @@
 
 use BookStack\Entities\Chapter;
 use BookStack\Entities\Page;
+use BookStack\Uploads\HttpFetcher;
 
 class ExportTest extends TestCase
 {
@@ -148,4 +149,17 @@ class ExportTest extends TestCase
         $resp->assertDontSee($page->updated_at->diffForHumans());
     }
 
+    public function test_page_export_sets_right_data_type_for_svg_embeds()
+    {
+        $page = Page::first();
+        $page->html = '<img src="http://example.com/image.svg">';
+        $page->save();
+
+        $this->asEditor();
+        $this->mockHttpFetch('<svg></svg>');
+        $resp = $this->get($page->getUrl('/export/html'));
+        $resp->assertStatus(200);
+        $resp->assertSee('<img src="data:image/svg+xml;base64');
+    }
+
 }
\ No newline at end of file
index 6201cf5d7af005243128b80657cf347b0f5a6dcb..b447a7c5d87f73c39d87c14f22a3bbcb6c81b40c 100644 (file)
@@ -80,10 +80,66 @@ class PageContentTest extends TestCase
         $page->save();
 
         $pageView = $this->get($page->getUrl());
+        $pageView->assertStatus(200);
         $pageView->assertDontSee($script);
         $pageView->assertSee('abc123abc123');
     }
 
+    public function test_more_complex_content_script_escaping_scenarios()
+    {
+        $checks = [
+            "<p>Some script</p><script>alert('cat')</script>",
+            "<div><div><div><div><p>Some script</p><script>alert('cat')</script></div></div></div></div>",
+            "<p>Some script<script>alert('cat')</script></p>",
+            "<p>Some script <div><script>alert('cat')</script></div></p>",
+            "<p>Some script <script><div>alert('cat')</script></div></p>",
+            "<p>Some script <script><div>alert('cat')</script><script><div>alert('cat')</script></p><script><div>alert('cat')</script>",
+        ];
+
+        $this->asEditor();
+        $page = Page::first();
+
+        foreach ($checks as $check) {
+            $page->html = $check;
+            $page->save();
+
+            $pageView = $this->get($page->getUrl());
+            $pageView->assertStatus(200);
+            $pageView->assertElementNotContains('.page-content', '<script>');
+            $pageView->assertElementNotContains('.page-content', '</script>');
+        }
+
+    }
+
+    public function test_iframe_js_and_base64_urls_are_removed()
+    {
+        $checks = [
+            '<iframe src="javascript:alert(document.cookie)"></iframe>',
+            '<iframe SRC=" javascript: alert(document.cookie)"></iframe>',
+            '<iframe src="data:text/html;base64,PHNjcmlwdD5hbGVydCgnaGVsbG8nKTwvc2NyaXB0Pg==" frameborder="0"></iframe>',
+            '<iframe src=" data:text/html;base64,PHNjcmlwdD5hbGVydCgnaGVsbG8nKTwvc2NyaXB0Pg==" frameborder="0"></iframe>',
+
+        ];
+
+        $this->asEditor();
+        $page = Page::first();
+
+        foreach ($checks as $check) {
+            $page->html = $check;
+            $page->save();
+
+            $pageView = $this->get($page->getUrl());
+            $pageView->assertStatus(200);
+            $pageView->assertElementNotContains('.page-content', '<iframe>');
+            $pageView->assertElementNotContains('.page-content', '</iframe>');
+            $pageView->assertElementNotContains('.page-content', 'src=');
+            $pageView->assertElementNotContains('.page-content', 'javascript:');
+            $pageView->assertElementNotContains('.page-content', 'data:');
+            $pageView->assertElementNotContains('.page-content', 'base64');
+        }
+
+    }
+
     public function test_page_inline_on_attributes_removed_by_default()
     {
         $this->asEditor();
@@ -93,10 +149,36 @@ class PageContentTest extends TestCase
         $page->save();
 
         $pageView = $this->get($page->getUrl());
+        $pageView->assertStatus(200);
         $pageView->assertDontSee($script);
         $pageView->assertSee('<p>Hello</p>');
     }
 
+    public function test_more_complex_inline_on_attributes_escaping_scenarios()
+    {
+        $checks = [
+            '<p onclick="console.log(\'test\')">Hello</p>',
+            '<div>Lorem ipsum dolor sit amet.</div><p onclick="console.log(\'test\')">Hello</p>',
+            '<div>Lorem ipsum dolor sit amet.<p onclick="console.log(\'test\')">Hello</p></div>',
+            '<div><div><div><div>Lorem ipsum dolor sit amet.<p onclick="console.log(\'test\')">Hello</p></div></div></div></div>',
+            '<div onclick="console.log(\'test\')">Lorem ipsum dolor sit amet.</div><p onclick="console.log(\'test\')">Hello</p><div></div>',
+            '<a a="<img src=1 onerror=\'alert(1)\'> ',
+        ];
+
+        $this->asEditor();
+        $page = Page::first();
+
+        foreach ($checks as $check) {
+            $page->html = $check;
+            $page->save();
+
+            $pageView = $this->get($page->getUrl());
+            $pageView->assertStatus(200);
+            $pageView->assertElementNotContains('.page-content', 'onclick');
+        }
+
+    }
+
     public function test_page_content_scripts_show_when_configured()
     {
         $this->asEditor();
diff --git a/tests/Entity/PageTemplateTest.php b/tests/Entity/PageTemplateTest.php
new file mode 100644 (file)
index 0000000..883de4a
--- /dev/null
@@ -0,0 +1,90 @@
+<?php namespace Entity;
+
+use BookStack\Entities\Page;
+use Tests\TestCase;
+
+class PageTemplateTest extends TestCase
+{
+    public function test_active_templates_visible_on_page_view()
+    {
+        $page = Page::first();
+
+        $this->asEditor();
+        $templateView = $this->get($page->getUrl());
+        $templateView->assertDontSee('Page Template');
+
+        $page->template = true;
+        $page->save();
+
+        $templateView = $this->get($page->getUrl());
+        $templateView->assertSee('Page Template');
+    }
+
+    public function test_manage_templates_permission_required_to_change_page_template_status()
+    {
+        $page = Page::first();
+        $editor = $this->getEditor();
+        $this->actingAs($editor);
+
+        $pageUpdateData = [
+            'name' => $page->name,
+            'html' => $page->html,
+            'template' => 'true',
+        ];
+
+        $this->put($page->getUrl(), $pageUpdateData);
+        $this->assertDatabaseHas('pages', [
+            'id' => $page->id,
+            'template' => false,
+        ]);
+
+        $this->giveUserPermissions($editor, ['templates-manage']);
+
+        $this->put($page->getUrl(), $pageUpdateData);
+        $this->assertDatabaseHas('pages', [
+            'id' => $page->id,
+            'template' => true,
+        ]);
+    }
+
+    public function test_templates_content_should_be_fetchable_only_if_page_marked_as_template()
+    {
+        $content = '<div>my_custom_template_content</div>';
+        $page = Page::first();
+        $editor = $this->getEditor();
+        $this->actingAs($editor);
+
+        $templateFetch = $this->get('/templates/' . $page->id);
+        $templateFetch->assertStatus(404);
+
+        $page->html = $content;
+        $page->template = true;
+        $page->save();
+
+        $templateFetch = $this->get('/templates/' . $page->id);
+        $templateFetch->assertStatus(200);
+        $templateFetch->assertJson([
+            'html' => $content,
+            'markdown' => '',
+        ]);
+    }
+
+    public function test_template_endpoint_returns_paginated_list_of_templates()
+    {
+        $editor = $this->getEditor();
+        $this->actingAs($editor);
+
+        $toBeTemplates = Page::query()->orderBy('name', 'asc')->take(12)->get();
+        $page = $toBeTemplates->first();
+
+        $emptyTemplatesFetch = $this->get('/templates');
+        $emptyTemplatesFetch->assertDontSee($page->name);
+
+        Page::query()->whereIn('id', $toBeTemplates->pluck('id')->toArray())->update(['template' => true]);
+
+        $templatesFetch = $this->get('/templates');
+        $templatesFetch->assertSee($page->name);
+        $templatesFetch->assertSee('pagination');
+    }
+
+}
\ No newline at end of file
index 91abadc91904a97cf8bd14c425ab01f854f9350c..d9b8655ee1c67f83d827808fee236aacdebb40f4 100644 (file)
@@ -41,21 +41,6 @@ class LanguageTest extends TestCase
         $loginPageFrenchReq->assertDontSee('Se Connecter');
     }
 
-    public function test_js_endpoint_for_each_language()
-    {
-
-        $visibleKeys = ['common', 'components', 'entities', 'errors'];
-
-        $this->asEditor();
-        foreach ($this->langs as $lang) {
-            setting()->putUser($this->getEditor(), 'language', $lang);
-            $transResp = $this->get('/translations');
-            foreach ($visibleKeys as $key) {
-                $transResp->assertSee($key);
-            }
-        }
-    }
-
     public function test_all_lang_files_loadable()
     {
         $files = array_diff(scandir(resource_path('lang/en')), ['..', '.']);
@@ -98,13 +83,4 @@ class LanguageTest extends TestCase
         $this->assertNotEquals($enEmailActionHelp, $deInformalEmailActionHelp);
     }
 
-    public function test_de_informal_falls_base_to_de_in_js_endpoint()
-    {
-        $this->asEditor();
-        setting()->putUser($this->getEditor(), 'language', 'de_informal');
-
-        $transResp = $this->get('/translations');
-        $transResp->assertSee('"cancel":"Abbrechen"');
-    }
-
 }
\ No newline at end of file
index 5bbdcf0bbb60c5f0c8ecf15d04f2285bbab5f7f5..a1f19364352c5f1ed74fa86f427ff8d0d95d4aac 100644 (file)
@@ -119,6 +119,43 @@ class RolesTest extends BrowserKitTest
         $this->actingAs($this->user)->visit('/')->dontSee($usersLink);
     }
 
+    public function test_user_cannot_change_email_unless_they_have_manage_users_permission()
+    {
+        $userProfileUrl = '/settings/users/' . $this->user->id;
+        $originalEmail = $this->user->email;
+        $this->actingAs($this->user);
+
+        $this->visit($userProfileUrl)
+            ->assertResponseOk()
+            ->seeElement('input[name=email][disabled]');
+        $this->put($userProfileUrl, [
+            'name' => 'my_new_name',
+            'email' => '[email protected]',
+        ]);
+        $this->seeInDatabase('users', [
+            'id' => $this->user->id,
+            'email' => $originalEmail,
+            'name' => 'my_new_name',
+        ]);
+
+        $this->giveUserPermissions($this->user, ['users-manage']);
+
+        $this->visit($userProfileUrl)
+            ->assertResponseOk()
+            ->dontSeeElement('input[name=email][disabled]')
+            ->seeElement('input[name=email]');
+        $this->put($userProfileUrl, [
+            'name' => 'my_new_name_2',
+            'email' => '[email protected]',
+        ]);
+
+        $this->seeInDatabase('users', [
+            'id' => $this->user->id,
+            'email' => '[email protected]',
+            'name' => 'my_new_name_2',
+        ]);
+    }
+
     public function test_user_roles_manage_permission()
     {
         $this->actingAs($this->user)->visit('/settings/roles')
index 8e903be11a3089ed25a3c1ed77c7890924b25657..1d87e942aaf2167e10dbaed48f0a20f887511b94 100644 (file)
@@ -11,6 +11,7 @@ use BookStack\Auth\Role;
 use BookStack\Auth\Permissions\PermissionService;
 use BookStack\Entities\Repos\PageRepo;
 use BookStack\Settings\SettingService;
+use BookStack\Uploads\HttpFetcher;
 
 trait SharedTestHelpers
 {
@@ -189,4 +190,18 @@ trait SharedTestHelpers
         return $permissionRepo->saveNewRole($roleData);
     }
 
+    /**
+     * Mock the HttpFetcher service and return the given data on fetch.
+     * @param $returnData
+     * @param int $times
+     */
+    protected function mockHttpFetch($returnData, int $times = 1)
+    {
+        $mockHttp = \Mockery::mock(HttpFetcher::class);
+        $this->app[HttpFetcher::class] = $mockHttp;
+        $mockHttp->shouldReceive('fetch')
+            ->times($times)
+            ->andReturn($returnData);
+    }
+
 }
\ No newline at end of file
diff --git a/tests/Unit/ConfigTest.php b/tests/Unit/ConfigTest.php
new file mode 100644 (file)
index 0000000..967915a
--- /dev/null
@@ -0,0 +1,60 @@
+<?php namespace Tests;
+
+/**
+ * Class ConfigTest
+ * Many of the tests here are to check on tweaks made
+ * to maintain backwards compatibility.
+ *
+ * @package Tests
+ */
+class ConfigTest extends TestCase
+{
+
+    public function test_filesystem_images_falls_back_to_storage_type_var()
+    {
+        putenv('STORAGE_TYPE=local_secure');
+
+        $this->checkEnvConfigResult('STORAGE_IMAGE_TYPE', 's3', 'filesystems.images', 's3');
+        $this->checkEnvConfigResult('STORAGE_IMAGE_TYPE', null, 'filesystems.images', 'local_secure');
+
+        putenv('STORAGE_TYPE=local');
+    }
+
+    public function test_filesystem_attachments_falls_back_to_storage_type_var()
+    {
+        putenv('STORAGE_TYPE=local_secure');
+
+        $this->checkEnvConfigResult('STORAGE_ATTACHMENT_TYPE', 's3', 'filesystems.attachments', 's3');
+        $this->checkEnvConfigResult('STORAGE_ATTACHMENT_TYPE', null, 'filesystems.attachments', 'local_secure');
+
+        putenv('STORAGE_TYPE=local');
+    }
+
+    public function test_app_url_blank_if_old_default_value()
+    {
+        $initUrl = 'https://example.com/docs';
+        $oldDefault = 'http://bookstack.dev';
+        $this->checkEnvConfigResult('APP_URL', $initUrl, 'app.url', $initUrl);
+        $this->checkEnvConfigResult('APP_URL', $oldDefault, 'app.url', '');
+    }
+
+    /**
+     * Set an environment variable of the given name and value
+     * then check the given config key to see if it matches the given result.
+     * Providing a null $envVal clears the variable.
+     * @param string $envName
+     * @param string|null $envVal
+     * @param string $configKey
+     * @param string $expectedResult
+     */
+    protected function checkEnvConfigResult(string $envName, $envVal, string $configKey, string $expectedResult)
+    {
+        $originalVal = getenv($envName);
+        $envString = $envName . (is_null($envVal) ? '' : '=') . ($envVal ?? '');
+        putenv($envString);
+        $this->refreshApplication();
+        $this->assertEquals($expectedResult, config($configKey));
+        putenv($envString = $envName . (empty($originalVal) ? '' : '=') . ($originalVal ?? ''));
+    }
+
+}
\ No newline at end of file
diff --git a/tests/Unit/HelpersTest.php b/tests/Unit/HelpersTest.php
deleted file mode 100644 (file)
index c8f4ce2..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-<?php namespace Tests;
-
-class HelpersTest extends TestCase
-{
-
-    public function test_base_url_takes_config_into_account()
-    {
-        config()->set('app.url', 'http://example.com/bookstack');
-        $result = baseUrl('/');
-        $this->assertEquals('http://example.com/bookstack/', $result);
-    }
-
-    public function test_base_url_takes_extra_path_into_account_on_forced_domain()
-    {
-        config()->set('app.url', 'http://example.com/bookstack');
-        $result = baseUrl('http://example.com/bookstack/', true);
-        $this->assertEquals('http://example.com/bookstack/', $result);
-    }
-
-    public function test_base_url_force_domain_works_as_expected_with_full_url_given()
-    {
-        config()->set('app.url', 'http://example.com');
-        $result = baseUrl('http://examps.com/books/test/page/cat', true);
-        $this->assertEquals('http://example.com/books/test/page/cat', $result);
-    }
-
-    public function test_base_url_force_domain_works_when_app_domain_is_same_as_given_url()
-    {
-        config()->set('app.url', 'http://example.com');
-        $result = baseUrl('http://example.com/books/test/page/cat', true);
-        $this->assertEquals('http://example.com/books/test/page/cat', $result);
-    }
-}
\ No newline at end of file
index 36addcbe41c5a4b801a662f32605ce99b39177b8..41e7c2f78c538121bf537c3077a6ff43111dc8df 100644 (file)
@@ -16,6 +16,32 @@ class PageRepoTest extends TestCase
         $this->pageRepo = app()->make(PageRepo::class);
     }
 
+    public function test_get_page_nav_sets_correct_properties()
+    {
+        $content = '<h1 id="testa">Hello</h1><h2 id="testb">There</h2><h3 id="testc">Donkey</h3>';
+        $navMap = $this->pageRepo->getPageNav($content);
+
+        $this->assertCount(3, $navMap);
+        $this->assertArraySubset([
+            'nodeName' => 'h1',
+            'link' => '#testa',
+            'text' => 'Hello',
+            'level' => 1,
+        ], $navMap[0]);
+        $this->assertArraySubset([
+            'nodeName' => 'h2',
+            'link' => '#testb',
+            'text' => 'There',
+            'level' => 2,
+        ], $navMap[1]);
+        $this->assertArraySubset([
+            'nodeName' => 'h3',
+            'link' => '#testc',
+            'text' => 'Donkey',
+            'level' => 3,
+        ], $navMap[2]);
+    }
+
     public function test_get_page_nav_does_not_show_empty_titles()
     {
         $content = '<h1 id="testa">Hello</h1><h2 id="testb">&nbsp;</h2><h3 id="testc"></h3>';
@@ -29,4 +55,24 @@ class PageRepoTest extends TestCase
         ], $navMap[0]);
     }
 
+    public function test_get_page_nav_shifts_headers_if_only_smaller_ones_are_used()
+    {
+        $content = '<h4 id="testa">Hello</h4><h5 id="testb">There</h5><h6 id="testc">Donkey</h6>';
+        $navMap = $this->pageRepo->getPageNav($content);
+
+        $this->assertCount(3, $navMap);
+        $this->assertArraySubset([
+            'nodeName' => 'h4',
+            'level' => 1,
+        ], $navMap[0]);
+        $this->assertArraySubset([
+            'nodeName' => 'h5',
+            'level' => 2,
+        ], $navMap[1]);
+        $this->assertArraySubset([
+            'nodeName' => 'h6',
+            'level' => 3,
+        ], $navMap[2]);
+    }
+
 }
\ No newline at end of file
diff --git a/tests/Unit/UrlTest.php b/tests/Unit/UrlTest.php
new file mode 100644 (file)
index 0000000..c7d3331
--- /dev/null
@@ -0,0 +1,25 @@
+<?php namespace Tests;
+
+class UrlTest extends TestCase
+{
+
+    public function test_request_url_takes_custom_url_into_account()
+    {
+        config()->set('app.url', 'http://example.com/bookstack');
+        $this->get('/');
+        $this->assertEquals('http://example.com/bookstack', request()->getUri());
+
+        config()->set('app.url', 'http://example.com/docs/content');
+        $this->get('/');
+        $this->assertEquals('http://example.com/docs/content', request()->getUri());
+    }
+
+    public function test_url_helper_takes_custom_url_into_account()
+    {
+        putenv('APP_URL=http://example.com/bookstack');
+        $this->refreshApplication();
+        $this->assertEquals('http://example.com/bookstack/books', url('/books'));
+        putenv('APP_URL=');
+    }
+
+}
\ No newline at end of file
index 01bf23d5b2b3ba2ab9a631d9ef151e101ff94ada..f9265337889c94ef7f049159e92da6bb3aada780 100644 (file)
@@ -176,7 +176,7 @@ class ImageTest extends TestCase
 
     public function test_secure_images_uploads_to_correct_place()
     {
-        config()->set('filesystems.default', 'local_secure');
+        config()->set('filesystems.images', 'local_secure');
         $this->asEditor();
         $galleryFile = $this->getTestImage('my-secure-test-upload.png');
         $page = Page::first();
@@ -194,7 +194,7 @@ class ImageTest extends TestCase
 
     public function test_secure_images_included_in_exports()
     {
-        config()->set('filesystems.default', 'local_secure');
+        config()->set('filesystems.images', 'local_secure');
         $this->asEditor();
         $galleryFile = $this->getTestImage('my-secure-test-upload.png');
         $page = Page::first();
@@ -217,7 +217,7 @@ class ImageTest extends TestCase
 
     public function test_system_images_remain_public()
     {
-        config()->set('filesystems.default', 'local_secure');
+        config()->set('filesystems.images', 'local_secure');
         $this->asAdmin();
         $galleryFile = $this->getTestImage('my-system-test-upload.png');
         $expectedPath = public_path('uploads/images/system/' . Date('Y-m') . '/my-system-test-upload.png');
diff --git a/version b/version
index a361484193e655a868708275458bacbb55113650..4494802a4fd0dc42714e3068afaba8ef2e351a31 100644 (file)
--- a/version
+++ b/version
@@ -1 +1 @@
-v0.26-dev
+v0.27-dev