Skip to content

Commit

Permalink
Additional internationalization for Hardware per #151
Browse files Browse the repository at this point in the history
  • Loading branch information
snipe committed Jun 9, 2014
1 parent 75590b6 commit 34b4615
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 45 deletions.
40 changes: 24 additions & 16 deletions app/lang/en/admin/hardware/form.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,29 @@

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',
'checkout_to' => 'Checkout to',
'checkin' => 'Checkin',
'depreciation' => 'Depreciation',
'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',
'years' => 'years',
'checkout_to' => 'Checkout to',
'checkedout_to' => 'Checked Out To',
'checkin' => 'Checkin',
'depreciation' => 'Depreciation',
'depreciates_on' => 'Depreciates On',
'fully_depreciated' => 'Fully Depreciated',
'eol_rate' => 'EOL Rate',
'eol_date' => 'EOL Date',
'manufacturer' => 'Manufacturer',
'qr' => 'QR Code',
)
;
4 changes: 3 additions & 1 deletion app/lang/en/admin/hardware/general.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@
'checkin' => 'Checkin Asset',
'checkout' => 'Checkout Asset to User',
'clone' => 'Clone Asset',

'view' => 'View Asset',
'edit' => 'Edit Asset',
'created_asset' => 'created asset',
);
1 change: 1 addition & 0 deletions app/lang/en/admin/hardware/message.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
),

'delete' => array(
'confirm' => 'Are you sure you wish to delete this asset?',
'error' => 'There was an issue deleting the asset. Please try again.',
'success' => 'The asset was deleted successfully.'
),
Expand Down
1 change: 1 addition & 0 deletions app/lang/en/button.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
'edit' => 'Edit',
'delete' => 'Delete',
'restore' => 'Restore',
'actions' => 'Actions',

);
1 change: 1 addition & 0 deletions app/lang/en/general.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,5 @@
'asset_models' => 'Asset Models',
'currency_symbol' => '$',
'no_results' => 'No Results.',
'unknown_admin' => 'Unknown Admin',
);
6 changes: 4 additions & 2 deletions app/views/backend/hardware/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@else
@lang('general.all')
@endif

@lang('general.assets')
@stop

Expand Down Expand Up @@ -112,7 +112,9 @@
</td>
<td nowrap="nowrap">
<a href="{{ route('update/hardware', $asset->id) }}" class="btn btn-warning"><i class="icon-pencil icon-white"></i></a>
<a data-html="false" class="btn delete-asset btn-danger" data-toggle="modal" href="{{ route('delete/hardware', $asset->id) }}" data-content="Are you sure you wish to delete this asset?" data-title="Delete {{ htmlspecialchars($asset->asset_tag) }}?" onClick="return false;"><i class="icon-trash icon-white"></i></a>
<a data-html="false" class="btn delete-asset btn-danger" data-toggle="modal" href="{{ route('delete/hardware', $asset->id) }}" data-content="@lang('admin/hardware/message.delete.confirm')"
data-title="@lang('general.delete')
{{ htmlspecialchars($asset->asset_tag) }}?" onClick="return false;"><i class="icon-trash icon-white"></i></a>
</td>
</tr>
@endforeach
Expand Down
73 changes: 47 additions & 26 deletions app/views/backend/hardware/view.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{{-- Page title --}}
@section('title')
View Asset {{ $asset->asset_tag }} ::
@lang('admin/hardware/general.view') {{ $asset->asset_tag }} ::
@parent
@stop

Expand All @@ -12,25 +12,28 @@
<div class="row header">
<div class="col-md-12">
<div class="btn-group pull-right">
<button class="btn glow">Actions</button>
<button class="btn glow">@lang('button.actions')</button>
<button class="btn glow dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu">

@if ($asset->status_id == 1)
@if ($asset->assigned_to != 0)
<li><a href="{{ route('checkin/hardware', $asset->id) }}" class="btn-flat info">Checkin</a></li>
<li><a href="{{ route('checkin/hardware', $asset->id) }}">@lang('admin/hardware/general.checkin')</a></li>
@endif
@elseif ($asset->status_id == 0)
<li><a href="{{ route('checkout/hardware', $asset->id) }}" class="btn-flat success">Checkout</a></li>
<li><a href="{{ route('checkout/hardware', $asset->id) }}">@lang('admin/hardware/general.checkout')</a></li>
@endif
<li><a href="{{ route('update/hardware', $asset->id) }}">Edit Asset</a></li>
<li><a href="{{ route('clone/hardware', $asset->id) }}">Clone Asset</a></li>
<li><a href="{{ route('update/hardware', $asset->id) }}">@lang('admin/hardware/general.edit')</a></li>
<li><a href="{{ route('clone/hardware', $asset->id) }}">@lang('admin/hardware/general.clone')</a></li>
</ul>
</div>
<h3>
<h3 class="name">History for {{ $asset->asset_tag }}
<h3 class="name">
@lang('admin/hardware/general.view') {{ $asset->asset_tag }}

{{ $asset->asset_tag }}
@if ($asset->name)
({{ $asset->name }})
@endif
Expand All @@ -45,38 +48,56 @@
<div class="col-md-12" style="min-height: 130px;">

@if ($asset->model->manufacturer)
<div class="col-md-6"><strong>Manufacturer: </strong> {{ $asset->model->manufacturer->name }} </div>
<div class="col-md-6"><strong>Model:</strong> {{ $asset->model->name }} / {{ $asset->model->modelno }}</div>
<div class="col-md-6"><strong>@lang('admin/hardware/form.manufacturer'): </strong>
{{ $asset->model->manufacturer->name }} </div>
<div class="col-md-6"><strong>@lang('admin/hardware/form.model'):</strong>
{{ $asset->model->name }} / {{ $asset->model->modelno }}</div>
@endif

@if ($asset->purchase_date)
<div class="col-md-6"><strong>Purchased On: </strong>{{ $asset->purchase_date }} </div>
<div class="col-md-6"><strong>@lang('admin/hardware/form.date'): </strong>
{{ $asset->purchase_date }} </div>
@endif

@if ($asset->purchase_cost)
<div class="col-md-6"><strong>Purchase Cost:</strong> ${{ number_format($asset->purchase_cost,2) }} </div>
<div class="col-md-6"><strong>@lang('admin/hardware/form.cost'):</strong>
@lang('general.currency')
{{ number_format($asset->purchase_cost,2) }} </div>
@endif

@if ($asset->order_number)
<div class="col-md-6"><strong>Order #:</strong> {{ $asset->order_number }} </div>
<div class="col-md-6"><strong>@lang('admin/hardware/form.order'):</strong>
{{ $asset->order_number }} </div>
@endif

@if ($asset->warranty_months)
<div class="col-md-6"><strong>Warranty:</strong> {{ $asset->warranty_months }} months</div>
<div class="col-md-6"><strong>Expires:</strong> {{ $asset->warrantee_expires() }}</div>
<div class="col-md-6"><strong>@lang('admin/hardware/form.warranty'):</strong>
{{ $asset->warranty_months }}
@lang('admin/hardware/form.months')
</div>
<div class="col-md-6"><strong>@lang('admin/hardware/form.expires'):</strong>
{{ $asset->warrantee_expires() }}</div>
@endif

@if ($asset->depreciation)
<div class="col-md-6"><strong>Depreciation: </strong>{{ $asset->depreciation->name }}
<div class="col-md-6"><strong>@lang('admin/hardware/form.depreciation'): </strong>
{{ $asset->depreciation->name }}
({{ $asset->depreciation->months }} months)</div>
<div class="col-md-6"><strong>Depreciates On: </strong>{{ $asset->depreciated_date() }} </div>
<div class="col-md-6"><strong>Fully Depreciated: </strong>{{ $asset->months_until_depreciated()->m }} months,
{{ $asset->months_until_depreciated()->y }} years</div>
<div class="col-md-6"><strong>@lang('admin/hardware/form.depreciates_on'): </strong>
{{ $asset->depreciated_date() }} </div>
<div class="col-md-6"><strong>@lang('admin/hardware/form.fully_depreciated'): </strong>
{{ $asset->months_until_depreciated()->m }}
@lang('admin/hardware/form.months'),
{{ $asset->months_until_depreciated()->y }}
@lang('admin/hardware/form.years')</div>
@endif

@if ($asset->model->eol)
<div class="col-md-6"><strong>EOL Rate: </strong> {{ $asset->model->eol }} months </div>
<div class="col-md-6"><strong>EOL Date: </strong> {{ $asset->eol_date() }}
<div class="col-md-6"><strong>@lang('admin/hardware/form.eol_rate'): </strong>
{{ $asset->model->eol }}
@lang('admin/hardware/form.months') </div>
<div class="col-md-6"><strong>@lang('admin/hardware/form.eol_date'): </strong>
{{ $asset->eol_date() }}
@if ($asset->months_until_eol())
({{ $asset->months_until_eol()->y }} years,
{{ $asset->months_until_eol()->m }} months)
Expand Down Expand Up @@ -138,10 +159,10 @@
@if ($asset->adminuser->id)
{{ $asset->adminuser->fullName() }}
@else
Unknown Admin
@lang('general.unknown_admin')
@endif
</td>
<td>created asset</td>
<td>@lang('admin/hardware/general.created_asset')</td>
<td></td>
<td></td>
</tr>
Expand All @@ -155,14 +176,14 @@
<div class="col-md-3 col-xs-12 address pull-right">

@if ($qr_code->display)
<h6>QR Code</h6>
<h6>@lang('admin/hardware/form.qr')</h6>
<p>
<img src="{{ $qr_code->url }}" />
</p>
@endif

@if ((isset($asset->assigned_to ) && ($asset->assigned_to > 0)))
<h6><br>Checked Out To:</h6>
<h6><br>@lang('admin/hardware/form.checkedout_to')</h6>
<ul>

<li><img src="{{ $asset->assigneduser->gravatar() }}" class="img-circle" style="width: 100px; margin-right: 20px;" /><br /><br /></li>
Expand All @@ -189,7 +210,7 @@
<li><i class="icon-phone"></i> {{ $asset->assigneduser->phone }}</li>
@endif

<li><br /><a href="{{ route('checkin/hardware', $asset->id) }}" class="btn-flat large info ">Checkin Asset</a></li>
<li><br /><a href="{{ route('checkin/hardware', $asset->id) }}" class="btn-flat large info ">@lang('admin/hardware/general.checkin')</a></li>
</ul>

@elseif (($asset->status_id ) && ($asset->status_id > 1))
Expand Down Expand Up @@ -217,7 +238,7 @@
</div>

@else
<h6><br>Checkout Asset</h6>
<h6><br>@lang('admin/hardware/general.checkout')</h6>
<ul>
<li>This asset is not checked out to anyone yet. Use the button below to check it out now.</li>
<li><br><br /><a href="{{ route('checkout/hardware', $asset->id) }}" class="btn-flat large success">Checkout Asset</a></li>
Expand Down

0 comments on commit 34b4615

Please sign in to comment.