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

[ljcom] r10372: LJSUP-8551: new thread expander

Committer: mchervonniy
LJSUP-8551: new thread expander
U   trunk/bin/upgrading/s2layers/flexiblesquares/layout.s2
Modified: trunk/bin/upgrading/s2layers/flexiblesquares/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/flexiblesquares/layout.s2	2011-04-11 11:14:13 UTC (rev 10371)
+++ trunk/bin/upgrading/s2layers/flexiblesquares/layout.s2	2011-04-12 04:52:47 UTC (rev 10372)
@@ -2182,7 +2182,6 @@
 
 function EntryPage::print_comments( Comment[] comments )
 {
-    var Page p = get_page();
     if ( size $comments == 0 )
     {
         return;
@@ -2190,6 +2189,14 @@
 
     foreach var Comment c ( $comments )
     {
+        $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) * 30;
         var string partialcomment = $c.full         ? " ljcmt_full" : "partial";
         var string margin = "";
@@ -2214,20 +2221,16 @@
         }
         elseif ( $c.full )
         {
-            $this->print_comment( $c );
+            $this->print_comment_full( $c );
         }
         else
         {
             $this->print_comment_partial( $c );
            }
         "</div>";
-        $this->print_comments( $c.replies );
-    }
 }
+function EntryPage::print_comment_full (Comment comment) {
 
-
-function EntryPage::print_comment (Comment comment) {
-
     var string subject = $comment.subject ? $comment.subject : $*text_nosubject;
     var string date = $comment.time->date_format();
     var string poster = isnull $comment.poster ? $*text_poster_anonymous : $comment.poster->as_string();
@@ -2315,9 +2318,7 @@
     {
         """(<a href="$comment.thread_url">$*text_comment_thread</a>) """;
         var Link expand_link = $comment->get_link("expand_comments");
-        if (defined $expand_link) {
-            "(" + $comment->expand_link() + ") ";
-        }
+        $comment->print_expand_collapse_links();
     }
 
 
@@ -2347,10 +2348,7 @@
     var string poster = isnull $c.poster ? $*text_poster_anonymous : $c.poster->as_string();
 
     print safe """<a href="$c.permalink_url">$subject</a> - $poster on $date""";
-    var Link expand_link = $c->get_link("expand_comments");
-    if ($c.thread_url != "" and defined $expand_link) {
-        " " + $c->expand_link();
-    }
+    $c->print_expand_collapse_links();
 }
 
 # -----------------------------------

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