62 lines
3.3 KiB
PHP

<x-layouts.admin>
<x-slot name="title">侧边栏功能名称</x-slot>
<x-slot name="content">
<x-form.container>
<x-form id="setting" method="PATCH" route="settings.navigation.save">
@foreach ($sections as $section)
<x-form.section>
<x-slot name="head">
<x-form.section.head title="{{ $section['title'] }}" description="一级功能名称" />
</x-slot>
<x-slot name="body">
@php $sectionInput = "section_titles[{$section['slug']}]"; @endphp
<div class="sm:col-span-3">
<x-form.label for="{{ $sectionInput }}">一级功能</x-form.label>
<input
type="text"
id="{{ $sectionInput }}"
name="{{ $sectionInput }}"
v-model="form['{{ $sectionInput }}']"
value="{{ $section['title'] }}"
maxlength="50"
class="w-full text-sm px-3 py-2.5 mt-1 rounded-lg border border-light-gray text-black placeholder-light-gray bg-white focus:outline-none focus:ring-transparent focus:border-purple"
>
</div>
@if (! empty($section['pages']))
<div class="sm:col-span-3 grid grid-cols-1 gap-4">
@foreach (collect($section['pages'])->flatMap(fn ($page) => [$page, ...($page['children'] ?? [])]) as $page)
@php $pageInput = "page_titles[{$section['slug']}][{$page['slug']}]"; @endphp
<div>
<x-form.label for="{{ $pageInput }}">功能名称</x-form.label>
<input
type="text"
id="{{ $pageInput }}"
name="{{ $pageInput }}"
v-model="form['{{ $pageInput }}']"
value="{{ $page['title'] }}"
maxlength="50"
class="w-full text-sm px-3 py-2.5 mt-1 rounded-lg border border-light-gray text-black placeholder-light-gray bg-white focus:outline-none focus:ring-transparent focus:border-purple"
>
</div>
@endforeach
</div>
@endif
</x-slot>
</x-form.section>
@endforeach
<x-form.section>
<x-slot name="foot">
<x-form.buttons :cancel="url()->previous()" />
</x-slot>
</x-form.section>
</x-form>
</x-form.container>
</x-slot>
<x-script folder="settings" file="settings" />
</x-layouts.admin>