afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
afuna ([personal profile] afuna) wrote in [site community profile] changelog2009-06-26 01:48 pm

[dw-free] Recent comments should have delete comment link

[commit: http://hg.dwscoalition.org/dw-free/rev/8f122b5b2aef]

http://bugs.dwscoalition.org/show_bug.cgi?id=1188

Delete links to recent comments, so that you can easily delete a comment
even on entries you can't access.

Patch by [personal profile] yvi.

Files modified:
  • htdocs/tools/recent_comments.bml
  • htdocs/tools/recent_comments.bml.text
--------------------------------------------------------------------------------
diff -r 8f0d28279059 -r 8f122b5b2aef htdocs/tools/recent_comments.bml
--- a/htdocs/tools/recent_comments.bml	Fri Jun 26 13:25:29 2009 +0000
+++ b/htdocs/tools/recent_comments.bml	Fri Jun 26 13:47:43 2009 +0000
@@ -241,7 +241,7 @@ body<=
         $ret .= "<?h1 $ML{ '.latest.posted' } h1?><?p " . BML::ml('.last.num.posted.by', {num => $count, user => LJ::ljuser($u) }) . " p?>";
         my %jcount;  # jid -> ct
         $ret .= "<table style='text-align: left'>";
-        $ret .= "<tr><th>$ML{ '.time' }</th><th>$ML{ '.location' }</th></tr>";
+        $ret .= "<tr><th>$ML{ '.time' }</th><th>&nbsp;$ML{ '.location' }</th><th>&nbsp;$ML{ '.delete' }</th</tr>";
 
         foreach my $r (@posted) {
             $jcount{$r->{'journalid'}}++;
@@ -256,17 +256,18 @@ body<=
 
             my $hr_ago = LJ::ago_text($now - $r->{'posttime'});
             my $subject;
+            my $delete;
             if (defined $lrow->{ditemid}) {
                 $hr_ago = "<a href='$talkurl'>$hr_ago</a>";
                 $subject = $log_text->{"$r->{journalid} $r->{nodeid}"}[0] || "$lrow->{ditemid}.html";
                 LJ::CleanHTML::clean_subject(\$subject);
                 $subject = "$subject <a href='$logurl'>(link)</a>";
+                $delete = "&nbsp;<a href='$LJ::SITEROOT/delcomment.bml?journal=$ju->{'user'}&amp;id=$talkid'>$ML{ '.delete.link' }</a>";
             } else {
                 $subject = $ML{ '.post.deleted' };
             }
 
-            my $links = "[<a href='$talkurl'>$ML{ '.comment' }</a>] [<a href='$logurl'>$ML{ '.entry' }</a>]\n";
-            $ret .= "<tr><td>$hr_ago</td><td>" . LJ::ljuser($ju->{user}) . ": $subject</td></tr>";
+            $ret .= "<tr><td>$hr_ago</td><td>" . LJ::ljuser($ju->{user}) . ": $subject</td><td>$delete</td></tr>";
         }
         $ret .= "</table>";
     }
diff -r 8f0d28279059 -r 8f122b5b2aef htdocs/tools/recent_comments.bml.text
--- a/htdocs/tools/recent_comments.bml.text	Fri Jun 26 13:25:29 2009 +0000
+++ b/htdocs/tools/recent_comments.bml.text	Fri Jun 26 13:47:43 2009 +0000
@@ -7,6 +7,10 @@
 .comment.link=Comment Link
 
 .comment=Comment
+
+.delete=Delete
+
+.delete.link=delete
 
 .entry.link=Entry Link
 
--------------------------------------------------------------------------------

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org