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

[livejournal] r18965: LJSUP-8563: new thread expander, Tabular...

Committer: mchervonniy
LJSUP-8563: new thread expander, Tabular Indent
U   trunk/bin/upgrading/s2layers/tabularindent/layout.s2
Modified: trunk/bin/upgrading/s2layers/tabularindent/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/tabularindent/layout.s2	2011-04-25 09:57:35 UTC (rev 18964)
+++ trunk/bin/upgrading/s2layers/tabularindent/layout.s2	2011-04-26 03:59:12 UTC (rev 18965)
@@ -532,6 +532,7 @@
 }
 
 function print_comment_close (string footer, Comment c) {
+    var Page p = get_page();
     "</td></tr>";
 
 
@@ -540,7 +541,7 @@
         print  "<tr><td style='white-space: nowrap'>";
         if ($c.frozen) {
             "(Replies frozen) ";
-        } else {
+        } elseif ((not $c.spam) or ($p.showspam)) {
             "("; 
             
             #$c->print_reply_link({"linktext" => $*text_comment_reply}); 
@@ -560,6 +561,9 @@
             ") ";
         }
         print $footer;
+        if ($c.thread_url != "" and (not $c.spam)) {
+            $c->print_expand_collapse_links();
+        }
 
         if (not $c.frozen) {
             $c->print_reply_container({"class" => "quickreply"});
@@ -1000,19 +1004,50 @@
     }
 }
 
+function EntryPage::print_comments (Comment[] cs) {
+    var Page p = get_page();
+    if (size $cs == 0) { return; }
+    foreach var Comment c ($cs) {
+        $this->print_comment($c);
+        $this->print_comments($c.replies);
+    }
+}
+
+function EntryPage::print_comment (Comment c) {
+    var Page p = get_page();
+    var int indent = ($c.depth - 1) * 25;
+
+    """<div id="$c.dom_id" style="margin-left:${indent}px;">""";
+
+    if ($c.screened and not $c.full and not viewer_is_owner()) {
+        """<strong>$*text_comment_screened</strong>""";
+    } elseif ($c.deleted) {
+        """<strong>$*text_comment_deleted</strong>""";
+    } elseif (($c.spam) and (not $p.showspam) and (size($c.replies) > 0)) {
+        """<strong>$*text_spam_comment</strong>""";
+    } elseif ($c.full) {
+        $this->print_comment_full($c);
+    } else {
+        $this->print_comment_partial($c);
+    }
+
+    "</div>";
+
+    $c->print_reply_container();
+}
+
 function EntryPage::print_comment_partial (Comment c) {
     var string poster = defined $c.poster ? $c.poster->as_string() : "<i>(Anonymous)</i>";
     var string subj = $c.subject != "" ? $c.subject : $*text_nosubject;
     print_genericbox_open();
     print "<a href='$c.permalink_url'>$subj</a> - $poster";
-    var Link expand_link = $c->get_link("expand_comments");
-    if ($c.thread_url != "" and defined $expand_link) {
-        print " " + $c->expand_link();
+    if ($c.thread_url != "") {
+        $c->print_expand_collapse_links();
     }
     print_genericbox_close();
 }
 
-function EntryPage::print_comment (Comment c) {
+function EntryPage::print_comment_full (Comment c) {
     var string{} colors; var string{} meta; var string footer = "";
 
     if ($c.screened) {
@@ -1058,12 +1093,8 @@
     }
 
     if ($c.parent_url != "") { $footer = "$footer (<a href='$c.parent_url'>Parent</a>) "; }
-    if ($c.thread_url != "") {
+    if ($c.thread_url != "" and (not $c.spam)) {
         $footer = "$footer (<a href='$c.thread_url'>Thread</a>) ";
-        var Link expand_link = $c->get_link("expand_comments");
-        if (defined $expand_link) {
-            $footer = "$footer (" + $c->expand_link() + ") ";
-        }
     }
 
     var Link link = new Link;
@@ -1073,7 +1104,6 @@
             $footer = "$footer $link";
         }
     }
-    println "<a name='$c.anchor'></a>";
     print_box_open($colors, $metapic, $meta, "cmtbar$c.talkid");
     $c->print_text();
     print_comment_close($footer, $c);

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