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

[ljcom] r10429: LJSUP-8563: new thread expander, A Novel...

Committer: mchervonniy
LJSUP-8563: new thread expander, A Novel Conundrum
U   trunk/bin/upgrading/s2layers/anovelconundrum/layout.s2
Modified: trunk/bin/upgrading/s2layers/anovelconundrum/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/anovelconundrum/layout.s2	2011-04-22 06:03:00 UTC (rev 10428)
+++ trunk/bin/upgrading/s2layers/anovelconundrum/layout.s2	2011-04-22 08:12:03 UTC (rev 10429)
@@ -1075,8 +1075,14 @@
 
 function EntryPage::print_comments(Comment[] cs) {
     if (size $cs == 0) { return; }
-    var Page p = get_page();
     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();
         if($c.depth==1) {
             "</td></tr></table>";
             print safe """<div class="bs">
@@ -1085,23 +1091,24 @@
             "<table align='center' cellspacing='0' border='0' cellpadding='0'><tr><td>";
         }
         var int indent = ($c.depth - 1) * 21;
-        if ($c.spam and not $p.showspam and (size $c.replies) > 0) {
+        if ($c.screened and not $c.full and not viewer_is_owner()) {
+            """<div class="ljcmt_full" id="$c.dom_id" style='margin-left: ${indent}pt;'>\n<div class="bodybox" style="margin-top:13pt;"><strong>$*text_comment_screened</strong>""";
+        } elseif ($c.deleted) {
+            """<div class="ljcmt_full" id="$c.dom_id" style='margin-left: ${indent}pt;'>\n<div class="bodybox" style="margin-top:13pt;"><strong>$*text_comment_deleted</strong>""";
+        } elseif ($c.spam and not $p.showspam and (size $c.replies) > 0) {
             """<div class="ljcmt_full" id="$c.dom_id" style='margin-left: ${indent}pt;'>\n<div class="bodybox" style="margin-top:13pt;"><strong>$*text_spam_comment</strong></div>""";
-        } elseif ($c.spam and not $p.showspam and (size $c.replies) < 1) {
-            # spam comment w/o children
         } elseif ($c.full) {
             """<div class="ljcmt_full" id="$c.dom_id" style='margin-left: ${indent}pt;'>\n""";
-            $this->print_comment($c);
+            $this->print_comment_full($c);
         } else {
             """<div id="$c.dom_id" style='margin-left: ${indent}pt;'>\n""";
             $this->print_comment_partial($c);
         }
         "</div>";
-        $this->print_comments($c.replies);
-    }
 }
 
-function EntryPage::print_comment(Comment c) {
+function EntryPage::print_comment_full(Comment c) {
+    var Page p = get_page();
     var string poster = defined $c.poster ? $c.poster->as_string() : $*text_poster_anonymous;
     var string sub_icon;
     if (defined $c.subject_icon) {
@@ -1137,30 +1144,33 @@
     "<div class='body'>";
     print_text($c);
     print "</div><div class='smallbar'>";
-    if ($c.frozen) {
-        "Replies Frozen";
-    } else {
-        if($c.screened == true) {
-            ### if comment screened - show link for unscreen
-            var Link link;
-            $link = $c->get_link("unscreen_to_reply");
-            """<a href="$link.url" title="$link.caption">$link.caption</a>""";
+    if ((not $c.spam) or ($p.showspam)) {
+        if ($c.frozen) {
+            "Replies Frozen";
         } else {
-            ### showing reply link if comment not screened
-            $c->print_reply_link({ "linktext" => $*text_comment_reply });
+            if($c.screened == true) {
+                ### if comment screened - show link for unscreen
+                var Link link;
+                $link = $c->get_link("unscreen_to_reply");
+                """<a href="$link.url" title="$link.caption">$link.caption</a>""";
+            } else {
+                ### showing reply link if comment not screened
+                $c->print_reply_link({ "linktext" => $*text_comment_reply });
+            }
+    
+            ###"<a href='$c.reply_url'>Reply</a>";
+            #$c->print_reply_link({"linktext" => $*text_comment_reply});
+    
         }
-
-        ###"<a href='$c.reply_url'>Reply</a>";
-        #$c->print_reply_link({"linktext" => $*text_comment_reply});
-
     }
     if ($c.parent_url != "") { " &middot; <a href='$c.parent_url'>Parent</a>"; }
-    if ($c.thread_url != "") {
+    if ($c.thread_url != "" and (not $c.spam)) {
         " &middot; <a href='$c.thread_url'>Thread</a>";
-        var Link expand_link = $c->get_link("expand_comments");
-        if (defined $expand_link) {
-            " &middot; " + $c->expand_link();
-        }
+        # var Link expand_link = $c->get_link("expand_comments");
+        # if (defined $expand_link) {
+        #     " &middot; " + $c->expand_link();
+        # }
+        $c->print_expand_collapse_links();
     }
     $c->print_linkbar();
     if ($this.multiform_on) {
@@ -1186,8 +1196,10 @@
     else { """posted <a href="$c.permalink_url">a reply</a>"""; }
     ".";
     var Link expand_link = $c->get_link("expand_comments");
-    if ($c.thread_url != "" and defined $expand_link) {
-        " " + $c->expand_link();
+    # if ($c.thread_url != "" and defined $expand_link) {
+    if ($c.thread_url != "") {
+        # " " + $c->expand_link();
+        $c->print_expand_collapse_links();
     }
     "</div>";
 }

Tags: fiskus_boulder, ljcom, 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