/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

  1. <div class="yui-gb content">
  2. <h2>Community Overview</h2>
  3. <p>Latest happenings from the Pylons community, mail lists, etc.</p>
  4. <div class="yui-u first">
  5. <h3>Snippets &nbsp; <a href="${url('formatted_snippets', format='atom', qualified=True)}"><img src="/images/icons/RSS_16.png" /></a></h3>
  6. <div class="itemlist">
  7. % for snippet in c.snippets:
  8. <div class="result">
  9. ${h.link_to(snippet.title, url=url('snippet', id=snippet.slug))}
  10. <div class="blurb">
  11. ${h.truncate(snippet.description, length=90, whole_word=True)}
  12. </div>
  13. <div class="meta">${widgets.format_timestamp(snippet.created)} - ${snippet.displayname or 'Anonymous'}</div>
  14. </div>
  15. % endfor
  16. </div>
  17. <br />
  18. <h3>Comments &nbsp; <a href="${url('formatted_comments', format='atom', qualified=True)}"><img src="/images/icons/RSS_16.png" /></a></h3>
  19. <div class="itemlist">
  20. % for comment in c.comments:
  21. ${render_comment(comment)}
  22. % endfor
  23. </div>
  24. </div>
  25. <div class="yui-u">
  26. <h3>Pastes &nbsp; <a href="${url('formatted_pasties', format='atom', qualified=True)}"><img src="/images/icons/RSS_16.png" /></a></h3>
  27. <div class="itemlist">
  28. % for paste in c.pastes:
  29. <div class="result">
  30. ${h.link_to(paste.title, url=url('paste', id=paste.old_id or paste.id))}
  31. <div class="blurb">
  32. % if len(paste.tags) > 0:
  33. <span class="tagheader">Tags: </span>\
  34. % for tag in paste.tags:
  35. % if tag:
  36. ${h.link_to(tag, url=url('pasties_tag', tag=tag))}
  37. % endif
  38. % endfor
  39. % endif
  40. </div>
  41. <div class="meta">${widgets.format_timestamp(paste.created)} - ${paste.displayname or 'Anonymous'}</div>
  42. </div>
  43. % endfor
  44. </div>
  45. </div>
  46. <div class="yui-u">
  47. <h2>Mail List &nbsp; <a href="http://groups.google.com/group/pylons-discuss/feed/atom_v1_0_msgs.xml"><img src="/images/icons/RSS_16.png" /></a></h2>
  48. <div id="maillist" class="itemlist">
  49. </div>
  50. </div>
  51. </div>
  52. <%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">
  53. <div class="result">
  54. ${widgets.comment_link(title='%s on %s' % (comment['displayname'], comment['title']), comment_id=comment['id'], doc=comment['doc'], type=comment['type'])}
  55. <div class="blurb">${h.truncate(h.strip_tags(h.textilize(comment['content'])), length=120, whole_word=True) | n}</div>
  56. <div class="meta">${widgets.format_timestamp(comment['created'])}</div>
  57. </div>
  58. </%def>
  59. <%def name="title()">${parent.title()} - ${_('Community')}</%def>
  60. <%namespace name="widgets" file="/widgets.mako"/>
  61. <%def name="javascript()">
  62. ${parent.javascript()}
  63. <script type="text/javascript" src="/javascripts/community.js" charset="utf-8"></script>
  64. </%def>
  65. <%inherit file="/layout.mako" />
  66. <%namespace name="widgets" file="/widgets.mako"/>