PageRenderTime 82ms CodeModel.GetById 40ms app.highlight 2ms RepoModel.GetById 39ms app.codeStats 0ms

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