Skip to content

Commit

Permalink
Fixes #483 - line breaks in notes on view
Browse files Browse the repository at this point in the history
  • Loading branch information
snipe committed Feb 4, 2015
1 parent 4dc81ce commit cd338d2
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 74 deletions.
55 changes: 30 additions & 25 deletions app/views/backend/hardware/view.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,65 +47,64 @@
<div class="row profile">
<div class="col-md-9 bio">

<div class="col-md-12" style="min-height: 130px;">

@if ($asset->serial)
<div class="col-md-6"><strong>@lang('admin/hardware/form.serial'): </strong>
<div class="col-md-12" style="padding-bottom: 5px;"><strong>@lang('admin/hardware/form.serial'): </strong>
<em>{{{ $asset->serial }}}</em></div>
<div class="col-md-6"><strong><br></strong></div>

@endif

@if ($asset->model->manufacturer)
<div class="col-md-6"><strong>@lang('admin/hardware/form.manufacturer'): </strong>
<div class="col-md-12" style="padding-bottom: 5px;"><strong>@lang('admin/hardware/form.manufacturer'): </strong>
<a href="{{ route('update/manufacturer', $asset->model->manufacturer->id) }}">
{{{ $asset->model->manufacturer->name }}}
</a> </div>
<div class="col-md-6"><strong>@lang('admin/hardware/form.model'):</strong>
<div class="col-md-12" style="padding-bottom: 5px;"><strong>@lang('admin/hardware/form.model'):</strong>
<a href="{{ route('view/model', $asset->model->id) }}">
{{{ $asset->model->name }}}
</a>
/ {{{ $asset->model->modelno }}}</div>
@endif

@if ($asset->purchase_date)
<div class="col-md-6"><strong>@lang('admin/hardware/form.date'): </strong>
<div class="col-md-12" style="padding-bottom: 5px;"><strong>@lang('admin/hardware/form.date'): </strong>
{{{ $asset->purchase_date }}} </div>
@endif

@if ($asset->purchase_cost)
<div class="col-md-6"><strong>@lang('admin/hardware/form.cost'):</strong>
<div class="col-md-12" style="padding-bottom: 5px;"><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>@lang('admin/hardware/form.order'):</strong>
<div class="col-md-12" style="padding-bottom: 5px;"><strong>@lang('admin/hardware/form.order'):</strong>
{{{ $asset->order_number }}} </div>
@endif

@if ($asset->supplier_id)
<div class="col-md-6"><strong>@lang('admin/hardware/form.supplier'): </strong>
<div class="col-md-6" style="padding-bottom: 5px;"><strong>@lang('admin/hardware/form.supplier'): </strong>
<a href="{{ route('view/supplier', $asset->supplier_id) }}">
{{{ $asset->supplier->name }}}
</a> </div>
@endif

@if ($asset->warranty_months)
<div class="col-md-6"><strong>@lang('admin/hardware/form.warranty'):</strong>
<div class="col-md-12" style="padding-bottom: 5px;"><strong>@lang('admin/hardware/form.warranty'):</strong>
{{{ $asset->warranty_months }}}
@lang('admin/hardware/form.months')
</div>
<div class="col-md-6 {{{ $asset->warrantee_expires() < date("Y-m-d H:i:s") ? 'ui-state-highlight' : '' }}}" ><strong>@lang('admin/hardware/form.expires'):</strong>
<div class="col-md-12 {{{ $asset->warrantee_expires() < date("Y-m-d H:i:s") ? 'ui-state-highlight' : '' }}}" style="padding-bottom: 5px;"><strong>@lang('admin/hardware/form.expires'):</strong>
{{{ $asset->warrantee_expires() }}}</div>
@endif

@if ($asset->depreciation)
<div class="col-md-6"><strong>@lang('admin/hardware/form.depreciation'): </strong>
<div class="col-md-12" style="padding-bottom: 5px;"><strong>@lang('admin/hardware/form.depreciation'): </strong>
{{ $asset->depreciation->name }}
({{{ $asset->depreciation->months }}}
@lang('admin/hardware/form.months')
)</div>
<div class="col-md-6"><strong>@lang('admin/hardware/form.fully_depreciated'): </strong>
<div class="col-md-12" style="padding-bottom: 5px;"><strong>@lang('admin/hardware/form.fully_depreciated'): </strong>
{{{ $asset->months_until_depreciated()->m }}}
@lang('admin/hardware/form.months')
@if ($asset->months_until_depreciated()->y > 0)
Expand All @@ -117,10 +116,12 @@
@endif

@if ($asset->model->eol)
<div class="col-md-6"><strong>@lang('admin/hardware/form.eol_rate'): </strong>
<div class="col-md-12" style="padding-bottom: 5px;">
<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>
<div class="col-md-12" style="padding-bottom: 5px;">
<strong>@lang('admin/hardware/form.eol_date'): </strong>
{{{ $asset->eol_date() }}}
@if ($asset->months_until_eol())
(
Expand All @@ -135,17 +136,13 @@
</div>
@endif

</div>

<!-- Asset notes -->
@if ($asset->notes)
<div class="col-md-12"><strong>@lang('admin/hardware/form.notes'):</strong>
{{{ $asset->notes }}} <br><br>
</div>
@endif

<!-- Licenses assets table -->
<h6>Software Assigned to {{{ $asset->name }}}</h6>


<div class="col-md-12">
<!-- Licenses assets table -->
<h6>Software Assigned </h6>
<br>
<!-- checked out assets table -->
@if (count($asset->licenses) > 0)
Expand Down Expand Up @@ -236,10 +233,18 @@


</div>

</div>
<!-- side address column -->
<div class="col-md-3 col-xs-12 address pull-right">

<!-- Asset notes -->
@if ($asset->notes)

<h6>@lang('admin/hardware/form.notes'):</h6>
{{ nl2br(e($asset->notes)) }}

@endif

@if ($qr_code->display)
<h6>@lang('admin/hardware/form.qr')</h6>
<p>
Expand Down
97 changes: 48 additions & 49 deletions app/views/backend/licenses/view.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,71 +26,72 @@
</div>
</div>

<div class="user-profile">
<div class="user-profile ">
<div class="row profile">
<div class="col-md-9 bio">

<h6>@lang('admin/licenses/general.info')</h6>
@if ($license->serial)
<div class="col-md-12" style="padding-bottom: 10px; margin-left: 15px;">
<strong>@lang('admin/licenses/form.serial'): </strong>
{{{ wordwrap($license->serial, 10, "\n", true) }}}
</div>
@endif

<div class="col-md-12">
<div class="col-md-12" style="padding-bottom: 20px">

@if ($license->license_name)
<div class="col-md-6"><strong>@lang('admin/licenses/form.to_name'): </strong>
<div class="col-md-6" style="padding-bottom: 5px"><strong>@lang('admin/licenses/form.to_name'): </strong>
{{{ $license->license_name }}} </div>
@endif

@if ($license->license_email)
<div class="col-md-6"><strong>@lang('admin/licenses/form.to_email'): </strong>
<div class="col-md-6" style="padding-bottom: 5px"><strong>@lang('admin/licenses/form.to_email'): </strong>
{{{ $license->license_email }}} </div>
@endif

@if ($license->supplier_id)
<div class="col-md-6"><strong>@lang('admin/licenses/form.supplier'): </strong>
<div class="col-md-6" style="padding-bottom: 5px"><strong>@lang('admin/licenses/form.supplier'): </strong>
<a href="{{ route('view/supplier', $license->supplier_id) }}">
{{{ $license->supplier->name }}}
</a> </div>
@endif

@if ($license->expiration_date > 0)
<div class="col-md-6"><strong>@lang('admin/licenses/form.expiration'): </strong>
<div class="col-md-6" style="padding-bottom: 5px"><strong>@lang('admin/licenses/form.expiration'): </strong>
{{{ $license->expiration_date }}} </div>
@endif

@if ($license->notes)
<div class="col-md-6"><strong>@lang('admin/licenses/form.notes'): </strong>
{{{ $license->notes }}}</div>
@endif

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


<br><br><br>
</div>

@if ($license->serial)
<div class="col-md-12"><strong>@lang('admin/licenses/form.serial'): </strong>
{{{ wordwrap($license->serial, 10, "\n", true) }}} </div>
<div class="col-md-6" style="padding-bottom: 5px">
<strong>@lang('admin/hardware/form.depreciation'): </strong>
{{{ $license->depreciation->name }}}
({{{ $license->depreciation->months }}}
@lang('admin/hardware/form.months')
)
</div>

<div class="col-md-6" style="padding-bottom: 5px">
<strong>@lang('admin/hardware/form.depreciates_on'): </strong>
{{{ $license->depreciated_date() }}}
</div>

<div class="col-md-6" style="padding-bottom: 5px">
<strong>@lang('admin/hardware/form.fully_depreciated'): </strong>
{{{ $license->months_until_depreciated()->m }}}
@lang('admin/hardware/form.months')

@if ($license->months_until_depreciated()->y > 0)
, {{{ $license->months_until_depreciated()->y }}}
@lang('admin/hardware/form.years')
@endif
</div>
@endif

</div>



<div class="col-md-12" style="padding-top: 60px;">
<!-- checked out assets table -->
<h6>{{ $license->seats }} @lang('admin/licenses/general.license_seats')</h6>
<table class="table table-hover">
Expand Down Expand Up @@ -149,7 +150,8 @@

</tbody>
</table>
<br>
</div>
<div class="col-md-12">
<h6>@lang('admin/licenses/general.checkout_history')</h6>

<table class="table table-hover">
Expand Down Expand Up @@ -208,39 +210,36 @@
</tbody>
</table>
</div>

</div>
<!-- side address column -->
<div class="col-md-3 col-xs-12 address pull-right">
<h6><br>@lang('general.moreinfo'):</h6>
<ul>
@if ($license->purchase_order)
<li>@lang('admin/licenses/form.purchase_order'):
<li><strong>@lang('admin/licenses/form.purchase_order'):</strong>
{{{ $license->purchase_order }}} </li>
@endif
@if ($license->purchase_date > 0)
<li>@lang('admin/licenses/form.date'):
<li><strong>@lang('admin/licenses/form.date'):</strong>
{{{ $license->purchase_date }}} </li>
@endif
@if ($license->purchase_cost > 0)
<li>@lang('admin/licenses/form.cost'):
<li><strong>@lang('admin/licenses/form.cost'):</strong>
@lang('general.currency')
{{{ number_format($license->purchase_cost,2) }}} </li>
@endif
@if ($license->order_number)
<li>@lang('admin/licenses/form.order'):
<li><strong>@lang('admin/licenses/form.order'):</strong>
{{{ $license->order_number }}} </li>
@endif
@if (($license->seats) && ($license->seats) > 0)
<li>@lang('admin/licenses/form.seats'):
<li><strong>@lang('admin/licenses/form.seats'):</strong>
{{{ $license->seats }}} </li>
@endif
@if ($license->depreciation)
<li>@lang('admin/licenses/form.depreciation'):
{{{ $license->depreciation->name }}}
({{{ $license->depreciation->months }}} months)</li>
@endif

@if ($license->notes)
<li>{{{ $license->notes }}}</li>
<li><strong>@lang('admin/licenses/form.notes'):</strong>
<li>{{ nl2br(e($license->notes)) }}</li>
@endif
</ul>
</div>
Expand Down

0 comments on commit cd338d2

Please sign in to comment.