mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)
Mark Smith ([staff profile] mark) wrote in [site community profile] changelog2009-10-16 04:46 am

[dw-free] Manage Comments page: toolbar in Latest Posted

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

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

Add second copy of the toolbar on the recent comments page to make the page
more usable.

Patch by [personal profile] yvi.

Files modified:
  • htdocs/tools/recent_comments.bml
--------------------------------------------------------------------------------
diff -r 404927f1b70e -r a5c6ae53e969 htdocs/tools/recent_comments.bml
--- a/htdocs/tools/recent_comments.bml	Fri Oct 16 02:15:13 2009 +0000
+++ b/htdocs/tools/recent_comments.bml	Fri Oct 16 04:46:08 2009 +0000
@@ -78,12 +78,14 @@ body<=
         }
     }
 
+    # anchors for 'latest received' and  'latest posted', link to Manage Comment Settings
+    # options for how many comments to view
     $ret .= "<?standout <div style='text-align: center'>";
     $ret .= "<a name='received'></a>";
-    $ret .= BML::ml('Actionlink', { 'link' => "Latest Received"}) . " "
+    $ret .= BML::ml('Actionlink', { link => $ML{'.latest.received'}}) . " "
         if $u->is_person;
-    $ret .= BML::ml('Actionlink', { 'link' => "<a href='#posted'>Latest Posted</a>"}) . " ";
-    $ret .= BML::ml('Actionlink', { 'link' => "<a href='$LJ::SITEROOT/manage/comments'>$ML{'.managesettings'}</a>"});
+    $ret .= BML::ml('Actionlink', { link => "<a href='#posted'>$ML{'.latest.posted'}</a>"}) . " ";
+    $ret .= BML::ml('Actionlink', { link => "<a href='$LJ::SITEROOT/manage/comments'>$ML{'.managesettings'}</a>"});
 
     $ret .= "<br />";
     $ret .= " $ML{ '.view.latest' } [ ";
@@ -94,9 +96,11 @@ body<=
         unless grep { $max == $_ } @values;
     my $getextra = LJ::u_equals($u, $remote) ? "" : "&authas=" . $u->user;
 
-    foreach my $val (sort { $a <=> $b } @values) {
+    @values = sort { $a <=> $b } @values;
+
+    foreach my $val ( @values ) {
         next if $val > $max;
-        if ($val == $count) {
+        if ( $val == $count ) {
             $ret .= " <b>$val</b> ";
         } else {
             $ret .= " <a href='?show=$val$getextra'>$val</a> ";
@@ -241,10 +245,26 @@ body<=
                                  " p?>" unless $max >= $LJ::TOOLS_RECENT_COMMENTS_MAX;
 
     if ($u->is_individual) {
-        $ret .= "<div style='text-align: center; margin-top: 1em'><a name='posted'></a>" .
-            BML::ml('Actionlink', { 'link'=>"<a href='#received'>$ML{ '.latest.received' }</a>"}) .
-            BML::ml('Actionlink', { 'link' => $ML{ '.latest.posted' }}) . " " .
-            "</div>";
+
+        $ret .= "<?standout <div style='text-align: center'>";
+        $ret .= "<a name='posted'></a>";
+        $ret .= BML::ml('Actionlink', { link => "<a href='#received'>$ML{'.latest.received'}</a>"}) . " "
+            if $u->is_person;
+        $ret .= BML::ml('Actionlink', { link => $ML{'.latest.posted'}}) . " ";
+        $ret .= BML::ml('Actionlink', { link => "<a href='$LJ::SITEROOT/manage/comments'>$ML{'.managesettings'}</a>"});
+
+        $ret .= "<br />";
+        $ret .= " $ML{ '.view.latest' } [ ";
+        foreach my $val ( @values ) {
+            next if $val > $max;
+            if ( $val == $count ) {
+                $ret .= " <b>$val</b> ";
+            } else {
+                $ret .= " <a href='?show=$val$getextra'>$val</a> ";
+            }
+        }
+        $ret .= "] $ML{ '.latest.comments' } </div> standout?>";
+
         $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'>";
--------------------------------------------------------------------------------