moved folders to common directory
This commit is contained in:
60
resources/views/common/companies/create.blade.php
Normal file
60
resources/views/common/companies/create.blade.php
Normal file
@@ -0,0 +1,60 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', trans('general.title.new', ['type' => trans_choice('general.companies', 1)]))
|
||||
|
||||
@section('content')
|
||||
<!-- Default box -->
|
||||
<div class="box box-success">
|
||||
{!! Form::open(['url' => 'common/companies', 'files' => true, 'role' => 'form']) !!}
|
||||
<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')) }}
|
||||
|
||||
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
|
||||
<div class="box-footer">
|
||||
{{ Form::saveButtons('common/companies') }}
|
||||
</div>
|
||||
<!-- /.box-footer -->
|
||||
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script src="{{ asset('public/js/bootstrap-fancyfile.js') }}"></script>
|
||||
@endpush
|
||||
|
||||
@push('css')
|
||||
<link rel="stylesheet" href="{{ asset('public/css/bootstrap-fancyfile.css') }}">
|
||||
@endpush
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
var text_yes = '{{ trans('general.yes') }}';
|
||||
var text_no = '{{ trans('general.no') }}';
|
||||
|
||||
$(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',
|
||||
placeholder : '{{ trans('general.form.no_file_selected') }}'
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
93
resources/views/common/companies/edit.blade.php
Normal file
93
resources/views/common/companies/edit.blade.php
Normal file
@@ -0,0 +1,93 @@
|
||||
@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',
|
||||
'url' => ['common/companies', $company->id],
|
||||
'files' => true,
|
||||
'role' => 'form'
|
||||
]) !!}
|
||||
|
||||
<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')) }}
|
||||
|
||||
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
|
||||
@permission('update-common-companies')
|
||||
<div class="box-footer">
|
||||
{{ Form::saveButtons('common/companies') }}
|
||||
</div>
|
||||
<!-- /.box-footer -->
|
||||
@endpermission
|
||||
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script src="{{ asset('public/js/bootstrap-fancyfile.js') }}"></script>
|
||||
@endpush
|
||||
|
||||
@push('css')
|
||||
<link rel="stylesheet" href="{{ asset('public/css/bootstrap-fancyfile.css') }}">
|
||||
@endpush
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
var text_yes = '{{ trans('general.yes') }}';
|
||||
var text_no = '{{ trans('general.no') }}';
|
||||
|
||||
$(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',
|
||||
@if($company->company_logo)
|
||||
placeholder : '<?php echo $company->company_logo->basename; ?>'
|
||||
@else
|
||||
placeholder : '{{ trans('general.form.no_file_selected') }}'
|
||||
@endif
|
||||
});
|
||||
|
||||
@if($company->company_logo)
|
||||
attachment_html = '<span class="attachment">';
|
||||
attachment_html += ' <a href="{{ url('uploads/' . $company->company_logo->id . '/download') }}">';
|
||||
attachment_html += ' <span id="download-attachment" class="text-primary">';
|
||||
attachment_html += ' <i class="fa fa-file-{{ $company->company_logo->aggregate_type }}-o"></i> {{ $company->company_logo->basename }}';
|
||||
attachment_html += ' </span>';
|
||||
attachment_html += ' </a>';
|
||||
attachment_html += ' {!! Form::open(['id' => 'attachment-' . $company->company_logo->id, 'method' => 'DELETE', 'url' => [url('uploads/' . $company->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->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') !!}");
|
||||
});
|
||||
@endif
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
90
resources/views/common/companies/index.blade.php
Normal file
90
resources/views/common/companies/index.blade.php
Normal file
@@ -0,0 +1,90 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', trans_choice('general.companies', 2))
|
||||
|
||||
@permission('create-common-companies')
|
||||
@section('new_button')
|
||||
<span class="new-button"><a href="{{ url('common/companies/create') }}" class="btn btn-success btn-sm"><span class="fa fa-plus"></span> {{ trans('general.add_new') }}</a></span>
|
||||
@endsection
|
||||
@endpermission
|
||||
|
||||
@section('content')
|
||||
<!-- Default box -->
|
||||
|
||||
<div class="box box-success">
|
||||
<div class="box-header with-border">
|
||||
{!! Form::open(['url' => 'common/companies', 'role' => 'form', 'method' => 'GET']) !!}
|
||||
<div class="pull-left">
|
||||
<span class="title-filter hidden-xs">{{ trans('general.search') }}:</span>
|
||||
{!! Form::text('search', request('search'), ['class' => 'form-control input-filter input-sm', 'placeholder' => trans('general.search_placeholder')]) !!}
|
||||
{!! Form::button('<span class="fa fa-filter"></span> ' . trans('general.filter'), ['type' => 'submit', 'class' => 'btn btn-sm btn-default btn-filter']) !!}
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<span class="title-filter hidden-xs">{{ trans('general.show') }}:</span>
|
||||
{!! Form::select('limit', $limits, request('limit', setting('general.list_limit', '25')), ['class' => 'form-control input-filter input-sm', 'onchange' => 'this.form.submit()']) !!}
|
||||
</div>
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
|
||||
<div class="box-body">
|
||||
<div class="table table-responsive">
|
||||
<table class="table table-striped table-hover" id="tbl-companies">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-md-1 hidden-xs">@sortablelink('id', trans('general.id'))</th>
|
||||
<th class="col-md-3">@sortablelink('name', trans('general.name'))</th>
|
||||
<th class="col-md-2 hidden-xs">@sortablelink('domain', trans('companies.domain'))</th>
|
||||
<th class="col-md-2 hidden-xs">@sortablelink('email', trans('general.email'))</th>
|
||||
<th class="col-md-2 hidden-xs">@sortablelink('created_at', trans('general.created'))</th>
|
||||
<th class="col-md-1 hidden-xs">@sortablelink('enabled', trans_choice('general.statuses', 1))</th>
|
||||
<th class="col-md-1 text-center">{{ trans('general.actions') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($companies as $item)
|
||||
<tr>
|
||||
<td class="hidden-xs">{{ $item->id }}</td>
|
||||
<td><a href="{{ url('common/companies/' . $item->id . '/edit') }}">{{ $item->company_name }}</a></td>
|
||||
<td class="hidden-xs">{{ $item->domain }}</td>
|
||||
<td class="hidden-xs">{{ $item->company_email }}</td>
|
||||
<td class="hidden-xs">{{ Date::parse($item->created_at)->format($date_format) }}</td>
|
||||
<td class="hidden-xs">
|
||||
@if ($item->enabled)
|
||||
<span class="label label-success">{{ trans('general.enabled') }}</span>
|
||||
@else
|
||||
<span class="label label-danger">{{ trans('general.disabled') }}</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" data-toggle-position="left" aria-expanded="false">
|
||||
<i class="fa fa-ellipsis-h"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-right">
|
||||
@if ($item->enabled)
|
||||
<li><a href="{{ url('common/companies/' . $item->id . '/set') }}">{{ trans('general.switch') }}</a></li>
|
||||
@endif
|
||||
<li><a href="{{ url('common/companies/' . $item->id . '/edit') }}">{{ trans('general.edit') }}</a></li>
|
||||
@permission('delete-common-companies')
|
||||
<li>{!! Form::deleteLink($item, 'common/companies', '', 'company_name') !!}</li>
|
||||
@endpermission
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
|
||||
<div class="box-footer">
|
||||
@include('partials.admin.pagination', ['items' => $companies, 'type' => 'companies'])
|
||||
</div>
|
||||
<!-- /.box-footer -->
|
||||
</div>
|
||||
<!-- /.box -->
|
||||
@endsection
|
||||
|
||||
Reference in New Issue
Block a user