Schnell-Link fuer verkuerzte Umfrage eingefuegt
verbliebene Zeit wird in den letzten zwei Tagen in Stunden angegeben
This commit is contained in:
parent
4084d22f08
commit
cec69f8846
2 changed files with 20 additions and 4 deletions
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python2.6
|
#!/usr/bin/env python
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
@ -160,7 +160,8 @@ def send_mail(to_address, from_address, subject, text):
|
||||||
use_ssl = use_ssl.lower() in ("1", "true", "yes", "on", "enabled")
|
use_ssl = use_ssl.lower() in ("1", "true", "yes", "on", "enabled")
|
||||||
host = config.get("mail", "host", "localhost")
|
host = config.get("mail", "host", "localhost")
|
||||||
if use_ssl:
|
if use_ssl:
|
||||||
s = smtplib.SMTP_SSL(host)
|
# see http://bugs.python.org/issue11927 (Python 2.7 uses port 25 instead of 465 by default)
|
||||||
|
s = smtplib.SMTP_SSL(host, port=465)
|
||||||
else:
|
else:
|
||||||
s = smtplib.SMTP(host)
|
s = smtplib.SMTP(host)
|
||||||
s.sendmail(from_address, [to_address], msg.as_string())
|
s.sendmail(from_address, [to_address], msg.as_string())
|
||||||
|
|
|
@ -30,7 +30,10 @@ Falls Sie Fragen oder Anregungen zu dieser Umsetzung haben sollten, dann senden
|
||||||
<?python
|
<?python
|
||||||
import datetime
|
import datetime
|
||||||
remaining = datetime.datetime(2012, 8, 25, 0, 0) - datetime.datetime.now()
|
remaining = datetime.datetime(2012, 8, 25, 0, 0) - datetime.datetime.now()
|
||||||
remaining_text = "%d Tage, %d Stunden und %d Minuten" % (remaining.days, remaining.seconds / 3600, (remaining.seconds / 60) % 60)
|
if remaining.days < 2:
|
||||||
|
remaining_text = "%d Stunden und %d Minuten" % (remaining.days * 24 + remaining.seconds / 3600, (remaining.seconds / 60) % 60)
|
||||||
|
else:
|
||||||
|
remaining_text = "%d Tage, %d Stunden und %d Minuten" % (remaining.days, remaining.seconds / 3600, (remaining.seconds / 60) % 60)
|
||||||
?>
|
?>
|
||||||
<p>Es verbleiben nur noch <em>${remaining_text}</em> bis zum Ende des städtischen Beteiligungsverfahrens!</p>
|
<p>Es verbleiben nur noch <em>${remaining_text}</em> bis zum Ende des städtischen Beteiligungsverfahrens!</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -39,7 +42,19 @@ Falls Sie Fragen oder Anregungen zu dieser Umsetzung haben sollten, dann senden
|
||||||
<form action="${base_url}" method="POST">
|
<form action="${base_url}" method="POST">
|
||||||
<div>
|
<div>
|
||||||
<input type="hidden" name="session_id" value="${session.name}" />
|
<input type="hidden" name="session_id" value="${session.name}" />
|
||||||
<input type="submit" class="submit" value="Umfrage starten ..." /><br/>
|
<input type="hidden" name="question_id" value="10" /><!-- letzte Frage -->
|
||||||
|
<input type="submit" class="submit" value="Verkürzte Umfrage | 3 Minuten" /><br/>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
<div class="start_evaluation">
|
||||||
|
<form action="${base_url}" method="POST">
|
||||||
|
<div>
|
||||||
|
<input type="hidden" name="session_id" value="${session.name}" />
|
||||||
|
<input type="submit" class="submit" value="Alle zehn Fragen zu vier Optionen beantworten | 25 Minuten" /><br/>
|
||||||
<input type="image" src="${base_url}media/warnemuende.png" title="Umfrage starten" /><br/>
|
<input type="image" src="${base_url}media/warnemuende.png" title="Umfrage starten" /><br/>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
Loading…
Reference in a new issue