Browse Source

Fixed project index page structure and use project lang file

pull/6/head
Nafies Luthfi 8 years ago
parent
commit
f51493f82b
  1. 1
      app/Http/Middleware/Lang.php
  2. 6
      resources/lang/en/project.php
  3. 2
      resources/lang/id/project.php
  4. 8
      resources/views/projects/index.blade.php

1
app/Http/Middleware/Lang.php

@ -11,6 +11,7 @@ class Lang
* *
* @param \Illuminate\Http\Request $request * @param \Illuminate\Http\Request $request
* @param \Closure $next * @param \Closure $next
*
* @return mixed * @return mixed
*/ */
public function handle($request, Closure $next) public function handle($request, Closure $next)

6
resources/lang/en/project.php

@ -4,11 +4,13 @@ return [
// Labels // Labels
'project' => 'Project', 'project' => 'Project',
'projects' => 'Project List', 'projects' => 'Project List',
'index_title' => ':status Project List',
'work_duration' => 'Work Duration', 'work_duration' => 'Work Duration',
'cash_in_total' => 'Cash in Total', 'cash_in_total' => 'Cash in Total',
'cash_out_total' => 'Cash out Total', 'cash_out_total' => 'Cash out Total',
'search' => 'Search Project',
'found' => 'Project found.',
'all' => 'All Projects',
'search' => 'Search Projects',
'found' => 'Projects found',
'not_found' => 'Project not found.', 'not_found' => 'Project not found.',
'select' => 'Select Project', 'select' => 'Select Project',
'empty' => 'Project list is empty.', 'empty' => 'Project list is empty.',

2
resources/lang/id/project.php

@ -4,9 +4,11 @@ return [
// Labels // Labels
'project' => 'Project', 'project' => 'Project',
'projects' => 'Daftar Project', 'projects' => 'Daftar Project',
'index_title' => 'Daftar :status Project',
'work_duration' => 'Durasi', 'work_duration' => 'Durasi',
'cash_in_total' => 'Total Pemasukan', 'cash_in_total' => 'Total Pemasukan',
'cash_out_total' => 'Total Pengeluaran', 'cash_out_total' => 'Total Pengeluaran',
'all' => 'Semua Project',
'search' => 'Cari Project', 'search' => 'Cari Project',
'found' => 'Project ditemukan', 'found' => 'Project ditemukan',
'not_found' => 'Project tidak ditemukan', 'not_found' => 'Project tidak ditemukan',

8
resources/views/projects/index.blade.php

@ -1,16 +1,16 @@
@extends('layouts.app') @extends('layouts.app')
@section('title', 'Daftar ' . $status . ' Project')
@section('title', trans('project.index_title', ['status' => $status]))
@section('content') @section('content')
<h1 class="page-header"> <h1 class="page-header">
{!! link_to_route('projects.create', trans('project.create'), [], ['class' => 'btn btn-success pull-right']) !!} {!! link_to_route('projects.create', trans('project.create'), [], ['class' => 'btn btn-success pull-right']) !!}
Daftar {{ $status }} Project <small>{{ $projects->total() }} {{ trans('project.found') }}</small>
{{ trans('project.index_title', ['status' => $status]) }} <small>{{ $projects->total() }} {{ trans('project.found') }}</small>
</h1> </h1>
<div class="well well-sm text-right"> <div class="well well-sm text-right">
<div class="pull-left hidden-xs">{{ $projects->appends(Request::except('page'))->render() }}</div> <div class="pull-left hidden-xs">{{ $projects->appends(Request::except('page'))->render() }}</div>
{!! Form::open(['method' => 'get', 'class' => 'form-inline']) !!} {!! Form::open(['method' => 'get', 'class' => 'form-inline']) !!}
{!! FormField::select('status', ProjectStatus::toArray(), ['value' => Request::get('status'), 'placeholder'=> 'Semua Project']) !!}
{!! FormField::select('status', ProjectStatus::toArray(), ['value' => Request::get('status'), 'placeholder' => trans('project.all')]) !!}
{!! Form::text('q', Request::get('q'), ['class' => 'form-control index-search-field', 'placeholder' => trans('project.search'), 'style' => 'width:100%;max-width:350px']) !!} {!! Form::text('q', Request::get('q'), ['class' => 'form-control index-search-field', 'placeholder' => trans('project.search'), 'style' => 'width:100%;max-width:350px']) !!}
{!! Form::submit(trans('project.search'), ['class' => 'btn btn-info btn-sm']) !!} {!! Form::submit(trans('project.search'), ['class' => 'btn btn-info btn-sm']) !!}
{!! link_to_route('projects.index', 'Reset', [], ['class' => 'btn btn-default btn-sm']) !!} {!! link_to_route('projects.index', 'Reset', [], ['class' => 'btn btn-default btn-sm']) !!}
@ -51,5 +51,5 @@
</tbody> </tbody>
</table> </table>
</div> </div>
{!! str_replace('/?', '?', $projects->appends(Request::except('page'))->render()) !!}
{{ $projects->appends(Request::except('page'))->render() }}
@endsection @endsection
Loading…
Cancel
Save