Skip to content

Commit bf1e075

Browse files
committed
Fixes #87 - made datatables responsive
1 parent 7c97477 commit bf1e075

File tree

6 files changed

+60
-12141
lines changed

6 files changed

+60
-12141
lines changed

app/views/backend/hardware/index.blade.php

Lines changed: 37 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848
@if ($assets->count() > 0)
4949

50-
50+
<div class="table-responsive">
5151
<table id="example">
5252
<thead>
5353
<tr role="row">
@@ -57,12 +57,10 @@
5757
<th class="col-md-3" bSortable="true">@lang('general.name')</th>
5858
@endif
5959
<th class="col-md-2" bSortable="true">@lang('admin/hardware/table.serial')</th>
60-
@if (Input::get('Pending') || Input::get('Undeployable') || Input::get('RTD'))
60+
6161
<th class="col-md-2" bSortable="true">@lang('general.status')</th>
62-
@else
63-
<th class="col-md-2" bSortable="true">@lang('admin/hardware/table.checkoutto')</th>
62+
6463
<th class="col-md-2" bSortable="true">@lang('admin/hardware/table.location')</th>
65-
@endif
6664
<th class="col-md-2">@lang('admin/hardware/table.eol')</th>
6765
<th class="col-md-1">@lang('admin/hardware/table.change')</th>
6866
<th class="col-md-2 actions" bSortable="false">@lang('table.actions')</th>
@@ -72,43 +70,53 @@
7270

7371
@foreach ($assets as $asset)
7472
<tr>
75-
<td><a href="{{ route('view/hardware', $asset->id) }}">{{ $asset->asset_tag }}</a></td>
76-
<td><a href="{{ route('view/model', $asset->model->id) }}">{{ $asset->model->name }}</a></td>
73+
<td><a href="{{ route('view/hardware', $asset->id) }}">{{{ $asset->asset_tag }}}</a></td>
74+
<td><a href="{{ route('view/model', $asset->model->id) }}">{{{ $asset->model->name }}}</a></td>
75+
7776
@if (Setting::getSettings()->display_asset_name)
78-
<td><a href="{{ route('view/hardware', $asset->id) }}">{{ $asset->name }}</a></td>
77+
<td><a href="{{ route('view/hardware', $asset->id) }}">{{{ $asset->name }}}</a></td>
7978
@endif
80-
<td>{{ $asset->serial }}</td>
81-
@if (Input::get('Pending') || Input::get('Undeployable') || Input::get('RTD'))
79+
80+
<td>{{{ $asset->serial }}}</td>
81+
82+
8283
<td>
8384
@if (Input::get('Pending'))
8485
@lang('general.pending')
8586
@elseif (Input::get('RTD'))
8687
@lang('general.ready_to_deploy')
8788
@elseif (Input::get('Undeployable'))
88-
@if ($asset->assetstatus) {{{ $asset->assetstatus->name }}}
89+
@if ($asset->assetstatus)
90+
{{{ $asset->assetstatus->name }}}
8991
@endif
92+
@else
93+
@if ($asset->assigneduser)
94+
<a href="{{ route('view/user', $asset->assigned_to) }}">
95+
{{{ $asset->assigneduser->fullName() }}}
96+
</a>
97+
@else
98+
@if ($asset->assetstatus)
99+
{{{ $asset->assetstatus->name }}}
100+
@endif
101+
@endif
90102
@endif
91103
</td>
92-
@else
93-
<td>
94-
@if ($asset->assigneduser)
95-
<a href="{{ route('view/user', $asset->assigned_to) }}">
96-
{{{ $asset->assigneduser->fullName() }}}
97-
</a>
98-
@endif
99-
</td>
100-
<td>
101-
@if ($asset->assigneduser && $asset->assetloc) <a href="{{ route('update/location', $asset->assetloc->id) }}">{{{ $asset->assetloc->name }}}</a>
102-
@else
103-
@if ($asset->assetstatus) {{{ $asset->assetstatus->name }}}
104-
@endif
104+
105+
106+
107+
<td>
108+
@if ($asset->assigneduser && $asset->assetloc)
109+
<a href="{{ route('update/location', $asset->assetloc->id) }}">{{{ $asset->assetloc->name }}}</a>
110+
@elseif ($asset->defaultLoc)
111+
<a href="{{ route('update/location', $asset->defaultLoc->id) }}">{{{ $asset->defaultLoc->name }}}</a>
112+
105113
@endif
106-
</td>
107114

108-
@endif
115+
</td>
109116

110117
<td>
111-
@if ($asset->model->eol) {{{ $asset->eol_date() }}}
118+
@if ($asset->model->eol)
119+
{{{ $asset->eol_date() }}}
112120
@endif
113121
</td>
114122

@@ -131,6 +139,7 @@
131139
@endforeach
132140
</tbody>
133141
</table>
142+
</div>
134143
@else
135144
<div class="col-md-9">
136145
<div class="alert alert-info alert-block">
@@ -140,6 +149,7 @@
140149
</div>
141150

142151
</div>
152+
143153
@endif
144154

145155

app/views/backend/layouts/default.blade.php

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<html lang="en">
44
<head>
5-
5+
66
<!-- Basic Page Needs
77
================================================== -->
88
<meta charset="utf-8" />
@@ -41,10 +41,15 @@
4141
<link rel="stylesheet" href="{{ asset('assets/css/compiled/user-profile.css') }}" type="text/css" media="screen" />
4242
<link rel="stylesheet" href="{{ asset('assets/css/compiled/form-showcase.css') }}" type="text/css" media="screen" />
4343
<link rel="stylesheet" href="{{ asset('assets/css/lib/jquery.dataTables.css') }}" type="text/css" media="screen" />
44+
<link rel="stylesheet" href="//cdn.datatables.net/responsive/1.0.2/css/dataTables.responsive.css" type="text/css" media="screen" />
45+
46+
4447

4548
<!-- global header javascripts -->
4649
<script src="//code.jquery.com/jquery-latest.js"></script>
47-
<script src="{{ asset('assets/js/jquery.dataTables.js') }}"></script>
50+
<script src="//cdn.datatables.net/1.10.3/js/jquery.dataTables.min.js"></script>
51+
<script src="//cdn.datatables.net/responsive/1.0.2/js/dataTables.responsive.js"></script>
52+
4853
<script>
4954
window.snipeit = {
5055
settings: {
@@ -70,14 +75,14 @@
7075
}
7176
7277
@show
73-
78+
7479
</style>
75-
80+
7681

7782
</head>
7883

7984
<body>
80-
85+
8186
<!-- navbar -->
8287

8388

@@ -206,7 +211,7 @@
206211
<i class="icon-cog"></i> @lang('general.settings')
207212
</a>
208213
</li>
209-
214+
210215
</ul>
211216
</li>
212217
@endif
@@ -248,9 +253,9 @@
248253
<a href="{{ URL::to('admin/licenses') }}" >
249254
<i class="icon-certificate"></i>
250255
<span>@lang('general.licenses')</span>
251-
256+
252257
</a>
253-
258+
254259
</li>
255260
<li{{ (Request::is('admin/users*') ? ' class="active"><div class="pointer"><div class="arrow"></div><div class="arrow_border"></div></div>' : '>') }}
256261
<a href="{{ URL::to('admin/users') }}">
@@ -338,7 +343,7 @@
338343

339344
<div class="muted credit" style="position:absolute;margin-top:1px;left:80px;margin-right:100px;"><a target="_blank" href="http://snipeitapp.com">Snipe IT</a> is a free open source
340345
project by <a target="_blank" href="http://twitter.com/snipeyhead">@snipeyhead</a>.</div>
341-
<div class="muted credit" style="position:absolute;margin-top:1px;right:80px;margin-left:100px;"><a target="_blank" href="https://github.com/snipe/snipe-it">Fork it</a> | <a target="_blank" href="http://docs.snipeitapp.com/">Documentation</a> |
346+
<div class="muted credit" style="position:absolute;margin-top:1px;right:80px;margin-left:100px;"><a target="_blank" href="https://github.com/snipe/snipe-it">Fork it</a> | <a target="_blank" href="http://docs.snipeitapp.com/">Documentation</a> |
342347
<a target="_blank" href="https://github.com/snipe/snipe-it/issues?state=open">Report a Bug</a> &nbsp; &nbsp; (alpha-0.4.3)</p>
343348
</div>
344349
</div>
@@ -373,5 +378,6 @@
373378
<script src="{{ asset('assets/js/snipeit.js') }}"></script>
374379

375380

381+
376382
</body>
377383
</html>

app/views/backend/licenses/index.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
</div>
1818

1919
<div class="row form-wrapper">
20-
20+
<div class="table-responsive">
2121
<table id="example">
2222
<thead>
2323
<tr role="row">
@@ -112,5 +112,5 @@
112112

113113
</tbody>
114114
</table>
115-
115+
</div>
116116
@stop

app/views/backend/reports/index.blade.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@
2020
<h3>@lang('general.depreciation_report')</h3>
2121
</div>
2222

23-
<div class="row table">
24-
<div class="col-md-12">
23+
<div class="row">
24+
25+
<div class="table-responsive">
2526
<table id="example">
2627
<thead>
2728
<tr role="row">
@@ -88,7 +89,7 @@
8889
@endforeach
8990
</tbody>
9091
</table>
91-
</div>
9292

93+
</div>
9394

9495
@stop

app/views/backend/users/index.blade.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
@if ($users->getTotal() > 0)
3535
<div class="row-fluid table users-list">
36+
<div class="table-responsive">
3637
<table id="example">
3738
<thead>
3839
<tr role="row">
@@ -92,7 +93,7 @@
9293
</tbody>
9394
</table>
9495
</div>
95-
96+
</div>
9697
<!-- {{
9798
Datatable::table()
9899
->addColumn(Lang::get('name'))

0 commit comments

Comments
 (0)