Added /about page.

master
q3k 2013-02-20 11:14:06 +01:00
parent 9cd5c83635
commit 48fe434b83
2 changed files with 122 additions and 65 deletions

18
main.py
View File

@ -29,9 +29,7 @@ def mailman_subscribe(email, mailing_list):
return False
return True
@app.route('/', methods=["POST", "GET"])
def main():
if request.method == "POST":
def parse_subscribe_requests():
if "email" in request.form:
email = request.form["email"].strip()
if len(email) > 0:
@ -55,7 +53,7 @@ def main():
W celu aktywacji subskrypcji odwiedź odnośnik wysłany mailem na adres %s." % (subscribed[0], email))
elif len(subscribed) > 1:
flash(u"Pomyślnie zasubskrybowano na listy %s. \
W celu aktywacji subskrypcji odwiedź odnośniki wysłane mailem na adres %s." % \
W celu aktywacji subskrypcji odwiedź odnośniki wysłane mailem na adres %s." % \
(", ".join(l + "@lists.hackerspace.pl" for l in subscribed), email))
if len(failed) > 0:
flash(u"Wystąpił problem z zapisaniem na następujące listy: %s. Ups! Napisz na bofh@hackerspace.pl, spróbujemy to naprawić." % ", ".join(failed), "error")
@ -64,13 +62,17 @@ W celu aktywacji subskrypcji odwiedź odnośniki wysłane mailem na adres %s." %
else:
flash(u"Nie podano adresu email.", "error")
@app.route('/', methods=["GET", "POST"])
def main():
if request.method == "POST":
parse_subscribe_requests()
return render_template('main.html', entries=pull_feed_entries())
@app.route('/about')
@app.route('/about', methods=["GET", "POST"])
def about():
return render_template('about.html')
if request.method == "POST":
parse_subscribe_requests()
return render_template('about.html', entries=pull_feed_entries())
@app.before_request
def csrf_protect():
if request.method == "POST":

View File

@ -1,6 +1,14 @@
{% extends 'basic.html' %}
{% block page_scripts %}
<script type="text/javascript" src="https://widgets.twimg.com/j/2/widget.js"></script>
{% endblock %}
{% block page_style %}
<link rel="stylesheet" href="static/main.css"/>
{% endblock %}
{% block title %}O Hackerspace Warszawa{% endblock %}
{% block content %}
<div id="left">
<div id="about">
<h1>O Hackerspace Warszawa</h1>
<p>
Hackerspace to przestrzeń stworzona i utrzymywana przez grupę kreatywnych osób, które łączy fascynacja
@ -28,4 +36,51 @@
Warszawski Hackerspace znajduje się w budynku ITR, w piwnicy. Sam ITR mieści się na ulicy Długiej 44, tuż obok Metra Ratusz-Arsenał.
</p>
<div id="map"><img src="/static/mapka.png" style="border-radius: 4px;" /></div>
</div>
<div id="right">
<form action="/about" method="post">
<input name=_csrf_token type=hidden value="{{ csrf_token() }}">
<h1 class="mail" style="text-align: center;">Listy mailingowe</h1>
<h2 style="text-align: center; margin-top: -6px;">Zapisz się i porozmawiaj</h2>
<h4><input name="mail-waw" type="checkbox" class="mailcheck" checked="true" />Warszawska</h4>
<div class="mail-desc">Główna lista dyskusyjna hackerspaceu - organizacja i rozwiązywanie problemów.</div>
<h4><input name="mail-proj" type="checkbox" class="mailcheck" checked="true"/>Warszawska Projektowa</h4>
<div class="mail-desc">Informacje o postępie projektów, pomysły, ogłaszanie sukcesów i porażek.</div>
<h4><input name="mail-offtopic" type="checkbox" class="mailcheck" />Off Topic</h4>
<div class="mail-desc">Dyskusja o wszystkim i o niczym. Niski stosunek sygnału do szumu.</div>
<center>
<input type="text" name="email" class="email-entry" placeholder="twoj@email.com" />
<input type="submit" value="Zapisz się" class="email-submit" />
</center>
</form>
<h1 class="twitter">Twitter</h1>
<script type="text/javascript">
new TWTR.Widget({
version: 2,
type: 'profile',
rpp: 5,
interval: 6000,
theme: {
shell: {
background: '#eee',
color: '#222'
},
tweets: {
background: '#eee',
color: '#222',
links: '#001ea6'
}
},
features: {
scrollbar: false,
loop: false,
live: false,
hashtags: true,
timestamp: true,
avatars: true,
behavior: 'all'
}
}).render().setUser('hackerspacepl').start();
</script>
</div>
{% endblock %}