added mail template callback functions

This commit is contained in:
b3yond 2018-07-22 13:47:56 +02:00
parent 89fce872f3
commit a05205289f
2 changed files with 13 additions and 1 deletions

View file

@ -87,6 +87,18 @@ def city_page(city):
return dict(info='There is no Ticketfrei bot in your city yet. Create one yourself!')
@get('/city/mail/<city>')
@view('template/mail.tpl')
def display_mail_page(city, user):
return user.state()
@post('/city/mail/submit/<city>')
def subscribe_mail(user, city):
email = request.forms['mailaddress']
redirect('/city/' + city)
@get('/settings')
@view('template/settings.tpl')
def settings(user):

View file

@ -6,7 +6,7 @@ import markdown as md
html = md.markdown(markdown)
%>
<form action="/city/mail/<% print(city) %>" method="post">
<form action="/city/mail/submit/<% print(city) %>" method="post">
<input type="text" name="mailaddress" placeholder="E-Mail address" id="mailaddress">
<input name='confirm' value='Subscribe to E-Mail notifications' type='submit'/>
</form>