47 lines
2.3 KiB
PHP
Raw Normal View History

@php
2019-11-16 10:21:14 +03:00
$column_name = !empty($column_name) ? $column_name : 'attachment';
$options = !empty($options) ? $options : false;
@endphp
2020-02-07 13:03:51 +03:00
<div class="card mb-0">
<div class="card-body">
<div class="row align-items-center">
<div class="col-auto">
@if ($file->aggregate_type != 'image')
2020-02-12 18:06:11 +03:00
<i class="fas fa-file-image display-3"></i>
2020-02-07 13:03:51 +03:00
@else
<a href="#" class="avatar">
2020-08-11 16:52:10 +03:00
<img src="{{ route('uploads.get', $file->id) }}" alt="{{ $file->basename }}">
2020-02-07 13:03:51 +03:00
</a>
@endif
</div>
2020-02-07 13:03:51 +03:00
<div class="col ml--2 long-texts">
<h4 class="mb-0">
<span><i class="fas fa-paperclip"></i></span>
<span>{{ $file->basename }}</span>
</h4>
2019-02-02 11:15:24 +03:00
2020-02-07 13:03:51 +03:00
<small>{{ $file->readableSize() }}</small>
</div>
2019-02-02 11:15:24 +03:00
2020-02-07 13:03:51 +03:00
<div class="col-auto">
@permission('delete-common-uploads')
<a href="javascript:void();" id="remove-{{ $column_name }}" @click="onDeleteFile('{{ $file->id }}', '{{ route('uploads.destroy', $file->id) }}', '{{ trans('general.title.delete', ['type' => $column_name]) }}', '{{ trans('general.delete_confirm', ['name' => $file->basename, 'type' => $column_name]) }} ', '{{ trans('general.cancel') }}', '{{ trans('general.delete') }}')" type="button" class="btn btn-sm btn-danger text-white header-button-top">
<i class="fas fa-times"></i>
</a>
@if ($options)
<input type="hidden" name="page_{{ $file->id}}" id="file-page-{{ $file->id}}" value="{{ $options['page'] }}" />
<input type="hidden" name="key_{{ $file->id}}" id="file-key-{{ $file->id}}" value="{{ $options['key'] }}" />
<input type="hidden" name="value_{{ $file->id}}" id="file-value-{{ $file->id}}" value="{{ $file->id }}" />
@endif
2020-02-07 13:03:51 +03:00
@endpermission
2019-02-02 11:15:24 +03:00
2020-08-11 16:52:10 +03:00
<a href="{{ rotue('uploads.download', $file->id) }}" type="button" class="btn btn-sm btn-info text-white header-button-top">
2020-02-07 13:03:51 +03:00
<i class="fas fa-file-download"></i>
2019-02-02 11:15:24 +03:00
</a>
2020-02-07 13:03:51 +03:00
</div>
2019-02-02 11:15:24 +03:00
</div>
2020-02-07 13:03:51 +03:00
</div>
</div>