move into sonardesk

This commit is contained in:
Mark Gregory
2026-10-12 14:50:13 +01:00
parent 5f0d2ceb72
commit 38b4a7406f
879 changed files with 24021 additions and 1 deletions
@@ -0,0 +1 @@
<x-layouts.app :title="__('Localisation')"><main class="p-6 space-y-6"><div><flux:heading size="xl">Localisation</flux:heading><flux:text>Languages, regional formats and translated content.</flux:text></div><div class="grid gap-6 xl:grid-cols-3"><section class="xl:col-span-2 space-y-4"><flux:heading>Locales</flux:heading>@foreach($locales as $locale)<form method="POST" action="{{ route('administration.localization.locales.update',$locale) }}" class="rounded-xl border p-4 grid gap-3 md:grid-cols-4">@csrf @method('PUT')<flux:input name="code" label="Code" :value="$locale->code"/><flux:input name="name" label="Name" :value="$locale->name"/><flux:input name="native_name" label="Native name" :value="$locale->native_name"/><flux:input name="regional_code" label="Regional code" :value="$locale->regional_code"/><flux:select name="direction" label="Direction"><option value="ltr" @selected($locale->direction==='ltr')>LTR</option><option value="rtl" @selected($locale->direction==='rtl')>RTL</option></flux:select><flux:input name="timezone" label="Timezone" :value="$locale->timezone"/><flux:input name="currency_code" label="Currency" :value="$locale->currency_code"/><flux:input name="currency_symbol" label="Symbol" :value="$locale->currency_symbol"/><input type="hidden" name="date_format" value="{{ $locale->date_format }}"><input type="hidden" name="time_format" value="{{ $locale->time_format }}"><input type="hidden" name="position" value="{{ $locale->position }}"><label class="flex items-center gap-2"><input type="hidden" name="is_active" value="0"><input type="checkbox" name="is_active" value="1" @checked($locale->is_active)> Active</label><label class="flex items-center gap-2"><input type="hidden" name="is_default" value="0"><input type="checkbox" name="is_default" value="1" @checked($locale->is_default)> Default</label><div class="md:col-span-2 flex justify-end"><flux:button type="submit" variant="primary">Save</flux:button></div></form>@endforeach</section><section class="rounded-xl border p-5"><flux:heading>Add locale</flux:heading><form method="POST" action="{{ route('administration.localization.locales.store') }}" class="mt-4 space-y-3">@csrf<flux:input name="code" label="Code" placeholder="fr" required/><flux:input name="name" label="Name" placeholder="French" required/><flux:input name="native_name" label="Native name" placeholder="Français" required/><flux:input name="regional_code" label="Regional code" placeholder="fr-FR"/><flux:select name="direction" label="Direction"><option value="ltr">LTR</option><option value="rtl">RTL</option></flux:select><flux:input name="timezone" label="Timezone" value="UTC" required/><flux:input name="currency_code" label="Currency code"/><flux:input name="currency_symbol" label="Currency symbol"/><input type="hidden" name="date_format" value="d/m/Y"><input type="hidden" name="time_format" value="H:i"><input type="hidden" name="position" value="0"><input type="hidden" name="is_active" value="1"><flux:button type="submit" variant="primary">Add locale</flux:button></form></section></div><section class="space-y-4"><flux:heading>Translate content</flux:heading><div class="grid gap-4 lg:grid-cols-3">@foreach($subjects as $key=>$subject)<div class="rounded-xl border p-4"><div class="font-semibold">{{ $subject['label'] }}</div><div class="mt-3 space-y-2">@foreach($subject['records'] as $record)<a class="block rounded-lg border px-3 py-2 hover:bg-zinc-50 dark:hover:bg-zinc-800" href="{{ route('administration.localization.translations.edit',[$key,$record->id]) }}">{{ $record->title ?? ('#'.$record->id) }}</a>@endforeach</div></div>@endforeach</div></section></main></x-layouts.app>
@@ -0,0 +1 @@
<x-layouts.app :title="__('Translate content')"><main class="p-6 space-y-6"><div><flux:heading size="xl">Translate: {{ $record->title ?? ('#'.$record->id) }}</flux:heading><flux:text>{{ $config['label'] }} · source language values are shown for reference.</flux:text></div><form method="POST" action="{{ route('administration.localization.translations.update',[$subject,$record->id]) }}" class="space-y-6">@csrf @method('PUT')@foreach($locales as $locale)<section class="rounded-xl border p-5 space-y-4"><div class="flex items-center justify-between"><flux:heading>{{ $locale->native_name }}</flux:heading><span class="text-sm text-zinc-500">{{ $locale->code }}</span></div>@foreach($config['fields'] as $field)@php($existing=$record->translations->first(fn($item)=>$item->locale_id===$locale->id&&$item->field===$field)?->value)<div><div class="mb-1 text-sm font-medium">{{ str($field)->headline() }}</div><div class="mb-2 text-xs text-zinc-500">Source: {{ str(strip_tags((string)$record->getAttribute($field)))->limit(180) }}</div>@if(in_array($field,['content','summary','excerpt','meta_description']))<flux:textarea name="translations[{{ $locale->code }}][{{ $field }}]" rows="6">{{ $existing }}</flux:textarea>@else<flux:input name="translations[{{ $locale->code }}][{{ $field }}]" :value="$existing"/>@endif</div>@endforeach</section>@endforeach<div class="flex justify-end"><flux:button type="submit" variant="primary">Save translations</flux:button></div></form></main></x-layouts.app>