v2 first commit

This commit is contained in:
denisdulici
2019-11-16 10:21:14 +03:00
parent 5b23e9c2c4
commit 6d50fa8442
3075 changed files with 3451681 additions and 65594 deletions

View File

@ -3,62 +3,52 @@
@section('title', trans('general.title.new', ['type' => trans_choice('general.categories', 1)]))
@section('content')
<!-- Default box -->
<div class="box box-success">
{!! Form::open(['url' => 'settings/categories', 'role' => 'form', 'class' => 'form-loading-button']) !!}
<div class="card">
{!! Form::open([
'route' => 'categories.store',
'id' => 'category',
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button',
'novalidate' => true
]) !!}
<div class="box-body">
{{ Form::textGroup('name', trans('general.name'), 'id-card-o') }}
<div class="card-body">
<div class="row">
{{ Form::textGroup('name', trans('general.name'), 'font') }}
{{ Form::selectGroup('type', trans_choice('general.types', 1), 'bars', $types, config('general.types')) }}
{{ Form::selectGroup('type', trans_choice('general.types', 1), 'bars', $types, config('general.types')) }}
@stack('color_input_start')
<div class="form-group col-md-6 required {{ $errors->has('color') ? 'has-error' : ''}}">
{!! Form::label('color', trans('general.color'), ['class' => 'control-label']) !!}
<div id="category-color-picker" class="input-group colorpicker-component">
<div class="input-group-addon"><i></i></div>
{!! Form::text('color', '#00a65a', ['id' => 'color', 'class' => 'form-control', 'required' => 'required']) !!}
@stack('color_input_start')
<div class="form-group col-md-6 required {{ $errors->has('color') ? 'has-error' : ''}}">
{!! Form::label('color', trans('general.color'), ['class' => 'form-control-label']) !!}
<div class="input-group input-group-merge" id="category-color-picker">
<div class="input-group-prepend">
<span class="input-group-text">
<el-color-picker v-model="color" size="mini" :predefine="predefineColors" @change="onChangeColor"></el-color-picker>
</span>
</div>
{!! Form::text('color', '#6DA252', ['v-model' => 'form.color', '@input' => 'onChangeColorInput', 'id' => 'color', 'class' => 'form-control color-hex', 'required' => 'required']) !!}
</div>
{!! $errors->first('color', '<p class="help-block">:message</p>') !!}
</div>
@stack('color_input_end')
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
</div>
{!! $errors->first('color', '<p class="help-block">:message</p>') !!}
</div>
@stack('color_input_end')
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
</div>
<!-- /.box-body -->
<div class="box-footer">
{{ Form::saveButtons('settings/categories') }}
</div>
<!-- /.box-footer -->
<div class="card-footer">
<div class="row float-right">
{{ Form::saveButtons('settings/categories') }}
</div>
</div>
{!! Form::close() !!}
</div>
@endsection
@push('js')
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/colorpicker/bootstrap-colorpicker.js') }}"></script>
@endpush
@push('css')
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/colorpicker/bootstrap-colorpicker.css') }}">
@endpush
@push('scripts')
<script type="text/javascript">
var text_yes = '{{ trans('general.yes') }}';
var text_no = '{{ trans('general.no') }}';
$(document).ready(function(){
$('#enabled_1').trigger('click');
$('#name').focus();
$("#type").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.types', 1)]) }}"
});
$('#category-color-picker').colorpicker();
});
</script>
@push('scripts_start')
<script src="{{ asset('public/js/settings/categories.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -3,70 +3,60 @@
@section('title', trans('general.title.edit', ['type' => trans_choice('general.categories', 1)]))
@section('content')
<!-- Default box -->
<div class="box box-success">
<div class="card">
{!! Form::model($category, [
'id' => 'category',
'method' => 'PATCH',
'url' => ['settings/categories', $category->id],
'route' => ['categories.update', $category->id],
'@submit.prevent' => 'onSubmit',
'@keydown' => 'form.errors.clear($event.target.name)',
'files' => true,
'role' => 'form',
'class' => 'form-loading-button'
'class' => 'form-loading-button',
'novalidate' => true
]) !!}
<div class="box-body">
{{ Form::textGroup('name', trans('general.name'), 'id-card-o') }}
<div class="card-body">
<div class="row">
{{ Form::textGroup('name', trans('general.name'), 'font') }}
@if ($type_disabled)
{{ Form::selectGroup('type', trans_choice('general.types', 1), 'bars', $types, null, ['required' => 'required', 'disabled' => 'disabled']) }}
<input type="hidden" name="type" value="{{ $category->type }}" />
@else
{{ Form::selectGroup('type', trans_choice('general.types', 1), 'bars', $types) }}
@endif
@if ($type_disabled)
{{ Form::selectGroup('type', trans_choice('general.types', 1), 'bars', $types, $category->type, ['required' => 'required', 'disabled' => 'disabled']) }}
<input type="hidden" name="type" value="{{ $category->type }}" />
@else
{{ Form::selectGroup('type', trans_choice('general.types', 1), 'bars', $types, $category->type) }}
@endif
@stack('color_input_start')
<div class="form-group col-md-6 required {{ $errors->has('color') ? 'has-error' : ''}}">
{!! Form::label('color', trans('general.color'), ['class' => 'control-label']) !!}
<div id="category-color-picker" class="input-group colorpicker-component">
<div class="input-group-addon"><i></i></div>
{!! Form::text('color', null, ['id' => 'color', 'class' => 'form-control', 'required' => 'required']) !!}
@stack('color_input_start')
<div class="form-group col-md-6 required {{ $errors->has('color') ? 'has-error' : ''}}">
{!! Form::label('color', trans('general.color'), ['class' => 'form-control-label']) !!}
<div class="input-group input-group-merge" id="category-color-picker">
<div class="input-group-prepend">
<span class="input-group-text">
<el-color-picker v-model="color" size="small" :predefine="predefineColors" @change="onChangeColor"></el-color-picker>
</span>
</div>
{!! Form::text('color', $category->color, ['@input' => 'onChangeColorInput', 'id' => 'color', 'class' => 'form-control color-hex', 'required' => 'required']) !!}
</div>
{!! $errors->first('color', '<p class="help-block">:message</p>') !!}
</div>
@stack('color_input_end')
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
</div>
{!! $errors->first('color', '<p class="help-block">:message</p>') !!}
</div>
@stack('color_input_end')
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
</div>
<!-- /.box-body -->
@permission('update-settings-categories')
<div class="box-footer">
{{ Form::saveButtons('settings/categories') }}
</div>
<!-- /.box-footer -->
@endpermission
@permission('update-settings-categories')
<div class="card-footer">
<div class="row float-right">
{{ Form::saveButtons('settings/categories') }}
</div>
</div>
@endpermission
{!! Form::close() !!}
</div>
@endsection
@push('js')
<script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/colorpicker/bootstrap-colorpicker.js') }}"></script>
@endpush
@push('css')
<link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/colorpicker/bootstrap-colorpicker.css') }}">
@endpush
@push('scripts')
<script type="text/javascript">
var text_yes = '{{ trans('general.yes') }}';
var text_no = '{{ trans('general.no') }}';
$(document).ready(function(){
$("#type").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.types', 1)]) }}"
});
$('#category-color-picker').colorpicker();
});
</script>
@push('scripts_start')
<script src="{{ asset('public/js/settings/categories.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -3,108 +3,92 @@
@section('title', trans_choice('general.categories', 2))
@permission('create-settings-categories')
@section('new_button')
<span class="new-button"><a href="{{ url('settings/categories/create') }}" class="btn btn-success btn-sm"><span class="fa fa-plus"></span> &nbsp;{{ trans('general.add_new') }}</a></span>
@endsection
@section('new_button')
<span><a href="{{ route('categories.create') }}" class="btn btn-success btn-sm btn-alone"><span class="fa fa-plus"></span> &nbsp;{{ 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' => 'settings/categories', 'role' => 'form', 'method' => 'GET']) !!}
<div id="items" class="pull-left box-filter">
<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::select('types[]', $types, request('types'), ['id' => 'filter-types', 'class' => 'form-control input-filter input-lg', 'multiple' => 'multiple']) !!}
{!! Form::button('<span class="fa fa-filter"></span> &nbsp;' . 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="card">
<div class="card-header border-bottom-0" v-bind:class="[bulk_action.show ? 'bg-gradient-primary' : '']">
{!! Form::open([
'url' => 'settings/categories',
'role' => 'form',
'method' => 'GET',
'class' => 'mb-0'
]) !!}
<div class="row" v-if="!bulk_action.show">
<div class="col-12">
<span class="table-text hidden-lg">{{ trans('general.search') }}:</span>
<akaunting-search></akaunting-search>
</div>
</div>
<div class="box-body">
<div class="table table-responsive">
<table class="table table-striped table-hover" id="tbl-categories">
<thead>
<tr>
<th class="col-md-5">@sortablelink('name', trans('general.name'))</th>
<th class="col-md-3">@sortablelink('type', trans_choice('general.types', 1))</th>
<th class="col-md-2 hidden-xs">{{ trans('general.color') }}</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>
{{ Form::bulkActionRowGroup('general.categories', $bulk_actions, 'settings/categories') }}
{!! Form::close() !!}
</div>
<div class="table-responsive">
<table class="table table-flush table-hover">
<thead class="thead-light">
<tr class="row table-head-line">
<th class="col-sm-2 col-md-2 col-lg-1 hidden-sm">{{ Form::bulkActionAllGroup() }}</th>
<th class="col-xs-4 col-sm-3 col-md-2 col-lg-4">@sortablelink('name', trans('general.name'), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])</th>
<th class="col-sm-2 col-md-2 col-lg-2 hidden-sm">@sortablelink('type', trans_choice('general.types', 1))</th>
<th class="col-md-2 col-lg-2 hidden-md">{{ trans('general.color') }}</th>
<th class="col-xs-4 col-sm-3 col-md-2 col-lg-2">@sortablelink('enabled', trans('general.enabled'))</th>
<th class="col-xs-4 col-sm-2 col-md-2 col-lg-1 text-center">{{ trans('general.actions') }}</th>
</tr>
</thead>
<tbody>
@foreach($categories as $item)
<tr>
<td>
@if (($item->type == 'income') && $auth_user->can('read-reports-income-summary'))
<a href="{{ url('reports/income-summary?categories[]=' . $item->id) }}">{{ $item->name }}</a>
@elseif (($item->type == 'expense') && $auth_user->can('read-reports-expense-summary'))
<a href="{{ url('reports/expense-summary?categories[]=' . $item->id) }}">{{ $item->name }}</a>
@elseif (($item->type == 'item') && $auth_user->can('read-common-items'))
<a href="{{ url('common/items?categories[]=' . $item->id) }}">{{ $item->name }}</a>
@else
<a href="{{ url('settings/categories/' . $item->id . '/edit') }}">{{ $item->name }}</a>
@endif
</td>
<td>{{ $types[$item->type] }}</td>
<td class="hidden-xs"><i class="fa fa-2x fa-circle" style="color:{{ $item->color }};"></i></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">
<li><a href="{{ url('settings/categories/' . $item->id . '/edit') }}">{{ trans('general.edit') }}</a></li>
@foreach($categories as $item)
<tr class="row align-items-center border-top-1">
<td class="col-sm-2 col-md-2 col-lg-1 hidden-sm">{{ Form::bulkActionGroup($item->id, $item->name) }}</td>
<td class="col-xs-4 col-sm-3 col-md-2 col-lg-4"><a class="col-aka text-success " href="{{ route('categories.edit', $item->id) }}">{{ $item->name }}</a></td>
<td class="col-sm-2 col-md-2 col-lg-2 hidden-sm">{{ $types[$item->type] }}</td>
<td class="col-md-2 col-lg-2 hidden-md"><i class="fa fa-2x fa-circle" style="color:{{ $item->color }};"></i></td>
<td class="col-xs-4 col-sm-3 col-md-2 col-lg-2">
@if (user()->can('update-settings-categories'))
{{ Form::enabledGroup($item->id, $item->name, $item->enabled) }}
@else
@if ($item->enabled)
<li><a href="{{ route('categories.disable', $item->id) }}">{{ trans('general.disable') }}</a></li>
<badge rounded type="success">{{ trans('general.enabled') }}</badge>
@else
<li><a href="{{ route('categories.enable', $item->id) }}">{{ trans('general.enable') }}</a></li>
<badge rounded type="danger">{{ trans('general.disabled') }}</badge>
@endif
@if ($item->id != $transfer_id)
@permission('delete-settings-categories')
<li class="divider"></li>
<li>{!! Form::deleteLink($item, 'settings/categories') !!}</li>
@endpermission
@endif
</ul>
</div>
</td>
</tr>
@endforeach
@endif
</td>
<td class="col-xs-4 col-sm-2 col-md-2 col-lg-1 text-center">
<div class="dropdown">
<a class="btn btn-neutral btn-sm text-light items-align-center py-2" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-ellipsis-h text-muted"></i>
</a>
<div class="dropdown-menu dropdown-menu-right dropdown-menu-arrow">
<a class="dropdown-item" href="{{ route('categories.edit', $item->id) }}">{{ trans('general.edit') }}</a>
@if ($item->id != $transfer_id)
@permission('delete-settings-categories')
<div class="dropdown-divider"></div>
{!! Form::deleteLink($item, 'settings/categories') !!}
@endpermission
@endif
</div>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
<!-- /.box-body -->
<div class="box-footer">
@include('partials.admin.pagination', ['items' => $categories, 'type' => 'categories'])
<div class="card-footer table-action">
<div class="row">
@include('partials.admin.pagination', ['items' => $categories, 'type' => 'categories'])
</div>
</div>
</div>
<!-- /.box-footer -->
</div>
<!-- /.box -->
@endsection
@push('scripts')
<script type="text/javascript">
$(document).ready(function(){
$("#filter-types").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.types', 1)]) }}"
});
});
</script>
@push('scripts_start')
<script src="{{ asset('public/js/settings/categories.js?v=' . version('short')) }}"></script>
@endpush