[dw-free] Manage Comments: add edit icon/link
[commit: http://hg.dwscoalition.org/dw-free/rev/7ee6b18ea616]
http://bugs.dwscoalition.org/show_bug.cgi?id=2364
Add link to edit a comment under the latest posted section of your recent
comments (/tools/recent_comments)
Patch by
denise.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=2364
Add link to edit a comment under the latest posted section of your recent
comments (/tools/recent_comments)
Patch by
![[staff profile]](https://www.dreamwidth.org/img/silk/identity/user_staff.png)
Files modified:
- htdocs/tools/recent_comments.bml
- htdocs/tools/recent_comments.bml.text
-------------------------------------------------------------------------------- diff -r 417d084b6dc7 -r 7ee6b18ea616 htdocs/tools/recent_comments.bml --- a/htdocs/tools/recent_comments.bml Mon Mar 08 01:38:51 2010 +0800 +++ b/htdocs/tools/recent_comments.bml Mon Mar 08 01:53:58 2010 +0800 @@ -284,7 +284,9 @@ 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><th> $ML{ '.delete' }</th</tr>"; + $ret .= "<tr><th>$ML{ '.time' }</th><th> $ML{ '.location' }</th><th> $ML{ '.delete' }</th>"; + $ret .= "<th> $ML{ '.edit' }</th>" if $remote->can_edit_comments; + $ret .= "</tr>"; foreach my $r (@posted) { $jcount{$r->{'journalid'}}++; @@ -303,20 +305,31 @@ body<= my $hr_ago = LJ::ago_text($now - $r->{'posttime'}); my $subject; my $delete; + my $editlink; + 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>"; + # add a sign if the comment has replies $subject .= "*" if $comment->has_nondeleted_children; + # delete link, very helpful for when the user does not have access to that entry anymore $delete = " <a href='$LJ::SITEROOT/delcomment?journal=$ju->{'user'}&id=$talkid'>$ML{ '.delete.link' }</a>"; + + # edit link, if comment can be edited + $editlink = " <a href='" . LJ::Talk::talkargs( $comment->edit_url ) . "'>$ML{ '.edit.link' }</a>" if $comment->remote_can_edit; + + } else { $subject = $ML{ '.post.deleted' }; } - $ret .= "<tr><td>$hr_ago</td><td>" . LJ::ljuser($ju->{user}) . ": $subject</td><td>$delete</td></tr>"; + $ret .= "<tr><td>$hr_ago</td><td>" . LJ::ljuser($ju->{user}) . ": $subject</td><td>$delete</td>"; + $ret .= "<td>$editlink</td>" if $remote->can_edit_comments; + $ret .= "</tr>"; } $ret .= "</table>"; } diff -r 417d084b6dc7 -r 7ee6b18ea616 htdocs/tools/recent_comments.bml.text --- a/htdocs/tools/recent_comments.bml.text Mon Mar 08 01:38:51 2010 +0800 +++ b/htdocs/tools/recent_comments.bml.text Mon Mar 08 01:53:58 2010 +0800 @@ -13,6 +13,10 @@ .delete=Delete .delete.link=delete + +.edit=Edit + +.edit.link=edit .entry.link=Entry Link --------------------------------------------------------------------------------