diff --git a/app/Database/seeds/settings.yml b/app/Database/seeds/settings.yml index 9ba00020..5067b4d2 100644 --- a/app/Database/seeds/settings.yml +++ b/app/Database/seeds/settings.yml @@ -40,6 +40,13 @@ options: '' type: boolean description: 'Send some data (php version, mysql version) to phpVMS. See AnalyticsSvc code for details' +- key: general.google_analytics_id + name: 'Google Analytics Tracking ID' + group: general + value: '' + options: '' + type: text + description: 'Enter your Google Analytics Tracking ID' - key: units.distance name: 'Distance Units' group: units diff --git a/resources/views/admin/menu.blade.php b/resources/views/admin/menu.blade.php index 050437d9..d12e88ac 100644 --- a/resources/views/admin/menu.blade.php +++ b/resources/views/admin/menu.blade.php @@ -70,13 +70,13 @@
  • roles
  • @endability - @ability('admin', 'settings') -
  • settings
  • - @endability - @ability('admin', 'maintenance')
  • maintenance
  • @endability + + @ability('admin', 'settings') +
  • settings
  • + @endability diff --git a/resources/views/admin/settings/table.blade.php b/resources/views/admin/settings/table.blade.php index 5f4bd49f..61d1d372 100644 --- a/resources/views/admin/settings/table.blade.php +++ b/resources/views/admin/settings/table.blade.php @@ -2,66 +2,80 @@ @foreach($grouped_settings as $group => $settings)
    - - - - +
    +
    -
    {{ $group }}
    -
    + + + - @foreach($settings as $setting) - - - + + - - @endforeach -
    +
    {{ $group }}
    +
    -

    {{ $setting->name }}

    -

    - @component('admin.components.info') - {{$setting->description}} - @endcomponent -

    - @if($setting->type === 'date') - {{ Form::input('text', $setting->id, $setting->value, ['class' => 'form-control', 'id' => 'datepicker']) }} - @elseif($setting->type === 'boolean' || $setting->type === 'bool') - {{ Form::hidden($setting->id, 0) }} - {{ Form::checkbox($setting->id, null, $setting->value) }} - @elseif($setting->type === 'int') - {{ Form::number($setting->id, $setting->value, ['class'=>'form-control']) }} - @elseif($setting->type === 'number') - {{ Form::number($setting->id, $setting->value, ['class'=>'form-control', 'step' => '0.01']) }} - @elseif($setting->type === 'select') + @foreach($settings as $setting) +
    +

    {{ $setting->name }}

    +

    + @component('admin.components.info') + {{$setting->description}} + @endcomponent +

    + @if($setting->type === 'date') + {{ Form::input('text', $setting->id, $setting->value, ['class' => 'form-control', 'id' => 'datepicker']) }} + @elseif($setting->type === 'boolean' || $setting->type === 'bool') + {{ Form::hidden($setting->id, 0) }} + {{ Form::checkbox($setting->id, null, $setting->value) }} + @elseif($setting->type === 'int') + {{ Form::number($setting->id, $setting->value, ['class'=>'form-control']) }} + @elseif($setting->type === 'number') + {{ Form::number($setting->id, $setting->value, ['class'=>'form-control', 'step' => '0.01']) }} + @elseif($setting->type === 'select') - @if($setting->id === 'general_theme') - {{ Form::select( - $setting->id, - list_to_assoc($themes), - $setting->value, - ['class' => 'select2', 'style' => 'width: 100%; text-align: left;']) }} - @else - {{ Form::select( + @if($setting->id === 'general_theme') + {{ Form::select( $setting->id, - list_to_assoc(explode(',', $setting->options)), - $setting->value, - ['class' => 'select2', 'style' => 'width: 100%; text-align: left;']) }} + list_to_assoc($themes), + $setting->value, + ['class' => 'select2', 'style' => 'width: 100%; text-align: left;']) }} + @else + {{ Form::select( + $setting->id, + list_to_assoc(explode(',', $setting->options)), + $setting->value, + ['class' => 'select2', 'style' => 'width: 100%; text-align: left;']) }} + @endif + @else + {{ Form::input('text', $setting->id, $setting->value, ['class' => 'form-control']) }} @endif - @else - {{ Form::input('text', $setting->id, $setting->value, ['class' => 'form-control']) }} - @endif -
    + + + @endforeach + +
    + + {{--
    +
    + {{ Form::button('Save', ['type' => 'submit', 'class' => 'btn btn-success']) }} + Cancel +
    +
    --}} +
    @endforeach +
    -
    - {{ Form::button('Save', ['type' => 'submit', 'class' => 'btn btn-success']) }} - Cancel +
    +
    + {{ Form::button('Save', ['type' => 'submit', 'class' => 'btn btn-success']) }} + Cancel +
    + {{ Form::close() }} + +{{-- +Google Analytics tracking code. Only active if an ID has been entered +You can modify to any tracking code and re-use that settings field, or +just remove it completely. Only added as a convenience factor +--}} +@php +$gtag = setting('general.google_analytics_id'); +@endphp +@if($gtag) + + + +@endif +{{-- End of the Google Analytics code --}} +