| 1 | [% IF c.action.class.match('^Vee::Controller::Forum') %] |
|---|
| 2 | <form method="post" action="/forum/mark_read" id="forum-global-controls"> |
|---|
| 3 | <p> <input type="submit" value="Mark entire forum read"/> </p> |
|---|
| 4 | </form> |
|---|
| 5 | [% END %] |
|---|
| 6 | |
|---|
| 7 | [% FILTER null %] |
|---|
| 8 | |
|---|
| 9 | [% BLOCK wrap_breadcrumbs %]<div class="breadcrumbs">You are here: [% crumbs.join(' :: ') %]</div>[% END %] |
|---|
| 10 | |
|---|
| 11 | <!-- postbar: why wasn't this a block yet --> |
|---|
| 12 | |
|---|
| 13 | [% BLOCK postbar %][%# posts %] |
|---|
| 14 | [% IF posts != 0 %] |
|---|
| 15 | [% postct_percent = log(posts) / log(2) %] |
|---|
| 16 | [% postct_barsize = postct_percent * 4 %] |
|---|
| 17 | [% ELSE %] |
|---|
| 18 | [% postct_percent = 0; %] |
|---|
| 19 | [% END %] |
|---|
| 20 | [% IF postct_barsize > 100; postct_barsize = 97.5; END %] |
|---|
| 21 | [% postct_hue = posts * 0.32 # not quite 360! %] |
|---|
| 22 | <div class="postbar-container"><div class="postbar-bar" style="width: [% round(postct_barsize, 1) %]%; background-color: #[% postbar_color(postct_hue) %];"></div></div> |
|---|
| 23 | [% END %] |
|---|
| 24 | |
|---|
| 25 | <!-- contact_icons: that row of icons we all know and love, or something --> |
|---|
| 26 | |
|---|
| 27 | [% BLOCK contact_icons -%][%# user, style (1, short version, 2, long version) -%] |
|---|
| 28 | [% DEFAULT style = 1 %] |
|---|
| 29 | <dl class="compact"> |
|---|
| 30 | [% FOREACH contact IN ContactTypes %] |
|---|
| 31 | [% tmp = 'contact_' _ contact.name | lower; value = user.$tmp; url = contact.url; name = contact.name %] |
|---|
| 32 | [% IF value %] |
|---|
| 33 | [% '<dt>' IF style == 2 %][% IF url %]<a href="[% url.replace('%s', value) -%]">[% END %]<img src="/images/icons/contact/[% name | lower %].png" alt="[% name %]: [% value %]" [% IF style == 1 %] title="[% name %]: [% value %] [% END %]"/> [% IF style == 2 %][% name %]<dd> [% value %][% END %][% IF url %]</a>[% END %][% '<br />' IF style == 2 %] |
|---|
| 34 | [% END %] |
|---|
| 35 | [% END %] |
|---|
| 36 | [% '<dt>' IF style == 2 %]<img src="/images/icons/pm/[% user.pm_icon %].png" alt="Send private message" title="Send private message" class="disabled"/> [% 'PM<dd>not yet' IF style == 2 %] |
|---|
| 37 | </dl> |
|---|
| 38 | [% END %] |
|---|
| 39 | |
|---|
| 40 | <!-- post_form: form used for post.. edit.. preview.. stuff. This is a block because I noticed it being used in more than three places --> |
|---|
| 41 | |
|---|
| 42 | [% BLOCK post_form -%][%# url %] |
|---|
| 43 | <form class="forum-reply" action="[% url %]" method="post"> |
|---|
| 44 | <p>[% IF form.exists('subject'); '<label>Subject: '; form.get_tag('subject'); '</label>'; END %]</p> |
|---|
| 45 | <p>[% IF form.exists('blurb'); '<label>Blurb: '; form.get_tag('blurb'); '</label>'; END %]</p> |
|---|
| 46 | <p>[% form.get_tag('id') %][% IF form.exists('content'); form.get_tag('content'); END %]</p> |
|---|
| 47 | <p> <input type="submit" name="submit" value="Post"/> <input type="submit" name="submit" value="Preview"/> <input type="reset" value="Clear"/> </p> |
|---|
| 48 | </form> |
|---|
| 49 | [% END %] |
|---|
| 50 | |
|---|
| 51 | <!-- post_buttons: print out the cutout edit/del/nuke buttons that go in the top-right of posts --> |
|---|
| 52 | |
|---|
| 53 | [% BLOCK post_buttons -%][%# post, thread, forum %] |
|---|
| 54 | [% is_deleted = post.flags.match('deleted') %] |
|---|
| 55 | [% IF c.can_i("postedit", post) OR post.user_id == c.user.obj.id; can_edit = 1; END %] |
|---|
| 56 | [% IF c.can_i("postdelete", post) OR (post.user_id == c.user.obj.id AND post.id == thread.last_post_id); can_delete = 1; END %] |
|---|
| 57 | [% IF c.can_i("postnuke"); can_nuke = 1; END %] |
|---|
| 58 | [% RETURN UNLESS can_edit || can_delete || can_nuke %] |
|---|
| 59 | <div class="buttons"> |
|---|
| 60 | [% IF can_edit %] <a href="/forum/post/[% post.id %]/edit"><img src="/images/icons/edit.png" alt="Edit" title="Edit"/></a>[% END %] |
|---|
| 61 | [% IF can_delete %] |
|---|
| 62 | [% IF is_deleted %] <a href="/forum/post/[% post.id %]/undelete"><img src="/images/icons/undelete.png" alt="Undelete" title="Undelete"/></a> |
|---|
| 63 | [% ELSE %] <a href="/forum/post/[% post.id %]/delete" onclick="return confirm('Really delete this post?\n(Deleting can be undone.)');"><img src="/images/icons/delete.png" alt="Delete" title="Delete"/></a> |
|---|
| 64 | [% END %] |
|---|
| 65 | [% END %] |
|---|
| 66 | [% IF can_nuke %] <a href="/forum/post/[% post.id %]/nuke" onclick="return confirm('Really nuke this post? All traces of it will be permanently removed; you may want to delete instead.') && confirm('Are you absolutely sure?\nNUKING CANNOT BE UNDONE.');"><img src="/images/icons/nuke.png" alt="Nuke" title="Nuke"/></a>[% END %] |
|---|
| 67 | </div> |
|---|
| 68 | [% END %] |
|---|
| 69 | |
|---|
| 70 | <!-- show_announcements: print out the announcement list at the top of a forum page --> |
|---|
| 71 | |
|---|
| 72 | [% BLOCK show_announcements %][%# announcements_rs %] |
|---|
| 73 | [% RETURN IF announcements_rs.is_empty %] |
|---|
| 74 | <h2>Announcements</h2> |
|---|
| 75 | [% INCLUDE threads_start -%] |
|---|
| 76 | [% WHILE (t = announcements_rs.next) %] |
|---|
| 77 | [% INCLUDE threads_each thread=t show_forum=1 %] |
|---|
| 78 | [% END %] |
|---|
| 79 | [% INCLUDE threads_end %] |
|---|
| 80 | <h2>Threads</h2> |
|---|
| 81 | [%+ END %] |
|---|
| 82 | |
|---|
| 83 | <!-- blocks for printing out a sequence of posts --> |
|---|
| 84 | |
|---|
| 85 | [% BLOCK posts_start %] |
|---|
| 86 | [% c.stash.posts_color = 1 %] |
|---|
| 87 | [% END %] |
|---|
| 88 | |
|---|
| 89 | [% BLOCK posts_each %][%# post, thread, forum, show_deleted %] |
|---|
| 90 | [% is_deleted = post.flags.match('deleted') %] |
|---|
| 91 | <div class="forum-post color[% c.stash.posts_color %][% ' deleted' IF is_deleted %]"> |
|---|
| 92 | [% IF is_deleted AND !show_deleted %] |
|---|
| 93 | <div class="sidebar"> |
|---|
| 94 | <img src="/images/icons/delete.png" alt=""/> |
|---|
| 95 | This post by <a href="[% c.uri('Users', 'info', post.user_id) %]">[% post.user.name %]</a> has been deleted. |
|---|
| 96 | [% IF c.can_i("postdelete", post) %] |
|---|
| 97 | <a href="/forum/post/[% post.id %]/undelete">Restore it?</a> Or <a href="/forum/post/[% post.id %]/edits">read it</a>? |
|---|
| 98 | [% END %] |
|---|
| 99 | </div> |
|---|
| 100 | </div> |
|---|
| 101 | [% RETURN %] |
|---|
| 102 | [% END %] |
|---|
| 103 | <div class="sidebar-wrapper"><div class="sidebar"> |
|---|
| 104 | [% groups = post.user.groups.split(' '); primary_group = groups.shift %] |
|---|
| 105 | <div class="username"><a href="[% c.uri('Users', 'info', post.user_id) %]"><img src="/images/groups/[% UserGroups.$primary_group.icon %]" alt="[% UserGroups.$primary_group.name %]" title="[% UserGroups.$primary_group.name %]"/> [% post.user.name %]</a></div> |
|---|
| 106 | <div class="title[% IF post.user.custom_title -%] custom">[% post.user.custom_title %][% ELSE %]">[% UserGroups.$primary_group.name %][% END %]</div> |
|---|
| 107 | <div class="avatar">[% IF post.user.is_dumb %]<img src="/images/dumb.png" alt="PSA: THIS USER IS DUMB" class="dumb"/>[% END %][% IF post.user.avatar %]<img src="/images/avatars/[% post.user.avatar %]" alt="">[% ELSE %]No avatar[% END %]</div> |
|---|
| 108 | <div class="postbar"> |
|---|
| 109 | <span class="postrank">[%# postrank(post.user.post_count) %]</span> |
|---|
| 110 | <span class="postcount">Posts: [% post.user.post_count %]</span> |
|---|
| 111 | [% INCLUDE postbar posts=post.user.post_count %] |
|---|
| 112 | </div> |
|---|
| 113 | </div></div> |
|---|
| 114 | <div class="topbar"> |
|---|
| 115 | [% IF 0 AND post.id AND pos %] |
|---|
| 116 | [%# fix this for filters and then re-enable it %] |
|---|
| 117 | <a href="/forum/post/[% post.id %]" name="p[% post.id %]">post #[% pos %]</a> -- |
|---|
| 118 | [% END %] |
|---|
| 119 | <a[% IF post.id %] href="/forum/post/[% post.id %]"[% END %] name="p[% post.id %]">posted at [% post.time | date %]</a> |
|---|
| 120 | [% IF timediff %] |
|---|
| 121 | <span class="timediff">-- [% timediff | timespan %] since previous post</span> |
|---|
| 122 | [% END %] |
|---|
| 123 | [% INCLUDE post_buttons post=post thread=thread forum=forum %] |
|---|
| 124 | </div> |
|---|
| 125 | <div class="content"> |
|---|
| 126 | [% IF post.news_pic %] |
|---|
| 127 | <img src="/images/news/[% post.user.news_pic %]" alt="[% post.name %]'s news pic" class="forum-post-newspic"/> |
|---|
| 128 | [% END %] |
|---|
| 129 | [% IF post.lastedit %] |
|---|
| 130 | <div class="edits">Post last <a href="/forum/post/[% post.id %]/edits">edited</a> on [% post.lastedit.time | date %] by <a href="[% c.uri('Users', 'info', post.lastedit.user.id) %]">[% post.lastedit.user.name %]</a></div> |
|---|
| 131 | [% END %] |
|---|
| 132 | <div class="message"> |
|---|
| 133 | [%+ post.content | bbcode | indent(12) %] |
|---|
| 134 | </div> |
|---|
| 135 | [% IF post.user.signature %] |
|---|
| 136 | <div class="sig">[% post.user.signature | bbcode %]</div> |
|---|
| 137 | [% END %] |
|---|
| 138 | </div> |
|---|
| 139 | </div> |
|---|
| 140 | [% c.stash.posts_color = 3 - c.stash.posts_color %] |
|---|
| 141 | [%+ END %] |
|---|
| 142 | |
|---|
| 143 | [% BLOCK posts_end %][% END %] |
|---|
| 144 | |
|---|
| 145 | <!-- blocks for printing out a table of threads --> |
|---|
| 146 | |
|---|
| 147 | [% BLOCK threads_start %] |
|---|
| 148 | [% c.stash.threads_color = 1 %] |
|---|
| 149 | <table class="forums" cellspacing="0"> |
|---|
| 150 | <tr><th class="unread"></th><th class="icon"></th><th class="name">Thread</th><th class="postinfo">First Post</th><th class="count">Replies</th><th class="count">Views</th><th class="postinfo">Last Post</th></tr> |
|---|
| 151 | [% END %] |
|---|
| 152 | |
|---|
| 153 | [% BLOCK threads_each %][%# thread, ?show_forum -%] |
|---|
| 154 | <tr class="color[% c.stash.threads_color %][% IF thread.flags.match('deleted') %] deleted[% END %]"> |
|---|
| 155 | <td class="unread">[% IF is_unread(thread) %]<img src="/images/icons/unread.png" alt="Unread" title="Unread"/>[% END %]</td> |
|---|
| 156 | <td class="icon"><!-- space reserved for some sort of thread icons --></td> |
|---|
| 157 | <td class="name"> |
|---|
| 158 | <!--<a href="/forum/thread/[% thread.id %]/nuke" style="float: right;"><img src="/images/icons/nuke.png" alt="Nuke" title="Nuke"/></a> |
|---|
| 159 | <a href="/forum/thread/[% thread.id %]/del" style="float: right;"><img src="/images/icons/delete.png" alt="Delete" title="Delete"/></a> |
|---|
| 160 | <a href="/forum/thread/[% thread.id %]/edit" style="float: right;"><img src="/images/icons/edit.png" alt="Edit" title="Edit"/></a>--> |
|---|
| 161 | <a href="/forum/thread/[% thread.id %]"> |
|---|
| 162 | <div class="name"> |
|---|
| 163 | [% FOREACH flag IN ThreadFlagArray %] |
|---|
| 164 | [% NEXT UNLESS thread.flags.match(flag.name) %] |
|---|
| 165 | <img src="/images/icons/[% flag.name %].png" alt="[% flag.name %]" title="[% flag.name %]: [% flag.blurb %]" class="flag"/> |
|---|
| 166 | [% END %] |
|---|
| 167 | [% thread.subject %] |
|---|
| 168 | </div> |
|---|
| 169 | [% IF thread.blurb %] |
|---|
| 170 | <div class="blurb">[% thread.blurb %]</div> |
|---|
| 171 | [% END %] |
|---|
| 172 | </a> <!-- [ <a>2</a>, <a>3</a>, <a>4</a>, ... <a>9</a>, <a>10</a> ] --> |
|---|
| 173 | [% IF show_forum %] |
|---|
| 174 | <div class="inforum">in forum "<a href="/forum/[% thread.forum_id %]">[% thread.forum.name %]</a>"</div> |
|---|
| 175 | [% END %] |
|---|
| 176 | </td> |
|---|
| 177 | <td class="postinfo"><a href="[% c.uri('Users', 'info', thread.first_post.user_id) %]">[% thread.first_post.user.name %]</a> <a href="/forum/post/[% thread.first_post.id %]">[% thread.first_post.time | date %]</a></td> |
|---|
| 178 | <td class="count">[%# this is stupid fix it lati, but if all posts are deleted this will show -1 %][% IF thread.post_count > 0; thread.post_count - 1; ELSE; thread.post_count; END %]</td><td class="count">[% thread.view_count %]</td> |
|---|
| 179 | <td class="postinfo"> |
|---|
| 180 | [% IF thread.post_count <= 1 -%] |
|---|
| 181 | - |
|---|
| 182 | [% ELSE %] |
|---|
| 183 | <a href="[% c.uri('Users', 'info', thread.last_post.user_id) %]">[% thread.last_post.user.name %]</a> <a href="/forum/post/[% thread.last_postastpost.id %]">[% thread.last_post.time | date %]</a> |
|---|
| 184 | [% END -%] |
|---|
| 185 | </td> |
|---|
| 186 | </tr> |
|---|
| 187 | [% c.stash.threads_color = 3 - c.stash.threads_color %] |
|---|
| 188 | [% END -%] |
|---|
| 189 | |
|---|
| 190 | [% BLOCK threads_message %][%# content -%] |
|---|
| 191 | <tr><td class="forum-message" colspan="7">[% content %]</td></tr> |
|---|
| 192 | [% END -%] |
|---|
| 193 | |
|---|
| 194 | [% BLOCK threads_end %] |
|---|
| 195 | </table> |
|---|
| 196 | [% END %] |
|---|
| 197 | |
|---|
| 198 | <!-- blocks for printing out a table of forums --> |
|---|
| 199 | |
|---|
| 200 | [% BLOCK forums_start %] |
|---|
| 201 | [% c.stash.forums_color = 1 %] |
|---|
| 202 | <table class="forums" cellspacing="0"> |
|---|
| 203 | <tr><th></th><th class="icon"></th><th class="name">Forum</th><th class="count">Threads</th><th class="count">Posts</th><th class="postinfo">Last Post</th></tr> |
|---|
| 204 | [% END %] |
|---|
| 205 | |
|---|
| 206 | [% BLOCK forums_header %][%# title, blurb -%] |
|---|
| 207 | <tr><th colspan="6" class="heading">[% title %][% IF blurb %]<div class="blurb">[% blurb %]</div>[% END %]</th></tr> |
|---|
| 208 | [% END %] |
|---|
| 209 | |
|---|
| 210 | [% BLOCK forums_each %][%# forum -%] |
|---|
| 211 | <tr class="color[% c.stash.forums_color %]"> |
|---|
| 212 | <td class="unread">[% IF is_unread(forum) %]<img src="/images/icons/unread.png" alt="Unread" title="Unread"/>[% END %]</td> |
|---|
| 213 | <td class="icon"> |
|---|
| 214 | [% UNLESS forum.accessibility == 'normal' %]<img src="/images/icons/[% forum.accessibility %].png" alt="[% forum.accessibility %]" title="[% forum.accessibility %]"/>[% END %] |
|---|
| 215 | </td> |
|---|
| 216 | <td class="name"> |
|---|
| 217 | <a href="/forum/[% forum.id %]"> |
|---|
| 218 | <span class="title">[% forum.name %]</span> |
|---|
| 219 | [% IF forum.blurb %] |
|---|
| 220 | <span class="blurb">[% forum.blurb %]</span> |
|---|
| 221 | [% END %] |
|---|
| 222 | </a> |
|---|
| 223 | </td> |
|---|
| 224 | <td class="count">[% forum.thread_count %]</td><td class="count">[% forum.post_count %]</td> |
|---|
| 225 | <td class="postinfo"> |
|---|
| 226 | [% IF forum.last_post_id %] |
|---|
| 227 | [% IF 25 < forum.last_post.thread.subject.length; subject = last_thread.subject.substr(0, 22) _ '...'; ELSE; subject = forum.last_post.thread.subject; END -%] |
|---|
| 228 | [% subject %] <a href="[% c.uri('Users', 'info', forum.last_post.user_id) %]">[% forum.last_post.user.name %]</a> <a href="/forum/post/[% forum.last_post_id %]">[% forum.last_post.time | date %]</a> |
|---|
| 229 | [% ELSE %] |
|---|
| 230 | (no posts) |
|---|
| 231 | [% END %] |
|---|
| 232 | </td> |
|---|
| 233 | </tr> |
|---|
| 234 | [% c.stash.forums_color = 3 - c.stash.forums_color %] |
|---|
| 235 | [% END %] |
|---|
| 236 | |
|---|
| 237 | [% BLOCK forums_message %][%# content -%] |
|---|
| 238 | <tr><td class="message" colspan="5">[% content %]</td></tr> |
|---|
| 239 | [% END %] |
|---|
| 240 | |
|---|
| 241 | [% BLOCK forums_end %] |
|---|
| 242 | </table> |
|---|
| 243 | [% END %] |
|---|
| 244 | |
|---|
| 245 | [% END # null %] |
|---|