Sortable categories.

This commit is contained in:
James Cole
2015-04-11 14:53:22 +02:00
parent ca3d59dc33
commit 505aee22bb
4 changed files with 331 additions and 11 deletions

View File

@@ -27,6 +27,10 @@
</div>
</div>
@stop
@section('styles')
<link rel="stylesheet" href="css/bootstrap-sortable.css" type="text/css" media="all" />
@stop
@section('scripts')
<script type="text/javascript">
var currencyCode = '{{Amount::getCurrencyCode()}}';
@@ -35,5 +39,6 @@
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript" src="js/gcharts.options.js"></script>
<script type="text/javascript" src="js/gcharts.js"></script>
<script type="text/javascript" src="js/bootstrap-sortable.js"></script>
<script type="text/javascript" src="js/categories.js"></script>
@stop

View File

@@ -1,9 +1,12 @@
<table class="table table-striped table-bordered">
<tr>
<th>&nbsp;</th>
<th>Name</th>
<th>Last activity</th>
</tr>
<table class="table table-striped table-bordered sortable">
<thead>
<tr>
<th data-defaultsort="disabled">&nbsp;</th>
<th>Name</th>
<th data-dateformat="DD-MMM-YYYY">Last activity</th>
</tr>
</thead>
<tbody>
<tr>
<td>&nbsp;</td>
<td><a href="{{route('categories.noCategory')}}"><em>Without a category</em></a></td>
@@ -20,13 +23,16 @@
<td>
<a href="{{route('categories.show',$category->id)}}" title="{{{$category->name}}}">{{{$category->name}}}</a>
</td>
<td>
@if($category->lastActivity)
@if($category->lastActivity)
<td data-value="{{$category->lastActivity->format('d-m-Y')}}">
{{$category->lastActivity->format('jS F Y')}}
@else
</td>
@else
<td>
<em>Never</em>
@endif
</td>
</td>
@endif
</tr>
@endforeach
</tbody>
</table>