Add User, Companies, Settings picture media manager

This commit is contained in:
cuneytsenturk
2018-01-03 14:02:27 +03:00
parent e3b736d3e8
commit 43619d1db4
20 changed files with 205 additions and 47 deletions

View File

@ -71,9 +71,34 @@
$('#picture').fancyfile({
text : '{{ trans('general.form.select.file') }}',
style : 'btn-default',
placeholder : '<?php echo $user->picture; ?>'
@if($user->picture)
placeholder : '<?php echo $user->picture->basename; ?>'
@else
placeholder : '{{ trans('general.form.no_file_selected') }}'
@endif
});
@if($user->picture)
picture_html = '<span class="picture">';
picture_html += ' <a href="{{ url('uploads/' . $user->picture->id . '/download') }}">';
picture_html += ' <span id="download-picture" class="text-primary">';
picture_html += ' <i class="fa fa-file-{{ $user->picture->aggregate_type }}-o"></i> {{ $user->picture->basename }}';
picture_html += ' </span>';
picture_html += ' </a>';
picture_html += ' {!! Form::open(['id' => 'picture-' . $user->picture->id, 'method' => 'DELETE', 'url' => [url('uploads/' . $user->picture->id)], 'style' => 'display:inline']) !!}';
picture_html += ' <a id="remove-picture" href="javascript:void();">';
picture_html += ' <span class="text-danger"><i class="fa fa fa-times"></i></span>';
picture_html += ' </a>';
picture_html += ' {!! Form::close() !!}';
picture_html += '</span>';
$('.fancy-file .fake-file').append(picture_html);
$(document).on('click', '#remove-picture', function (e) {
confirmDelete("#picture-{!! $user->picture->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $user->picture->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
});
@endif
$('input[type=checkbox]').iCheck({
checkboxClass: 'icheckbox_square-green',
radioClass: 'iradio_square-green',