Other file added

This commit is contained in:
cuneytsenturk
2018-01-02 18:20:52 +03:00
parent dd686409ef
commit 675b1ba42a
11 changed files with 181 additions and 10 deletions

View File

@@ -92,9 +92,32 @@
$('#attachment').fancyfile({
text : '{{ trans('general.form.select.file') }}',
style : 'btn-default',
placeholder : '<?php echo ($payment->attachment) ? $payment->attachment : trans('general.form.no_file_selected'); ?>'
@if($payment->attachment)
placeholder : '<?php echo $payment->attachment->basename; ?>'
@endif
});
@if($payment->attachment)
attachment_html = '<span class="attachment">';
attachment_html += ' <a href="{{ url('uploads/' . $payment->attachment->id . '/download') }}">';
attachment_html += ' <span id="download-attachment" class="text-primary">';
attachment_html += ' <i class="fa fa-file-{{ $payment->attachment->aggregate_type }}-o"></i> {{ $payment->attachment->basename }}';
attachment_html += ' </span>';
attachment_html += ' </a>';
attachment_html += ' {!! Form::open(['id' => 'attachment-' . $payment->attachment->id, 'method' => 'DELETE', 'url' => [url('uploads/' . $payment->attachment->id)], 'style' => 'display:inline']) !!}';
attachment_html += ' <a id="remove-attachment" href="javascript:void();">';
attachment_html += ' <span class="text-danger"><i class="fa fa fa-times"></i></span>';
attachment_html += ' </a>';
attachment_html += ' {!! Form::close() !!}';
attachment_html += '</span>';
$('.fancy-file .fake-file').append(attachment_html);
$(document).on('click', '#remove-attachment', function (e) {
confirmDelete("#attachment-{!! $payment->attachment->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $payment->attachment->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
});
@endif
$(document).on('change', '#account_id', function (e) {
$.ajax({
url: '{{ url("settings/currencies/currency") }}',