3 changed files with 41 additions and 41 deletions
-
34resources/views/products/index.blade.php
-
40resources/views/products/partials/forms.blade.php
-
4resources/views/products/price-list.blade.php
@ -1,58 +1,58 @@ |
|||||
@inject('unit', 'App\Unit') |
@inject('unit', 'App\Unit') |
||||
@if (Request::get('action') == 'create') |
@if (Request::get('action') == 'create') |
||||
{!! Form::open(['route' => 'products.store']) !!} |
{!! Form::open(['route' => 'products.store']) !!} |
||||
{!! FormField::text('name', ['label' => trans('product.name'), 'required' => true]) !!} |
|
||||
|
{!! FormField::text('name', ['label' => __('product.name'), 'required' => true]) !!} |
||||
<div class="row"> |
<div class="row"> |
||||
<div class="col-md-6">{!! FormField::price('cash_price', ['label' => trans('product.cash_price'), 'required' => true]) !!}</div> |
|
||||
<div class="col-md-6">{!! FormField::price('credit_price', ['label' => trans('product.credit_price')]) !!}</div> |
|
||||
|
<div class="col-md-6">{!! FormField::price('cash_price', ['label' => __('product.cash_price'), 'required' => true]) !!}</div> |
||||
|
<div class="col-md-6">{!! FormField::price('credit_price', ['label' => __('product.credit_price')]) !!}</div> |
||||
</div> |
</div> |
||||
{!! FormField::select('unit_id', $unit->pluck('name','id'), ['label' => trans('product.unit'), 'required' => true]) !!} |
|
||||
{!! Form::submit(trans('product.create'), ['class' => 'btn btn-success']) !!} |
|
||||
{{ link_to_route('products.index', trans('app.cancel'), [], ['class' => 'btn btn-default']) }} |
|
||||
|
{!! FormField::select('unit_id', $unit->pluck('name','id'), ['label' => __('product.unit'), 'required' => true]) !!} |
||||
|
{!! Form::submit(__('product.create'), ['class' => 'btn btn-success']) !!} |
||||
|
{{ link_to_route('products.index', __('app.cancel'), [], ['class' => 'btn btn-default']) }} |
||||
{!! Form::close() !!} |
{!! Form::close() !!} |
||||
@endif |
@endif |
||||
@if (Request::get('action') == 'edit' && $editableProduct) |
@if (Request::get('action') == 'edit' && $editableProduct) |
||||
{!! Form::model($editableProduct, ['route' => ['products.update', $editableProduct->id],'method' => 'patch']) !!} |
{!! Form::model($editableProduct, ['route' => ['products.update', $editableProduct->id],'method' => 'patch']) !!} |
||||
{!! FormField::text('name', ['label' => trans('product.name'), 'required' => true]) !!} |
|
||||
|
{!! FormField::text('name', ['label' => __('product.name'), 'required' => true]) !!} |
||||
<div class="row"> |
<div class="row"> |
||||
<div class="col-md-6">{!! FormField::price('cash_price', ['label' => trans('product.cash_price'), 'required' => true]) !!}</div> |
|
||||
<div class="col-md-6">{!! FormField::price('credit_price', ['label' => trans('product.credit_price')]) !!}</div> |
|
||||
|
<div class="col-md-6">{!! FormField::price('cash_price', ['label' => __('product.cash_price'), 'required' => true]) !!}</div> |
||||
|
<div class="col-md-6">{!! FormField::price('credit_price', ['label' => __('product.credit_price')]) !!}</div> |
||||
</div> |
</div> |
||||
{!! FormField::select('unit_id', $unit->pluck('name','id'), ['label' => trans('product.unit'), 'required' => true]) !!} |
|
||||
|
{!! FormField::select('unit_id', $unit->pluck('name','id'), ['label' => __('product.unit'), 'required' => true]) !!} |
||||
@if (request('q')) |
@if (request('q')) |
||||
{{ Form::hidden('q', request('q')) }} |
{{ Form::hidden('q', request('q')) }} |
||||
@endif |
@endif |
||||
@if (request('page')) |
@if (request('page')) |
||||
{{ Form::hidden('page', request('page')) }} |
{{ Form::hidden('page', request('page')) }} |
||||
@endif |
@endif |
||||
{!! Form::submit(trans('product.update'), ['class' => 'btn btn-success']) !!} |
|
||||
{{ link_to_route('products.index', trans('app.cancel'), Request::only('q'), ['class' => 'btn btn-default']) }} |
|
||||
|
{!! Form::submit(__('product.update'), ['class' => 'btn btn-success']) !!} |
||||
|
{{ link_to_route('products.index', __('app.cancel'), Request::only('q'), ['class' => 'btn btn-default']) }} |
||||
{!! Form::close() !!} |
{!! Form::close() !!} |
||||
@endif |
@endif |
||||
@if (Request::get('action') == 'delete' && $editableProduct) |
@if (Request::get('action') == 'delete' && $editableProduct) |
||||
<div class="panel panel-default"> |
<div class="panel panel-default"> |
||||
<div class="panel-heading"><h3 class="panel-title">{{ trans('product.delete') }}</h3></div> |
|
||||
|
<div class="panel-heading"><h3 class="panel-title">{{ __('product.delete') }}</h3></div> |
||||
<div class="panel-body"> |
<div class="panel-body"> |
||||
<table class="table table-condensed"> |
<table class="table table-condensed"> |
||||
<tbody> |
<tbody> |
||||
<tr><th>{{ trans('product.name') }}</th><td>{{ $editableProduct->name }}</td></tr> |
|
||||
<tr><th>{{ trans('product.unit') }}</th><td>{{ $editableProduct->unit->name }}</td></tr> |
|
||||
<tr><th>{{ trans('product.cash_price') }}</th><td>{{ formatRp($editableProduct->cash_price) }}</td></tr> |
|
||||
<tr><th>{{ trans('product.credit_price') }}</th><td>{{ formatRp($editableProduct->credit_price) }}</td></tr> |
|
||||
|
<tr><th>{{ __('product.name') }}</th><td>{{ $editableProduct->name }}</td></tr> |
||||
|
<tr><th>{{ __('product.unit') }}</th><td>{{ $editableProduct->unit->name }}</td></tr> |
||||
|
<tr><th>{{ __('product.cash_price') }}</th><td>{{ formatRp($editableProduct->cash_price) }}</td></tr> |
||||
|
<tr><th>{{ __('product.credit_price') }}</th><td>{{ formatRp($editableProduct->credit_price) }}</td></tr> |
||||
</tbody> |
</tbody> |
||||
</table> |
</table> |
||||
<hr> |
<hr> |
||||
{{ trans('product.delete_confirm') }} |
|
||||
|
{{ __('product.delete_confirm') }} |
||||
</div> |
</div> |
||||
<div class="panel-footer"> |
<div class="panel-footer"> |
||||
{!! FormField::delete(['route'=>['products.destroy',$editableProduct->id]], trans('app.delete_confirm_button'), [ |
|
||||
|
{!! FormField::delete(['route'=>['products.destroy',$editableProduct->id]], __('app.delete_confirm_button'), [ |
||||
'class'=>'btn btn-danger' |
'class'=>'btn btn-danger' |
||||
], [ |
], [ |
||||
'product_id'=>$editableProduct->id, |
'product_id'=>$editableProduct->id, |
||||
'page' => request('page'), |
'page' => request('page'), |
||||
'q' => request('q'), |
'q' => request('q'), |
||||
]) !!} |
]) !!} |
||||
{{ link_to_route('products.index', trans('app.cancel'), Request::only('q'), ['class' => 'btn btn-default']) }} |
|
||||
|
{{ link_to_route('products.index', __('app.cancel'), Request::only('q'), ['class' => 'btn btn-default']) }} |
||||
</div> |
</div> |
||||
</div> |
</div> |
||||
@endif |
@endif |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue