Company logo added media manager

This commit is contained in:
cuneytsenturk
2018-01-02 19:00:07 +03:00
parent 675b1ba42a
commit e3b736d3e8
4 changed files with 67 additions and 9 deletions

View File

@ -61,8 +61,31 @@
$('#company_logo').fancyfile({
text : '{{ trans('general.form.select.file') }}',
style : 'btn-default',
placeholder : '<?php echo $company->company_logo; ?>'
@if($company->logo)
placeholder : '<?php echo $company->logo->basename; ?>'
@endif
});
@if($company->logo)
attachment_html = '<span class="attachment">';
attachment_html += ' <a href="{{ url('uploads/' . $company->logo->id . '/download') }}">';
attachment_html += ' <span id="download-attachment" class="text-primary">';
attachment_html += ' <i class="fa fa-file-{{ $company->logo->aggregate_type }}-o"></i> {{ $company->logo->basename }}';
attachment_html += ' </span>';
attachment_html += ' </a>';
attachment_html += ' {!! Form::open(['id' => 'attachment-' . $company->logo->id, 'method' => 'DELETE', 'url' => [url('uploads/' . $company->logo->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-{!! $company->logo->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $company->logo->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
});
@endif
});
</script>
@endpush