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 ## Prints a little hierarchy of context when viewing a thread
17 <%def name="hierarchy(forum, thread=None)">
18 <ul class="forum-hierarchy">
21 <a href="${url(controller='forum', action='threads', forum_id=forum.id)}">
25 <img src="${h.static_uri('spline', 'icons/folders-stack.png')}" alt=""> ${forum.name}
31 % if forum.description:
32 — ${forum.description}
34 ${forum_access_level(forum)}
38 <strong><img src="${h.static_uri('spline', 'icons/folder-open-document-text.png')}" alt=""> ${thread.subject}</strong>
44 <%def name="posts(posts)">
45 <div class="forum-post-container">
47 <div class="forum-post">
50 ${userlib.avatar(post.author)}
53 <a href="${url(controller='users', action='profile', id=post.author.id, name=post.author.name)}">
55 ${userlib.color_bar(post.author)}
60 <time>${post.posted_time}</time>
62 <div class="content">${post.content}</div>
68 <%def name="write_thread_form(forum)">
69 % if forum.can_create_thread(c.user):
70 <h1>Create new thread</h1>
71 ${h.form(url(controller='forum', action='write_thread', forum_id=forum.id))}
72 <dl class="standard-form">
73 ${lib.field('subject', form=c.write_thread_form)}
74 ${lib.field('content', form=c.write_thread_form, rows=12, cols=80)}
76 <dd><button type="submit">Post!</button></dd>
79 % endif ## can create post
82 <%def name="write_post_form(thread)">
83 % if thread.can_create_post(c.user):
85 ${h.form(url(controller='forum', action='write', forum_id=thread.forum.id, thread_id=thread.id))}
86 <dl class="standard-form">
87 ${lib.field('content', form=c.write_post_form, rows=12, cols=80)}
89 <dd><button type="submit">Post!</button></dd>
92 % endif ## can create post