[chronojump-server] Airport page in only one vertical page



commit 082bda08cc798376a79ffe00d27f5b5d82acf82b
Author: chronojump <chronojump@chronojumpserver>
Date:   Fri Jul 7 10:08:30 2017 +0200

    Airport page in only one vertical page

 chronojumpserver/js/airport.js          |   25 +++----------------------
 chronojumpserver/templates/airport.html |    8 --------
 chronojumpserver/views.py               |   11 +----------
 3 files changed, 4 insertions(+), 40 deletions(-)
---
diff --git a/chronojumpserver/js/airport.js b/chronojumpserver/js/airport.js
index 6b96d03..5745e52 100644
--- a/chronojumpserver/js/airport.js
+++ b/chronojumpserver/js/airport.js
@@ -45,27 +45,8 @@ $(document).ready(function() {
     });
 
     setInterval(function() {
-       /* Set the interval for refresh */
-       var pageId = parseInt($('#airportPageId').val());
-       var totalPages = parseInt($('#totalPages').val());
-       console.log(pageId);
-       console.log(totalPages);
-       var nextPageId = pageId + 1;
-       if (nextPageId > totalPages) {
-           nextPageId = 1;
-       }
-       console.log(nextPageId)
-       window.location.href = "/airport/"+nextPageId;
-   }, 15000);
-
-   $('li.pageIndicator').on('click', function() {
-       var pageId = parseInt($(this).attr('data-slide-to'));
-       var currentPageId = parseInt($('#airportPageId').val());
-       if (pageId != currentPageId) {
-            // Go to the page selected
-            window.location.href = "/airport/"+pageId;
-       }
-
-   })
+       /* Set the interval for refresh */
+       window.location.href = "/airport";
+    }, 15000);
 
 });
diff --git a/chronojumpserver/templates/airport.html b/chronojumpserver/templates/airport.html
index 00f2917..b685906 100644
--- a/chronojumpserver/templates/airport.html
+++ b/chronojumpserver/templates/airport.html
@@ -36,8 +36,6 @@
 {%block body_class %}airport{% endblock %}
 
 {% block content_fluid %}
-<input type="hidden" id="airportPageId" value="{{airportPageId}}"  />
-<input type="hidden" id="totalPages" value="{{totalPages}}"  />
 <table id="airportTable" class="table table-bordered table-hover" style="margin-top: 40px">
     <thead>
         <tr>
@@ -68,12 +66,6 @@
     </thead>
 </table>
 
-<ol class="carousel-indicators">
-    {% for n in range(totalPages) %}
-
-        <li ©="{{n+1}}" class="pageIndicator {% if (n+1 == airportPageId) %}active{% endif %}"></li>
-    {% endfor %}
-  </ol>
 {% endblock %}
 
 {% block footer %}
diff --git a/chronojumpserver/views.py b/chronojumpserver/views.py
index 42f87d5..31c78fd 100755
--- a/chronojumpserver/views.py
+++ b/chronojumpserver/views.py
@@ -19,19 +19,10 @@ def index():
 @app.route('/airport')
 def airport():
     """Airport mode."""
-    return redirect('/airport/1')
-
-@app.route('/airport/<pageId>')
-def airport_page(pageId=1):
-    """Airport mode."""
 
     stations = [ station.serialize for station in Station.query.filter(Station.type != 'S')]
     players =  [ player.serialize for player in Person.query.all()]
-    totalPages = len(players) / 15
-    _min = (int(pageId) -1) * 15;
-    _max =  _min + 15
-    return render_template('airport.html', stations=stations, players=players[_min:_max],
-                           airportPageId=int(pageId), totalPages=totalPages+1)
+    return render_template('airport.html', stations=stations, players=players)
 
 @app.route('/results')
 def show_results():


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]