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