]> ruin.nu Git - ndwebbie.git/blob - root/src/forum/thread.tt2
5668f8a25e222c082be59dc4bf4841d76da4c251
[ndwebbie.git] / root / src / forum / thread.tt2
1 [% META title = 'Forum thread' %]
2 <h2>[% thread.subject %]</h2>
3 <h3>[% thread.category %] - <a href="[% c.uri_for('board',thread.fbid) %]">[% thread.board %]</a></h3>
4 [% IF thread.moderate %]
5 <a href="[% c.uri_for('setSticky',thread.ftid, (thread.sticky ? 0 : 1)) %]">Make this thread [% thread.sticky ? 'unsticky' : 'sticky' %]</a>
6 [% END %]
7
8 [% createNewPostHr = 1 %]
9 [% FOR post IN posts %]
10         [% IF createNewPostHr AND post.unread%]
11         [% createNewPostHr = 0 %]
12 <hr>
13 <p><a name="NewPosts">New posts below:</a></p>
14         [% END %]
15 <fieldset class="forum-post">
16 <legend class="forum-post-header"><b>[% post.username %]</b> : [% post.time %] </legend>
17 <div class="forum-post-body">[% post.message %]</div>
18 </fieldset>
19 [% END %]
20
21 [% IF thread.post %]
22 <form action="[% c.uri_for('addPost',thread.ftid) %]#NewPosts" method="post"><fieldset class="forum-post"> <legend><a name="Reply">New Reply</a></legend>
23         <textarea class="bbcode" rows="25" cols="60" name="message" id="replybox">[% previewMessage %]</textarea>
24         <br>
25         <input type="submit" name="cmd" value="Submit">
26         <input type="submit" name="cmd" value="Preview">
27 </fieldset></form>
28 [% END %]
29
30 [% IF access.size > 0 %]
31 [% hasaccess = 0 %]
32 <p>The following ppl have access to this thread: [% FOR a IN access %]
33                 [% IF a.uid == UID; hasaccess = 1; END %]
34 [% a.username %]
35         [% END %]</p>
36         [% IF hasaccess %]
37         <p><a href="[% c.uri_for('removeownthreadaccess',thread.ftid) %]">Remove your access</a></p>
38         [% END %]
39 [% END %]
40
41 [% IF thread.moderate %]
42
43 <form action="[% c.uri_for('moveThreads',thread.fbid) %]" method="post">
44 <p>Move checked threads to:
45 <input type="hidden" name="t:[% thread.ftid %]" value="1">
46 <select name="board">
47 [% FOR category IN categories %]
48         <optgroup label="[% category.category %]">
49         [% FOR targetboard IN category.boards %]
50                 <option value="[% targetboard.fbid %]">[% targetboard.board %]</option>
51         [% END %]
52         </optgroup>
53 [% END %]
54 </select>
55 <input type="submit" name="cmd" value="Move">
56 </p>
57 </form>
58
59 <form action="[% c.uri_for('postthreadaccess',thread.ftid) %]#NewPosts" method="post">
60 <fieldset class="forum-post"> <legend>Change thread access</legend>
61 <table>
62         <tr><th>Add</th><th>Remove</th></tr>
63         <tr>
64                 <td><select name="uid" multiple size="5">
65         [% FOR u IN users %]
66                         <option value="[% u.uid %]">[% u.username %]</option>
67         [% END %]
68                 </select></td>
69                 <td><select name="access" multiple size="5">
70                         <option value=""></option>
71         [% FOR u IN access %]
72                         <option value="[% u.uid %]">[% u.username %]</option>
73         [% END %]
74                 </select></td>
75         </tr>
76 </table>
77 <input type="submit" name="cmd" value="Change access">
78 </fieldset></form>
79 [% END %]
80
81 [% IF thread.post %]
82 <script type="text/javascript">
83 $(document).ready(function(){
84         $(".forum-post-header").append(
85                 $("<a>").attr("href","#Reply").addClass("quotelink").text("Quote"));
86         $(".quotelink").click(function(){
87                 var text = $(this).parents("legend").siblings().text();
88                 var username = $(this).parents("legend").text().split(" ",1);
89                 var oldtext = $("#replybox").val();
90                 $("#replybox").val(oldtext + "\n[quote=" + username + "]" + text + "[/quote]\n");
91         });
92 });
93 </script>
94 [% INCLUDE inc/markitup.tt2 %]
95 [% END %]