Skip to content

Commit

Permalink
Nicer formatting when 0 years
Browse files Browse the repository at this point in the history
  • Loading branch information
snipe committed Jun 9, 2014
1 parent 7448db6 commit dae3220
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions app/views/backend/hardware/view.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,19 @@
@if ($asset->depreciation)
<div class="col-md-6"><strong>@lang('admin/hardware/form.depreciation'): </strong>
{{ $asset->depreciation->name }}
({{ $asset->depreciation->months }} months)</div>
({{ $asset->depreciation->months }}
@lang('admin/hardware/form.months')
)</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>
@lang('admin/hardware/form.months')
@if ($asset->months_until_depreciated()->y > 0)
, {{ $asset->months_until_depreciated()->y }}
@lang('admin/hardware/form.years')
@endif
</div>
@endif

@if ($asset->model->eol)
Expand All @@ -99,8 +104,15 @@
<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)
(
@if ($asset->months_until_eol()->y > 0)
{{ $asset->months_until_eol()->y }}
@lang('admin/hardware/form.years'),
@endif

{{ $asset->months_until_eol()->m }}
@lang('admin/hardware/form.months')
)
@endif
</div>
@endif
Expand Down

0 comments on commit dae3220

Please sign in to comment.