BookStack/resources/views/settings/footer-links.blade.php
Dan Brown 44c41e9e4d Updated footer links to be a configurable list
Made so footer link ordering, names and urls can be set.
Cleaned up some of the setting-service and added support for array
setting types, which are cleaned on entry and stored as json with a new
type indicator column on the settings table for auto-decode.
Also added testing to cover this feature.

Related to #1973 and #854
2021-01-31 00:23:15 +00:00

34 lines
1.6 KiB
PHP

{{--
$value - Setting value
$name - Setting input name
--}}
<div components="add-remove-rows"
option:add-remove-rows:row-selector=".card"
option:add-remove-rows:remove-selector="button.text-neg">
<div component="sortable-list"
option:sortable-list:handle-selector=".handle">
@foreach(array_merge($value, [['label' => '', 'url' => '']]) as $index => $link)
<div class="card drag-card {{ $loop->last ? 'hidden' : '' }}" @if($loop->last) refs="add-remove-rows@model" @endif>
<div class="handle">@icon('grip')</div>
@foreach(['label', 'url'] as $prop)
<div class="outline">
<input value="{{ $link[$prop] ?? '' }}"
placeholder="{{ trans('settings.app_footer_links_' . $prop) }}"
aria-label="{{ trans('settings.app_footer_links_' . $prop) }}"
name="{{ $name }}[{{ $loop->parent->last ? 'randrowid' : $index }}][{{$prop}}]"
type="text"
autocomplete="off"/>
</div>
@endforeach
<button type="button"
aria-label="{{ trans('common.remove') }}"
class="text-center drag-card-action text-neg">
@icon('close')
</button>
</div>
@endforeach
</div>
<button refs="add-remove-rows@add" type="button" class="text-button">{{ trans('settings.app_footer_links_add') }}</button>
</div>