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-11-10 04:15 am

[dw-free] S2 page summary module needs more stylability

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

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

Add CSS classes for the pagesummary module so you can style the contents.

Patch by [personal profile] ninetydegrees.

Files modified:
  • bin/upgrading/s2layers/core2.s2
--------------------------------------------------------------------------------
diff -r 91c7fcc72ba1 -r 43b3103945b5 bin/upgrading/s2layers/core2.s2
--- a/bin/upgrading/s2layers/core2.s2	Tue Nov 10 04:09:23 2009 +0000
+++ b/bin/upgrading/s2layers/core2.s2	Tue Nov 10 04:15:30 2009 +0000
@@ -3486,13 +3486,13 @@ function print_module_pagesummary_commen
     var string module_comment_text = get_plural_phrase($count, $prop);
 
     if ($*module_pagesummary_opts_comments_tooltip) {
-        return "title='$module_comment_text'>$subject</a>";
+        return "title='$module_comment_text'>$subject</a></span>";
     }
     elseif ($count != 0) {
-        return ">$subject</a> +$module_comment_text";
-    }
-    else {
-        return ">$subject</a>";
+        return ">$subject</a></span> <span class='pagesummary-commentcount'>+$module_comment_text</span>";
+    }
+    else {
+        return ">$subject</a></span>";
     }
 }
 
@@ -3508,7 +3508,7 @@ function print_module_pagesummary() {
                 print_module_pagesummary_comments($c.subject, $count, "text_read_comments_threads");
             var string poster = isnull $c.poster ? $*text_poster_anonymous : $c.poster->ljuser();
 
-            $links[size $links] = """$poster - <a href="#$c.anchor" $comment_display""";
+            $links[size $links] = """<span class="pagesummary-poster">$poster</span> - <span class="pagesummary-subject"><a href="#$c.anchor" $comment_display""";
         }
     }
 
@@ -3517,13 +3517,13 @@ function print_module_pagesummary() {
         foreach var Entry e ( $cp.entries ) {
             var string comment_display =
                 print_module_pagesummary_comments($e.subject, $e.comments.count, "text_read_comments_friends");
-            var string poster = $e.poster->ljuser();
+            var string poster = "<span class='pagesummary-poster'>" + $e.poster->ljuser() + "</span>";
             
             if ( not $e.poster->equals($e.journal) ) {
-                $poster = "$poster in $e.journal";
-            }
-
-            $links[size $links] = """$poster - <a href="#entry-$e.itemid" $comment_display""";
+                $poster = "$poster in <span class='pagesummary-community'>$e.journal</span>";
+            }
+
+            $links[size $links] = """$poster - <span class="pagesummary-subject"><a href="#entry-$e.itemid" $comment_display""";
         }
     }
 
@@ -3532,13 +3532,13 @@ function print_module_pagesummary() {
         foreach var Entry e ( $cp.entries ) {
             var string comment_display =
                 print_module_pagesummary_comments($e.subject, $e.comments.count, "text_read_comments");
-            var string poster = $e.poster->ljuser();
+            var string poster = "<span class='pagesummary-poster'>" + $e.poster->ljuser() + "</span>";
 
             if ( not $e.poster->equals($e.journal) ) {
-                $links[size $links] = """$poster - <a href="#entry-$e.itemid" $comment_display""";
+                $links[size $links] = """$poster - <span class="pagesummary-subject"><a href="#entry-$e.itemid" $comment_display""";
             }
             else {
-                $links[size $links] = """<a href="#entry-$e.itemid" $comment_display""";
+                $links[size $links] = """<span class="pagesummary-subject"><a href="#entry-$e.itemid" $comment_display""";
             }
         }
     }
@@ -3548,13 +3548,13 @@ function print_module_pagesummary() {
         foreach var Entry e ( $cp.entries ) {
             var string comment_display =
                 print_module_pagesummary_comments($e.subject, $e.comments.count, "text_read_comments");
-            var string poster = $e.poster->ljuser();
+            var string poster = "<span class='pagesummary-poster'>" + $e.poster->ljuser() + "</span>";
 
             if ( not $e.poster->equals($e.journal) ) {
-                $links[size $links] = """$poster - <a href="#entry-$e.itemid" $comment_display""";
+                $links[size $links] = """$poster - <span class="pagesummary-subject"><a href="#entry-$e.itemid" $comment_display""";
             }
             else {
-                $links[size $links] = """<a href="#entry-$e.itemid" $comment_display""";
+                $links[size $links] = """<span class="pagesummary-subject"><a href="#entry-$e.itemid" $comment_display""";
             }
         }
     }
--------------------------------------------------------------------------------