From e78021a0fe5695cd171b50cdda4ebf9b84e6b08f Mon Sep 17 00:00:00 2001 From: philipp Date: Wed, 27 Dec 2017 22:31:13 +0000 Subject: [PATCH] rodelbahn_list.html now uses jinja2. git-svn-id: http://www.winterrodeln.org/svn/wradmin/trunk@2757 7aebc617-e5e2-0310-91dc-80fb5f6d2477 --- wradmin/controllers/rodelbahn.py | 11 ++-- wradmin/templates/rodelbahn_list.html | 82 ++++++++++++--------------- 2 files changed, 42 insertions(+), 51 deletions(-) diff --git a/wradmin/controllers/rodelbahn.py b/wradmin/controllers/rodelbahn.py index 66107f2..32654a8 100644 --- a/wradmin/controllers/rodelbahn.py +++ b/wradmin/controllers/rodelbahn.py @@ -1,5 +1,5 @@ #!/usr/bin/python3.4 -from flask import request, abort, redirect, url_for, flash +from flask import request, abort, redirect, url_for, flash, render_template import paginate import sqlalchemy as sa @@ -17,11 +17,10 @@ class RodelbahnController: """Lists all sled runs""" q = model.meta.Session.query(model.WrSledrunCache) q = q.order_by(model.WrSledrunCache.page_title) - c = TemplateContext() - c.paginator = paginate.Page(q.all(), page=int(request.args.get('page', 1)), - url_maker=lambda page: url_for('rodelbahn_list', page=page), - items_per_page=25) - return render_genshi_template('rodelbahn_list.html', c=c) + paginator = paginate.Page(q.all(), page=int(request.args.get('page', 1)), + url_maker=lambda page: url_for('rodelbahn_list', page=page), + items_per_page=25) + return render_template('rodelbahn_list.html', paginator=paginator) def view(self, id): """Displays a sled run""" diff --git a/wradmin/templates/rodelbahn_list.html b/wradmin/templates/rodelbahn_list.html index 754ef89..e67900d 100644 --- a/wradmin/templates/rodelbahn_list.html +++ b/wradmin/templates/rodelbahn_list.html @@ -1,71 +1,63 @@ - - - - +{% extends "master.html" %} +{% block title %}Rodelbahnen{% endblock %} - - Rodelbahnen - - - +{% block content %}

Rodelbahnen

-

Die folgende Lise wurde automatisiert von den Rodelbahnboxen gesammelt. Da dies nicht automatisch passiert, kann es sein, dass die Liste "veraltete" Information enthält.

+

Die folgende Lise wurde automatisiert von den Rodelbahnboxen gesammelt. Da dies nicht automatisch passiert, kann es sein, dass die Liste "veraltete" Information enthält.

-(1) Rodelbahnboxen auslesen und DB aktualisieren -(2) Rodelbahnen in den Regionslisten aktualisieren +(1) Rodelbahnboxen auslesen und DB aktualisieren +(2) Rodelbahnen in den Regionslisten aktualisieren -

${Markup(c.paginator.pager('$link_first $link_previous $first_item bis $last_item von $item_count $link_next $link_last'))}

+

{{paginator.pager('$link_first $link_previous $first_item bis $last_item von $item_count $link_next $link_last') | safe}}

- + - - - + + + - + - + - - - - - - - - - - - - - - - - - - - - + {% for s in paginator %} + + + + + + + + + + + + + + + + + + + + + {% endfor %}
ID NameLängeLänge GehzeitHöhe (oben)Höhe (unten)Aufstieg möglichHöhe (oben)Höhe (unten)Aufstieg möglich Aufstieg getrennt Lift Licht RodelverleihÖffentl. AnreiseÖffentl. Anreise Bild Latitude Longitude Information Forum-ID In ArbeitIn ÜbersichtIn Übersicht
${s.page_id}${s.page_title}${s.length}${s.walkup_time}${s.top_elevation}${s.bottom_elevation}${h.bool(s.walkup_possible)}${h.tristate_float(s.walkup_separate)}${h.bool(s.lift)}${h.tristate_float(s.night_light)}${h.bool(s.sled_rental)}${h.public_transport(s.public_transport)}${s.image}${s.position_latitude}${s.position_longitude}${s.information_phone}${s.forum_id}${h.bool(s.under_construction)}${h.bool(s.show_in_overview)}
{{s.page_id}}{{s.page_title}}{{s.length}}{{s.walkup_time}}{{s.top_elevation}}{{s.bottom_elevation}}{{h.bool(s.walkup_possible)}}{{h.tristate_float(s.walkup_separate)}}{{h.bool(s.lift)}}{{h.tristate_float(s.night_light)}}{{h.bool(s.sled_rental)}}{{h.public_transport(s.public_transport)}}{{s.image}}{{s.position_latitude}}{{s.position_longitude}}{{s.information_phone}}{{s.forum_id}}{{h.bool(s.under_construction)}}{{h.bool(s.show_in_overview)}}
-

${Markup(c.paginator.pager('~2~'))}

+

{{paginator.pager('~2~') | safe}}

- - +{% endblock %} -- 2.39.5