Website update. There is now a community section.
|
|
@ -33,10 +33,12 @@ app.add_url_rule('/docs/flask-docs.zip', endpoint='docs.zip',
|
||||||
build_only=True)
|
build_only=True)
|
||||||
|
|
||||||
from flask_website.views.general import general
|
from flask_website.views.general import general
|
||||||
|
from flask_website.views.community import community
|
||||||
from flask_website.views.mailinglist import mailinglist
|
from flask_website.views.mailinglist import mailinglist
|
||||||
from flask_website.views.snippets import snippets
|
from flask_website.views.snippets import snippets
|
||||||
from flask_website.views.extensions import extensions
|
from flask_website.views.extensions import extensions
|
||||||
app.register_module(general)
|
app.register_module(general)
|
||||||
|
app.register_module(community)
|
||||||
app.register_module(mailinglist)
|
app.register_module(mailinglist)
|
||||||
app.register_module(snippets)
|
app.register_module(snippets)
|
||||||
app.register_module(extensions)
|
app.register_module(extensions)
|
||||||
|
|
|
||||||
BIN
flask_website/static/badges/flask-powered.png
Executable file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
flask_website/static/badges/flask-project-s.png
Executable file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
flask_website/static/badges/i-wish.png
Executable file
|
After Width: | Height: | Size: 5.9 KiB |
BIN
flask_website/static/badges/made-with-flask-s.png
Executable file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
flask_website/static/badges/powered-by-flask-s.png
Executable file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
flask_website/static/badges/unfortunately-not.png
Executable file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
flask_website/static/community.png
Executable file
|
After Width: | Height: | Size: 24 KiB |
1037
flask_website/static/logo/flask.eps
Executable file
BIN
flask_website/static/logo/flask.pdf
Executable file
BIN
flask_website/static/logo/flask.png
Executable file
|
After Width: | Height: | Size: 208 KiB |
166
flask_website/static/logo/flask.svg
Executable file
|
After Width: | Height: | Size: 72 KiB |
|
|
@ -6,8 +6,8 @@ h2, h3 { font-family: 'Garamond', 'Georgia', serif; font-weight: normal; }
|
||||||
h1 { margin: 0 0 30px 0; background: url(/static/flask.png) no-repeat center;
|
h1 { margin: 0 0 30px 0; background: url(/static/flask.png) no-repeat center;
|
||||||
height: 165px; }
|
height: 165px; }
|
||||||
h1 span { display: none; }
|
h1 span { display: none; }
|
||||||
h2 { font-size: 28px; margin: 15px 0 5px 0; }
|
h2 { font-size: 30px; margin: 15px 0 5px 0; }
|
||||||
h3 { font-size: 22px; margin: 15px 0 5px 0; }
|
h3 { font-size: 24px; margin: 15px 0 5px 0; }
|
||||||
textarea, code,
|
textarea, code,
|
||||||
pre { font-family: 'Consolas', 'Menlo', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono',
|
pre { font-family: 'Consolas', 'Menlo', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono',
|
||||||
monospace!important; font-size: 15px; background: #eee; }
|
monospace!important; font-size: 15px; background: #eee; }
|
||||||
|
|
@ -19,6 +19,7 @@ ul li:before { content: "\00BB \0020"; color: #888; position: absolute; margin-l
|
||||||
ol { line-height: 1.4; margin: 15px 0 15px 30px; padding: 0; }
|
ol { line-height: 1.4; margin: 15px 0 15px 30px; padding: 0; }
|
||||||
blockquote { margin: 0; font-style: italic; color: #444; }
|
blockquote { margin: 0; font-style: italic; color: #444; }
|
||||||
.footer { font-size: 13px; color: #888; text-align: right; margin-top: 25px; }
|
.footer { font-size: 13px; color: #888; text-align: right; margin-top: 25px; }
|
||||||
|
.more { text-align: right; margin-top: 0; font-size: 0.9em; font-style: italic; }
|
||||||
.nav { text-align: center; }
|
.nav { text-align: center; }
|
||||||
.nav a { font-style: italic; }
|
.nav a { font-style: italic; }
|
||||||
.backnav { float: right; color: #444; font-style: italic;
|
.backnav { float: right; color: #444; font-style: italic;
|
||||||
|
|
@ -40,6 +41,10 @@ th { background: #eee; font-weight: normal; }
|
||||||
|
|
||||||
td input { border: none; padding: 0; }
|
td input { border: none; padding: 0; }
|
||||||
|
|
||||||
|
/* latest version button */
|
||||||
|
.latestver { margin: 20px 0 0 0; float: right; font-style: italic; }
|
||||||
|
.latestver strong { font-weight: normal; }
|
||||||
|
|
||||||
/* forms */
|
/* forms */
|
||||||
input, textarea, select { border: 1px solid black; padding: 2px; background: white;
|
input, textarea, select { border: 1px solid black; padding: 2px; background: white;
|
||||||
font-family: 'Georgia', serif; font-size: 17px; color: #004B6B; }
|
font-family: 'Georgia', serif; font-size: 17px; color: #004B6B; }
|
||||||
|
|
@ -52,6 +57,13 @@ input.openid { background: url(openid.png) no-repeat 4px center;
|
||||||
padding-left: 26px; }
|
padding-left: 26px; }
|
||||||
.formlist dt { color: #004B6B; margin: 8px 0; }
|
.formlist dt { color: #004B6B; margin: 8px 0; }
|
||||||
|
|
||||||
|
/* badges */
|
||||||
|
.badge { margin: 15px -30px; padding: 0 30px;
|
||||||
|
border: 1px solid #eee; }
|
||||||
|
.badge p { margin: 0; padding: 10px 0; line-height: 0; }
|
||||||
|
.badge img { margin: 0; }
|
||||||
|
.badge pre { margin: 0 -30px; padding: 5px 30px; }
|
||||||
|
|
||||||
/* snippets */
|
/* snippets */
|
||||||
.snippet-author { margin: 0 0 20px 0; font-size: 0.9em; }
|
.snippet-author { margin: 0 0 20px 0; font-size: 0.9em; }
|
||||||
#comment-box { background: #fafafa; margin: 45px -30px 15px -30px; padding: 10px 30px; }
|
#comment-box { background: #fafafa; margin: 45px -30px 15px -30px; padding: 10px 30px; }
|
||||||
|
|
|
||||||
12
flask_website/templates/_twitter.html
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
{% macro tweet_box(tweets, limit=none) %}
|
||||||
|
<div class=twitter>
|
||||||
|
<ul>
|
||||||
|
{%- for tweet in tweets.get(limit) %}
|
||||||
|
<li>
|
||||||
|
<a href="http://twitter.com/{{ tweet.user }}">{{ tweet.user }}</a>:
|
||||||
|
{{ tweet.text|urlize }}
|
||||||
|
<span class=meta>— {{ tweet.pub_date|timedeltaformat }} ago via {{ tweet.via }}</span>
|
||||||
|
{%- endfor %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
{% endmacro %}
|
||||||
32
flask_website/templates/community/badges.html
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
{% extends "community/layout.html" %}
|
||||||
|
{% block title %}Badges{% endblock %}
|
||||||
|
{% macro badge(filename, title) -%}
|
||||||
|
<a href="{{ url_for('general.index', _external=true) }}"><img
|
||||||
|
src="{{ url_for('.static', filename='badges/' ~ filename, _external=true) }}"
|
||||||
|
border="0"
|
||||||
|
alt="{{ title }}"
|
||||||
|
title="{{ title }}"></a>
|
||||||
|
{%- endmacro %}
|
||||||
|
{% macro show_badge(filename, title) -%}
|
||||||
|
<div class=badge>
|
||||||
|
<p>{{ badge(filename, title) }}
|
||||||
|
<pre>{{ badge(filename, title)|forceescape }}</pre>
|
||||||
|
</div>
|
||||||
|
{%- endmacro %}
|
||||||
|
{% block body %}
|
||||||
|
<h2>Badges</h2>
|
||||||
|
<p>
|
||||||
|
If you want to share the word and want to add a “powered by
|
||||||
|
Flask” badge to your website you can display one of these
|
||||||
|
nifty badges. We also have some badges if your website is not
|
||||||
|
yet powered by Flask :)
|
||||||
|
<h3>Large Badges</h3>
|
||||||
|
{{ show_badge('flask-powered.png', 'Flask powered') }}
|
||||||
|
{{ show_badge('i-wish.png', 'I wish this site were Flask powered') }}
|
||||||
|
{{ show_badge('unfortunately-not.png', 'Unfortunately not Flask powered') }}
|
||||||
|
<h3>Small Badges</h3>
|
||||||
|
{{ show_badge('flask-project-s.png', 'a Flask project') }}
|
||||||
|
{{ show_badge('made-with-flask-s.png', 'made with Flask') }}
|
||||||
|
{{ show_badge('powered-by-flask-s.png', 'powered by Flask') }}
|
||||||
|
<p><small>Idea for badges inspired by the Django Framework badges.</small></p>
|
||||||
|
{% endblock %}
|
||||||
21
flask_website/templates/community/index.html
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
{% extends "community/layout.html" %}
|
||||||
|
{% block body %}
|
||||||
|
<p>
|
||||||
|
Even though Flask is a rather new project, there has already a healty
|
||||||
|
community evolved around it. There is an active
|
||||||
|
<a href="{{ url_for('mailinglist.index') }}">mailinglist</a> both for
|
||||||
|
developers using Flask as well as working on the core, and an
|
||||||
|
<a href="{{ url_for('community.irc') }}">IRC</a> channel.
|
||||||
|
<p>
|
||||||
|
If you want to spread the word, there is also a selection of
|
||||||
|
<a href="{{ url_for('community.badges') }}">badges</a> and
|
||||||
|
<a href="{{ url_for('community.logos') }}">logos</a> you can use
|
||||||
|
on your own website.
|
||||||
|
<ul>
|
||||||
|
<li><a href="{{ url_for('mailinglist.index') }}">Mailinglist</a>
|
||||||
|
<li><a href="{{ url_for('community.irc') }}">IRC Channel</a>
|
||||||
|
<li><a href="{{ url_for('community.twitter') }}">Flask on Twitter</a>
|
||||||
|
<li><a href="{{ url_for('community.badges') }}">Badges</a>
|
||||||
|
<li><a href="{{ url_for('community.logos') }}">Logos</a>
|
||||||
|
</ul>
|
||||||
|
{% endblock %}
|
||||||
26
flask_website/templates/community/irc.html
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
{% extends "community/layout.html" %}
|
||||||
|
{% block title %}IRC Channel{% endblock %}
|
||||||
|
{% block body %}
|
||||||
|
<h2>IRC Channel</h2>
|
||||||
|
<p>
|
||||||
|
The Flask IRC channel is <code>#pocoo</code> on irc.freenode.net.
|
||||||
|
Flask shares that channel with other Pocoo projects, so please
|
||||||
|
let the others know that you are talking about Flask when asking
|
||||||
|
a question.
|
||||||
|
<p>
|
||||||
|
You can use any IRC client to connect to freenode. If you don't
|
||||||
|
have one yet, pick one from the list:
|
||||||
|
<ul>
|
||||||
|
<li><a href="http://pidgin.im/">Pidgin</a>, Windows, Linux, OS X
|
||||||
|
<li><a href="http://xchat.org/">X-Chat</a>, Linux
|
||||||
|
<li><a href="http://mirc.com/">mirc</a>, Windows
|
||||||
|
<li><a href="http://colloquy.info/">colloquy</a>, OS X
|
||||||
|
</ul>
|
||||||
|
<p>
|
||||||
|
Alternatively you can also use the freenode web interface to
|
||||||
|
join the IRC channel: <a href="http://bit.ly/pocooirc">open
|
||||||
|
#pocoo in your browser</a>.
|
||||||
|
<p>
|
||||||
|
If you want to read up on older discussions you can access
|
||||||
|
the IRC logs on <a href=http://dev.pocoo.org/irclogs/>dev.pocoo.org/irclogs</a>.
|
||||||
|
{% endblock %}
|
||||||
10
flask_website/templates/community/layout.html
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
{% extends "layout.html" %}
|
||||||
|
{% block head %}
|
||||||
|
{{ super() }}
|
||||||
|
<style type=text/css>
|
||||||
|
h1 { background-image: url({{ url_for('.static', filename='community.png') }}); }
|
||||||
|
</style>
|
||||||
|
{% endblock %}
|
||||||
|
{% block body_title %}
|
||||||
|
<h1><span>Flask Community</span></h1>
|
||||||
|
{% endblock %}
|
||||||
27
flask_website/templates/community/logos.html
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
{% extends "community/layout.html" %}
|
||||||
|
{% block title %}Logos{% endblock %}
|
||||||
|
{% macro logo(format) -%}
|
||||||
|
<a href="{{ url_for('.static', filename='logo/flask.' ~ format)
|
||||||
|
}}">{{ format|upper }} format</a>
|
||||||
|
{%- endmacro %}
|
||||||
|
{% block body %}
|
||||||
|
<h2>Logos</h2>
|
||||||
|
<p>
|
||||||
|
The Flask logo is available for download and use in the formats
|
||||||
|
below. You can use the logo to promote Flask like you want.
|
||||||
|
The image is licensed under the Creative Commons
|
||||||
|
“Attribution-No Derivative Works 3.0 Austria” license.
|
||||||
|
<a href="http://creativecommons.org/licenses/by-nd/3.0/at/deed.en"
|
||||||
|
>Read license text</a>.
|
||||||
|
<ul>
|
||||||
|
<li>{{ logo('png') }}: for online and screen usage
|
||||||
|
<li>{{ logo('svg') }}: for online and screen usage
|
||||||
|
<li>{{ logo('eps') }}: for print use
|
||||||
|
<li>{{ logo('pdf') }}: for print use
|
||||||
|
</ul>
|
||||||
|
<p>
|
||||||
|
The font used in the logo is “Hightower Text roman” from the
|
||||||
|
Font Bureau foundry. The font can be purchased from
|
||||||
|
<a href="http://www.ascenderfonts.com/font/hightower-text-roman.aspx"
|
||||||
|
>Ascender Fonts</a>.
|
||||||
|
{% endblock %}
|
||||||
23
flask_website/templates/community/twitter.html
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
{% extends "community/layout.html" %}
|
||||||
|
{% from "_twitter.html" import tweet_box %}
|
||||||
|
{% block head %}
|
||||||
|
{{ super() }}
|
||||||
|
{% endblock %}
|
||||||
|
{% block body %}
|
||||||
|
<h2>Twitter</h2>
|
||||||
|
<p>
|
||||||
|
Currently there is no dedicated Twitter account for updates
|
||||||
|
regarding Flask, but here are some accounts that you might
|
||||||
|
want to follow:
|
||||||
|
<ul>
|
||||||
|
<li><a href="http://twitter.com/mitsuhiko">@mitsuhiko</a> —
|
||||||
|
development lead
|
||||||
|
<li><a href="http://twitter.com/PocooProject">@PocooProject</a> —
|
||||||
|
official Pocoo Project account
|
||||||
|
</ul>
|
||||||
|
<h3>Recent Tweets</h3>
|
||||||
|
<p>
|
||||||
|
Here some aggregated tweets from various people all over the planet
|
||||||
|
mentioning Flask:
|
||||||
|
{{ tweet_box(tweets, 15) }}
|
||||||
|
{% endblock %}
|
||||||
|
|
@ -1,11 +1,14 @@
|
||||||
{% extends "layout.html" %}
|
{% extends "layout.html" %}
|
||||||
|
{% from "_twitter.html" import tweet_box %}
|
||||||
|
{% set latest_version = '0.2' %}
|
||||||
|
{% set download_url = 'http://pypi.python.org/packages/source/' ~
|
||||||
|
'F/Flask/Flask-' ~ latest_version ~ '.tar.gz' %}
|
||||||
{% block head %}
|
{% block head %}
|
||||||
{{ super() }}
|
{{ super() }}
|
||||||
<style type=text/css>
|
<style type=text/css>
|
||||||
h1 { margin: 0 0 30px 0; background: url({{ url_for('.static', filename='logo.png') }}) no-repeat center; height: 165px; }
|
h1 { margin: 0 0 30px 0; background: url({{ url_for('.static', filename='logo.png') }}) no-repeat center; height: 165px; }
|
||||||
h1 span, p.tagline { display: none; }
|
h1 span, p.tagline { display: none; }
|
||||||
</style>
|
</style>
|
||||||
<link href="{{ tweets.feed_url }}" rel="alternate" title="Flask on Twitter" type="application/atom+xml">
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block body_title %}
|
{% block body_title %}
|
||||||
{{ super() }}
|
{{ super() }}
|
||||||
|
|
@ -17,6 +20,9 @@
|
||||||
And before you ask: It's <a href="{{ url_for('docs.show', page='license')
|
And before you ask: It's <a href="{{ url_for('docs.show', page='license')
|
||||||
}}">BSD licensed</a>!
|
}}">BSD licensed</a>!
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
<p class=latestver>
|
||||||
|
<strong>Latest Version:</strong>
|
||||||
|
<a href="{{ download_url }}" title="Download tarball">{{ latest_version }}</a>
|
||||||
<h2>Flask is Fun</h2>
|
<h2>Flask is Fun</h2>
|
||||||
<pre><span class=ig>from flask import Flask
|
<pre><span class=ig>from flask import Flask
|
||||||
app = Flask(__name__)</span>
|
app = Flask(__name__)</span>
|
||||||
|
|
@ -33,13 +39,13 @@ def hello():
|
||||||
<span class=ig> * Running on http://localhost:5000/</span></pre>
|
<span class=ig> * Running on http://localhost:5000/</span></pre>
|
||||||
<h2>Interested?</h2>
|
<h2>Interested?</h2>
|
||||||
<ul>
|
<ul>
|
||||||
|
<li><a href="{{ download_url }}">Download latest release</a> ({{ latest_version }})
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ url_for('docs.index') }}">Read the documentation</a> or download as
|
<a href="{{ url_for('docs.index') }}">Read the documentation</a> or download as
|
||||||
<a href="{{ url_for('docs.pdf') }}">PDF</a> and
|
<a href="{{ url_for('docs.pdf') }}">PDF</a> and
|
||||||
<a href="{{ url_for('docs.zip') }}">zipped HTML</a>
|
<a href="{{ url_for('docs.zip') }}">zipped HTML</a>
|
||||||
<li><a href="{{ url_for('mailinglist.index') }}">Join the mailinglist</a>
|
<li><a href="{{ url_for('mailinglist.index') }}">Join the mailinglist</a>
|
||||||
<li><a href=http://github.com/mitsuhiko/flask>Fork it on github</a>
|
<li><a href=http://github.com/mitsuhiko/flask>Fork it on github</a>
|
||||||
<li><a href=http://pypi.python.org/pypi/Flask>Download it from PyPI</a>
|
|
||||||
</ul>
|
</ul>
|
||||||
<h2>What’s in the Box?</h2>
|
<h2>What’s in the Box?</h2>
|
||||||
<ul>
|
<ul>
|
||||||
|
|
@ -54,6 +60,7 @@ def hello():
|
||||||
}}#sessions">secure cookies</a> (client side sessions)
|
}}#sessions">secure cookies</a> (client side sessions)
|
||||||
<li>100% <a href=http://www.python.org/dev/peps/pep-0333/>WSGI 1.0</a> compliant
|
<li>100% <a href=http://www.python.org/dev/peps/pep-0333/>WSGI 1.0</a> compliant
|
||||||
<li>Unicode based
|
<li>Unicode based
|
||||||
|
<li>extensively <a href="{{ url_for('docs.index') }}">documented</a>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>What do Flask Apps look like?</h2>
|
<h2>What do Flask Apps look like?</h2>
|
||||||
<p>
|
<p>
|
||||||
|
|
@ -71,22 +78,15 @@ def hello():
|
||||||
<p>Found a bug? Have a good idea for improving Flask? Head over to
|
<p>Found a bug? Have a good idea for improving Flask? Head over to
|
||||||
<a href=http://github.com/mitsuhiko/flask>Flask's github</a> page and
|
<a href=http://github.com/mitsuhiko/flask>Flask's github</a> page and
|
||||||
create a new ticket or fork. If you just want to chat with fellow
|
create a new ticket or fork. If you just want to chat with fellow
|
||||||
developers, go to <code>#pocoo</code> on irc.freenode.net.
|
developers, visit <a href="{{ url_for('community.irc') }}">the IRC
|
||||||
|
channel</a> or join <a href="{{ url_for('mailinglist.index') }}"
|
||||||
|
>the mailinglist</a>.
|
||||||
{% if tweets %}
|
{% if tweets %}
|
||||||
<h2>Recent Tweets</h2>
|
<h2>Recent Tweets</h2>
|
||||||
<div class=twitter>
|
|
||||||
<p>
|
<p>
|
||||||
What people say about Flask on <a href=http://twitter.com/>Twitter</a>:
|
What people say about Flask on <a href=http://twitter.com/>Twitter</a>:
|
||||||
<ul>
|
{{ tweet_box(tweets, 3) }}
|
||||||
{%- for tweet in tweets %}
|
<p class=more><a href="{{ url_for('community.twitter') }}">more »<a>
|
||||||
<li>
|
|
||||||
<a href="http://twitter.com/{{ tweet.user }}">{{ tweet.user }}</a>:
|
|
||||||
{{ tweet.text|urlize }}
|
|
||||||
<span class=meta>— {{ tweet.pub_date|timedeltaformat }} ago via {{ tweet.via }}</span>
|
|
||||||
{%- endfor %}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<a href="http://github.com/mitsuhiko/flask"><img style="position: fixed; top: 0; right: 0; border: 0;"
|
<a href="http://github.com/mitsuhiko/flask"><img style="position: fixed; top: 0; right: 0; border: 0;"
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
<p class=nav>
|
<p class=nav>
|
||||||
<a href="{{ url_for('general.index') }}">overview</a> //
|
<a href="{{ url_for('general.index') }}">overview</a> //
|
||||||
<a href="{{ url_for('docs.index') }}">documentation</a> //
|
<a href="{{ url_for('docs.index') }}">documentation</a> //
|
||||||
<a href="{{ url_for('mailinglist.index') }}">mailinglist</a> //
|
<a href="{{ url_for('community.index') }}">community</a> //
|
||||||
<a href="{{ url_for('snippets.index') }}">snippets</a> //
|
<a href="{{ url_for('snippets.index') }}">snippets</a> //
|
||||||
<a href="{{ url_for('extensions.index') }}">extensions</a>
|
<a href="{{ url_for('extensions.index') }}">extensions</a>
|
||||||
{% for message in get_flashed_messages() %}
|
{% for message in get_flashed_messages() %}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
{% extends "mailinglist/layout.html" %}
|
{% extends "mailinglist/layout.html" %}
|
||||||
{% block title %}Mailinglist Archive{% endblock %}
|
{% block title %}Mailinglist Archive{% endblock %}
|
||||||
{% block body %}
|
{% block body %}
|
||||||
|
<p class=backnav>
|
||||||
|
<a href="{{ url_for('index') }}">« list information</a>
|
||||||
<h2>Mailinglist Archive</h2>
|
<h2>Mailinglist Archive</h2>
|
||||||
<ul class=archive>
|
<ul class=archive>
|
||||||
{% for thread in threads %}
|
{% for thread in threads %}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
{% extends "mailinglist/layout.html" %}
|
{% extends "mailinglist/layout.html" %}
|
||||||
{% block title %}Mailinglist{% endblock %}
|
{% block title %}Mailinglist{% endblock %}
|
||||||
{% block body %}
|
{% block body %}
|
||||||
|
<h2>Mailinglist Information</h2>
|
||||||
<p>
|
<p>
|
||||||
There is a mailinglist for Flask hosted on <a
|
There is a mailinglist for Flask hosted on <a
|
||||||
href=http://librelist.com/>librelist</a> you can use for both user requests
|
href=http://librelist.com/>librelist</a> you can use for both user requests
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,12 @@
|
||||||
{% block title %}{{ thread.title }}{% endblock %}
|
{% block title %}{{ thread.title }}{% endblock %}
|
||||||
{% block head %}
|
{% block head %}
|
||||||
{{ super() }}
|
{{ super() }}
|
||||||
<script type=text/javascript src=/static/mailinglist.js></script>
|
<script type=text/javascript src="{{ url_for('.static',
|
||||||
|
filename='mailinglist.js') }}"></script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block body %}
|
{% block body %}
|
||||||
<p class=backnav>
|
<p class=backnav>
|
||||||
<a href=/mailinglist/archive/>« back to archive</a>
|
<a href="{{ url_for('archive') }}">« back to archive</a>
|
||||||
<h2>{{ thread.title }}</h2>
|
<h2>{{ thread.title }}</h2>
|
||||||
|
|
||||||
<ul class=mailtree>
|
<ul class=mailtree>
|
||||||
|
|
|
||||||
|
|
@ -21,10 +21,9 @@ class SearchResult(object):
|
||||||
class SearchQuery(object):
|
class SearchQuery(object):
|
||||||
fetch_timeout = 10
|
fetch_timeout = 10
|
||||||
|
|
||||||
def __init__(self, required=None, optional=None, limit=5, timeout=60, lang=None):
|
def __init__(self, required=None, optional=None, timeout=60, lang=None):
|
||||||
self.required = set(x.lower() for x in (required or ()))
|
self.required = set(x.lower() for x in (required or ()))
|
||||||
self.optional = set(x.lower() for x in (optional or ()))
|
self.optional = set(x.lower() for x in (optional or ()))
|
||||||
self.limit = limit
|
|
||||||
self.lang = lang
|
self.lang = lang
|
||||||
self.timeout = timeout
|
self.timeout = timeout
|
||||||
self._last_fetch = 0
|
self._last_fetch = 0
|
||||||
|
|
@ -49,6 +48,7 @@ class SearchQuery(object):
|
||||||
return 'http://search.twitter.com/search.%s?%s' % (kind, url_encode({
|
return 'http://search.twitter.com/search.%s?%s' % (kind, url_encode({
|
||||||
'q': self.query,
|
'q': self.query,
|
||||||
'result_type': 'mixed',
|
'result_type': 'mixed',
|
||||||
|
'rpp': 30,
|
||||||
'lang': self.lang
|
'lang': self.lang
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
|
@ -86,6 +86,19 @@ class SearchQuery(object):
|
||||||
return len(self._cached or ())
|
return len(self._cached or ())
|
||||||
|
|
||||||
def __iter__(self):
|
def __iter__(self):
|
||||||
|
return iter(self.get())
|
||||||
|
|
||||||
|
def get(self, limit=None):
|
||||||
self._try_refresh()
|
self._try_refresh()
|
||||||
for item in (self._cached or ())[:self.limit]:
|
seq = (self._cached or ())
|
||||||
yield item
|
if limit is not None:
|
||||||
|
seq = seq[:limit]
|
||||||
|
return seq
|
||||||
|
|
||||||
|
|
||||||
|
flask_tweets = SearchQuery(
|
||||||
|
required=['flask'],
|
||||||
|
optional=['code', 'dev', 'python', 'py', 'pocoo', 'micro',
|
||||||
|
'mitsuhiko', 'framework', 'django', 'jinja', 'werkzeug',
|
||||||
|
'documentation', 'app']
|
||||||
|
)
|
||||||
|
|
|
||||||
28
flask_website/views/community.py
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
from flask import Module, render_template
|
||||||
|
from flask_website.twitter import flask_tweets
|
||||||
|
|
||||||
|
community = Module(__name__, url_prefix='/community')
|
||||||
|
|
||||||
|
@community.route('/')
|
||||||
|
def index():
|
||||||
|
return render_template('community/index.html')
|
||||||
|
|
||||||
|
|
||||||
|
@community.route('/irc/')
|
||||||
|
def irc():
|
||||||
|
return render_template('community/irc.html')
|
||||||
|
|
||||||
|
|
||||||
|
@community.route('/twitter/')
|
||||||
|
def twitter():
|
||||||
|
return render_template('community/twitter.html', tweets=flask_tweets)
|
||||||
|
|
||||||
|
|
||||||
|
@community.route('/badges/')
|
||||||
|
def badges():
|
||||||
|
return render_template('community/badges.html')
|
||||||
|
|
||||||
|
|
||||||
|
@community.route('/logos/')
|
||||||
|
def logos():
|
||||||
|
return render_template('community/logos.html')
|
||||||
|
|
@ -1,22 +1,17 @@
|
||||||
from flask import Module, render_template, session, redirect, url_for, \
|
from flask import Module, render_template, session, redirect, url_for, \
|
||||||
request, flash, g, Response
|
request, flash, g, Response
|
||||||
from flaskext.openid import COMMON_PROVIDERS
|
from flaskext.openid import COMMON_PROVIDERS
|
||||||
from flask_website import oid, twitter
|
from flask_website import oid
|
||||||
|
from flask_website.twitter import flask_tweets
|
||||||
from flask_website.utils import requires_login
|
from flask_website.utils import requires_login
|
||||||
from flask_website.database import db_session, User
|
from flask_website.database import db_session, User
|
||||||
|
|
||||||
general = Module(__name__)
|
general = Module(__name__)
|
||||||
tweets = twitter.SearchQuery(required=['flask'],
|
|
||||||
optional=['code', 'web', 'python', 'py',
|
|
||||||
'pocoo', 'micro', 'mitsuhiko',
|
|
||||||
'framework', 'django', 'jinja',
|
|
||||||
'werkzeug', 'documentation',
|
|
||||||
'app'])
|
|
||||||
|
|
||||||
|
|
||||||
@general.route('/')
|
@general.route('/')
|
||||||
def index():
|
def index():
|
||||||
return render_template('general/index.html', tweets=tweets)
|
return render_template('general/index.html', tweets=flask_tweets)
|
||||||
|
|
||||||
|
|
||||||
@general.route('/logout/')
|
@general.route('/logout/')
|
||||||
|
|
|
||||||