1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-14 15:13:29 +01:00
invoiceninja/resources/views/portal/ninja2020/components/entity-documents.blade.php

103 lines
6.7 KiB
PHP
Raw Normal View History

@if ($entity->documents()->where('is_public',1)->count() > 0 || $entity->company->documents()->where('is_public',1)->count() > 0 || ($entity->expense && $entity->expense->invoice_documents) || ($entity->task && $entity->company->invoice_task_documents))
2021-06-30 20:40:51 +02:00
<div class="bg-white shadow sm:rounded-lg my-4">
<div class="px-4 py-5 sm:p-6">
<div class="sm:flex sm:items-start sm:justify-between">
<div>
<p class="text-lg leading-6 font-medium text-gray-900">{{ ctrans('texts.attachments') }}:</p>
2023-10-06 23:55:52 +02:00
@foreach ($entity->documents()->where('is_public',1)->get() as $document)
2021-06-30 20:40:51 +02:00
<div class="inline-flex items-center space-x-1">
2022-07-27 07:39:43 +02:00
@if($entity instanceof App\Models\PurchaseOrder)
<a href="{{ route('vendor.documents.download', $document->hashed_id) }}" target="_blank"
class="block text-sm button-link text-primary">{{ Illuminate\Support\Str::limit($document->name, 40) }}</a>
2022-07-27 07:39:43 +02:00
@else
<a href="{{ route('client.documents.download', $document->hashed_id) }}" target="_blank"
2022-07-27 07:39:43 +02:00
class="block text-sm button-link text-primary">{{ Illuminate\Support\Str::limit($document->name, 40) }}</a>
@endif
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
class="text-primary h-6 w-4">
2021-06-30 20:40:51 +02:00
<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path>
<polyline points="15 3 21 3 21 9"></polyline>
<line x1="10" y1="14" x2="21" y2="3"></line>
</svg>
@if (!$loop->last)
<span>&mdash;</span>
@endif
</div>
@endforeach
2023-10-06 23:55:52 +02:00
@foreach ($entity->company->documents()->where('is_public',1)->get() as $document)
<div class="inline-flex items-center space-x-1">
2022-07-27 07:39:43 +02:00
@if($entity instanceof App\Models\PurchaseOrder)
<a href="{{ route('vendor.documents.download', $document->hashed_id) }}" target="_blank"
2022-07-27 07:39:43 +02:00
class="block text-sm button-link text-primary">{{ Illuminate\Support\Str::limit($document->name, 40) }}</a>
@else
<a href="{{ route('client.documents.download', $document->hashed_id) }}" target="_blank"
class="block text-sm button-link text-primary">{{ Illuminate\Support\Str::limit($document->name, 40) }}</a>
2022-07-27 07:39:43 +02:00
@endif
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
class="text-primary h-6 w-4">
<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path>
<polyline points="15 3 21 3 21 9"></polyline>
<line x1="10" y1="14" x2="21" y2="3"></line>
</svg>
@if (!$loop->last)
2021-06-30 20:40:51 +02:00
<span>&mdash;</span>
@endif
</div>
@endforeach
2022-03-11 09:49:51 +01:00
@if($entity instanceof App\Models\Invoice)
@foreach ($entity->expense_documents() as $expense)
@foreach($expense->documents as $document)
<div class="inline-flex items-center space-x-1">
<a href="{{ route('client.documents.download', $document->hashed_id) }}" target="_blank"
class="block text-sm button-link text-primary">{{ Illuminate\Support\Str::limit($document->name, 40) }}</a>
2022-03-14 07:17:26 +01:00
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
class="text-primary h-6 w-4">
<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path>
<polyline points="15 3 21 3 21 9"></polyline>
<line x1="10" y1="14" x2="21" y2="3"></line>
</svg>
2022-03-14 07:17:26 +01:00
@if (!$loop->last)
<span>&mdash;</span>
@endif
</div>
@endforeach
2022-03-14 07:17:26 +01:00
@endforeach
@endif
@if($entity instanceof App\Models\Invoice)
@foreach ($entity->task_documents() as $task)
@foreach($task->documents as $document)
<div class="inline-flex items-center space-x-1">
<a href="{{ route('client.documents.download', $document->hashed_id) }}" target="_blank"
class="block text-sm button-link text-primary">{{ Illuminate\Support\Str::limit($document->name, 40) }}</a>
2022-03-11 09:49:51 +01:00
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
class="text-primary h-6 w-4">
<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path>
<polyline points="15 3 21 3 21 9"></polyline>
<line x1="10" y1="14" x2="21" y2="3"></line>
</svg>
2022-03-11 09:49:51 +01:00
@if (!$loop->last)
<span>&mdash;</span>
@endif
</div>
@endforeach
2022-03-11 09:49:51 +01:00
@endforeach
@endif
2021-06-30 20:40:51 +02:00
</div>
</div>
</div>
</div>
@endif