From: Eevee Date: Mon, 26 Jul 2010 05:18:17 +0000 (-0700) Subject: Split off updates to another template. List sources. X-Git-Tag: veekun-promotions/2010080801~1 X-Git-Url: http://git.veekun.com/zzz-spline-frontpage.git/commitdiff_plain/16a2995a38feb21c3477a474a752efd9005e6b4f?hp=f3fc85523d8288c4eb352bf9836660fe4a67781b;ds=sidebyside Split off updates to another template. List sources. --- diff --git a/splinext/frontpage/controllers/frontpage.py b/splinext/frontpage/controllers/frontpage.py index 764b292..0990e81 100644 --- a/splinext/frontpage/controllers/frontpage.py +++ b/splinext/frontpage/controllers/frontpage.py @@ -52,7 +52,8 @@ class FrontPageController(BaseController): global_max_age = max_age_to_datetime( config['spline-frontpage.max_age']) - for source in config['spline-frontpage.sources']: + c.sources = config['spline-frontpage.sources'] + for source in c.sources: new_updates = source.poll(global_limit, global_max_age) updates.extend(new_updates) diff --git a/splinext/frontpage/templates/front_page/updates.mako b/splinext/frontpage/templates/front_page/updates.mako new file mode 100644 index 0000000..9a6f584 --- /dev/null +++ b/splinext/frontpage/templates/front_page/updates.mako @@ -0,0 +1,13 @@ +% for update in c.updates: +<%include file="${update.source.template}" args="update=update" /> +% endfor +% if not c.updates: +

No updates.

+% endif + +

Sources:

+ diff --git a/splinext/frontpage/templates/index.mako b/splinext/frontpage/templates/index.mako index 677c58c..b7a3b5c 100644 --- a/splinext/frontpage/templates/index.mako +++ b/splinext/frontpage/templates/index.mako @@ -1,8 +1,6 @@ <%inherit file="base.mako" /> -<%def name="title()">Home +<%def name="title()">Updates

Updates

-% for update in c.updates: -<%include file="${update.source.template}" args="update=update" /> -% endfor +<%include file="/front_page/updates.mako" />