1 <%namespace name="lib" file="/lib.mako" />
2 <%namespace name="userlib" file="/users/lib.mako" />
4 <%def name="forum_access_level(forum)">
5 % if forum.access_level != 'normal':
6 <div class="forum-access-level">
7 % if forum.access_level == 'soapbox':
8 <img src="${h.static_uri('spline', 'icons/soap.png')}" alt=""> <strong>Soapbox</strong>: Regular users can't start new threads.
9 % elif forum.access_level == 'archive':
10 <img src="${h.static_uri('spline', 'icons/wooden-box.png')}" alt=""> <strong>Archive</strong>: No more posting!
16 <%def name="posts(posts)">
17 <div class="forum-post-container">
19 <div class="forum-post">
22 ${userlib.avatar(post.author)}
25 <a href="${url(controller='users', action='profile', id=post.author.id, name=post.author.name)}">
27 ${userlib.color_bar(post.author)}
32 <time>${post.posted_time}</time>
34 <div class="content">${post.content}</div>
40 <%def name="write_thread_form(forum)">
41 % if forum.can_create_thread(c.user):
42 <h1>Create new thread</h1>
43 ${h.form(url(controller='forum', action='write_thread', forum_id=forum.id))}
44 <dl class="standard-form">
45 ${lib.field('subject', form=c.write_thread_form)}
46 ${lib.field('content', form=c.write_thread_form, rows=12, cols=80)}
48 <dd><button type="submit">Post!</button></dd>
51 % endif ## can create post
54 <%def name="write_post_form(thread)">
55 % if thread.can_create_post(c.user):
57 ${h.form(url(controller='forum', action='write', forum_id=thread.forum.id, thread_id=thread.id))}
58 <dl class="standard-form">
59 ${lib.field('content', form=c.write_post_form, rows=12, cols=80)}
61 <dd><button type="submit">Post!</button></dd>
64 % endif ## can create post