Attachment file update

This commit is contained in:
cuneytsenturk
2017-12-29 19:56:56 +03:00
parent 94b7e9ec64
commit 3e04f1295b
7 changed files with 66 additions and 5 deletions

View File

@@ -180,8 +180,23 @@
</div>
@if($invoice->attachment)
<span>
<a href=""><i class="fa fa-file-{{ $invoice->attachment->aggregate_type }}-o"></i> {{ $invoice->attachment->basename }}</a> <i class="fa fa fa-times"></i>
<span class="attachment">
<a href="{{ url('uploads/invoices/' . $invoice->attachment->basename . '/download') }}">
<span id="download-attachment" class="text-primary">
<i class="fa fa-file-{{ $invoice->attachment->aggregate_type }}-o"></i> {{ $invoice->attachment->basename }}
</span>
</a>
{!! Form::open([
'id' => 'attachment-' . $invoice->attachment->id,
'method' => 'DELETE',
'url' => [url('uploads/invoices/' . $invoice->attachment->id)],
'style' => 'display:inline'
]) !!}
{{ Form::hidden('id', $invoice->id) }}
<a id="remove-attachment" href="javascript:void();">
<span class="text-danger"><i class="fa fa fa-times"></i></span>
</a>
{!! Form::close() !!}
</span>
@endif
</div>
@@ -420,6 +435,11 @@
$('#email-modal').modal('show');
});
@if($invoice->attachment)
$(document).on('click', '#remove-attachment', function (e) {
confirmDelete("#attachment-{!! $invoice->attachment->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $invoice->attachment->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
});
@endif
});
function addPayment() {