diff --git a/app/Http/Controllers/SettingController.php b/app/Http/Controllers/SettingController.php index 01fb68fe0..159e19a2b 100644 --- a/app/Http/Controllers/SettingController.php +++ b/app/Http/Controllers/SettingController.php @@ -1,5 +1,6 @@ $version]); + return view('settings.index', [ + 'version' => $version, + 'guestUser' => User::getDefault() + ]); } /** @@ -57,7 +61,7 @@ class SettingController extends Controller // Get application version $version = trim(file_get_contents(base_path('version'))); - return view('settings/maintenance', ['version' => $version]); + return view('settings.maintenance', ['version' => $version]); } /** diff --git a/resources/lang/en/settings.php b/resources/lang/en/settings.php index 44ae0c613..8b18ad736 100755 --- a/resources/lang/en/settings.php +++ b/resources/lang/en/settings.php @@ -12,12 +12,18 @@ return [ 'settings_save_success' => 'Settings saved', // App Settings - 'app_settings' => 'App Settings', + 'app_customization' => 'Customization', + 'app_features_security' => 'Features & Security', 'app_name' => 'Application name', 'app_name_desc' => 'This name is shown in the header and in any system-sent emails.', 'app_name_header' => 'Show name in header', + 'app_public_access' => 'Public access', + 'app_public_access_desc' => 'Enabling this option will allow visitors, that are not logged-in, to access content in your BookStack instance.', + 'app_public_access_desc_guest' => 'Access for public visitors can be controlled through the "Guest" user.', + 'app_public_access_toggle' => 'Allow public access', 'app_public_viewing' => 'Allow public viewing?', - 'app_secure_images' => 'Enable higher security image uploads?', + 'app_secure_images' => 'Higher security image uploads', + 'app_secure_images_toggle' => 'Enable higher security image uploads', 'app_secure_images_desc' => 'For performance reasons, all images are public. This option adds a random, hard-to-guess string in front of image urls. Ensure directory indexes are not enabled to prevent easy access.', 'app_editor' => 'Page editor', 'app_editor_desc' => 'Select which editor will be used by all users to edit pages.', @@ -31,14 +37,16 @@ return [ 'app_homepage_desc' => 'Select a view to show on the homepage instead of the default view. Page permissions are ignored for selected pages.', 'app_homepage_select' => 'Select a page', 'app_disable_comments' => 'Disable comments', - 'app_disable_comments_desc' => 'Disable comments across all pages in the application. Existing comments are not shown.', + 'app_disable_comments_desc' => 'Disables comments across all pages in the application.
Existing comments are not shown.', // Registration Settings - 'reg_settings' => 'Registration Settings', - 'reg_allow' => 'Allow registration?', + 'reg_settings' => 'Registration', + 'reg_enable' => 'Enable registration', + 'reg_enable_desc' => 'When registration is enabled user will be able to sign themselves up as an application user. Upon registration they are given a single, default user role.', 'reg_default_role' => 'Default user role after registration', - 'reg_confirm_email' => 'Require email confirmation?', - 'reg_confirm_email_desc' => 'If domain restriction is used then email confirmation will be required and the below value will be ignored.', + 'reg_email_confirmation' => 'Email confirmation', + 'reg_email_confirmation_toggle' => 'Require email confirmation', + 'reg_confirm_email_desc' => 'If domain restriction is used then email confirmation will be required and this option will be ignored.', 'reg_confirm_restrict_domain' => 'Restrict registration to domain', 'reg_confirm_restrict_domain_desc' => 'Enter a comma separated list of email domains you would like to restrict registration to. Users will be sent an email to confirm their address before being allowed to interact with the application.
Note that users will be able to change their email addresses after successful registration.', 'reg_confirm_restrict_domain_placeholder' => 'No restriction set', diff --git a/resources/views/settings/index.blade.php b/resources/views/settings/index.blade.php index b72e462bf..54d27ea95 100644 --- a/resources/views/settings/index.blade.php +++ b/resources/views/settings/index.blade.php @@ -1,14 +1,11 @@ @extends('simple-layout') -{{--TODO - Reorder--}} - @section('body')
-
- @include('settings/navbar', ['selected' => 'settings']) + @include('settings.navbar', ['selected' => 'settings'])

@@ -16,8 +13,72 @@
-
-

{{ trans('settings.app_settings') }}

+
+

{{ trans('settings.app_features_security') }}

+
+ {!! csrf_field() !!} + +
+ + +
+
+ +

{!! trans('settings.app_public_access_desc') !!}

+ @if(userCan('users-manage')) +

+ {!! trans('settings.app_public_access_desc_guest') !!} +

+ @endif +
+
+ @include('components.toggle-switch', [ + 'name' => 'setting-app-public', + 'value' => setting('app-public'), + 'label' => trans('settings.app_public_access_toggle'), + ]) +
+
+ +
+
+ +

{{ trans('settings.app_secure_images_desc') }}

+
+
+ @include('components.toggle-switch', [ + 'name' => 'setting-app-secure-images', + 'value' => setting('app-secure-images'), + 'label' => trans('settings.app_secure_images_toggle'), + ]) +
+
+ +
+
+ +

{!! trans('settings.app_disable_comments_desc') !!}

+
+
+ @include('components.toggle-switch', [ + 'name' => 'setting-app-disable-comments', + 'value' => setting('app-disable-comments'), + 'label' => trans('settings.app_disable_comments'), + ]) +
+
+ + +
+ +
+ +
+
+
+ +
+

{{ trans('settings.app_customization') }}

{!! csrf_field() !!} @@ -38,51 +99,6 @@
-
-
- - {{--

{{ trans('settings.app_name_desc') }}

--}} -
-
- @include('components.toggle-switch', [ - 'name' => 'setting-app-public', - 'value' => setting('app-public'), - 'label' => trans('settings.app_public_viewing'), - ]) - {{--TODO - Text --}} -
-
- -
-
- -

{{ trans('settings.app_secure_images_desc') }}

-
-
- @include('components.toggle-switch', [ - 'name' => 'setting-app-secure-images', - 'value' => setting('app-secure-images'), - 'label' => trans('settings.app_secure_images'), - ]) - {{--TODO - Text --}} -
-
- -
-
- -

{{ trans('settings.app_disable_comments_desc') }}

-
-
- @include('components.toggle-switch', [ - 'name' => 'setting-app-disable-comments', - 'value' => setting('app-disable-comments'), - 'label' => trans('settings.app_disable_comments'), - ]) - {{--TODO - Text --}} -
-
-
@@ -93,14 +109,13 @@ - {{--TODO - Text --}}
-

{{ trans('settings.app_logo_desc') }}

+

{!! trans('settings.app_logo_desc') !!}

@include('components.image-picker', [ @@ -162,8 +177,7 @@
- -
+

{{ trans('settings.reg_settings') }}

{!! csrf_field() !!} @@ -171,25 +185,17 @@
- - {{--

{!! trans('settings.app_primary_color_desc') !!}

--}}{{-- TODO--}} + +

{!! trans('settings.reg_enable_desc') !!}

@include('components.toggle-switch', [ 'name' => 'setting-registration-enabled', 'value' => setting('registration-enabled'), - 'label' => trans('settings.reg_allow') + 'label' => trans('settings.reg_enable') ]) - {{--TODO - label --}} -
-
-
-
- - {{--

{!! trans('settings.app_primary_color_desc') !!}

--}}{{-- TODO--}} -
-
+
+ +
+
+ +

{{ trans('settings.reg_confirm_email_desc') }}

+
+
+ @include('components.toggle-switch', [ + 'name' => 'setting-registration-confirmation', + 'value' => setting('registration-confirmation'), + 'label' => trans('settings.reg_email_confirmation_toggle') + ]) +
+
+
@@ -241,24 +247,23 @@ @stop @section('scripts') - {{--TODO - Merge into JS--}}