Refactored website
This commit is contained in:
parent
ad55cb7e34
commit
857f5a8020
9 changed files with 282 additions and 272 deletions
|
|
@ -1,113 +1,35 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from urlparse import urlparse
|
||||
from flask import Markup, Module, render_template
|
||||
from flask import Module, render_template
|
||||
from flask_website.twitter import flask_tweets
|
||||
from flask_website.listings.projects import projects
|
||||
|
||||
community = Module(__name__, url_prefix='/community')
|
||||
mod = Module(__name__, url_prefix='/community')
|
||||
|
||||
|
||||
class Project(object):
|
||||
|
||||
def __init__(self, name, url, description, source=None):
|
||||
self.name = name
|
||||
self.url = url
|
||||
self.description = Markup(description)
|
||||
self.source = source
|
||||
|
||||
@property
|
||||
def host(self):
|
||||
return urlparse(self.url)[1]
|
||||
|
||||
@property
|
||||
def sourcehost(self):
|
||||
if self.source is not None:
|
||||
return urlparse(self.source)[1]
|
||||
|
||||
projects = {
|
||||
'websites': [
|
||||
Project('Flask Website', 'http://flask.pocoo.org/', '''
|
||||
<p>
|
||||
The website of the Flask microframework itself including the
|
||||
mailinglist interface, snippet archive and extension registry.
|
||||
'''),
|
||||
Project('Brightonpy', 'http://brightonpy.org/', '''
|
||||
<p>
|
||||
The website of the Brighton Python User Group
|
||||
''', source='http://github.com/j4mie/brightonpy.org/'),
|
||||
Project('vlasiku.lojban.org', 'http://vlasisku.lojban.org/', '''
|
||||
<p>
|
||||
An intelligent search engine for the Lojban dictionary.
|
||||
'''),
|
||||
Project(u's h o r e … software development', 'http://shore.be/', '''
|
||||
<p>Corporate website of Shore Software Development.
|
||||
'''),
|
||||
# this one might change URL soon, check on each update
|
||||
Project('rdrei.net', 'http://new.rdrei.net/', '''
|
||||
<p>Personal website of Pascal Hartig.
|
||||
'''),
|
||||
],
|
||||
'apps': [
|
||||
Project('960 Layout System', 'http://960ls.atomidata.com/', '''
|
||||
<p>
|
||||
The generator of the 960 Layout System is powered by Flask. It
|
||||
generates downloadable 960 stylesheets.
|
||||
'''),
|
||||
Project('hg-review', 'http://review.stevelosh.com/', '''
|
||||
<p>
|
||||
hg-review is a code review system for Mercurial. It is available
|
||||
GPL2 license.
|
||||
''', source='http://bitbucket.org/sjl/hg-review/'),
|
||||
Project('geocron', 'http://geocron.us/', '''
|
||||
<p>
|
||||
By combining your present location with the time of day, geocron
|
||||
automates your life.
|
||||
<p>
|
||||
When you get to your Metro station during the commute home,
|
||||
geocron can send a text message reading "Pick me up dear" to your
|
||||
spouse.
|
||||
'''),
|
||||
Project('Cockerel', 'http://dcolish.github.com/Cockerel/', '''
|
||||
<p>An Online Logic Assistent Based on Coq.
|
||||
''', source='http://github.com/dcolish/Cockerel'),
|
||||
Project('Ryshcate', 'http://ryshcate.leafstorm.us/', '''
|
||||
<p>
|
||||
Ryshcate is a Flask powered pastebin with sourcecode
|
||||
available.
|
||||
''', source='http://bitbucket.org/leafstorm/ryshcate/')
|
||||
]
|
||||
}
|
||||
|
||||
# order projects by name
|
||||
for _category in projects.itervalues():
|
||||
_category.sort(key=lambda x: x.name.lower())
|
||||
del _category
|
||||
|
||||
|
||||
@community.route('/')
|
||||
@mod.route('/')
|
||||
def index():
|
||||
return render_template('community/index.html')
|
||||
|
||||
|
||||
@community.route('/irc/')
|
||||
@mod.route('/irc/')
|
||||
def irc():
|
||||
return render_template('community/irc.html')
|
||||
|
||||
|
||||
@community.route('/twitter/')
|
||||
@mod.route('/twitter/')
|
||||
def twitter():
|
||||
return render_template('community/twitter.html', tweets=flask_tweets)
|
||||
|
||||
|
||||
@community.route('/badges/')
|
||||
@mod.route('/badges/')
|
||||
def badges():
|
||||
return render_template('community/badges.html')
|
||||
|
||||
|
||||
@community.route('/poweredby/')
|
||||
@mod.route('/poweredby/')
|
||||
def poweredby():
|
||||
return render_template('community/poweredby.html', projects=projects)
|
||||
|
||||
|
||||
@community.route('/logos/')
|
||||
@mod.route('/logos/')
|
||||
def logos():
|
||||
return render_template('community/logos.html')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue