first commit

This commit is contained in:
denisdulici
2017-09-14 22:21:00 +03:00
commit 515bdaf5cd
598 changed files with 48030 additions and 0 deletions

View File

@@ -0,0 +1,75 @@
@extends('layouts.admin')
@section('title', trans('general.title.new', ['type' => trans_choice('general.items', 1)]))
@section('content')
<!-- Default box -->
<div class="box box-success">
{!! Form::open(['url' => 'items/items', 'files' => true, 'role' => 'form']) !!}
<div class="box-body">
{{ Form::textGroup('name', trans('general.name'), 'id-card-o') }}
{{ Form::textGroup('sku', trans('items.sku'), 'key') }}
{{ Form::textareaGroup('description', trans('general.description')) }}
{{ Form::textGroup('sale_price', trans('items.sales_price'), 'money') }}
{{ Form::textGroup('purchase_price', trans('items.purchase_price'), 'money') }}
{{ Form::textGroup('quantity', trans_choice('items.quantities', 1), 'cubes', ['required' => 'required'], '1') }}
{{ Form::selectGroup('tax_id', trans_choice('general.taxes', 1), 'percent', $taxes, setting('general.default_tax', '')) }}
{{ Form::selectGroup('category_id', trans_choice('general.categories', 1), 'folder-open-o', $categories) }}
{{ Form::fileGroup('picture', trans_choice('general.pictures', 1)) }}
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
</div>
<!-- /.box-body -->
<div class="box-footer">
{{ Form::saveButtons('items/items') }}
</div>
<!-- /.box-footer -->
{!! Form::close() !!}
</div>
@endsection
@section('js')
<script src="{{ asset('public/js/bootstrap-fancyfile.js') }}"></script>
@endsection
@section('css')
<link rel="stylesheet" href="{{ asset('public/css/bootstrap-fancyfile.css') }}">
@endsection
@section('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();
$("#tax_id").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.taxes', 1)]) }}"
});
$("#category_id").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.categories', 1)]) }}"
});
$('#picture').fancyfile({
text : '{{ trans('general.form.select.file') }}',
style : 'btn-default',
placeholder : '{{ trans('general.form.no_file_selected') }}'
});
});
</script>
@endsection

View File

@@ -0,0 +1,77 @@
@extends('layouts.admin')
@section('title', trans('general.title.edit', ['type' => trans_choice('general.items', 1)]))
@section('content')
<!-- Default box -->
<div class="box box-success">
{!! Form::model($item, [
'method' => 'PATCH',
'files' => true,
'url' => ['items/items', $item->id],
'role' => 'form'
]) !!}
<div class="box-body">
{{ Form::textGroup('name', trans('general.name'), 'id-card-o') }}
{{ Form::textGroup('sku', trans('items.sku'), 'key') }}
{{ Form::textareaGroup('description', trans('general.description')) }}
{{ Form::textGroup('sale_price', trans('items.sales_price'), 'money') }}
{{ Form::textGroup('purchase_price', trans('items.purchase_price'), 'money') }}
{{ Form::textGroup('quantity', trans_choice('items.quantities', 1), 'cubes') }}
{{ Form::selectGroup('tax_id', trans_choice('general.taxes', 1), 'percent', $taxes, setting('general.default_tax', '')) }}
{{ Form::selectGroup('category_id', trans_choice('general.categories', 1), 'folder-open-o', $categories) }}
{{ Form::fileGroup('picture', trans_choice('general.pictures', 1)) }}
{{ Form::radioGroup('enabled', trans('general.enabled')) }}
</div>
<!-- /.box-body -->
@permission('update-items-items')
<div class="box-footer">
{{ Form::saveButtons('items/items') }}
</div>
<!-- /.box-footer -->
@endpermission
{!! Form::close() !!}
</div>
@endsection
@section('js')
<script src="{{ asset('public/js/bootstrap-fancyfile.js') }}"></script>
@endsection
@section('css')
<link rel="stylesheet" href="{{ asset('public/css/bootstrap-fancyfile.css') }}">
@endsection
@section('scripts')
<script type="text/javascript">
var text_yes = '{{ trans('general.yes') }}';
var text_no = '{{ trans('general.no') }}';
$(document).ready(function(){
$("#tax_id").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.taxes', 1)]) }}"
});
$("#category_id").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.categories', 1)]) }}"
});
$('#picture').fancyfile({
text : '{{ trans('general.form.select.file') }}',
style : 'btn-default',
placeholder : '<?php echo $item->picture; ?>'
});
});
</script>
@endsection

View File

@@ -0,0 +1,81 @@
@extends('layouts.admin')
@section('title', trans_choice('general.items', 2))
@permission('create-items-items')
@section('new_button')
<span class="new-button"><a href="{{ url('items/items/create') }}" class="btn btn-success btn-sm"><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">
{!! Form::open(['url' => 'items/items', 'role' => 'form', 'method' => 'GET']) !!}
<div class="pull-left">
<span class="title-filter">{{ trans('general.search') }}:</span>
{!! Form::text('search', request('search'), ['class' => 'form-control input-filter input-sm', 'placeholder' => trans('general.search_placeholder')]) !!}
{!! Form::select('category', $categories, request('category'), ['class' => 'form-control input-filter input-sm', 'placeholder' => trans('categories.all')]) !!}
{!! 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">{{ 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-bordered table-striped table-hover" id="tbl-items">
<thead>
<tr>
<th class="col-md-1">{{ trans_choice('general.pictures', 1) }}</th>
<th class="col-md-3">@sortablelink('name', trans('general.name'))</th>
<th class="col-md-1">@sortablelink('category.name', trans_choice('general.categories', 1))</th>
<th class="col-md-1">@sortablelink('quantity', trans_choice('items.quantities', 1))</th>
<th>@sortablelink('sale_price', trans('items.sales_price'))</th>
<th>@sortablelink('purchase_price', trans('items.purchase_price'))</th>
<th class="col-md-1">@sortablelink('enabled', trans('general.status'))</th>
<th class="col-md-2">{{ trans('general.actions') }}</th>
</tr>
</thead>
<tbody>
@foreach($items as $item)
<tr>
<td><img src="{{ asset($item->picture) }}" class="img-thumbnail" width="50" alt="{{ $item->name }}"></td>
<td><a href="{{ url('items/items/' . $item->id . '/edit') }}">{{ $item->name }}</a></td>
<td>{{ $item->category ? $item->category->name : trans('general.na') }}</td>
<td>{{ $item->quantity }}</td>
<td>{{ money($item->sale_price, setting('general.default_currency'), true) }}</td>
<td>{{ money($item->purchase_price, setting('general.default_currency'), true) }}</td>
<td>
@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>
<a href="{{ url('items/items/' . $item->id . '/edit') }}" class="btn btn-primary btn-xs"><i class="fa fa-pencil-square-o" aria-hidden="true"></i> {{ trans('general.edit') }}</a>
@permission('delete-items-items')
{!! Form::deleteButton($item, 'items/items') !!}
@endpermission
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
<!-- /.box-body -->
<div class="box-footer">
@include('partials.admin.pagination', ['items' => $items, 'type' => 'items'])
</div>
<!-- /.box-footer -->
</div>
<!-- /.box -->
@endsection