Skip to content

Commit

Permalink
Hard-coded English text strings should be moved to their language files
Browse files Browse the repository at this point in the history
  • Loading branch information
feeva committed Jan 4, 2014
1 parent 8806208 commit 40d6ad0
Show file tree
Hide file tree
Showing 9 changed files with 176 additions and 113 deletions.
4 changes: 2 additions & 2 deletions app/controllers/admin/AssetsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public function getCreate()
$model_list = array('' => '') + Model::orderBy('name', 'asc')->lists('name', 'id');

// Grab the dropdown list of status
$statuslabel_list = array('' => 'Pending') + array('0' => 'Ready to Deploy') + Statuslabel::orderBy('name', 'asc')->lists('name', 'id');
$statuslabel_list = array('' => Lang::get('general.pending')) + array('0' => Lang::get('general.ready_to_deploy')) + Statuslabel::orderBy('name', 'asc')->lists('name', 'id');

return View::make('backend/hardware/edit')->with('model_list',$model_list)->with('statuslabel_list',$statuslabel_list)->with('asset',new Asset);

Expand Down Expand Up @@ -250,7 +250,7 @@ public function getEdit($assetId = null)
$model_list = array('' => '') + Model::orderBy('name', 'asc')->lists('name', 'id');

// Grab the dropdown list of status
$statuslabel_list = array('' => 'Pending') + array('0' => 'Ready to Deploy') + Statuslabel::orderBy('name', 'asc')->lists('name', 'id');
$statuslabel_list = array('' => Lang::get('general.pending')) + array('0' => Lang::get('general.ready_to_deploy')) + Statuslabel::orderBy('name', 'asc')->lists('name', 'id');

return View::make('backend/hardware/edit', compact('asset'))->with('model_list',$model_list)->with('statuslabel_list',$statuslabel_list);
}
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/admin/LicensesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function getCreate()
// Show the page
$license_options = array('0' => 'Top Level') + License::lists('name', 'id');
// Show the page
$depreciation_list = array('0' => 'Do Not Depreciate') + Depreciation::lists('name', 'id');
$depreciation_list = array('0' => Lang::get('admin/licenses/form.no_depreciation')) + Depreciation::lists('name', 'id');
return View::make('backend/licenses/edit')->with('license_options',$license_options)->with('depreciation_list',$depreciation_list)->with('license',new License);
}

Expand Down Expand Up @@ -143,7 +143,7 @@ public function getEdit($licenseId = null)

// Show the page
$license_options = array('' => 'Top Level') + DB::table('assets')->where('id', '!=', $licenseId)->lists('name', 'id');
$depreciation_list = array('0' => 'Do Not Depreciate') + Depreciation::lists('name', 'id');
$depreciation_list = array('0' => Lang::get('admin/licenses/form.no_depreciation')) + Depreciation::lists('name', 'id');
return View::make('backend/licenses/edit', compact('license'))->with('license_options',$license_options)->with('depreciation_list',$depreciation_list);
}

Expand Down
19 changes: 19 additions & 0 deletions app/lang/en/admin/hardware/form.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

return array(

'create' => 'Create Asset',
'update' => 'Asset Update',
'tag' => 'Asset Tag',
'name' => 'Asset Name',
'serial' => 'Serial',
'order' => 'Order Number',
'model' => 'Model',
'date' => 'Purchase Date',
'cost' => 'Purchase Cost',
'warranty' => 'Warranty',
'status' => 'Status',
'notes' => 'Notes',
'months' => 'months',
)
;
20 changes: 20 additions & 0 deletions app/lang/en/admin/licenses/form.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

return array(

'create' => 'Create License',
'update' => 'Update License',
'name' => 'Software Name',
'serial' => 'Serial',
'to_name' => 'Licensed to Name',
'to_email' => 'Licensed to Email',
'seats' => 'Seats',
'order' => 'Order No.',
'date' => 'Purchase Date',
'cost' => 'Purchase Cost',
'depreciation' => 'Depreciation',
'no_depreciation' => 'Do Not Depreciate',
'notes' => 'Notes',

)
;
41 changes: 39 additions & 2 deletions app/lang/en/general.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,43 @@
'save' => 'Save',
'checkout' => 'Checkout',
'checkin' => 'Checkin',
'cancel' => 'Cancel'
'cancel' => 'Cancel',
'back' => 'Back',

);
'total_assets' => 'total assets',
'assets_available'=> 'assets available',
'total_licenses'=> 'total licenses',
'licenses_available'=> 'licenses available',
'all_assets' => 'All Assets',
'assets' => 'Assets',
'asset' => 'Asset',
'license' => 'License',
'licenses' => 'Licenses',
'user' => 'User',
'people' => 'People',
'reports' => 'Reports',
'all' => 'All',

'create' => 'Create New',
'welcome' => 'Welcome, :name',
'settings' => 'Settings',
'profile' => 'Your profile',
'logout' => 'Logout',
'admin' => 'Admin',
'groups' => 'Groups',
'status' => 'Status',
'status_labels' => 'Status Labels',
'manufacturers' => 'Manufacturers',
'categories' => 'Categories',
'locations' => 'Locations',
'depreciation' => 'Depreciation',

'sign_in' => 'Sign in',
'deployed' => 'Deployed',
'ready_to_deploy'=> 'Ready to Deploy',
'pending' => 'Pending',
'undeployable' => 'Un-deployable',
'list_all' => 'List All',
'asset_models' => 'Asset Models',
)
;
38 changes: 19 additions & 19 deletions app/views/backend/hardware/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
{{-- Page title --}}
@section('title')
@if ($asset->id)
Asset Update ::
@lang('admin/hardware/form.update') ::
@else
Create Asset ::
@lang('admin/hardware/form.create') ::
@endif
@parent
@stop
Expand All @@ -16,12 +16,12 @@

<div class="row header">
<div class="col-md-12">
<a href="{{ URL::previous() }}" class="btn-flat gray pull-right right"><i class="icon-circle-arrow-left icon-white"></i> Back</a>
<a href="{{ URL::previous() }}" class="btn-flat gray pull-right right"><i class="icon-circle-arrow-left icon-white"></i> @lang('general.back')</a>
<h3>
@if ($asset->id)
Asset Update
@lang('admin/hardware/form.update')
@else
Create Asset
@lang('admin/hardware/form.create')
@endif
</h3>
</div>
Expand All @@ -37,7 +37,7 @@

<!-- Asset Tag -->
<div class="form-group {{ $errors->has('asset_tag') ? ' has-error' : '' }}">
<label for="asset_tag" class="col-md-2 control-label">Asset Tag</label>
<label for="asset_tag" class="col-md-2 control-label">@lang('admin/hardware/form.tag')</label>
<div class="col-md-7">
<input class="form-control" type="text" name="asset_tag" id="asset_tag" value="{{ Input::old('asset_tag', $asset->asset_tag) }}" />
{{ $errors->first('asset_tag', '<span class="alert-msg"><i class="icon-remove-sign"></i> :message</span>') }}
Expand All @@ -46,15 +46,15 @@

<!-- Asset Title -->
<div class="form-group {{ $errors->has('name') ? ' has-error' : '' }}">
<label for="name" class="col-md-2 control-label">Asset Name</label>
<label for="name" class="col-md-2 control-label">@lang('admin/hardware/form.name')</label>
<div class="col-md-7">
<input class="form-control" type="text" name="name" id="name" value="{{ Input::old('name', $asset->name) }}" />
{{ $errors->first('name', '<span class="alert-msg"><i class="icon-remove-sign"></i> :message</span>') }}
</div>
</div>
<!-- Serial -->
<div class="form-group {{ $errors->has('serial') ? ' has-error' : '' }}">
<label for="serial" class="col-md-2 control-label">Serial</label>
<label for="serial" class="col-md-2 control-label">@lang('admin/hardware/form.serial')</label>
<div class="col-md-7">
<input class="form-control" type="text" name="serial" id="serial" value="{{ Input::old('serial', $asset->serial) }}" />
{{ $errors->first('serial', '<span class="alert-msg"><i class="icon-remove-sign"></i> :message</span>') }}
Expand All @@ -63,7 +63,7 @@

<!-- Order Number -->
<div class="form-group {{ $errors->has('order_number') ? ' has-error' : '' }}">
<label for="order_number" class="col-md-2 control-label">Order Number</label>
<label for="order_number" class="col-md-2 control-label">@lang('admin/hardware/form.order')</label>
<div class="col-md-7">
<input class="form-control" type="text" name="order_number" id="order_number" value="{{ Input::old('order_number', $asset->order_number) }}" />
{{ $errors->first('order_number', '<span class="alert-msg"><i class="icon-remove-sign"></i> :message</span>') }}
Expand All @@ -72,7 +72,7 @@

<!-- Model -->
<div class="form-group {{ $errors->has('model_id') ? ' has-error' : '' }}">
<label for="parent" class="col-md-2 control-label">Model</label>
<label for="parent" class="col-md-2 control-label">@lang('admin/hardware/form.model')</label>
<div class="col-md-7">
{{ Form::select('model_id', $model_list , Input::old('model_id', $asset->model_id), array('class'=>'select2', 'style'=>'min-width:350px')) }}
{{ $errors->first('model_id', '<span class="alert-msg"><i class="icon-remove-sign"></i> :message</span>') }}
Expand All @@ -81,7 +81,7 @@

<!-- Purchase Date -->
<div class="form-group {{ $errors->has('purchase_date') ? ' has-error' : '' }}">
<label for="purchase_date" class="col-md-2 control-label">Purchase Date</label>
<label for="purchase_date" class="col-md-2 control-label">@lang('admin/hardware/form.date')</label>
<div class="input-group col-md-2">
<input type="date" class="datepicker form-control" data-date-format="yyyy-mm-dd" placeholder="Select Date" name="purchase_date" id="purchase_date" value="{{ Input::old('purchase_date', $asset->purchase_date) }}">
<span class="input-group-addon"><i class="icon-calendar"></i></span>
Expand All @@ -91,10 +91,10 @@

<!-- Purchase Cost -->
<div class="form-group {{ $errors->has('purchase_cost') ? ' has-error' : '' }}">
<label for="purchase_cost" class="col-md-2 control-label">Purchase Cost</label>
<label for="purchase_cost" class="col-md-2 control-label">@lang('admin/hardware/form.cost')</label>
<div class="col-md-2">
<div class="input-group">
<span class="input-group-addon">$</span>
<span class="input-group-addon">@lang('general.currency')</span>
<input class="col-md-2 form-control" type="text" name="purchase_cost" id="purchase_cost" value="{{ Input::old('purchase_cost', $asset->purchase_cost) }}" />
{{ $errors->first('purchase_cost', '<span class="alert-msg"><i class="icon-remove-sign"></i> :message</span>') }}
</div>
Expand All @@ -103,18 +103,18 @@

<!-- Warrantee -->
<div class="form-group {{ $errors->has('warranty_months') ? ' has-error' : '' }}">
<label for="warranty_months" class="col-md-2 control-label">Warranty</label>
<label for="warranty_months" class="col-md-2 control-label">@lang('admin/hardware/form.warranty')</label>
<div class="col-md-2">
<div class="input-group">
<input class="col-md-2 form-control" type="text" name="warranty_months" id="warranty_months" value="{{ Input::old('warranty_months', $asset->warranty_months) }}" /> <span class="input-group-addon">months</span>
<input class="col-md-2 form-control" type="text" name="warranty_months" id="warranty_months" value="{{ Input::old('warranty_months', $asset->warranty_months) }}" /> <span class="input-group-addon">@lang('admin/hardware/form.months')</span>
{{ $errors->first('warranty_months', '<span class="alert-msg"><i class="icon-remove-sign"></i> :message</span>') }}
</div>
</div>
</div>

<!-- Status -->
<div class="form-group {{ $errors->has('status_id') ? ' has-error' : '' }}">
<label for="status_id" class="col-md-2 control-label">Status</label>
<label for="status_id" class="col-md-2 control-label">@lang('admin/hardware/form.status')</label>
<div class="col-md-7">
{{ Form::select('status_id', $statuslabel_list , Input::old('status_id', $asset->status_id), array('class'=>'select2', 'style'=>'width:350px')) }}
{{ $errors->first('status_id', '<span class="alert-msg"><i class="icon-remove-sign"></i> :message</span>') }}
Expand All @@ -123,7 +123,7 @@

<!-- Notes -->
<div class="form-group {{ $errors->has('notes') ? ' has-error' : '' }}">
<label for="notes" class="col-md-2 control-label">Notes</label>
<label for="notes" class="col-md-2 control-label">@lang('admin/hardware/form.notes')</label>
<div class="col-md-7">
<input class="col-md-6 form-control" type="text" name="notes" id="notes" value="{{ Input::old('notes', $asset->notes) }}" />
{{ $errors->first('notes', '<span class="alert-msg"><i class="icon-remove-sign"></i> :message</span>') }}
Expand All @@ -134,8 +134,8 @@
<div class="form-group">
<label class="col-md-2 control-label"></label>
<div class="col-md-7">
<a class="btn btn-link" href="{{ URL::previous() }}">Cancel</a>
<button type="submit" class="btn btn-success"><i class="icon-ok icon-white"></i> Save</button>
<a class="btn btn-link" href="{{ URL::previous() }}">@lang('general.cancel')</a>
<button type="submit" class="btn btn-success"><i class="icon-ok icon-white"></i> @lang('general.save')</button>
</div>
</div>

Expand Down
67 changes: 27 additions & 40 deletions app/views/backend/hardware/index.blade.php
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
@extends('backend/layouts/default')

@section('title0')
@if (Input::get('Pending') || Input::get('Undeployable') || Input::get('RTD') || Input::get('Deployed'))
@if (Input::get('Pending'))
@lang('general.pending')
@elseif (Input::get('RTD'))
@lang('general.ready_to_deploy')
@elseif (Input::get('Undeployable'))
@lang('general.undeployable')
@elseif (Input::get('Deployed'))
@lang('general.deployed')
@endif
@else
@lang('general.all')
@endif

@lang('general.assets')
@stop

{{-- Page title --}}
@section('title')
@if (Input::get('Pending') || Input::get('Undeployable') || Input::get('RTD') || Input::get('Deployed'))
@if (Input::get('Pending'))
Pending
@elseif (Input::get('RTD'))
Ready to Deploy
@elseif (Input::get('Undeployable'))
Un-deployable
@elseif (Input::get('Deployed'))
Deployed
@endif
@else
All
@endif

Assets ::
@parent
@yield('title0') :: @parent
@stop

{{-- Page content --}}
Expand All @@ -26,23 +29,8 @@

<div class="row header">
<div class="col-md-12">
<a href="{{ route('create/hardware') }}" class="btn btn-success pull-right"><i class="icon-plus-sign icon-white"></i> Create New</a>
<h3>
@if (Input::get('Pending') || Input::get('Undeployable') || Input::get('RTD') || Input::get('Deployed'))
@if (Input::get('Pending'))
Pending
@elseif (Input::get('RTD'))
Ready to Deploy
@elseif (Input::get('Undeployable'))
Un-deployable
@elseif (Input::get('Deployed'))
Deployed
@endif
@else
All
@endif
Assets
</h3>
<a href="{{ route('create/hardware') }}" class="btn btn-success pull-right"><i class="icon-plus-sign icon-white"></i> @lang('general.create')</a>
<h3>@yield('title0')</h3>
</div>
</div>

Expand All @@ -58,7 +46,7 @@
<th class="col-md-3" bSortable="true">@lang('admin/hardware/table.title')</th>
<th class="col-md-2" bSortable="true">@lang('admin/hardware/table.serial')</th>
@if (Input::get('Pending') || Input::get('Undeployable') || Input::get('RTD'))
<th class="col-md-2" bSortable="true">Status</th>
<th class="col-md-2" bSortable="true">@lang('general.status')</th>
@else
<th class="col-md-2" bSortable="true">@lang('admin/hardware/table.checkoutto')</th>
<th class="col-md-2" bSortable="true">@lang('admin/hardware/table.location')</th>
Expand All @@ -78,15 +66,14 @@
@if (Input::get('Pending') || Input::get('Undeployable') || Input::get('RTD'))
<td>
@if (Input::get('Pending'))
Pending
@lang('general.pending')
@elseif (Input::get('RTD'))
Ready to Deploy
@lang('general.ready_to_deploy')
@elseif (Input::get('Undeployable'))
@if ($asset->assetstatus)
{{ $asset->assetstatus->name }}
@endif

@endif
@endif
</td>
@else
<td>
Expand Down Expand Up @@ -117,9 +104,9 @@
<td>
@if ($asset->status_id < 1 )
@if ($asset->assigned_to != 0)
<a href="{{ route('checkin/hardware', $asset->id) }}" class="btn btn-primary">Checkin</a>
<a href="{{ route('checkin/hardware', $asset->id) }}" class="btn btn-primary">@lang('general.checkin')</a>
@else
<a href="{{ route('checkout/hardware', $asset->id) }}" class="btn btn-info">Checkout</a>
<a href="{{ route('checkout/hardware', $asset->id) }}" class="btn btn-info">@lang('general.checkout')</a>
@endif
@endif
</td>
Expand Down
Loading

0 comments on commit 40d6ad0

Please sign in to comment.