/kai/templates/home/community.mako
https://bitbucket.org/bbangert/kai/ · Mako · 67 lines · 66 code · 1 blank · 0 comment · 12 complexity · ce437b16af8caa922ec9de3bdffa79f1 MD5 · raw file
- <div class="yui-gb content">
- <h2>Community Overview</h2>
- <p>Latest happenings from the Pylons community, mail lists, etc.</p>
- <div class="yui-u first">
- <h3>Snippets <a href="${url('formatted_snippets', format='atom', qualified=True)}"><img src="/images/icons/RSS_16.png" /></a></h3>
- <div class="itemlist">
- % for snippet in c.snippets:
- <div class="result">
- ${h.link_to(snippet.title, url=url('snippet', id=snippet.slug))}
- <div class="blurb">
- ${h.truncate(snippet.description, length=90, whole_word=True)}
- </div>
- <div class="meta">${widgets.format_timestamp(snippet.created)} - ${snippet.displayname or 'Anonymous'}</div>
- </div>
- % endfor
- </div>
- <br />
- <h3>Comments <a href="${url('formatted_comments', format='atom', qualified=True)}"><img src="/images/icons/RSS_16.png" /></a></h3>
- <div class="itemlist">
- % for comment in c.comments:
- ${render_comment(comment)}
- % endfor
- </div>
- </div>
- <div class="yui-u">
- <h3>Pastes <a href="${url('formatted_pasties', format='atom', qualified=True)}"><img src="/images/icons/RSS_16.png" /></a></h3>
- <div class="itemlist">
- % for paste in c.pastes:
- <div class="result">
- ${h.link_to(paste.title, url=url('paste', id=paste.old_id or paste.id))}
- <div class="blurb">
- % if len(paste.tags) > 0:
- <span class="tagheader">Tags: </span>\
- % for tag in paste.tags:
- % if tag:
- ${h.link_to(tag, url=url('pasties_tag', tag=tag))}
- % endif
- % endfor
- % endif
- </div>
- <div class="meta">${widgets.format_timestamp(paste.created)} - ${paste.displayname or 'Anonymous'}</div>
- </div>
- % endfor
- </div>
- </div>
- <div class="yui-u">
- <h2>Mail List <a href="http://groups.google.com/group/pylons-discuss/feed/atom_v1_0_msgs.xml"><img src="/images/icons/RSS_16.png" /></a></h2>
- <div id="maillist" class="itemlist">
- </div>
- </div>
- </div>
- <%def name="render_comment(comment)" cached="True" cache_timeout="3600" cache_key="${comment['id']}" cache_type="ext:memcached" cache_url="127.0.0.1:11211">
- <div class="result">
- ${widgets.comment_link(title='%s on %s' % (comment['displayname'], comment['title']), comment_id=comment['id'], doc=comment['doc'], type=comment['type'])}
- <div class="blurb">${h.truncate(h.strip_tags(h.textilize(comment['content'])), length=120, whole_word=True) | n}</div>
- <div class="meta">${widgets.format_timestamp(comment['created'])}</div>
- </div>
- </%def>
- <%def name="title()">${parent.title()} - ${_('Community')}</%def>
- <%namespace name="widgets" file="/widgets.mako"/>
- <%def name="javascript()">
- ${parent.javascript()}
- <script type="text/javascript" src="/javascripts/community.js" charset="utf-8"></script>
- </%def>
- <%inherit file="/layout.mako" />
- <%namespace name="widgets" file="/widgets.mako"/>