Document item edit columns checking name and description column ( #866acb813 )

This commit is contained in:
Cüneyt Şentürk
2023-07-03 17:25:26 +03:00
parent f040a95118
commit c58db84339
6 changed files with 54 additions and 6 deletions

View File

@@ -7,11 +7,13 @@
v-if="{{ $attributes['show'] }}"
@endif
>
<x-form.label for="{{ $name }}">{!! $label !!}</x-form.label>
<x-form.label for="{{ $name }}">
{!! $label !!}
</x-form.label>
<div class="flex items-center mt-1">
@if (empty($attributes['disabled']))
<label class="relative w-10 ltr:rounded-tl-lg ltr:rounded-bl-lg rtl:rounded-tr-lg rtl:rounded-br-lg py-2 px-1 text-sm text-center transition-all cursor-pointer" @click="form.{{ $name }}=1" v-bind:class="[form.{{ $name }} == 1 ? ['bg-green-500','text-white'] : 'bg-black-100']">
<label class="relative w-10 ltr:rounded-tl-lg ltr:rounded-bl-lg rtl:rounded-tr-lg rtl:rounded-br-lg py-2 px-1 text-sm text-center transition-all cursor-pointer" @click="form.{{ $name }}=1; @if(isset($attributes['change'])) {!! $attributes['change'] !!} @endif" v-bind:class="[form.{{ $name }} == 1 ? ['bg-green-500','text-white'] : 'bg-black-100']">
{{ empty($enable) ? trans('general.yes') : $enable }}
<input type="radio" name="{{ $name }}" id="{{ $name }}-1" class="absolute left-0 opacity-0">
</label>
@@ -23,7 +25,7 @@
@endif
@if (empty($attributes['disabled']))
<label class="relative w-10 ltr:rounded-tr-lg ltr:rounded-br-lg rtl:rounded-tl-lg rtl:rounded-bl-lg py-2 px-1 text-sm text-center transition-all cursor-pointer" @click="form.{{ $name }}=0" v-bind:class="[form.{{ $name }} == 0 ? ['bg-red-500','text-white'] : 'bg-black-100']">
<label class="relative w-10 ltr:rounded-tr-lg ltr:rounded-br-lg rtl:rounded-tl-lg rtl:rounded-bl-lg py-2 px-1 text-sm text-center transition-all cursor-pointer" @click="form.{{ $name }}=0; @if(isset($attributes['change'])) {!! $attributes['change'] !!} @endif" v-bind:class="[form.{{ $name }} == 0 ? ['bg-red-500','text-white'] : 'bg-black-100']">
{{ empty($disable) ? trans('general.no') : $disable }}
<input type="radio" name="{{ $name }}" id="{{ $name }}-0" class="absolute left-0 opacity-0">
</label>

View File

@@ -33,10 +33,11 @@
form-group-class="sm:col-span-6 sm:gap-0"
/>
<x-form.group.toggle name="hide_item_description" label="{{ trans('settings.invoice.hide.item_description') }}" :value="$hide_item_description" />
<x-form.group.toggle name="hide_item_description" label="{{ trans('settings.invoice.hide.item_description') }}" :value="$hide_item_description" change="settingsInvoice()" />
<x-form.group.toggle name="hide_amount" label="{{ trans('settings.invoice.hide.amount') }}" :value="$hide_amount" not-required form-group-class="sm:col-span-6" />
<x-form.input.hidden name="type" :value="$type" />
<x-form.input.hidden name="enabled" value="1" />
<x-form.input.hidden name="message_name_or_description_required" :value="trans('invoices.messages.name_or_description_required', ['name' => trans('general.name'), 'description' => trans('general.description')])" />
</div>
</x-form>

View File

@@ -132,7 +132,7 @@
</div>
<div class="flex gap-10">
<x-form.group.toggle name="hide_item_description" label="{{ trans('settings.invoice.hide.item_description') }}" :value="setting('invoice.hide_item_description')" not-required form-group-class="sm:col-span-6" />
<x-form.group.toggle name="hide_item_description" label="{{ trans('settings.invoice.hide.item_description') }}" :value="setting('invoice.hide_item_description')" change="settingsInvoice()" not-required form-group-class="sm:col-span-6" />
<x-form.group.toggle name="hide_amount" label="{{ trans('settings.invoice.hide.amount') }}" :value="setting('invoice.hide_amount')" not-required form-group-class="sm:col-span-6" />
</div>
@@ -149,6 +149,7 @@
<x-form.input.hidden name="_template" :value="setting('invoice.template')" />
<x-form.input.hidden name="_prefix" value="invoice" />
<x-form.input.hidden name="message_name_or_description_required" :value="trans('invoices.messages.name_or_description_required', ['name' => trans('general.name'), 'description' => trans('general.description')])" />
</x-form>
</x-form.container>
</x-slot>