fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2012-01-31 02:56 am

[dw-free] add explicit comment hierarchy to S2

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

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

Adds ECHI to S2 comment pages.

Patch by [personal profile] allen.

Files modified:
  • bin/upgrading/en.dat
  • bin/upgrading/s2layers/core2.s2
  • cgi-bin/LJ/S2/EntryPage.pm
--------------------------------------------------------------------------------
diff -r 95ccb4a55838 -r 465c8ed9639b bin/upgrading/en.dat
--- a/bin/upgrading/en.dat	Mon Jan 30 20:18:46 2012 +0800
+++ b/bin/upgrading/en.dat	Tue Jan 31 10:58:20 2012 +0800
@@ -2620,7 +2620,7 @@
 
 setting.display.viewstyle.site=Site skin
 
-setting.echi_display.des=Display Explicit Comment Hierarchy Indicators (site scheme only)
+setting.echi_display.des=Display Explicit Comment Hierarchy Indicators
 
 setting.echi_display.label=Comment Hierarchy
 
diff -r 95ccb4a55838 -r 465c8ed9639b bin/upgrading/s2layers/core2.s2
--- a/bin/upgrading/s2layers/core2.s2	Mon Jan 30 20:18:46 2012 +0800
+++ b/bin/upgrading/s2layers/core2.s2	Tue Jan 31 10:58:20 2012 +0800
@@ -344,6 +344,7 @@
 
     var readonly bool hidden_child "Indicates if the child is hidden by default.";
     var readonly bool hide_children "Indicates we are hiding the children of this comment";
+    var readonly string echi "The Explicit Comment Hierarchy Indicator, if enabled by user.";
 
     function print_wrapper_start() "Start the wrapper for this entry or comment; includes anchor and classes";
     function print_wrapper_end() "End the wrapper for this entry or comment.";
@@ -4798,6 +4799,9 @@
         if ($c.frozen) {
             print $*text_frozen;
         }
+        if ($c.echi) {
+            print "<span class='echi'>${c.echi}.</span> ";
+        }
         print $this->formatted_subject( $opts );
         "</h4></div>";
     }
diff -r 95ccb4a55838 -r 465c8ed9639b cgi-bin/LJ/S2/EntryPage.pm
--- a/cgi-bin/LJ/S2/EntryPage.pm	Mon Jan 30 20:18:46 2012 +0800
+++ b/cgi-bin/LJ/S2/EntryPage.pm	Tue Jan 31 10:58:20 2012 +0800
@@ -285,6 +285,7 @@
                 'showable_children' => $com->{'showable_children'},
                 'hide_children' => $com->{'hide_children'},
                 'hidden_child' => $com->{'hidden_child'},
+                'echi' => $com->{echi},
             };
 
             # don't show info from suspended users
--------------------------------------------------------------------------------