1 <%namespace name="lib" file="/lib.mako" />
2 <%namespace name="userlib" file="/users/lib.mako" />
4 <%def name="posts(posts)">
5 <div class="forum-post-container">
7 <div class="forum-post">
10 ${userlib.avatar(post.author)}
13 <a href="${url(controller='users', action='profile', id=post.author.id, name=post.author.name)}">
15 ${userlib.color_bar(post.author)}
20 <time>${post.posted_time}</time>
22 <div class="content">${post.content}</div>
28 <%def name="write_thread_form(forum)">
29 % if forum.can_create_thread(c.user):
30 <h1>Create new thread</h1>
31 ${h.form(url(controller='forum', action='write_thread', forum_id=forum.id))}
32 <dl class="standard-form">
33 ${lib.field('subject', form=c.write_thread_form)}
34 ${lib.field('content', form=c.write_thread_form, rows=12, cols=80)}
36 <dd><button type="submit">Post!</button></dd>
39 % endif ## can create post
42 <%def name="write_post_form(thread)">
43 % if thread.can_create_post(c.user):
45 ${h.form(url(controller='forum', action='write', forum_id=thread.forum.id, thread_id=thread.id))}
46 <dl class="standard-form">
47 ${lib.field('content', form=c.write_post_form, rows=12, cols=80)}
49 <dd><button type="submit">Post!</button></dd>
52 % endif ## can create post