Browse Source

Change trans() helper to __()

pull/14/head
Nafies Luthfi 8 years ago
parent
commit
cbe77f5b1c
  1. 36
      resources/views/products/index.blade.php
  2. 40
      resources/views/products/partials/forms.blade.php
  3. 6
      resources/views/products/price-list.blade.php

36
resources/views/products/index.blade.php

@ -1,15 +1,15 @@
@extends('layouts.app')
@section('title', trans('product.list'))
@section('title', __('product.list'))
@section('content')
<div class="pull-right">
{{ link_to_route('products.price-list', trans('product.print_price_list'), [], ['class' => 'btn btn-info']) }}
{{ link_to_route('products.index', trans('product.create'), ['action' => 'create'], ['class' => 'btn btn-success']) }}
{{ link_to_route('products.price-list', __('product.print_price_list'), [], ['class' => 'btn btn-info']) }}
{{ link_to_route('products.index', __('product.create'), ['action' => 'create'], ['class' => 'btn btn-success']) }}
</div>
<h3 class="page-header">
{{ trans('product.list') }}
<small>{{ trans('app.total') }} : {{ $products->total() }} {{ trans('product.product') }}</small>
{{ __('product.list') }}
<small>{{ __('app.total') }} : {{ $products->total() }} {{ __('product.product') }}</small>
</h3>
<div class="row">
@ -17,24 +17,24 @@
<div class="panel panel-default table-responsive">
<div class="panel-heading">
{{ Form::open(['method' => 'get','class' => 'form-inline']) }}
{!! FormField::text('q', ['value' => request('q'), 'label' => trans('product.search'), 'class' => 'input-sm']) !!}
{{ Form::submit(trans('product.search'), ['class' => 'btn btn-sm']) }}
{{ link_to_route('products.index', trans('app.reset')) }}
{!! FormField::text('q', ['value' => request('q'), 'label' => __('product.search'), 'class' => 'input-sm']) !!}
{{ Form::submit(__('product.search'), ['class' => 'btn btn-sm']) }}
{{ link_to_route('products.index', __('app.reset')) }}
{{ Form::close() }}
</div>
<table class="table table-condensed">
<thead>
<tr>
<th class="text-center">{{ trans('app.table_no') }}</th>
<th>{{ trans('product.name') }}</th>
<th>{{ trans('product.unit') }}</th>
<th class="text-right">{{ trans('product.cash_price') }}</th>
<th class="text-right">{{ trans('product.credit_price') }}</th>
<th class="text-center">{{ trans('app.action') }}</th>
<th class="text-center">{{ __('app.table_no') }}</th>
<th>{{ __('product.name') }}</th>
<th>{{ __('product.unit') }}</th>
<th class="text-right">{{ __('product.cash_price') }}</th>
<th class="text-right">{{ __('product.credit_price') }}</th>
<th class="text-center">{{ __('app.action') }}</th>
</tr>
</thead>
<tbody>
<?php $customersTotal = 0 ?>
<?php $customersTotal = 0?>
@foreach($products as $key => $product)
<tr>
<td class="text-center">{{ $products->firstItem() + $key }}</td>
@ -43,14 +43,14 @@
<td class="text-right">{{ formatRp($product->cash_price) }}</td>
<td class="text-right">{{ formatRp($product->credit_price) }}</td>
<td class="text-center">
{!! link_to_route('products.index', trans('app.edit'), ['action' => 'edit', 'id' => $product->id] + Request::only('page','q'), ['id' => 'edit-product-' . $product->id]) !!} |
{!! link_to_route('products.index', trans('app.delete'), ['action' => 'delete', 'id' => $product->id] + Request::only('page','q'), ['id' => 'del-product-' . $product->id]) !!}
{!! link_to_route('products.index', __('app.edit'), ['action' => 'edit', 'id' => $product->id] + request(['page','q']), ['id' => 'edit-product-' . $product->id]) !!} |
{!! link_to_route('products.index', __('app.delete'), ['action' => 'delete', 'id' => $product->id] + request(['page','q']), ['id' => 'del-product-' . $product->id]) !!}
</td>
</tr>
@endforeach
</tbody>
</table>
<div class="panel-body">{!! str_replace('/?', '?', $products->appends(Request::except('page'))->render()) !!}</div>
<div class="panel-body">{{ $products->appends(Request::except('page'))->render() }}</div>
</div>
</div>
<div class="col-md-4">

40
resources/views/products/partials/forms.blade.php

@ -1,58 +1,58 @@
@inject('unit', 'App\Unit')
@if (Request::get('action') == 'create')
{!! 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="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>
{!! 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() !!}
@endif
@if (Request::get('action') == 'edit' && $editableProduct)
{!! 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="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>
{!! 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'))
{{ Form::hidden('q', request('q')) }}
@endif
@if (request('page'))
{{ Form::hidden('page', request('page')) }}
@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() !!}
@endif
@if (Request::get('action') == 'delete' && $editableProduct)
<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">
<table class="table table-condensed">
<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>
</table>
<hr>
{{ trans('product.delete_confirm') }}
{{ __('product.delete_confirm') }}
</div>
<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'
], [
'product_id'=>$editableProduct->id,
'page' => request('page'),
'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>
@endif

6
resources/views/products/price-list.blade.php

@ -1,6 +1,6 @@
@extends('layouts.pdf')
@section('title', trans('product.price_list') . ' (per ' . date('Y-m-d H:i') . ')')
@section('title', __('product.price_list') . ' (per ' . date('Y-m-d H:i') . ')')
@section('content')
@ -8,7 +8,7 @@
<tbody>
<tr>
<td colspan="4">
<h2 class="text-center">{{ trans('product.price_list') }} - {{ config('store.name') }}</h2>
<h2 class="text-center">{{ __('product.price_list') }} - {{ config('store.name') }}</h2>
<p class="text-center strong">Per: {{ date('Y-m-d H:i') }}</p>
<br>
</td>
@ -34,4 +34,4 @@
@endforeach
</tbody>
</table>
@endsection
@endsection
Loading…
Cancel
Save