aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Lemon <matt@matthewlemon.com>2020-03-09 17:41:46 +0000
committerMatthew Lemon <matt@matthewlemon.com>2020-03-09 17:41:46 +0000
commitea1d48ab0a327ec9a2ce6f18989cd1ca5e1dbba5 (patch)
treea6605f195f0a2a03838c60c5746ce673c7b7d490
parent0f2c9fc6fddb7a1e435ab7d1ca8962383a7cc731 (diff)
better formatting for table using Datatables
-rw-r--r--ctrack/caf/templates/caf/applicablesystem_list.html2
-rw-r--r--ctrack/static/js/project.js7
-rw-r--r--ctrack/templates/base.html4
3 files changed, 9 insertions, 4 deletions
diff --git a/ctrack/caf/templates/caf/applicablesystem_list.html b/ctrack/caf/templates/caf/applicablesystem_list.html
index f0ba634..985960a 100644
--- a/ctrack/caf/templates/caf/applicablesystem_list.html
+++ b/ctrack/caf/templates/caf/applicablesystem_list.html
@@ -11,7 +11,7 @@
<div class="col-sm-12">
<h3>Applicable Systems</h3>
- <table id="datatable" class="display" style="width:100%">
+ <table id="datatable" class="display compact cell-border" style="width:100%">
<thead>
<tr>
<th>Organisation</th>
diff --git a/ctrack/static/js/project.js b/ctrack/static/js/project.js
index 2df7245..1679114 100644
--- a/ctrack/static/js/project.js
+++ b/ctrack/static/js/project.js
@@ -1,4 +1,9 @@
/* Project specific Javascript goes here. */
$(document).ready(function() {
- $('#datatable').DataTable();
+ $('#datatable').DataTable({
+ ordering: true,
+ searching: true,
+ dom: 'B<"clear">lfrtip',
+ buttons: true
+ });
} );
diff --git a/ctrack/templates/base.html b/ctrack/templates/base.html
index 903fac8..c9e4044 100644
--- a/ctrack/templates/base.html
+++ b/ctrack/templates/base.html
@@ -27,7 +27,7 @@
<link href="{% static 'css/project.css' %}" rel="stylesheet">
{# <link rel="stylesheet" type="text/css" href="css/DataTables/datatables.min.css"/>#}
- <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/dt-1.10.20/af-2.3.4/b-1.6.1/cr-1.5.2/r-2.2.3/datatables.min.css"/>
+ <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/dt-1.10.20/af-2.3.4/b-1.6.1/b-print-1.6.1/cr-1.5.2/r-2.2.3/datatables.min.css"/>
{% endblock %}
@@ -108,7 +108,7 @@
<script src="{% static 'js/project.js' %}"></script>
{# <script src="{% static 'js/DataTables/datatables.min.js' %}"></script>#}
- <script type="text/javascript" src="https://cdn.datatables.net/v/dt/dt-1.10.20/af-2.3.4/b-1.6.1/cr-1.5.2/r-2.2.3/datatables.min.js"></script>
+ <script type="text/javascript" src="https://cdn.datatables.net/v/dt/dt-1.10.20/af-2.3.4/b-1.6.1/b-print-1.6.1/cr-1.5.2/r-2.2.3/datatables.min.js"></script>
{% endblock javascript %}