94 lines
4.8 KiB
PHP
Raw Normal View History

2022-06-01 10:15:55 +03:00
<x-form id="form-email" :route="[$store_route, $invoice->id]">
2023-05-31 16:22:40 +03:00
<x-tabs active="general" class="grid grid-cols-2 auto-rows-max" override="class" ignore-hash>
<x-slot name="navs">
<x-tabs.nav id="general">
{{ trans('general.general') }}
</x-tabs.nav>
2022-06-01 10:15:55 +03:00
2023-05-31 16:22:40 +03:00
<x-tabs.nav id="attachments">
{{ trans_choice('general.attachments', 2) }}
</x-tabs.nav>
</x-slot>
<x-slot name="content">
<x-tabs.tab id="general">
<x-form.section>
<x-slot name="body">
<x-form.group.text name="to" label="{{ trans('general.to') }}" value="{{ $invoice->contact->email }}" form-group-class="sm:col-span-6" />
<x-form.group.text name="subject" label="{{ trans('settings.email.templates.subject') }}" value="{{ $notification->getSubject() }}" form-group-class="sm:col-span-6" />
<x-form.group.editor name="body" label="{{ trans('settings.email.templates.body') }}" :value="$notification->getBody()" rows="5" data-toggle="quill" form-group-class="sm:col-span-6 mb-0" />
<x-form.group.checkbox name="user_email" :options="['1' => trans('general.email_send_me', ['email' => user()->email])]" checkbox-class="col-span-6" />
<x-form.input.hidden name="document_id" :value="$invoice->id" />
</x-slot>
</x-form.section>
</x-tabs.tab>
2023-05-31 16:22:40 +03:00
<x-tabs.tab id="attachments">
@if ($invoice->attachment)
<x-table>
<x-table.thead>
<x-table.tr class="flex items-center px-1">
<x-table.th class="w-1/12">
</x-table.th>
<x-table.th class="w-1/6">
</x-table.th>
<x-table.th class="w-4/6">
{{ trans('general.name') }}
</x-table.th>
<x-table.th class="w-1/6">
{{ trans('general.size') }}
</x-table.th>
</x-table.tr>
</x-table.thead>
2022-06-01 10:15:55 +03:00
<x-table.tbody>
@foreach($invoice->attachment as $attachment)
<x-table.tr id="method-{{ $attachment->id }}">
<x-table.td class="w-1/12">
<input type="checkbox"
2023-05-31 16:22:40 +03:00
id="attachment-{{ $attachment->id }}"
name="{{ $attachment->id }}"
class="rounded-sm text-purple border-gray-300 cursor-pointer disabled:bg-gray-200 focus:outline-none focus:ring-transparent"
data-field="attachments"
@input="e => form.attachments[e.target.name] = e.target.checked | 0">
</x-table.td>
<x-table.td class="w-1/6">
@if ($attachment->aggregate_type == 'image')
<div class="avatar-attachment">
<img src="{{ route('uploads.get', $attachment->id) }}" alt="{{ $attachment->basename }}" class="avatar-img h-full rounded object-cover">
</div>
@else
<div class="avatar-attachment">
<span class="material-icons text-base">attach_file</span>
</div>
@endif
</x-table.td>
2022-06-01 10:15:55 +03:00
<x-table.td class="w-4/6">
{{ $attachment->basename }}
</x-table.td>
2022-06-01 10:15:55 +03:00
<x-table.td class="w-1/6">
{{ $attachment->readableSize() }}
</x-table.td>
</x-table.tr>
@endforeach
</x-table.tbody>
</x-table>
2023-05-31 16:22:40 +03:00
@else
<p class="mt-6 text-sm">
{{ trans('documents.empty_attachments', ['type' => $invoice->type]) }}
</p>
@endif
</x-tabs.tab>
2022-06-01 10:15:55 +03:00
</x-slot>
</x-tabs>
2022-06-01 10:15:55 +03:00
</x-form>