return u"Nicht implementiert."
def list(self):
- "Lists all pages"
+ "Lists all reports"
records = model.meta.Session.query(model.WrReport)
records = records.order_by(sa.sql.expression.desc(model.WrReport.id))
c.paginator = paginate.Page(records, page=int(request.params.get('page', 1)), items_per_page = 25)
--- /dev/null
+import logging
+
+from pylons import request, response, session, tmpl_context as c
+from pylons.controllers.util import abort, redirect_to
+import webhelpers.paginate as paginate
+
+from wradmin.lib.base import BaseController, render
+import wradmin.model as model
+import sqlalchemy as sa
+
+log = logging.getLogger(__name__)
+
+class RodelbahnController(BaseController):
+
+ def list(self):
+ "Lists all sledding routes"
+ records = model.meta.Session.query(model.WrSleddingCache)
+ records = records.order_by(model.WrSleddingCache.page_title)
+ c.paginator = paginate.Page(records, page=int(request.params.get('page', 1)), items_per_page = 25)
+ return render('rodelbahn_list.html')
\ No newline at end of file
#from webhelpers.html.tags import checkbox, password
from routes import url_for
+
+def wiki(page=None):
+ "TODO: Improve, escape, ..."
+ return 'http://www.winterrodeln.org/wiki/' + page
\ No newline at end of file
salt, pwd_md5 = tuple(pwd_parts[2:4]) # salt = 'd25b2886'; pwd_md5 = '41e46c952790b1b442aac4f24f7ea7a8'
else:
raise AuthKitError("Password in the MediaWiki database format has an unexpected format ('%s' instead of e.g. ':B:d25b2886:41e46c952790b1b442aac4f24f7ea7a8')" % pwd)
- log.info("user: '%s'; md5 of salt+' '+entered_pwd: '%s'; md5-part of DB-pwd: %s" % (username, md5(salt + '-' + md5(password)), pwd_md5))
+ # log.info("user: '%s'; md5 of salt+' '+entered_pwd: '%s'; md5-part of DB-pwd: %s" % (username, md5(salt + '-' + md5(password)), pwd_md5))
return md5(salt + '-' + md5(password)) == pwd_md5
def init_model(engine):
"""Call me before using any of the tables or classes in the model"""
- ## Reflected tables must be defined and mapped here
- #global reflected_table
- #reflected_table = sa.Table("Reflected", meta.metadata, autoload=True,
- # autoload_with=engine)
- #orm.mapper(Reflected, reflected_table)
- #
meta.Session.configure(bind=engine)
meta.engine = engine
-## Non-reflected tables may be defined and mapped at module level
wrreport_table = sa.Table("wrreport", meta.metadata,
- sa.Column("id", sa.types.Integer, primary_key=True),
- sa.Column("page_id", sa.types.Integer, nullable=False),
- sa.Column("page_title", sa.types.Unicode(255), nullable=False),
- sa.Column("date_report", sa.types.Date),
- sa.Column("date_entry", sa.types.DateTime, nullable=False),
- sa.Column("date_invalid", sa.types.DateTime),
- sa.Column("condition", sa.types.Integer),
- sa.Column("description", sa.types.Unicode),
- sa.Column("author_name", sa.types.Unicode(30)),
- sa.Column("author_ip", sa.types.Unicode(15)),
- sa.Column("author_userid", sa.types.Integer),
- sa.Column("author_username", sa.types.Unicode(30)),
- sa.Column("delete_date", sa.types.DateTime),
- sa.Column("delete_person_name", sa.types.Unicode(30)),
- sa.Column("delete_person_ip", sa.types.Unicode(15)),
- sa.Column("delete_person_userid", sa.types.Integer),
- sa.Column("delete_person_username", sa.types.Unicode(30)),
- sa.Column("delete_reason_public", sa.types.Unicode),
+ sa.Column("id", types.Integer, primary_key=True),
+ sa.Column("page_id", types.Integer, nullable=False),
+ sa.Column("page_title", types.Unicode(255), nullable=False),
+ sa.Column("date_report", types.Date),
+ sa.Column("date_entry", types.DateTime, nullable=False),
+ sa.Column("date_invalid", types.DateTime),
+ sa.Column("condition", types.Integer),
+ sa.Column("description", types.Unicode),
+ sa.Column("author_name", types.Unicode(30)),
+ sa.Column("author_ip", types.Unicode(15)),
+ sa.Column("author_userid", types.Integer),
+ sa.Column("author_username", types.Unicode(30)),
+ sa.Column("delete_date", types.DateTime),
+ sa.Column("delete_person_name", types.Unicode(30)),
+ sa.Column("delete_person_ip", types.Unicode(15)),
+ sa.Column("delete_person_userid", types.Integer),
+ sa.Column("delete_person_username", types.Unicode(30)),
+ sa.Column("delete_reason_public", types.Unicode),
+ )
+
+
+wrsleddingcache_table = sa.Table("wrsleddingcache", meta.metadata,
+ sa.Column("page_id", types.Integer, primary_key=True),
+ sa.Column("page_title", types.Unicode(255)),
+ sa.Column("length", types.Integer),
+ sa.Column("walktime", types.Integer),
+ sa.Column("height_top", types.Integer),
+ sa.Column("height_bottom", types.Integer),
+ sa.Column("walkup_separate", types.Boolean),
+ sa.Column("lift", types.Boolean),
+ sa.Column("night_light", types.Boolean),
+ sa.Column("sledge_rental", types.Boolean),
+ sa.Column("public_transport", types.Boolean),
+ sa.Column("image", types.Unicode(255)),
+ sa.Column("position_latitude", types.Float),
+ sa.Column("position_longitude", types.Float),
+ sa.Column("information", types.Unicode(255)),
+ sa.Column("under_construction", types.Boolean),
+ sa.Column("show_in_overview", types.Boolean),
)
class WrReport(object):
pass
-orm.mapper(WrReport, wrreport_table)
+class WrSleddingCache(object):
+ pass
+
+
+orm.mapper(WrReport, wrreport_table)
+orm.mapper(WrSleddingCache, wrsleddingcache_table)
-## Classes for reflected tables may be defined here, but the table and
-## mapping itself must be done in the init_model function
-#reflected_table = None
-#
-#class Reflected(object):
-# pass
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:py="http://genshi.edgewall.org/"
- xmlns:xi="http://www.w3.org/2001/XInclude">
+ xmlns:py="http://genshi.edgewall.org/"
+ xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="master.html" />
<head>
- <title>Rodelbahnberichte</title>
+ <title>Rodelbahnberichte</title>
</head>
<body>
<p>${c.paginator.pager('$link_first $link_previous $first_item to $last_item of $item_count $link_next $link_last', controller='bericht', action='list')}</p>
<table>
- <tr>
- <th>ID</th>
- <th>Seite</th>
+ <tr>
+ <th>ID</th>
+ <th>Seite</th>
<th>Datum Eintrag</th>
<th>Datum Ungültig</th>
<th>Datum für Bericht</th>
<th>Beschreibung (WikiText)</th>
<th>Autor-Name</th>
<th>Gelöscht</th>
- </tr>
- <tr py:for="r in c.paginator">
- <td><a href="${h.url_for(controller='bericht', action='view', id=r.id)}">${r.id}</a></td>
- <td>${r.page_title}</td>
- <td>${r.date_entry}</td>
- <td>${r.date_invalid}</td>
+ </tr>
+ <tr py:for="r in c.paginator">
+ <td><a href="${h.url_for(controller='bericht', action='view', id=r.id)}">${r.id}</a></td>
+ <td>${r.page_title}</td>
+ <td>${r.date_entry}</td>
+ <td>${r.date_invalid}</td>
<td>${r.date_report}</td>
<td>${r.condition}</td>
<td>${r.description}</td>
- <td>${r.author_name}</td>
+ <td>${r.author_name}</td>
<td>${r.delete_date}</td>
- </tr>
+ </tr>
</table>
<p>${c.paginator.pager('~2~', controller='bericht', action='list')}</p>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:py="http://genshi.edgewall.org/"
- xmlns:xi="http://www.w3.org/2001/XInclude">
+ xmlns:py="http://genshi.edgewall.org/"
+ xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="master.html" />
<head>
- <title>Hauptmenü</title>
+ <title>Hauptmenü</title>
</head>
<body>
<p>Willkommen auf den Administrationsseiten von Winterrodeln.</p>
<ul>
- <li><a href="${h.url_for(controller='wrcontroller', action='forumlink')}">Forum-Links auf Rodelbahnen</a></li>
- <li><a href="${h.url_for(controller='wrcontroller', action='rodelbahnbox')}">Rodelbahn-Infoboxen</a> überprüfen und Koordinaten aktualisieren</li>
+ <li><a href="${h.url_for(controller='wrcontroller', action='forumlink')}">Forum-Links auf Rodelbahnen</a></li>
+ <li><a href="${h.url_for(controller='rodelbahn', action='list')}">Rodelbahnen</a></li>
<li><a href="${h.url_for(controller='bericht', action='list')}">Rodelbahnberichte</a></li>
+ <li><a href="${h.url_for(controller='wrcontroller', action='rodelbahnbox')}">Rodelbahn-Infoboxen</a> überprüfen und Koordinaten aktualisieren</li>
</ul>
<ul>
- <li><a href="http://www.winterrodeln.org/wiki">Winterrodeln-Hauptseite</a></li>
- <li><a href="http://www.winterrodeln-forum.org/">Forum</a></li>
+ <li><a href="http://www.winterrodeln.org/wiki">Winterrodeln-Hauptseite</a></li>
+ <li><a href="http://www.winterrodeln-forum.org/">Forum</a></li>
</ul>
</body>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:py="http://genshi.edgewall.org/"
- xmlns:xi="http://www.w3.org/2001/XInclude"
- py:strip="True">
+ xmlns:py="http://genshi.edgewall.org/"
+ xmlns:xi="http://www.w3.org/2001/XInclude"
+ py:strip="True">
<py:match path="head" once="True">
<head py:attrs="select('@*')">
- <title py:with="title = list(select('title/text()'))">Winterrodeln<py:if test="title"> - ${title}</py:if></title>
- <meta content="text/html; charset=UTF-8" http-equiv="content-type" />
- <meta name="robots" content="noindex, nofollow" />
- <link rel="stylesheet" type="text/css" media="screen" href="${h.url_for('/style.css')}" />
+ <title py:with="title = list(select('title/text()'))">Winterrodeln<py:if test="title"> - ${title}</py:if></title>
+ <meta content="text/html; charset=UTF-8" http-equiv="content-type" />
+ <meta name="robots" content="noindex, nofollow" />
+ <link rel="stylesheet" type="text/css" media="screen" href="${h.url_for('/style.css')}" />
<link rel="shortcut icon" href="${h.url_for('/favicon.png')}" />
</head>
</py:match>
<h1 id="header"><img src="${h.url_for('/titlebanner.png')}" alt="Winterrodeln Administration"/></h1>
<ul id="mainmenu">
- <li><a href="${h.url_for(controller='wrcontroller', action='index')}">Übersicht</a></li>
- <li><a href="${h.url_for(controller='wrcontroller', action='rodelbahnbox')}">Rodelbahnboxen</a></li>
- <li><a href="${h.url_for(controller='wrcontroller', action='forumlink')}">Forum-Links</a></li>
+ <li><a href="${h.url_for(controller='wrcontroller', action='index')}">Übersicht</a></li>
+ <li><a href="${h.url_for(controller='rodelbahn', action='list')}">Rodelbahnen</a></li>
+ <li><a href="${h.url_for(controller='wrcontroller', action='rodelbahnbox')}">Rodelbahnboxen</a></li>
<li><a href="${h.url_for(controller='bericht', action='list')}">Berichte</a></li>
+ <li><a href="${h.url_for(controller='wrcontroller', action='forumlink')}">Forum-Links</a></li>
</ul>
<div id="content">
--- /dev/null
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:py="http://genshi.edgewall.org/"
+ xmlns:xi="http://www.w3.org/2001/XInclude">
+<xi:include href="master.html" />
+
+<head>
+ <title>Rodelbahnen</title>
+</head>
+
+<body>
+<h2>Rodelbahnen</h2>
+
+<p>${c.paginator.pager('$link_first $link_previous $first_item bis $last_item von $item_count $link_next $link_last', controller='rodelbahn', action='list')}</p>
+
+<table>
+ <tr>
+ <th>ID</th>
+ <th>Name</th>
+ <th>Länge</th>
+ <th>Gehzeit</th>
+ <th>Höhe (oben)</th>
+ <th>Höhe (unten)</th>
+ <th>Aufstieg getrennt</th>
+ <th>Lift</th>
+ <th>Licht</th>
+ <th>Rodelverleih</th>
+ <th>Öffentl. Anreise</th>
+ <th>Bild</th>
+ <th>Latitude</th>
+ <th>Longitude</th>
+ <th>Information</th>
+ <th>In Arbeit</th>
+ <th>In Übersicht</th>
+ </tr>
+ <tr py:for="s in c.paginator">
+ <td>${s.page_id}</td>
+ <td>${s.page_title}</td>
+ <td>${s.length}</td>
+ <td>${s.walktime}</td>
+ <td>${s.height_top}</td>
+ <td>${s.height_bottom}</td>
+ <td>${s.walkup_separate}</td>
+ <td>${s.lift}</td>
+ <td>${s.night_light}</td>
+ <td>${s.sledge_rental}</td>
+ <td>${s.public_transport}</td>
+ <td><small>${s.image}</small></td>
+ <td>${s.position_latitude}</td>
+ <td>${s.position_longitude}</td>
+ <td>${s.information}</td>
+ <td>${s.under_construction}</td>
+ <td>${s.show_in_overview}</td>
+ </tr>
+</table>
+
+<p>${c.paginator.pager('~2~', controller='rodelbahn', action='list')}</p>
+
+</body>
+</html>