2017-09-14 22:21:00 +03:00
|
|
|
@extends('layouts.admin')
|
|
|
|
|
|
|
|
@section('title', trans('general.title.edit', ['type' => trans_choice('general.companies', 1)]))
|
|
|
|
|
|
|
|
@section('content')
|
|
|
|
<!-- Default box -->
|
|
|
|
<div class="box box-success">
|
|
|
|
{!! Form::model($company, [
|
|
|
|
'method' => 'PATCH',
|
2018-06-10 02:48:51 +03:00
|
|
|
'url' => ['common/companies', $company->id],
|
2017-09-14 22:21:00 +03:00
|
|
|
'files' => true,
|
2018-09-17 13:57:03 +03:00
|
|
|
'role' => 'form',
|
|
|
|
'class' => 'form-loading-button'
|
2017-09-14 22:21:00 +03:00
|
|
|
]) !!}
|
|
|
|
|
|
|
|
<div class="box-body">
|
|
|
|
{{ Form::textGroup('company_name', trans('general.name'), 'id-card-o') }}
|
|
|
|
|
|
|
|
{{ Form::textGroup('domain', trans('companies.domain'), 'globe') }}
|
|
|
|
|
|
|
|
{{ Form::emailGroup('company_email', trans('general.email'), 'envelope') }}
|
|
|
|
|
|
|
|
{{ Form::selectGroup('default_currency', trans_choice('general.currencies', 1), 'money', $currencies) }}
|
|
|
|
|
|
|
|
{{ Form::textareaGroup('company_address', trans('general.address')) }}
|
|
|
|
|
|
|
|
{{ Form::fileGroup('company_logo', trans('companies.logo')) }}
|
2017-10-07 23:52:34 +03:00
|
|
|
|
|
|
|
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
|
2017-09-14 22:21:00 +03:00
|
|
|
</div>
|
|
|
|
<!-- /.box-body -->
|
|
|
|
|
2018-06-10 02:48:51 +03:00
|
|
|
@permission('update-common-companies')
|
2017-09-14 22:21:00 +03:00
|
|
|
<div class="box-footer">
|
2018-06-10 02:48:51 +03:00
|
|
|
{{ Form::saveButtons('common/companies') }}
|
2017-09-14 22:21:00 +03:00
|
|
|
</div>
|
|
|
|
<!-- /.box-footer -->
|
|
|
|
@endpermission
|
|
|
|
|
|
|
|
{!! Form::close() !!}
|
|
|
|
</div>
|
|
|
|
@endsection
|
|
|
|
|
2017-11-13 21:55:15 +03:00
|
|
|
@push('js')
|
2017-09-14 22:21:00 +03:00
|
|
|
<script src="{{ asset('public/js/bootstrap-fancyfile.js') }}"></script>
|
2017-11-13 21:55:15 +03:00
|
|
|
@endpush
|
2017-09-14 22:21:00 +03:00
|
|
|
|
2017-11-13 21:55:15 +03:00
|
|
|
@push('css')
|
2017-09-14 22:21:00 +03:00
|
|
|
<link rel="stylesheet" href="{{ asset('public/css/bootstrap-fancyfile.css') }}">
|
2017-11-13 21:55:15 +03:00
|
|
|
@endpush
|
2017-09-14 22:21:00 +03:00
|
|
|
|
2017-11-13 21:55:15 +03:00
|
|
|
@push('scripts')
|
2017-09-14 22:21:00 +03:00
|
|
|
<script type="text/javascript">
|
2017-10-07 23:52:34 +03:00
|
|
|
var text_yes = '{{ trans('general.yes') }}';
|
|
|
|
var text_no = '{{ trans('general.no') }}';
|
|
|
|
|
2017-09-14 22:21:00 +03:00
|
|
|
$(document).ready(function(){
|
|
|
|
$("#default_currency").select2({
|
|
|
|
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.currencies', 1)]) }}"
|
|
|
|
});
|
|
|
|
|
|
|
|
$('#company_logo').fancyfile({
|
|
|
|
text : '{{ trans('general.form.select.file') }}',
|
|
|
|
style : 'btn-default',
|
2018-01-03 17:54:02 +03:00
|
|
|
@if($company->company_logo)
|
2019-02-02 14:02:26 +03:00
|
|
|
placeholder : '{{ $company->company_logo->basename }}'
|
2018-01-03 14:02:27 +03:00
|
|
|
@else
|
|
|
|
placeholder : '{{ trans('general.form.no_file_selected') }}'
|
2018-01-02 19:00:07 +03:00
|
|
|
@endif
|
2017-09-14 22:21:00 +03:00
|
|
|
});
|
2018-01-02 19:00:07 +03:00
|
|
|
|
2018-01-03 17:54:02 +03:00
|
|
|
@if($company->company_logo)
|
2019-02-02 14:02:26 +03:00
|
|
|
$.ajax({
|
|
|
|
url: '{{ url('uploads/' . $company->company_logo->id . '/show') }}',
|
|
|
|
type: 'GET',
|
|
|
|
data: {column_name: 'attachment'},
|
|
|
|
dataType: 'JSON',
|
|
|
|
success: function(json) {
|
|
|
|
if (json['success']) {
|
|
|
|
$('.fancy-file').after(json['html']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
@permission('delete-common-uploads')
|
|
|
|
$(document).on('click', '#remove-attachment', function (e) {
|
|
|
|
confirmDelete("#attachment-{!! $company->company_logo->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $company->company_logo->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
|
|
|
|
});
|
|
|
|
@endpermission
|
2018-01-02 19:00:07 +03:00
|
|
|
@endif
|
2017-09-14 22:21:00 +03:00
|
|
|
});
|
|
|
|
</script>
|
2017-11-13 21:55:15 +03:00
|
|
|
@endpush
|