Skip to content

Commit

Permalink
Fixes #597 - print-friendly view on users
Browse files Browse the repository at this point in the history
  • Loading branch information
snipe committed Mar 5, 2015
1 parent 3f9d9f2 commit 817384b
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 15 deletions.
2 changes: 2 additions & 0 deletions app/views/backend/layouts/default.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
<link rel="stylesheet" href="{{ asset('assets/css/lib/jquery.dataTables.css') }}" type="text/css" media="screen" />
<link rel="stylesheet" href="{{ asset('assets/css/compiled/dataTables.responsive.css') }}" type="text/css" media="screen" />

<link rel="stylesheet" type="text/css" href="{{ asset('assets/css/compiled/print.css') }}" media="print" />



<!-- open sans font -->
Expand Down
30 changes: 15 additions & 15 deletions app/views/backend/users/view.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
<div class="row header">
<div class="col-md-8">
@if ($user->avatar)
<img src="/uploads/avatars/{{{ $user->avatar }}}" class="avatar img-circle">
<img src="/uploads/avatars/{{{ $user->avatar }}}" class="avatar img-circle hidden-print">
@else
<img src="{{{ $user->gravatar() }}}" class="avatar img-circle">
<img src="{{{ $user->gravatar() }}}" class="avatar img-circle hidden-print">
@endif
<h3 class="name">{{{ $user->fullName() }}}
@if ($user->employee_num)
Expand All @@ -33,7 +33,7 @@
<!--<a href="{{ route('update/user', $user->id) }}" class="btn btn-warning pull-right edit"><i class="fa fa-pencil"></i> @lang('button.edit') This User</a>-->
<div class="row header">

<div class="btn-group pull-right">
<div class="btn-group pull-right hidden-print">
<button class="btn btn-default" data-toggle="dropdown">@lang('button.actions')
<span class="caret"></span>
</button>
Expand Down Expand Up @@ -77,7 +77,7 @@
<th class="col-md-3">Asset Type</th>
<th class="col-md-2">Asset Tag</th>
<th class="col-md-2">Name</th>
<th class="col-md-1">Actions</th>
<th class="col-md-1 hidden-print">Actions</th>
</tr>
</thead>
<tbody>
Expand All @@ -90,7 +90,7 @@
<td><a href="{{ route('view/hardware', $asset->id) }}">{{{ $asset->asset_tag }}}</a></td>
<td><a href="{{ route('view/hardware', $asset->id) }}">{{{ $asset->name }}}</a></td>

<td> <a href="{{ route('checkin/hardware', array('assetId'=> $asset->id, 'backto'=>'user')) }}" class="btn-flat info">Checkin</a></td>
<td class="hidden-print"> <a href="{{ route('checkin/hardware', array('assetId'=> $asset->id, 'backto'=>'user')) }}" class="btn-flat info">Checkin</a></td>
</tr>
@endforeach
</tbody>
Expand All @@ -116,15 +116,15 @@
<tr>
<th class="col-md-5">Name</th>
<th class="col-md-6">Serial</th>
<th class="col-md-1">Actions</th>
<th class="col-md-1 hidden-print">Actions</th>
</tr>
</thead>
<tbody>
@foreach ($user->licenses as $license)
<tr>
<td><a href="{{ route('view/license', $license->id) }}">{{{ $license->name }}}</a></td>
<td><a href="{{ route('view/license', $license->id) }}">{{{ mb_strimwidth($license->serial, 0, 50, "...") }}}</a></td>
<td> <a href="{{ route('checkin/license', array('licenseseat_id'=> $license->pivot->id, 'backto'=>'user')) }}" class="btn-flat info">Checkin</a>
<td class="hidden-print"> <a href="{{ route('checkin/license', array('licenseseat_id'=> $license->pivot->id, 'backto'=>'user')) }}" class="btn-flat info">Checkin</a>
</td>
</tr>
@endforeach
Expand Down Expand Up @@ -155,14 +155,14 @@
<thead>
<tr>
<th class="col-md-5">Name</th>
<th class="col-md-1">Actions</th>
<th class="col-md-1 hidden-print">Actions</th>
</tr>
</thead>
<tbody>
@foreach ($user->accessories as $accessory)
<tr>
<td><a href="{{ route('view/accessory', $accessory->id) }}">{{{ $accessory->name }}}</a></td>
<td> <a href="{{ route('checkin/accessory', array('accessory_id'=> $accessory->pivot->id, 'backto'=>'user')) }}" class="btn-flat info">Checkin</a>
<td class="hidden-print"> <a href="{{ route('checkin/accessory', array('accessory_id'=> $accessory->pivot->id, 'backto'=>'user')) }}" class="btn-flat info">Checkin</a>
</td>
</tr>
@endforeach
Expand Down Expand Up @@ -190,10 +190,10 @@
<table class="table table-hover">
<thead>
<tr>
<th class="col-md-3">Date</th>
<th class="col-md-3"><span class="line"></span>@lang('table.action')</th>
<th class="col-md-3"><span class="line"></span>@lang('general.asset')</th>
<th class="col-md-3"><span class="line"></span>@lang('table.by')</th>
<th class="col-md-2">Date</th>
<th class="col-md-2"><span class="line"></span>@lang('table.action')</th>
<th class="col-md-2"><span class="line"></span>@lang('general.asset')</th>
<th class="col-md-2"><span class="line"></span>@lang('table.by')</th>
</tr>
</thead>
<tbody>
Expand Down Expand Up @@ -232,10 +232,10 @@


</div>
</div>


<!-- side address column -->
<div class="col-md-3 address pull-right">
<div class="col-md-3 address pull-right hidden-print">



Expand Down
15 changes: 15 additions & 0 deletions public/assets/css/compiled/print.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
body {margin:0; padding:0; line-height: 1.4em; word-spacing:1px; letter-spacing:0.2px; font: 13px Arial, Helvetica,"Lucida Grande", serif; color: #000; width:auto}

.content a:link:after, #content a:visited:after {
content: "";
}
/*Remove Element*/
#footer, .footer, .navbar, navbar-header, .nav, .navbar-nav, .navbar-right, #sidebar-nav, .btn, .btn-flat, .dataTables_length, .dataTables_filter, .paginate_button, .dataTables_info {display:none;}


.content {margin-left: 10px; border: 0px; width:auto}

.col-md-9, .col-md-3 { width: 100%; }

.header{ margin-bottom: 10px; }

0 comments on commit 817384b

Please sign in to comment.