diff --git a/app/Setting.php b/app/Setting.php index cb613522..2df15b10 100644 --- a/app/Setting.php +++ b/app/Setting.php @@ -127,6 +127,9 @@ class Setting extends Model } $value = Form::select('value', $options, null, ['class' => 'form-control']); break; + case 'textarea': + $value = Form::textarea('value', null, ['class' => 'form-control', 'cols' => '44', 'rows' => '15']); + break; default: $value = Form::text('value', null, ['class' => 'form-control']); break; diff --git a/database/seeds/SettingsSeeder.php b/database/seeds/SettingsSeeder.php index 5941fbd5..e5e2cd0c 100644 --- a/database/seeds/SettingsSeeder.php +++ b/database/seeds/SettingsSeeder.php @@ -44,6 +44,16 @@ class SettingsSeeder extends Seeder $setting_group->title = 'app.settings.miscellaneous'; $setting_group->save(); } + if(!$setting_group = SettingGroup::find(4)) { + $setting_group = new SettingGroup; + $setting_group->id = 4; + $setting_group->title = 'app.settings.advanced'; + $setting_group->order = 3; + $setting_group->save(); + } else { + $setting_group->title = 'app.settings.advanced'; + $setting_group->save(); + } if($version = Setting::find(1)) { $version->label = 'app.settings.version'; @@ -194,6 +204,38 @@ class SettingsSeeder extends Seeder $setting->system = true; $setting->save(); } + + if(!$setting = Setting::find(10)) { + $setting = new Setting; + $setting->id = 10; + $setting->group_id = 4; + $setting->key = 'custom_css'; + $setting->type = 'textarea'; + $setting->label = 'app.settings.custom_css'; + $setting->value = ''; + $setting->save(); + } else { + $setting->type = 'textarea'; + $setting->group_id = 4; + $setting->label = 'app.settings.custom_css'; + $setting->save(); + } + + if(!$setting = Setting::find(11)) { + $setting = new Setting; + $setting->id = 11; + $setting->group_id = 4; + $setting->key = 'custom_js'; + $setting->type = 'textarea'; + $setting->label = 'app.settings.custom_js'; + $setting->value = ''; + $setting->save(); + } else { + $setting->type = 'textarea'; + $setting->group_id = 4; + $setting->label = 'app.settings.custom_js'; + $setting->save(); + } if(!$home_tag = \App\Item::find(0)) { $home_tag = new \App\Item; diff --git a/resources/lang/en/app.php b/resources/lang/en/app.php index 6f05dbfd..35eebe64 100644 --- a/resources/lang/en/app.php +++ b/resources/lang/en/app.php @@ -12,6 +12,8 @@ return [ 'settings.system' => 'System', 'settings.appearance' => 'Appearance', 'settings.miscellaneous' => 'Miscellaneous', + 'settings.advanced' => 'Advanced', + 'settings.support' => 'Support', 'settings.donate' => 'Donate', @@ -29,11 +31,13 @@ return [ 'settings.search' => 'search', 'settings.no_items' => 'No items found', - 'settings.label' => 'Label', 'settings.value' => 'Value', 'settings.edit' => 'Edit', 'settings.view' => 'View', + + 'settings.custom_css' => 'Custom CSS', + 'settings.custom_js' => 'Custom JavaScript', 'options.none' => '- not set -', 'options.google' => 'Google', diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index d7721b50..a1044581 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -34,6 +34,10 @@ @else @endif +
@@ -114,5 +118,9 @@ @yield('scripts') + diff --git a/resources/views/settings/list.blade.php b/resources/views/settings/list.blade.php index 40561cfa..9a9d3e79 100644 --- a/resources/views/settings/list.blade.php +++ b/resources/views/settings/list.blade.php @@ -25,7 +25,11 @@ {{ __($setting->label) }} + @if($setting->type === "textarea") +
{{ $setting->list_value }}
+ @else {!! $setting->list_value !!} + @endif @if((bool)$setting->system !== true) @@ -49,4 +53,4 @@ @endforeach -@endsection \ No newline at end of file +@endsection