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