oops ... there was no way to delete blog comments ... fixed that
authorArt Cancro <ajc@uncensored.citadel.org>
Tue, 13 Sep 2011 20:35:21 +0000 (16:35 -0400)
committerWilfried Goesgens <dothebart@citadel.org>
Fri, 16 Sep 2011 18:50:08 +0000 (18:50 +0000)
webcit/static/roomops.js
webcit/static/t/view_blog/comment.html
webcit/static/t/view_message.html

index c4bc6585ca0d2b8b302aa57fbc02d79e989f557a..e91b386fea6fdae23058a8202bec79268e3fd5e4 100644 (file)
@@ -76,3 +76,17 @@ function GetMailboxRooms() {
   }
   return roomsForFloor;
 }
+
+/*
+ * function to delete a comment from a blog post
+ */
+function DeleteBlogComment(msgnum) {
+       cmd = encodeURI("g_cmd=DELE " + msgnum);
+       new Ajax.Request("ajax_servcmd", { 
+               parameters: cmd,
+               method: 'post',
+               onSuccess: function(transport) {
+               Effect.BlindUp('blog_comment_' + msgnum);
+               }
+       });
+}
index 8a24ee42e259b69df12c2ae11d3842b940e59013..a37fdc0e2ce5960fd58c54d05131a5b57c469039 100644 (file)
@@ -1,4 +1,4 @@
-<div class="blog_comment">
+<div class="blog_comment" id="blog_comment_<?MAIL:SUMM:N>">
 <div class="blog_comment_header">
 <span>
  <??("COND:MAIL:ANON",1)>
@@ -8,6 +8,9 @@
  <??("X", 1)>
 </span>
  <span><?MAIL:SUMM:DATEFULL></span>
+<?!("COND:ROOM:EDITACCESS", 16)>
+   <a href="#" onclick="if (confirm('<?_("Delete this message?")>')) { DeleteBlogComment(<?MAIL:SUMM:N>); }"><span>[</span><?_("Delete")><span>]</span> </a> 
+<??("X", 16)>
 </div>
 <div class="blog_comment_content">
 <?MAIL:BODY>
index 0cbb281fe92ea900c54671d90587624a58ba24ad..ff63fa155736e3a618dfa275d45b8779806ac67d 100644 (file)
        <a href="javascript:GetLoggedInFirst(encodeURIComponent('display_enter?replying_mode=replyall?replying_to=<?MAIL:SUMM:N>?replyquote=<?MAIL:SUMM:N>'));"><span>[</span><?_("ReplyAll")><span>]</span></a> 
        <a href="javascript:GetLoggedInFirst(encodeURIComponent('display_enter?replying_mode=forward?replying_to=<?MAIL:SUMM:N>?fwdquote=<?MAIL:SUMM:N>'));"><span>[</span><?_("Forward")><span>]</span></a> 
 <??("X", 9)>
-<?!("COND:ROOM:EDITACCESS", 14)>
+<?!("COND:ROOM:EDITACCESS", 16)>
    <a href="do_template?template=msg_confirm_move?msgid=<?MAIL:SUMM:N>"><span>[</span><?_("Move")><span>]</span></a> 
    <a href="delete_msg?msgid=<?MAIL:SUMM:N>" onclick="return confirm('<?_("Delete this message?")>');"><span>[</span><?_("Delete")><span>]</span> </a> 
-<??("X", 14)>
+<??("X", 16)>
    <a href="#" onclick="window.open('msgheaders/<?MAIL:SUMM:N>', 'headers<?MAIL:SUMM:N>', 'toolbar=no,location=no,directories=no,copyhistory=no,status=yes,scrollbars=yes,resizable=yes,width=600,height=400'); "><span>[</span><?_("Headers")><span>]</span></a>
    <a href="#" onclick="window.open('printmsg/<?MAIL:SUMM:N>', 'print<?MAIL:SUMM:N>', 'toolbar=no,location=no,directories=no,copyhistory=no,status=yes,scrollbars=yes,resizable=yes,width=600,height=400'); "><span>[</span><?_("Print")><span>]</span></a>
  </p>