kareila: (Default)
kareila ([personal profile] kareila) wrote in [site community profile] changelog2009-11-12 05:04 pm

[dw-free] Display number of comments on reply pages that use site schemes

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

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

Display number of comments on reply pages that use site schemes.

Codemerge from LJ; prepared for Dreamwidth by [staff profile] denise.

Files modified:
  • bin/upgrading/en.dat
  • htdocs/talkpost.bml
  • htdocs/talkread.bml
--------------------------------------------------------------------------------
diff -r b510e43dbfcd -r a99bebf23fe2 bin/upgrading/en.dat
--- a/bin/upgrading/en.dat	Wed Nov 11 11:59:30 2009 +0000
+++ b/bin/upgrading/en.dat	Thu Nov 12 11:04:06 2009 -0600
@@ -3491,6 +3491,12 @@ talk.commentpost=Post a new comment
 
 talk.commentsread=Read comments
 
+talk.commentsread.counted=Read [[replycount]] [[?replycount|comment|comments]]
+
+talk.comments.counted=[[replycount]] [[?replycount|comment|comments]]
+
+talk.commentsread.nocomments=No comments
+
 talk.curname_groups=<b>Custom friends groups:</b>
 
 talk.curname_location=<b>Current location:</b>
diff -r b510e43dbfcd -r a99bebf23fe2 htdocs/talkpost.bml
--- a/htdocs/talkpost.bml	Wed Nov 11 11:59:30 2009 +0000
+++ b/htdocs/talkpost.bml	Thu Nov 12 11:04:06 2009 -0600
@@ -361,7 +361,13 @@ body<=
     my $jarg = "journal=$u->{'user'}&amp;";
     my $readurl = LJ::Talk::talkargs($talkurl, $stylemine, $formatlight);
 
-    $ret .= "<p align='center' class='lesstop'><b>(<a href=\"$readurl#comments\">$ML{'talk.commentsread'}</a>)</b></p>";
+    my $replycount = $entry->prop( "replycount" );
+    my $readlink_text = BML::ml( "talk.commentsread.counted",
+                                 { replycount => $replycount } );
+    $readlink_text = BML::ml( "talk.commentsread.nocomments" )
+        if $replycount == 0;
+
+    $ret .= "<p align='center' class='lesstop'><b>(<a href=\"$readurl#comments\">$readlink_text</a>)</b></p>";
 
     # can a comment even be made?
     if ($props->{'opt_nocomments'}) {
diff -r b510e43dbfcd -r a99bebf23fe2 htdocs/talkread.bml
--- a/htdocs/talkread.bml	Wed Nov 11 11:59:30 2009 +0000
+++ b/htdocs/talkread.bml	Thu Nov 12 11:04:06 2009 -0600
@@ -765,10 +765,19 @@ body<=
         $ret .= "<div id='Comments'>";
         $ret .= "<a name='comments'></a>";
         $ret .= "<p>$navcrap</p>" if $navcrap;
+
         my $readlink;
-        if ($dthread && $pages == 1) {
-            my $readurl = LJ::Talk::talkargs($talkurl, $stylemine, $formatlight);
-            $readlink = "(<a href='$readurl#comments'>$T{'readcomments'}</a>) - ";
+        my $replycount = $entry->prop("replycount");
+        my $readlink_text = BML::ml( "talk.commentsread.counted",
+                            { replycount => $replycount } );
+        my $comments_count = BML::ml( "talk.comments.counted",
+                            { replycount => $replycount } );
+
+        if ( $dthread && $pages == 1 ) {
+            my $readurl = LJ::Talk::talkargs( $talkurl, $stylemine, $formatlight );
+            $readlink = "(<a href='$readurl#comments'>$readlink_text</a>) - ";
+        } else {
+            $readlink = "($comments_count) - " if $replycount > 0;
         }
 
         #
@@ -785,7 +794,7 @@ body<=
             # See if we want to force them to change their password
             my $bp = LJ::bad_password_redirect({ 'returl' => 1 });
             if ($bp) {
-                $ret .= "(<a href='$bp'>$T{'replythis'}</a>)";
+                $ret .= "(<a href='$bp'>$T{'replythis'} </a>)";
             } else {
                 $ret .= "(" . LJ::make_qr_link('top', '', $T{'postcomments'}, $posturl) . ")";
             }
--------------------------------------------------------------------------------

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