From: Eevee Date: Thu, 15 Jul 2010 05:54:43 +0000 (-0700) Subject: Tidied up presentation: correct ordering, CSS, and no more debug junk. X-Git-Tag: veekun-promotions/2010080801~8 X-Git-Url: http://git.veekun.com/zzz-spline-frontpage.git/commitdiff_plain/f644131f6f14f3851da390399f93b8fbe0f800e6 Tidied up presentation: correct ordering, CSS, and no more debug junk. --- diff --git a/splinext/frontpage/controllers/frontpage.py b/splinext/frontpage/controllers/frontpage.py index 959f5fb..4bac44f 100644 --- a/splinext/frontpage/controllers/frontpage.py +++ b/splinext/frontpage/controllers/frontpage.py @@ -25,8 +25,9 @@ class FrontPageController(BaseController): # return value a list of lists updates_lol = run_hooks('frontpage_updates', limit=10) updates = sum(updates_lol, []) - updates.sort(key=lambda obj: obj.time) + updates.sort(key=lambda obj: obj.time) + updates.reverse() c.updates = updates[0:10] return render('/index.mako') diff --git a/splinext/frontpage/templates/css/frontpage.mako b/splinext/frontpage/templates/css/frontpage.mako new file mode 100644 index 0000000..03330c8 --- /dev/null +++ b/splinext/frontpage/templates/css/frontpage.mako @@ -0,0 +1,10 @@ +.frontpage-update { position: relative; overflow: auto; margin: 1em 0; background: #f4f4f4; -moz-border-radius: 1em; -webkit-border-radius: 1em; } +.frontpage-update:nth-child(2n) { background: #f0f0f0; } +.frontpage-update .header { padding: 0.5em 1em; border: 1px solid #b4c7e6; background: url(${h.static_uri('local', 'images/layout/th-background.png')}) left bottom repeat-x; -moz-border-radius-topleft: 1em; -moz-border-radius-topright: 1em; -webkit-border-top-left-radius: 0.5em; -webkit-border-top-right-radius: 0.5em; } +.frontpage-update .header .category { float: left; font-size: 1.33em; font-style: italic; color: #404040; } +.frontpage-update .header .title { float: left; font-size: 1.33em; margin-left: 0.25em; } +.frontpage-update .header .date { line-height: 1.33; text-align: right; } +.frontpage-update .avatar { float: right; margin: 1em; } +.frontpage-update .avatar img { -moz-box-shadow: 0 0 2px black; } +.frontpage-update .content { padding: 1em; padding-bottom: 3.5em; } +.frontpage-update .comments { position: absolute; bottom: 0; left: 0; padding: 1em; } diff --git a/splinext/frontpage/templates/index.mako b/splinext/frontpage/templates/index.mako index b9d9f4f..1651be7 100644 --- a/splinext/frontpage/templates/index.mako +++ b/splinext/frontpage/templates/index.mako @@ -4,7 +4,5 @@

Updates

% for update in c.updates: -

${repr(update.__dict__)}

<%include file="${update.template}" args="update=update" /> -
% endfor