leichte Layout-Aufhuebschungen
This commit is contained in:
parent
e84e413dd7
commit
297b268395
6 changed files with 85 additions and 61 deletions
|
@ -4,45 +4,11 @@
|
|||
|
||||
<py:match path="head" once="true">
|
||||
<head py:attrs="select('@*')">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
${select('*|text()')}
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
${select('*|text()')}
|
||||
</head>
|
||||
</py:match>
|
||||
|
||||
<?python
|
||||
import creoleparser
|
||||
import genshi
|
||||
import datetime
|
||||
|
||||
def formatter(text):
|
||||
if not text:
|
||||
return u""
|
||||
text = text.replace("\\", "\\\\")
|
||||
html = creoleparser.text2html(text, encoding=None).strip()
|
||||
if html.startswith("<p>") and html.endswith("</p>"):
|
||||
html = html[3:-4]
|
||||
return genshi.Markup(html)
|
||||
|
||||
|
||||
TODAY_FORMAT = "%H:%M"
|
||||
FULL_FORMAT = "%d.%m.%y %H:%M"
|
||||
last_day = datetime.datetime.today() - datetime.timedelta(days=1)
|
||||
def show_timestamp(date):
|
||||
if date <= last_day:
|
||||
template = TODAY_FORMAT
|
||||
else:
|
||||
template = FULL_FORMAT
|
||||
return date.strftime(template)
|
||||
|
||||
def nav_links():
|
||||
result = []
|
||||
if prev_link:
|
||||
result.append('<a href="%s" title="zeige neuere Einträge">aktuellere</a>' % prev_link)
|
||||
if next_link:
|
||||
result.append('<a href="%s" title="zeige ältere Einträge">ältere</a>' % next_link)
|
||||
return genshi.Markup(" | ".join(result))
|
||||
?>
|
||||
|
||||
<py:match path="body" once="true">
|
||||
<body py:attrs="select('@*')">
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue