]> ruin.nu Git - ndwebbie.git/blobdiff - root/src/forum/thread.tt2
Possible to mark threads as unread
[ndwebbie.git] / root / src / forum / thread.tt2
index 0095155f04e14633d88b6c1eb3bf27960ccb389d..d2820580ffd06da3ce3da1c30de11a5d5942286c 100644 (file)
@@ -5,6 +5,10 @@
 <a href="[% c.uri_for('setSticky',thread.ftid, (thread.sticky ? 0 : 1)) %]">Make this thread [% thread.sticky ? 'unsticky' : 'sticky' %]</a>
 [% END %]
 
+[% IF c.user.id %]
+<a href="[% c.uri_for('markThreadAsUnread',thread.ftid) %]">Mark thread as unread</a>
+[% END %]
+
 [% createNewPostHr = 1 %]
 [% FOR post IN posts %]
        [% IF createNewPostHr AND post.unread%]
 <p><a name="NewPosts">New posts below:</a></p>
        [% END %]
 <fieldset class="forum-post">
-<legend class="unread:[% post.unread %]"><b>[% post.username %]</b> : [% post.time %]</legend>
-       [% post.message %]
+<legend class="forum-post-header"><b>[% post.username %]</b> : [% post.time %] </legend>
+<div class="forum-post-body">[% post.message %]</div>
 </fieldset>
 [% END %]
 
+[% IF c.user.id %]
+<a href="[% c.uri_for('markThreadAsUnread',thread.ftid) %]">Mark thread as unread</a>
+[% END %]
+
 [% IF thread.post %]
-<form action="[% c.uri_for('addPost',thread.ftid) %]#NewPosts" method="post"><fieldset class="forum-post"> <legend>New Reply</legend>
-       <textarea rows="25" cols="60" name="message">[% previewMessage %]</textarea>
+<form action="[% c.uri_for('addPost',thread.ftid) %]#NewPosts" method="post"><fieldset class="forum-post"> <legend><a name="Reply">New Reply</a></legend>
+       <textarea class="bbcode" rows="25" cols="60" name="message" id="replybox">[% previewMessage %]</textarea>
        <br>
        <input type="submit" name="cmd" value="Submit">
        <input type="submit" name="cmd" value="Preview">
@@ -67,6 +75,7 @@
        [% END %]
                </select></td>
                <td><select name="access" multiple size="5">
+                       <option value=""></option>
        [% FOR u IN access %]
                        <option value="[% u.uid %]">[% u.username %]</option>
        [% END %]
 <input type="submit" name="cmd" value="Change access">
 </fieldset></form>
 [% END %]
+
+[% IF thread.post %]
+<script type="text/javascript">
+$(document).ready(function(){
+       $(".forum-post-header").append(
+               $("<a>").attr("href","#Reply").addClass("quotelink").text("Quote"));
+       $(".quotelink").click(function(){
+               var text = $(this).parents("legend").siblings().text();
+               var username = $(this).parents("legend").text().split(" ",1);
+               var oldtext = $("#replybox").val();
+               $("#replybox").val(oldtext + "\n[quote=" + username + "]" + text + "[/quote]\n");
+       });
+});
+</script>
+[% INCLUDE inc/markitup.tt2 %]
+[% END %]