NOW MANAGED ON CODEBERG
Compacted entity color options in settings view
Dan Browncee4dccc5543
diff --git a/resources/js/components/setting-app-color-picker.js b/resources/js/components/setting-app-color-picker.jsindex 02512e109..ee894c932 100644--- a/resources/js/components/setting-app-color-picker.js+++ b/resources/js/components/setting-app-color-picker.js@@ -6,7 +6,7 @@ class SettingAppColorPicker {this.colorInput = elem.querySelector('input[type=color]');this.lightColorInput = elem.querySelector('input[name="setting-app-color-light"]');this.resetButton = elem.querySelector('[setting-app-color-picker-reset]');- this.defaultButton = elem.querySelector('[setting-app-color-picker-default]')+ this.defaultButton = elem.querySelector('[setting-app-color-picker-default]');this.colorInput.addEventListener('change', this.updateColor.bind(this));this.colorInput.addEventListener('input', this.updateColor.bind(this));diff --git a/resources/lang/en/settings.php b/resources/lang/en/settings.phpindex efb849077..8255b4cbe 100755--- a/resources/lang/en/settings.php+++ b/resources/lang/en/settings.php@@ -42,17 +42,13 @@ return ['app_disable_comments_desc' => 'Disables comments across all pages in the application. <br> Existing comments are not shown.',// Color settings+ 'content_colors' => 'Content Colors',+ 'content_colors_desc' => 'Sets colors for all elements in the page organisation hierarchy. Choosing colors with a similar brightness to the default colors is recommended for readability.','bookshelf_color' => 'Shelf Color',- 'bookshelf_color_desc' => 'Sets the color indicator for shelves.','book_color' => 'Book Color',- 'book_color_desc' => 'Sets the color indicator for books.','chapter_color' => 'Chapter Color',- 'chapter_color_desc' => 'Sets the color indicator for chapters.','page_color' => 'Page Color',- 'page_color_desc' => 'Sets the color indicator for pages.','page_draft_color' => 'Page Draft Color',- 'page_draft_color_desc' => 'Sets the color indicator for page drafts.',-// Registration Settings'reg_settings' => 'Registration',diff --git a/resources/sass/_colors.scss b/resources/sass/_colors.scssindex 8623d374a..77f51b324 100644--- a/resources/sass/_colors.scss+++ b/resources/sass/_colors.scss@@ -40,6 +40,11 @@fill: #575757 !important;}+.text-dark {+ color: #222 !important;+ fill: #222 !important;+}+/** Entity text colors*/diff --git a/resources/sass/_forms.scss b/resources/sass/_forms.scssindex 64308b29e..1e0c908f9 100644--- a/resources/sass/_forms.scss+++ b/resources/sass/_forms.scss@@ -172,6 +172,11 @@ input[type=date] {input[type=color] {height: 60px;+ &.small {+ height: 42px;+ width: 60px;+ padding: 2px;+ }}.toggle-switch {diff --git a/resources/views/components/setting-entity-color-picker.blade.php b/resources/views/components/setting-entity-color-picker.blade.phpnew file mode 100644index 000000000..fffb4220e--- /dev/null+++ b/resources/views/components/setting-entity-color-picker.blade.php@@ -0,0 +1,21 @@+{{--+ @type - Name of entity type+--}}+<div setting-color-picker class="grid no-break half mb-l">+ <div>+ <label for="setting-{{ $type }}-color" class="text-dark">{{ trans('settings.'. str_replace('-', '_', $type) .'_color') }}</label>+ <button type="button" class="text-button text-muted" setting-color-picker-default>{{ trans('common.default') }}</button>+ <span class="sep mx-xs">|</span>+ <button type="button" class="text-button text-muted" setting-color-picker-reset>{{ trans('common.reset') }}</button>+ </div>+ <div>+ <input type="color"+ data-default="{{ config('setting-defaults.'. $type .'-color') }}"+ data-current="{{ setting($type .'-color') }}"+ value="{{ setting($type .'-color') }}"+ name="setting-{{ $type }}-color"+ id="setting-{{ $type }}-color"+ placeholder="{{ config('setting-defaults.'. $type .'-color') }}"+ class="small">+ </div>+</div>\ No newline at end of filediff --git a/resources/views/settings/index.blade.php b/resources/views/settings/index.blade.phpindex 4da1d90b0..1bc454385 100644--- a/resources/views/settings/index.blade.php+++ b/resources/views/settings/index.blade.php@@ -146,78 +146,22 @@</div></div>- <!-- Shelf Color -->- <div class="grid half gap-xl">- <div>- <label class="setting-list-label">{{ trans('settings.bookshelf_color') }}</label>- <p class="small">{!! trans('settings.bookshelf_color_desc') !!}</p>- </div>- <div setting-color-picker class="text-m-right">- <input type="color" data-default="#a94747" data-current="{{ setting('bookshelf-color') }}" value="{{ setting('bookshelf-color') }}" name="setting-bookshelf-color" id="setting-bookshelf-color" placeholder="#a94747">- <br>- <button type="button" class="text-button text-muted mt-s mx-s" setting-color-picker-default>{{ trans('common.default') }}</button>- <span class="sep">|</span>- <button type="button" class="text-button text-muted mt-s mx-s" setting-color-picker-reset>{{ trans('common.reset') }}</button>- </div>- </div>-- <!-- Book Color -->- <div class="grid half gap-xl">- <div>- <label class="setting-list-label">{{ trans('settings.book_color') }}</label>- <p class="small">{!! trans('settings.book_color_desc') !!}</p>- </div>- <div setting-color-picker class="text-m-right">- <input type="color" data-default="#077b70" data-current="{{ setting('book-color') }}" value="{{ setting('book-color') }}" name="setting-book-color" id="setting-book-color" placeholder="#077b70">- <br>- <button type="button" class="text-button text-muted mt-s mx-s" setting-color-picker-default>{{ trans('common.default') }}</button>- <span class="sep">|</span>- <button type="button" class="text-button text-muted mt-s mx-s" setting-color-picker-reset>{{ trans('common.reset') }}</button>- </div>- </div>-- <!-- Chapter Color -->- <div class="grid half gap-xl">- <div>- <label class="setting-list-label">{{ trans('settings.chapter_color') }}</label>- <p class="small">{!! trans('settings.chapter_color_desc') !!}</p>- </div>- <div setting-color-picker class="text-m-right">- <input type="color" data-default="#af4d0d" data-current="{{ setting('chapter-color') }}" value="{{ setting('chapter-color') }}" name="setting-chapter-color" id="setting-chapter-color" placeholder="#af4d0d">- <br>- <button type="button" class="text-button text-muted mt-s mx-s" setting-color-picker-default>{{ trans('common.default') }}</button>- <span class="sep">|</span>- <button type="button" class="text-button text-muted mt-s mx-s" setting-color-picker-reset>{{ trans('common.reset') }}</button>- </div>- </div>-- <!-- Page Color -->- <div class="grid half gap-xl">+ <!-- Entity Color -->+ <div class="pb-l"><div>- <label class="setting-list-label">{{ trans('settings.page_color') }}</label>- <p class="small">{!! trans('settings.page_color_desc') !!}</p>- </div>- <div setting-color-picker class="text-m-right">- <input type="color" data-default="#206ea7" data-current="{{ setting('page-color') }}" value="{{ setting('page-color') }}" name="setting-page-color" id="setting-page-color" placeholder="#206ea7">- <br>- <button type="button" class="text-button text-muted mt-s mx-s" setting-color-picker-default>{{ trans('common.default') }}</button>- <span class="sep">|</span>- <button type="button" class="text-button text-muted mt-s mx-s" setting-color-picker-reset>{{ trans('common.reset') }}</button>- </div>- </div>-- <!-- Page Draft Color -->- <div class="grid half gap-xl">- <div>- <label class="setting-list-label">{{ trans('settings.page_draft_color') }}</label>- <p class="small">{!! trans('settings.page_draft_color_desc') !!}</p>- </div>- <div setting-color-picker class="text-m-right">- <input type="color" data-default="#7e50b1" data-current="{{ setting('page-draft-color') }}" value="{{ setting('page-draft-color') }}" name="setting-page-draft-color" id="setting-page-draft-color" placeholder="#7e50b1">- <br>- <button type="button" class="text-button text-muted mt-s mx-s" setting-color-picker-default>{{ trans('common.default') }}</button>- <span class="sep">|</span>- <button type="button" class="text-button text-muted mt-s mx-s" setting-color-picker-reset>{{ trans('common.reset') }}</button>+ <label class="setting-list-label">{{ trans('settings.content_colors') }}</label>+ <p class="small">{!! trans('settings.content_colors_desc') !!}</p>+ </div>+ <div class="grid half pt-m">+ <div>+ @include('components.setting-entity-color-picker', ['type' => 'bookshelf'])+ @include('components.setting-entity-color-picker', ['type' => 'book'])+ @include('components.setting-entity-color-picker', ['type' => 'chapter'])+ </div>+ <div>+ @include('components.setting-entity-color-picker', ['type' => 'page'])+ @include('components.setting-entity-color-picker', ['type' => 'page-draft'])+ </div></div></div>