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-05-16 06:04 pm

[dw-free] Improve page summary module

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

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

Use variables for number of comments

Patch by [personal profile] liv.

Files modified:
  • bin/upgrading/s2layers/core2.s2
--------------------------------------------------------------------------------
diff -r 5a7a2a1c0bcc -r e818348e68a5 bin/upgrading/s2layers/core2.s2
--- a/bin/upgrading/s2layers/core2.s2	Sat May 16 17:12:18 2009 +0000
+++ b/bin/upgrading/s2layers/core2.s2	Sun May 17 02:04:13 2009 +0800
@@ -3120,19 +3120,20 @@ function print_module_pagesummary() {
         foreach var Entry e ( $cp.entries ) {
             $poster = $e.poster->ljuser();
             $subject = ($e.subject != "" ? striphtml($e.subject) : "<em>$*text_nosubject</em>");
+            var string module_comment_text = get_plural_phrase($e.comments.count, "text_read_comments_friends");
             var string comment_display;
             if ($*module_pagesummary_opts_comments_tooltip) {
-                $comment_display = "title='$e.comments.count comments'>$subject";
-               }
-            else {
-               $comment_display = ">$subject</a> +$e.comments.count comments";
+                $comment_display = "title='$module_comment_text'>$subject</a>";
+               }
+            else {
+               $comment_display = ">$subject</a> +$module_comment_text";
                }
             
             if (not $e.poster->equals($e.journal)) {
-                $links[size $links] = """$poster in $e.journal - <a href="#entry-$e.itemid" $comment_display</a>""";
-            }
-            else {
-                $links[size $links] = """$poster - <a href="#entry-$e.itemid" $comment_display</a>""";
+                $links[size $links] = """$poster in $e.journal - <a href="#entry-$e.itemid" $comment_display""";
+            }
+            else {
+                $links[size $links] = """$poster - <a href="#entry-$e.itemid" $comment_display""";
             }
         }
     }
@@ -3142,20 +3143,21 @@ function print_module_pagesummary() {
         var string poster;
         foreach var Entry e ( $cp.entries ) {
             $subject = ($e.subject != "" ? striphtml($e.subject) : "<em>$*text_nosubject</em>");
+            var string module_comment_text = get_plural_phrase($e.comments.count, "text_read_comments");
             var string comment_display;
             if ($*module_pagesummary_opts_comments_tooltip) {
-                $comment_display = "title='$e.comments.count comments'>$subject";
-               }
-            else {
-               $comment_display = ">$subject</a> +$e.comments.count comments";
+                $comment_display = "title='$module_comment_text'>$subject</a>";
+               }
+            else {
+               $comment_display = ">$subject</a> +$module_comment_text";
                }
             
             if (not $e.poster->equals($e.journal)) {
                 $poster = $e.poster->ljuser();
-                $links[size $links] = """$poster - <a href="#entry-$e.itemid" $comment_display</a>""";
-            }
-            else {
-                $links[size $links] = """<a href="#entry-$e.itemid" $comment_display</a>""";
+                $links[size $links] = """$poster - <a href="#entry-$e.itemid" $comment_display""";
+            }
+            else {
+                $links[size $links] = """<a href="#entry-$e.itemid" $comment_display""";
             }
         }
     }
@@ -3166,21 +3168,21 @@ function print_module_pagesummary() {
         var string poster;
         foreach var Entry e ( $cp.entries ) {
             $subject = ($e.subject != "" ? striphtml($e.subject) : "<em>$*text_nosubject</em>");
-            
+            var string module_comment_text = get_plural_phrase($e.comments.count, "text_read_comments");
             var string comment_display;
             if ($*module_pagesummary_opts_comments_tooltip) {
-                $comment_display = "title='$e.comments.count comments'>$subject";
-               }
-            else {
-               $comment_display = ">$subject</a> +$e.comments.count comments";
+                $comment_display = "title='$module_comment_text'>$subject</a>";
+               }
+            else {
+               $comment_display = ">$subject</a> +$module_comment_text";
                }
 
             if (not $e.poster->equals($e.journal)) {
                 $poster = $e.poster->ljuser();
-                $links[size $links] = """$poster - <a href="#entry-$e.itemid" title="$e.comments.count comments">$subject</a>""";
-            }
-            else {
-                $links[size $links] = """<a href="#entry-$e.itemid" title="$e.comments.count comments">$subject</a>""";
+                $links[size $links] = """$poster - <a href="#entry-$e.itemid" $comment_display""";
+            }
+            else {
+                $links[size $links] = """<a href="#entry-$e.itemid" $comment_display""";
             }
         }
     }
@@ -3189,6 +3191,7 @@ function print_module_pagesummary() {
     print_module_list($links);
     close_module();
 }
+
 
 function print_module_tags() {
     var Page p = get_page();
--------------------------------------------------------------------------------