mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Add shareable links to client portal
This commit is contained in:
parent
76c940ae9a
commit
7378043ce3
@ -30,9 +30,12 @@ class CreditController extends Controller
|
||||
{
|
||||
set_time_limit(0);
|
||||
|
||||
$data = ['credit' => $credit];
|
||||
$invitation = $credit->invitations()->where('client_contact_id', auth()->user()->id)->first();
|
||||
|
||||
$invitation = $credit->invitations()->where('client_contact_id', auth()->user()->id)->first();
|
||||
$data = [
|
||||
'credit' => $credit,
|
||||
'key' => $invitation->key
|
||||
];
|
||||
|
||||
if ($invitation && auth()->guard('contact') && ! request()->has('silent') && ! $invitation->viewed_date) {
|
||||
|
||||
|
@ -58,12 +58,14 @@ class QuoteController extends Controller
|
||||
{
|
||||
/* If the quote is expired, convert the status here */
|
||||
|
||||
$data = [
|
||||
'quote' => $quote,
|
||||
];
|
||||
|
||||
$invitation = $quote->invitations()->where('client_contact_id', auth()->user()->id)->first();
|
||||
|
||||
$data = [
|
||||
'quote' => $quote,
|
||||
'key' => $invitation->key,
|
||||
];
|
||||
|
||||
if ($invitation && auth()->guard('contact') && ! request()->has('silent') && ! $invitation->viewed_date) {
|
||||
|
||||
$invitation->markViewed();
|
||||
|
@ -1,5 +1,5 @@
|
||||
@extends('portal.ninja2020.layout.app')
|
||||
@section('meta_title', ctrans('texts.entity_number_placeholder', ['entity' => ctrans('texts.credit'), 'entity_number' => $credit->number]))
|
||||
@section('meta_title', ctrans('texts.view_credit'))
|
||||
|
||||
@push('head')
|
||||
<meta name="pdf-url" content="{{ $credit->pdf_file_path(null, 'url', true) }}">
|
||||
@ -9,15 +9,52 @@
|
||||
@endpush
|
||||
|
||||
@section('body')
|
||||
<div class="bg-white shadow sm:rounded-lg mb-4" translate>
|
||||
<div class="px-4 py-5 sm:p-6">
|
||||
<div class="sm:flex sm:items-start sm:justify-between">
|
||||
<div>
|
||||
<h3 class="text-lg leading-6 font-medium text-gray-900">
|
||||
{{ ctrans('texts.entity_number_placeholder', ['entity' => ctrans('texts.credit'), 'entity_number' => $credit->number]) }}
|
||||
</h3>
|
||||
|
||||
<div class="btn" data-clipboard-text="{{url("client/credit/{$key}")}}" aria-label="Copied!">
|
||||
<div class="flex text-sm leading-6 font-medium text-gray-500">
|
||||
<p class="mr-2">{{url("client/credit/{$key}")}}</p>
|
||||
<p><img class="h-5 w-5" src="{{ asset('assets/clippy.svg') }}" alt="Copy to clipboard"></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('portal.ninja2020.components.entity-documents', ['entity' => $credit])
|
||||
|
||||
@include('portal.ninja2020.components.pdf-viewer', ['entity' => $credit])
|
||||
|
||||
<div class="flex justify-center">
|
||||
<canvas id="pdf-placeholder" class="shadow rounded-lg bg-white lg:hidden mt-4 p-4"></canvas>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@section('footer')
|
||||
<script src="{{ asset('js/clients/shared/pdf.js') }}"></script>
|
||||
<script src="{{ asset('vendor/clipboard.min.js') }}"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
var clipboard = new ClipboardJS('.btn');
|
||||
|
||||
// clipboard.on('success', function(e) {
|
||||
// console.info('Action:', e.action);
|
||||
// console.info('Text:', e.text);
|
||||
// console.info('Trigger:', e.trigger);
|
||||
|
||||
// e.clearSelection();
|
||||
// });
|
||||
|
||||
// clipboard.on('error', function(e) {
|
||||
// console.error('Action:', e.action);
|
||||
// console.error('Trigger:', e.trigger);
|
||||
// });
|
||||
|
||||
</script>
|
||||
@endsection
|
||||
|
@ -7,7 +7,6 @@
|
||||
@include('portal.ninja2020.components.no-cache')
|
||||
|
||||
<script src="{{ asset('vendor/signature_pad@2.3.2/signature_pad.min.js') }}"></script>
|
||||
<script src="{{ asset('vendor/clipboard.min.js') }}"></script>
|
||||
|
||||
@endpush
|
||||
|
||||
@ -43,7 +42,7 @@
|
||||
|
||||
<div class="btn" data-clipboard-text="{{url("client/invoice/{$key}")}}" aria-label="Copied!">
|
||||
<div class="flex text-sm leading-6 font-medium text-gray-500">
|
||||
<p class="pr-10">{{url("client/invoice/{$key}")}}</p>
|
||||
<p class="mr-2">{{url("client/invoice/{$key}")}}</p>
|
||||
<p><img class="h-5 w-5" src="{{ asset('assets/clippy.svg') }}" alt="Copy to clipboard"></p>
|
||||
</div>
|
||||
</div>
|
||||
@ -74,6 +73,13 @@
|
||||
{{ ctrans('texts.invoice_number_placeholder', ['invoice' => $invoice->number])}}
|
||||
- {{ \App\Models\Invoice::stringStatus($invoice->status_id) }}
|
||||
</h3>
|
||||
|
||||
<div class="btn" data-clipboard-text="{{url("client/invoice/{$key}")}}" aria-label="Copied!">
|
||||
<div class="flex text-sm leading-6 font-medium text-gray-500">
|
||||
<p class="pr-10">{{url("client/invoice/{$key}")}}</p>
|
||||
<p><img class="h-5 w-5" src="{{ asset('assets/clippy.svg') }}" alt="Copy to clipboard"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -88,6 +94,8 @@
|
||||
|
||||
@section('footer')
|
||||
<script src="{{ asset('js/clients/invoices/payment.js') }}"></script>
|
||||
<script src="{{ asset('vendor/clipboard.min.js') }}"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
var clipboard = new ClipboardJS('.btn');
|
||||
|
@ -9,9 +9,20 @@
|
||||
<div class="bg-white shadow sm:rounded-lg">
|
||||
<div class="px-4 py-5 sm:p-6">
|
||||
<div class="sm:flex sm:items-start sm:justify-between">
|
||||
<h3 class="text-lg leading-6 font-medium text-gray-900">
|
||||
{{ ctrans('texts.approve') }}
|
||||
</h3>
|
||||
<div>
|
||||
|
||||
<h3 class="text-lg leading-6 font-medium text-gray-900">
|
||||
{{ ctrans('texts.approve') }}
|
||||
</h3>
|
||||
|
||||
<div class="btn" data-clipboard-text="{{url("client/quote/{$key}")}}" aria-label="Copied!">
|
||||
<div class="flex text-sm leading-6 font-medium text-gray-500">
|
||||
<p class="mr-2">{{url("client/quote/{$key}")}}</p>
|
||||
<p><img class="h-5 w-5" src="{{ asset('assets/clippy.svg') }}" alt="Copy to clipboard"></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="mt-5 sm:mt-0 sm:ml-6 sm:flex-shrink-0 sm:flex sm:items-center">
|
||||
@yield('quote-not-approved-right-side')
|
||||
|
@ -25,8 +25,67 @@
|
||||
<div class="mb-4">
|
||||
@include('portal.ninja2020.quotes.includes.actions', ['quote' => $quote])
|
||||
</div>
|
||||
@elseif($quote->status_id === \App\Models\Quote::STATUS_CONVERTED)
|
||||
|
||||
<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>
|
||||
<h3 class="text-lg leading-6 font-medium text-gray-900">
|
||||
{{ ctrans('texts.approved') }}
|
||||
</h3>
|
||||
|
||||
<div class="btn" data-clipboard-text="{{url("client/quote/{$key}")}}" aria-label="Copied!">
|
||||
<div class="flex text-sm leading-6 font-medium text-gray-500">
|
||||
<p class="mr-2">{{url("client/quote/{$key}")}}</p>
|
||||
<p><img class="h-5 w-5" src="{{ asset('assets/clippy.svg') }}" alt="Copy to clipboard"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@elseif($quote->status_id === \App\Models\Quote::STATUS_APPROVED)
|
||||
<p class="text-right text-gray-900 text-sm mb-4">{{ ctrans('texts.approved') }}</p>
|
||||
|
||||
<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>
|
||||
<h3 class="text-lg leading-6 font-medium text-gray-900">
|
||||
{{ ctrans('texts.approved') }}
|
||||
</h3>
|
||||
|
||||
<div class="btn" data-clipboard-text="{{url("client/quote/{$key}")}}" aria-label="Copied!">
|
||||
<div class="flex text-sm leading-6 font-medium text-gray-500">
|
||||
<p class="mr-2">{{url("client/quote/{$key}")}}</p>
|
||||
<p><img class="h-5 w-5" src="{{ asset('assets/clippy.svg') }}" alt="Copy to clipboard"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
|
||||
<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>
|
||||
<h3 class="text-lg leading-6 font-medium text-gray-900">
|
||||
{{ ctrans('texts.expired') }}
|
||||
</h3>
|
||||
|
||||
<div class="btn" data-clipboard-text="{{url("client/quote/{$key}")}}" aria-label="Copied!">
|
||||
<div class="flex text-sm leading-6 font-medium text-gray-500">
|
||||
<p class="mr-2">{{url("client/quote/{$key}")}}</p>
|
||||
<p><img class="h-5 w-5" src="{{ asset('assets/clippy.svg') }}" alt="Copy to clipboard"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@include('portal.ninja2020.components.entity-documents', ['entity' => $quote])
|
||||
@ -37,4 +96,24 @@
|
||||
|
||||
@section('footer')
|
||||
<script src="{{ asset('js/clients/quotes/approve.js') }}"></script>
|
||||
<script src="{{ asset('vendor/clipboard.min.js') }}"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
var clipboard = new ClipboardJS('.btn');
|
||||
|
||||
// clipboard.on('success', function(e) {
|
||||
// console.info('Action:', e.action);
|
||||
// console.info('Text:', e.text);
|
||||
// console.info('Trigger:', e.trigger);
|
||||
|
||||
// e.clearSelection();
|
||||
// });
|
||||
|
||||
// clipboard.on('error', function(e) {
|
||||
// console.error('Action:', e.action);
|
||||
// console.error('Trigger:', e.trigger);
|
||||
// });
|
||||
|
||||
</script>
|
||||
@endsection
|
||||
|
Loading…
x
Reference in New Issue
Block a user