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

[ljcom] r10430: LJSUP-8563: new thread expander, nebula

Committer: mchervonniy
LJSUP-8563: new thread expander, nebula
U   trunk/bin/upgrading/s2layers/nebula/layout.s2
Modified: trunk/bin/upgrading/s2layers/nebula/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/nebula/layout.s2	2011-04-22 08:12:03 UTC (rev 10429)
+++ trunk/bin/upgrading/s2layers/nebula/layout.s2	2011-04-22 08:46:38 UTC (rev 10430)
@@ -1582,9 +1582,41 @@
 
 
 ## --  p r i n t   e n t r y   c o m m e n t  -- ##############################
+function EntryPage::print_comments (Comment[] cs) {
+    var Page p = get_page();
+    if (size $cs == 0) { return; }
 
-function EntryPage::print_comment ( Comment c )
+    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; margin-top: 5px">\n""";
+
+    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>";
+
+}
+
+function EntryPage::print_comment_full ( Comment c )
 {
+    var Page p = get_page();
     var string userpic;
     var string boxclass = "";
     var string boxheight = "";
@@ -1647,34 +1679,37 @@
         $c->print_multiform_check();
         "</div>";
     }
-    if ( $c.frozen ) {
-        print safe $*text_comment_frozen + " :: ";
-    } else {
-        print "("; 
-        #$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>""";
+    if ((not $c.spam) or ($p.showspam)) {
+        if ( $c.frozen ) {
+            print safe $*text_comment_frozen + " :: ";
         } else {
-            ### showing reply link if comment not screened
-            $c->print_reply_link({ "linktext" => $*text_comment_reply });
+            print "("; 
+            #$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 });
+            }
+    
+            ") ";
+            ### print safe "(<a href='$c.reply_url'>$*text_comment_reply</a>) ";
         }
-
-        ") ";
-        ### print safe "(<a href='$c.reply_url'>$*text_comment_reply</a>) ";
     }
     if ( $c.parent_url != "" ) {
         print safe "(<a href='$c.parent_url'>$*text_comment_parent</a>) ";
     }
-    if ( $c.thread_url != "" ) {
+    if (($c.thread_url != "") and (not $c.spam)) {
         print safe "(<a href='$c.thread_url'>$*text_comment_thread</a>) ";
-        var Link expand_link = $c->get_link("expand_comments");
-        if (defined $expand_link) {
-            println "(" + $c->expand_link() + ") ";
-        }
+        # var Link expand_link = $c->get_link("expand_comments");
+        # if (defined $expand_link) {
+        #     println "(" + $c->expand_link() + ") ";
+        # }
+        $c->print_expand_collapse_links();
     }
     if (not $c.frozen) {
         $c->print_reply_container({"class" => "quickreply"});
@@ -1683,7 +1718,19 @@
     "</div></div>\n\n";
 }
 
+function EntryPage::print_comment_partial (Comment c) {
+    var string poster = defined $c.poster ? $c.poster->as_string() : "<i>$*text_poster_anonymous</i>";
+    var string subj = $c.subject != "" ? $c.subject : $*text_nosubject;
+    print safe "<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) {
+    if ($c.thread_url != "") {
+        # " "; $c->print_expand_link();
+        $c->print_expand_collapse_links();
+    }
+}
 
+
 ## --  p r i n t   r e p l y   p a g e  -- ####################################
 
 function ReplyPage::print_body ()

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