From 0608d02aab70e4dacb746b62ccfa12d8d9ff5baa Mon Sep 17 00:00:00 2001
From: Jacek Lebioda <jacek.lebioda@uni.lu>
Date: Thu, 14 Dec 2017 11:41:18 +0100
Subject: [PATCH] Using data-tables in flying teams and rooms pages

---
 .../flying_teams/index.html                   | 20 +++++++++++++++++++
 .../equipment_and_rooms/rooms/add.html        |  2 +-
 .../equipment_and_rooms/rooms/index.html      | 20 +++++++++++++++++++
 3 files changed, 41 insertions(+), 1 deletion(-)

diff --git a/smash/web/templates/equipment_and_rooms/flying_teams/index.html b/smash/web/templates/equipment_and_rooms/flying_teams/index.html
index 4a55f895..df8165b1 100644
--- a/smash/web/templates/equipment_and_rooms/flying_teams/index.html
+++ b/smash/web/templates/equipment_and_rooms/flying_teams/index.html
@@ -50,3 +50,23 @@
         <p>No flying teams found.</p>
     {% endif %}
 {% endblock maincontent %}
+
+{% block scripts %}
+    {{ block.super }}
+
+    <script src="{% static 'AdminLTE/plugins/datatables/jquery.dataTables.min.js' %}"></script>
+    <script src="{% static 'AdminLTE/plugins/datatables/dataTables.bootstrap.min.js' %}"></script>
+
+    <script>
+        $(function () {
+            $('#table').DataTable({
+                "paging": true,
+                "lengthChange": false,
+                "searching": true,
+                "ordering": true,
+                "info": true,
+                "autoWidth": false
+            });
+        });
+    </script>
+{% endblock scripts %}
diff --git a/smash/web/templates/equipment_and_rooms/rooms/add.html b/smash/web/templates/equipment_and_rooms/rooms/add.html
index 36cc0a78..bd8406ec 100644
--- a/smash/web/templates/equipment_and_rooms/rooms/add.html
+++ b/smash/web/templates/equipment_and_rooms/rooms/add.html
@@ -26,7 +26,7 @@
                     <div class="col-sm-6">
                         {% for field in form %}
                             <div class="form-group  {% if field.errors %}has-error{% endif %}">
-                                <label for="{# TODO #}" class="col-sm-4 control-label">
+                                <label for="{{ field.id_for_label }}" class="col-sm-4 control-label">
                                     {{ field.label }}
                                 </label>
 
diff --git a/smash/web/templates/equipment_and_rooms/rooms/index.html b/smash/web/templates/equipment_and_rooms/rooms/index.html
index 454cd79e..c5d34b72 100644
--- a/smash/web/templates/equipment_and_rooms/rooms/index.html
+++ b/smash/web/templates/equipment_and_rooms/rooms/index.html
@@ -59,3 +59,23 @@
         <p>No rooms found.</p>
     {% endif %}
 {% endblock maincontent %}
+
+{% block scripts %}
+    {{ block.super }}
+
+    <script src="{% static 'AdminLTE/plugins/datatables/jquery.dataTables.min.js' %}"></script>
+    <script src="{% static 'AdminLTE/plugins/datatables/dataTables.bootstrap.min.js' %}"></script>
+
+    <script>
+        $(function () {
+            $('#table').DataTable({
+                "paging": true,
+                "lengthChange": false,
+                "searching": true,
+                "ordering": true,
+                "info": true,
+                "autoWidth": false
+            });
+        });
+    </script>
+{% endblock scripts %}
-- 
GitLab