#9: Updated the settings page to Bootstrap 4

This commit is contained in:
Andy Heathershaw 2017-03-23 05:07:38 +00:00
parent 66d005432c
commit a86bbee8e3

View File

@ -14,8 +14,8 @@
<h1>@yield('title')</h1>
<p style="margin-bottom: 30px;">@lang('admin.settings_intro')</p>
{!! Form::model($config, ['route' => 'admin.saveSettings', 'method' => 'POST']) !!}
<form action="{{ route('admin.saveSettings') }}" method="post">
{{ csrf_field() }}
<div>
{{-- Nav tabs --}}
<ul class="nav nav-tabs" role="tablist">
@ -28,16 +28,32 @@
<div class="tab-content">
{{-- General --}}
<div role="tabpanel" class="tab-pane active" id="general-tab">
<div class="form-group">
{!! Form::label('app_name', 'Gallery name:', ['class' => 'control-label']) !!}
{!! Form::text('app_name', old('app_name'), ['class' => 'form-control']) !!}
<div class="form-group{{ $errors->has('app_name') ? ' has-danger' : '' }}">
<label class="form-control-label" for="gallery-name">Gallery name:</label>
<input type="text" class="form-control" id="gallery-name" name="app_name" value="{{ old('app_name', $config['app_name']) }}">
@if ($errors->has('app_name'))
<div class="form-control-feedback">
<strong>{{ $errors->first('app_name') }}</strong>
</div>
@endif
</div>
<div class="row">
<div class="col-sm-4">
<div class="form-group">
{!! Form::label('date_format', 'Date format:', ['class' => 'control-label']) !!}
{!! Form::select('date_format', $date_formats, old('date_format'), ['class' => 'form-control']) !!}
<label class="form-control-label" for="date-format">Date format:</label>
<select name="date_format" id="date-format" class="form-control">
@foreach ($date_formats as $key => $value)
<option value="{{ $key }}"{{ old('date_format', $config['date_format']) == $key ? ' selected="selected"' : '' }}>{{ $value }}</option>
@endforeach
</select>
@if ($errors->has('date_format'))
<div class="form-control-feedback">
<strong>{{ $errors->first('date_format') }}</strong>
</div>
@endif
</div>
</div>
</div>
@ -45,8 +61,18 @@
<div class="row">
<div class="col-sm-4">
<div class="form-group">
{!! Form::label('theme', 'Theme:', ['class' => 'control-label']) !!}
{!! Form::select('theme', $theme_names, old('theme'), ['class' => 'form-control']) !!}
<label class="form-control-label" for="theme">Theme:</label>
<select name="theme" id="theme" class="form-control">
@foreach ($theme_names as $key => $value)
<option value="{{ $key }}"{{ old('theme', $config['theme']) == $key ? ' selected="selected"' : '' }}>{{ $value }}</option>
@endforeach
</select>
@if ($errors->has('theme'))
<div class="form-control-feedback">
<strong>{{ $errors->first('theme') }}</strong>
</div>
@endif
</div>
</div>
</div>
@ -57,9 +83,9 @@
<p>To help spread the word about Blue Twilight, I'd really appreciate it if you left the &quot;Powered by&quot; notice in your gallery's footer.</p>
<p>This is not compulsory, however, and you may remove it by checking the box below.</p>
<div class="checkbox" style="margin-top: 20px;">
<label>
<input type="checkbox" name="remove_copyright" @if (UserConfig::get('remove_copyright'))checked="checked"@endif>
<div class="form-check" style="margin-top: 20px;">
<label class="form-check-label">
<input class="form-check-input" type="checkbox" name="remove_copyright" @if (old('remove_copyright', UserConfig::get('remove_copyright')))checked="checked"@endif>
<strong>Remove &quot;Powered by&quot; notice from the public gallery</strong>
</label>
</div>
@ -71,54 +97,90 @@
<p>@lang('admin.visitor_analytics_p')</p>
<p>@lang('admin.visitor_analytics_p2')</p>
{!! Form::textarea('analytics_code', old('analytics_code'), ['class' => 'form-control', 'rows' => 10]) !!}
<textarea class="form-control" rows="10" name="analytics_code">{{ old('analytics_code', $config['analytics_code']) }}</textarea>
</fieldset>
</div>
{{-- E-mail --}}
<div role="tabpanel" class="tab-pane" id="email-tab">
<div class="form-group">
{!! Form::label('sender_name', 'Sender name:', ['class' => 'control-label']) !!}
{!! Form::text('sender_name', old('sender_name'), ['class' => 'form-control']) !!}
<div class="form-group{{ $errors->has('sender_name') ? ' has-danger' : '' }}">
<label class="form-control-label" for="email-sender-name">Sender name:</label>
<input type="text" class="form-control" id="email-sender-name" name="sender_name" value="{{ old('sender_name', $config['sender_name']) }}">
@if ($errors->has('sender_name'))
<div class="form-control-feedback">
<strong>{{ $errors->first('sender_name') }}</strong>
</div>
@endif
</div>
<div class="form-group">
{!! Form::label('sender_address', 'Sender address:', ['class' => 'control-label']) !!}
{!! Form::text('sender_address', old('sender_address'), ['class' => 'form-control']) !!}
<div class="form-group{{ $errors->has('sender_address') ? ' has-danger' : '' }}">
<label class="form-control-label" for="email-sender-address">Sender address:</label>
<input type="text" class="form-control" id="email-sender-address" name="sender_address" value="{{ old('sender_address', $config['sender_address']) }}">
@if ($errors->has('sender_address'))
<div class="form-control-feedback">
<strong>{{ $errors->first('sender_address') }}</strong>
</div>
@endif
</div>
<hr/>
<fieldset style="margin-top: 20px;">
<legend>SMTP Server</legend>
<p style="margin-bottom: 15px;">Configure your SMTP server using the settings below. If your server does not require authentication, leave the Username and Password fields empty.</p>
<div class="form-group">
{!! Form::label('smtp_server', 'Hostname:', ['class' => 'control-label']) !!}
{!! Form::text('smtp_server', old('smtp_server'), ['class' => 'form-control']) !!}
<div class="form-group{{ $errors->has('smtp_server') ? ' has-danger' : '' }}">
<label class="form-control-label" for="email-smtp-server">Hostname:</label>
<input type="text" class="form-control" id="email-smtp-server" name="smtp_server" value="{{ old('smtp_server', $config['smtp_server']) }}">
@if ($errors->has('smtp_server'))
<div class="form-control-feedback">
<strong>{{ $errors->first('smtp_server') }}</strong>
</div>
@endif
</div>
<div class="form-group">
{!! Form::label('smtp_port', 'Port:', ['class' => 'control-label']) !!}
{!! Form::text('smtp_port', old('smtp_port'), ['class' => 'form-control']) !!}
<div class="form-group{{ $errors->has('smtp_port') ? ' has-danger' : '' }}">
<label class="form-control-label" for="email-smtp-port">Port:</label>
<input type="text" class="form-control" id="email-smtp-port" name="smtp_port" value="{{ old('smtp_port', $config['smtp_port']) }}">
@if ($errors->has('smtp_port'))
<div class="form-control-feedback">
<strong>{{ $errors->first('smtp_port') }}</strong>
</div>
@endif
</div>
<div class="form-group">
{!! Form::label('smtp_username', 'Username:', ['class' => 'control-label']) !!}
{!! Form::text('smtp_username', old('smtp_username'), ['class' => 'form-control']) !!}
<div class="form-group{{ $errors->has('smtp_username') ? ' has-danger' : '' }}">
<label class="form-control-label" for="email-smtp-username">Username:</label>
<input type="text" class="form-control" id="email-smtp-username" name="smtp_username" value="{{ old('smtp_username', $config['smtp_username']) }}">
@if ($errors->has('smtp_username'))
<div class="form-control-feedback">
<strong>{{ $errors->first('smtp_username') }}</strong>
</div>
@endif
</div>
<div class="form-group">
{!! Form::label('smtp_password', 'Password:', ['class' => 'control-label']) !!}
{!! Form::password('smtp_password', ['class' => 'form-control']) !!}
<div class="form-group{{ $errors->has('smtp_password') ? ' has-danger' : '' }}">
<label class="form-control-label" for="email-smtp-password">Password:</label>
<input type="text" class="form-control" id="email-smtp-password" name="smtp_password" value="{{ old('smtp_password', $config['smtp_password']) }}">
@if ($errors->has('smtp_password'))
<div class="form-control-feedback">
<strong>{{ $errors->first('smtp_password') }}</strong>
</div>
@endif
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="smtp_encryption" @if (UserConfig::get('smtp_encryption'))checked="checked"@endif>
<div class="form-check">
<label class="form-check-label">
<input class="form-check-input" type="checkbox" name="smtp_encryption" @if (UserConfig::get('smtp_encryption'))checked="checked"@endif>
<strong>Requires encrypted connection</strong>
</label>
</div>
<div>
<div style="margin-top: 20px;">
<button id="test-email-button" type="button" class="btn btn-primary">@lang('admin.settings_test_email_action')</button>
<div style="margin-top: 10px;">
@ -131,13 +193,14 @@
</div>
</div>
</div>
</fieldset>
</div>
{{-- Security --}}
<div role="tabpanel" class="tab-pane" id="security-tab">
<div class="checkbox">
<label>
<input type="checkbox" name="allow_self_registration" @if (UserConfig::get('allow_self_registration'))checked="checked"@endif>
<input type="checkbox" name="allow_self_registration" @if (old('allow_self_registration', UserConfig::get('allow_self_registration')))checked="checked"@endif>
<strong>Allow self-registration</strong><br/>
With this option enabled, users can sign up for their own &quot;visitor&quot; accounts to comment on photos.
</label>
@ -145,7 +208,7 @@
<div class="checkbox" style="margin-top: 20px;">
<label>
<input type="checkbox" name="require_email_verification" @if (UserConfig::get('require_email_verification'))checked="checked"@endif>
<input type="checkbox" name="require_email_verification" @if (old('require_email_verification', UserConfig::get('require_email_verification')))checked="checked"@endif>
<strong>Require e-mail verification for self-registered accounts</strong><br/>
<span class="text-danger">It is strongly recommended to enable this option.</span>
</label>
@ -153,7 +216,7 @@
<div class="checkbox" style="margin-top: 20px;">
<label>
<input type="checkbox" name="recaptcha_enabled_registration" @if (UserConfig::get('recaptcha_enabled_registration'))checked="checked"@endif>
<input type="checkbox" name="recaptcha_enabled_registration" @if (old('recaptcha_enabled_registration', UserConfig::get('recaptcha_enabled_registration')))checked="checked"@endif>
<strong>Enable <a href="https://www.google.com/recaptcha" target="_blank">reCAPTCHA</a> for self-registrations</strong><br/>
<span class="text-danger">It is strongly recommended to enable this option.</span>
</label>
@ -162,14 +225,26 @@
<fieldset style="margin-top: 30px;">
<legend>@lang('admin.settings_recaptcha')</legend>
<div class="form-group">
{!! Form::label('recaptcha_site_key', 'Site key:', ['class' => 'control-label']) !!}
{!! Form::text('recaptcha_site_key', old('recaptcha_site_key'), ['class' => 'form-control']) !!}
<div class="form-group{{ $errors->has('recaptcha_site_key') ? ' has-danger' : '' }}">
<label class="form-control-label" for="recaptcha-site-key">Site key:</label>
<input type="text" class="form-control" id="recaptcha-site-key" name="recaptcha_site_key" value="{{ old('recaptcha_site_key', $config['recaptcha_site_key']) }}">
@if ($errors->has('recaptcha_site_key'))
<div class="form-control-feedback">
<strong>{{ $errors->first('recaptcha_site_key') }}</strong>
</div>
@endif
</div>
<div class="form-group">
{!! Form::label('recaptcha_secret_key', 'Secret key:', ['class' => 'control-label']) !!}
{!! Form::text('recaptcha_secret_key', old('recaptcha_secret_key'), ['class' => 'form-control']) !!}
<div class="form-group{{ $errors->has('recaptcha_secret_key') ? ' has-danger' : '' }}">
<label class="form-control-label" for="recaptcha-secret-key">Secret key:</label>
<input type="text" class="form-control" id="recaptcha-secret-key" name="recaptcha_secret_key" value="{{ old('recaptcha_secret_key', $config['recaptcha_secret_key']) }}">
@if ($errors->has('recaptcha_secret_key'))
<div class="form-control-feedback">
<strong>{{ $errors->first('recaptcha_secret_key') }}</strong>
</div>
@endif
</div>
</fieldset>
@ -178,7 +253,7 @@
<div class="checkbox">
<label>
<input type="checkbox" name="restrict_original_download" @if (UserConfig::get('restrict_original_download'))checked="checked"@endif>
<input type="checkbox" name="restrict_original_download" @if (old('restrict_original_download', UserConfig::get('restrict_original_download')))checked="checked"@endif>
<strong>@lang('forms.settings_restrict_originals_download')</strong><br/>
@lang('forms.settings_restrict_originals_download_help')
</label>
@ -186,7 +261,7 @@
<div class="checkbox" style="margin-top: 20px;">
<label>
<input type="checkbox" name="hotlink_protection" @if (UserConfig::get('hotlink_protection'))checked="checked"@endif>
<input type="checkbox" name="hotlink_protection" @if (old('hotlink_protection', UserConfig::get('hotlink_protection')))checked="checked"@endif>
<strong>@lang('forms.settings_hotlink_protection')</strong><br/>
@lang('forms.settings_hotlink_protection_help')
</label>
@ -200,8 +275,7 @@
<button type="submit" class="btn btn-success"><i class="fa fa-fw fa-check"></i> @lang('admin.settings_save_action')</button>
</div>
</div>
{!! Form::close() !!}
</form>
</div>
</div>
</div>