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