#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> <h1>@yield('title')</h1>
<p style="margin-bottom: 30px;">@lang('admin.settings_intro')</p> <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> <div>
{{-- Nav tabs --}} {{-- Nav tabs --}}
<ul class="nav nav-tabs" role="tablist"> <ul class="nav nav-tabs" role="tablist">
@ -28,16 +28,32 @@
<div class="tab-content"> <div class="tab-content">
{{-- General --}} {{-- General --}}
<div role="tabpanel" class="tab-pane active" id="general-tab"> <div role="tabpanel" class="tab-pane active" id="general-tab">
<div class="form-group"> <div class="form-group{{ $errors->has('app_name') ? ' has-danger' : '' }}">
{!! Form::label('app_name', 'Gallery name:', ['class' => 'control-label']) !!} <label class="form-control-label" for="gallery-name">Gallery name:</label>
{!! Form::text('app_name', old('app_name'), ['class' => 'form-control']) !!} <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>
<div class="row"> <div class="row">
<div class="col-sm-4"> <div class="col-sm-4">
<div class="form-group"> <div class="form-group">
{!! Form::label('date_format', 'Date format:', ['class' => 'control-label']) !!} <label class="form-control-label" for="date-format">Date format:</label>
{!! Form::select('date_format', $date_formats, old('date_format'), ['class' => 'form-control']) !!} <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> </div>
</div> </div>
@ -45,8 +61,18 @@
<div class="row"> <div class="row">
<div class="col-sm-4"> <div class="col-sm-4">
<div class="form-group"> <div class="form-group">
{!! Form::label('theme', 'Theme:', ['class' => 'control-label']) !!} <label class="form-control-label" for="theme">Theme:</label>
{!! Form::select('theme', $theme_names, old('theme'), ['class' => 'form-control']) !!} <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> </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>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> <p>This is not compulsory, however, and you may remove it by checking the box below.</p>
<div class="checkbox" style="margin-top: 20px;"> <div class="form-check" style="margin-top: 20px;">
<label> <label class="form-check-label">
<input type="checkbox" name="remove_copyright" @if (UserConfig::get('remove_copyright'))checked="checked"@endif> <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> <strong>Remove &quot;Powered by&quot; notice from the public gallery</strong>
</label> </label>
</div> </div>
@ -71,54 +97,90 @@
<p>@lang('admin.visitor_analytics_p')</p> <p>@lang('admin.visitor_analytics_p')</p>
<p>@lang('admin.visitor_analytics_p2')</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> </fieldset>
</div> </div>
{{-- E-mail --}} {{-- E-mail --}}
<div role="tabpanel" class="tab-pane" id="email-tab"> <div role="tabpanel" class="tab-pane" id="email-tab">
<div class="form-group"> <div class="form-group{{ $errors->has('sender_name') ? ' has-danger' : '' }}">
{!! Form::label('sender_name', 'Sender name:', ['class' => 'control-label']) !!} <label class="form-control-label" for="email-sender-name">Sender name:</label>
{!! Form::text('sender_name', old('sender_name'), ['class' => 'form-control']) !!} <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>
<div class="form-group"> <div class="form-group{{ $errors->has('sender_address') ? ' has-danger' : '' }}">
{!! Form::label('sender_address', 'Sender address:', ['class' => 'control-label']) !!} <label class="form-control-label" for="email-sender-address">Sender address:</label>
{!! Form::text('sender_address', old('sender_address'), ['class' => 'form-control']) !!} <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> </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> <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"> <div class="form-group{{ $errors->has('smtp_server') ? ' has-danger' : '' }}">
{!! Form::label('smtp_server', 'Hostname:', ['class' => 'control-label']) !!} <label class="form-control-label" for="email-smtp-server">Hostname:</label>
{!! Form::text('smtp_server', old('smtp_server'), ['class' => 'form-control']) !!} <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>
<div class="form-group"> <div class="form-group{{ $errors->has('smtp_port') ? ' has-danger' : '' }}">
{!! Form::label('smtp_port', 'Port:', ['class' => 'control-label']) !!} <label class="form-control-label" for="email-smtp-port">Port:</label>
{!! Form::text('smtp_port', old('smtp_port'), ['class' => 'form-control']) !!} <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>
<div class="form-group"> <div class="form-group{{ $errors->has('smtp_username') ? ' has-danger' : '' }}">
{!! Form::label('smtp_username', 'Username:', ['class' => 'control-label']) !!} <label class="form-control-label" for="email-smtp-username">Username:</label>
{!! Form::text('smtp_username', old('smtp_username'), ['class' => 'form-control']) !!} <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>
<div class="form-group"> <div class="form-group{{ $errors->has('smtp_password') ? ' has-danger' : '' }}">
{!! Form::label('smtp_password', 'Password:', ['class' => 'control-label']) !!} <label class="form-control-label" for="email-smtp-password">Password:</label>
{!! Form::password('smtp_password', ['class' => 'form-control']) !!} <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>
<div class="checkbox"> <div class="form-check">
<label> <label class="form-check-label">
<input type="checkbox" name="smtp_encryption" @if (UserConfig::get('smtp_encryption'))checked="checked"@endif> <input class="form-check-input" type="checkbox" name="smtp_encryption" @if (UserConfig::get('smtp_encryption'))checked="checked"@endif>
<strong>Requires encrypted connection</strong> <strong>Requires encrypted connection</strong>
</label> </label>
</div> </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> <button id="test-email-button" type="button" class="btn btn-primary">@lang('admin.settings_test_email_action')</button>
<div style="margin-top: 10px;"> <div style="margin-top: 10px;">
@ -131,13 +193,14 @@
</div> </div>
</div> </div>
</div> </div>
</fieldset>
</div> </div>
{{-- Security --}} {{-- Security --}}
<div role="tabpanel" class="tab-pane" id="security-tab"> <div role="tabpanel" class="tab-pane" id="security-tab">
<div class="checkbox"> <div class="checkbox">
<label> <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/> <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. With this option enabled, users can sign up for their own &quot;visitor&quot; accounts to comment on photos.
</label> </label>
@ -145,7 +208,7 @@
<div class="checkbox" style="margin-top: 20px;"> <div class="checkbox" style="margin-top: 20px;">
<label> <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/> <strong>Require e-mail verification for self-registered accounts</strong><br/>
<span class="text-danger">It is strongly recommended to enable this option.</span> <span class="text-danger">It is strongly recommended to enable this option.</span>
</label> </label>
@ -153,7 +216,7 @@
<div class="checkbox" style="margin-top: 20px;"> <div class="checkbox" style="margin-top: 20px;">
<label> <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/> <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> <span class="text-danger">It is strongly recommended to enable this option.</span>
</label> </label>
@ -162,14 +225,26 @@
<fieldset style="margin-top: 30px;"> <fieldset style="margin-top: 30px;">
<legend>@lang('admin.settings_recaptcha')</legend> <legend>@lang('admin.settings_recaptcha')</legend>
<div class="form-group"> <div class="form-group{{ $errors->has('recaptcha_site_key') ? ' has-danger' : '' }}">
{!! Form::label('recaptcha_site_key', 'Site key:', ['class' => 'control-label']) !!} <label class="form-control-label" for="recaptcha-site-key">Site key:</label>
{!! Form::text('recaptcha_site_key', old('recaptcha_site_key'), ['class' => 'form-control']) !!} <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>
<div class="form-group"> <div class="form-group{{ $errors->has('recaptcha_secret_key') ? ' has-danger' : '' }}">
{!! Form::label('recaptcha_secret_key', 'Secret key:', ['class' => 'control-label']) !!} <label class="form-control-label" for="recaptcha-secret-key">Secret key:</label>
{!! Form::text('recaptcha_secret_key', old('recaptcha_secret_key'), ['class' => 'form-control']) !!} <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> </div>
</fieldset> </fieldset>
@ -178,7 +253,7 @@
<div class="checkbox"> <div class="checkbox">
<label> <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/> <strong>@lang('forms.settings_restrict_originals_download')</strong><br/>
@lang('forms.settings_restrict_originals_download_help') @lang('forms.settings_restrict_originals_download_help')
</label> </label>
@ -186,7 +261,7 @@
<div class="checkbox" style="margin-top: 20px;"> <div class="checkbox" style="margin-top: 20px;">
<label> <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/> <strong>@lang('forms.settings_hotlink_protection')</strong><br/>
@lang('forms.settings_hotlink_protection_help') @lang('forms.settings_hotlink_protection_help')
</label> </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> <button type="submit" class="btn btn-success"><i class="fa fa-fw fa-check"></i> @lang('admin.settings_save_action')</button>
</div> </div>
</div> </div>
</form>
{!! Form::close() !!}
</div> </div>
</div> </div>
</div> </div>