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
 
--------------------------------------------------------------------------------
cesy: "Cesy" - An old-fashioned quill and ink (Default)

Changelog

[personal profile] cesy 2009-06-26 02:13 pm (UTC)(link)
*fangirls*

I guess this will help some of the people who were worried about all their comments being imported by OpenID.
yvi: Kaylee half-smiling, looking very pretty (Default)

Re: Changelog

[personal profile] yvi 2009-06-26 02:22 pm (UTC)(link)
:)

Well, at least for some portion of the problem, it is. Unfortunately, it still doesn't update to only show the comments that are still on the site, so after the first 100, you are out of luck.

There's a bug report open for that one as well, though.