Максим Червонный (fiskus_boulder) wrote in changelog,
Максим Червонный
fiskus_boulder
changelog

[livejournal] r18848: LJSUP-8551: new thread expander

Committer: mchervonniy
LJSUP-8551: new thread expander
U   trunk/bin/upgrading/s2layers/generator/layout.s2
Modified: trunk/bin/upgrading/s2layers/generator/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/generator/layout.s2	2011-04-12 05:06:32 UTC (rev 18847)
+++ trunk/bin/upgrading/s2layers/generator/layout.s2	2011-04-12 07:07:07 UTC (rev 18848)
@@ -1316,6 +1316,29 @@
 }
 
 function EntryPage::print_comment (Comment c) {
+        var Page p = get_page();
+        var int indent = ($c.depth - 1) * 25;
+        if ($c.spam and not $p.showspam) {
+            """<div style='margin-left: ${indent}px;margin-top:5px;' id="$c.dom_id">\n""";
+            $this->print_comment_partial($c);
+        } elseif ($c.full) {
+            """<div style='margin-left: ${indent}px;margin-top:5px;' id="$c.dom_id" class="ljcmt_full">\n""";
+            $this->print_comment_full($c);
+        } else {
+            """<div style='margin-left: ${indent}px;margin-top:5px;' id="$c.dom_id">\n""";
+            $this->print_comment_partial($c);
+        }
+        "</div>";
+    }
+function EntryPage::print_comment_partial (Comment c) {
+    var string subject = $c.subject ? $c.subject : $*text_nosubject;
+    var string date = $c->time_display("long", "");
+    var string poster = isnull $c.poster ? $*text_poster_anonymous : $c.poster->as_string();
+
+    print safe """<a href="$c.permalink_url">$subject</a> $poster""";
+    $c->print_expand_collapse_links();
+}
+function EntryPage::print_comment_full (Comment c) {
     var Color background; var Color color;
     if ($c.screened) {
         $background = $*comment_bar_screened_bgcolor;
@@ -1402,10 +1425,7 @@
     if ($c.parent_url != "") { "(<a href='$c.parent_url'>Parent</a>) "; }
     if ($c.thread_url != "") {
         "(<a href='$c.thread_url'>Thread</a>) ";
-        var Link expand_link = $c->get_link("expand_comments");
-        if (defined $expand_link) {
-            "(" + $c->expand_link() + ") ";
-        }
+        $c->print_expand_collapse_links();
     }
     if (not $c.frozen) {
         $c->print_reply_container({"class" => "quickreply"});

Tags: fiskus_boulder, livejournal, s2
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments