Merge pull request #6173 from beganovich/v5-3006-show-attachments-on-entities

Show attachments on entities
This commit is contained in:
Benjamin Beganović 2021-06-30 20:42:09 +02:00 committed by GitHub
commit 24a6c55240
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 42 additions and 32 deletions

View File

@ -0,0 +1,29 @@
@if($entity->documents->count() > 0)
<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>
@foreach($entity->documents as $document)
<div class="inline-flex items-center space-x-1">
<a href="{{ route('client.documents.show', $document->hashed_id) }}" target="_blank"
class="block text-sm button-link text-primary">{{ Illuminate\Support\Str::limit($document->name, 40) }}</a>
<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)
<span>&mdash;</span>
@endif
</div>
@endforeach
</div>
</div>
</div>
</div>
@endif

View File

@ -7,6 +7,8 @@
@endpush
@section('body')
@include('portal.ninja2020.components.entity-documents', ['entity' => $credit])
<div class="flex items-center justify-between">
<section class="flex items-center">
<div class="items-center" style="display: none" id="pagination-button-container">

View File

@ -70,35 +70,7 @@
</div>
@endif
@if($invoice->documents->count() > 0)
<div class="bg-white shadow sm:rounded-lg mb-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>
@foreach($invoice->documents as $document)
<div class="inline-flex items-center space-x-1">
<a href="{{ route('client.documents.show', $document->hashed_id) }}" target="_blank"
class="block text-sm button-link text-primary">{{ Illuminate\Support\Str::limit($document->name, 40) }}</a>
<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)
<span>&mdash;</span>
@endif
</div>
@endforeach
</div>
</div>
</div>
</div>
@endif
@include('portal.ninja2020.components.entity-documents', ['entity' => $invoice])
<div class="flex items-center justify-between mt-4">
<section class="flex items-center">

View File

@ -25,15 +25,19 @@
</div>
@endif
@include('portal.ninja2020.components.entity-documents', ['entity' => $quote])
<div class="flex items-center justify-between mt-4">
<section class="flex items-center">
<div class="items-center" style="display: none" id="pagination-button-container">
<button class="input-label focus:outline-none hover:text-blue-600 transition ease-in-out duration-300" id="previous-page-button" title="Previous page">
<button class="input-label focus:outline-none hover:text-blue-600 transition ease-in-out duration-300"
id="previous-page-button" title="Previous page">
<svg class="w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7"/>
</svg>
</button>
<button class="input-label focus:outline-none hover:text-blue-600 transition ease-in-out duration-300" id="next-page-button" title="Next page">
<button class="input-label focus:outline-none hover:text-blue-600 transition ease-in-out duration-300"
id="next-page-button" title="Next page">
<svg class="w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"/>
</svg>

View File

@ -59,12 +59,15 @@
</div>
</div>
@include('portal.ninja2020.components.entity-documents', ['entity' => $invoice])
@if($invoice->auto_bill === 'optin' || $invoice->auto_bill === 'optout')
<div class="bg-white shadow overflow-hidden lg:rounded-lg mt-4">
<div class="flex flex-col md:flex-row items-start justify-between px-4 py-5 sm:p-6">
<div>
<h3 class="text-lg leading-6 font-medium text-gray-900">Auto Bill</h3>
<p class="mt-1 max-w-2xl text-sm leading-5 text-gray-500">Change your update bill preferences.</p>
<p class="mt-1 max-w-2xl text-sm leading-5 text-gray-500">Change your update bill
preferences.</p>
</div>
<div class="flex mt-4 space-x-2">