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

[ljcom] r10406: LJSUP-8563: new thread expander, Compone...

Committer: mchervonniy
LJSUP-8563: new thread expander, Component
U   trunk/bin/upgrading/s2layers/component/layout.s2
Modified: trunk/bin/upgrading/s2layers/component/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/component/layout.s2	2011-04-20 09:10:26 UTC (rev 10405)
+++ trunk/bin/upgrading/s2layers/component/layout.s2	2011-04-21 02:48:02 UTC (rev 10406)
@@ -2734,7 +2734,7 @@
                     </tr>
                     <tr>
                         <td width="1" class="medLine"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td>
-                        <td class="entry"  id='$c.dom_id'>
+                        <td class="entry">
     """;
 
 }
@@ -2785,19 +2785,17 @@
         var string subj = $c.subject != "" ? $c.subject : $*text_nosubject;
         $content =  "<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) {
-        $content = "$content " + $c->expand_link();
-    }
     print_comment_content_top($c);
     "$content";
+    if ($c.thread_url != "") {
+        $c->print_expand_collapse_links();
+    }
     print_comment_content_bottom();
 }
 
 # called from entry page.  loops through entries and runs EntryPage::print_comment
 function EntryPage::print_comments (Comment[] cs) {
     if (size $cs == 0) { return; }
-    var Page p = get_page();
     var bool first = true;
     foreach var Comment c ($cs) {
         if($c.depth == 1) {
@@ -2807,22 +2805,31 @@
                 $first = false;
             }
         }
-        if ($c.spam and not $p.showspam and (size $c.replies) > 0) {
+        $this->print_comment($c);
+        $this->print_comments($c.replies);
+    }
+}
+
+function EntryPage::print_comment (Comment c) {
+        var Page p = get_page();
+        """<div id="$c.dom_id">""";
+        """<a name="$c.anchor"></a>""";
+        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) {
             var int margin = ($c.depth - 1) * 25;
             print "<div style=\"margin:3px 0 3px " + $margin + "px;border:1px solid #D6D6D6;\" class=\"entry\"><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) {
-            $this->print_comment($c);
+            $this->print_comment_full($c);
         } else {
             $this->print_comment_partial($c);
         }
-        $this->print_comments($c.replies);
-    }
+	""" </div> """;
 }
-
 # Runs for every entry found
-function EntryPage::print_comment (Comment c) {
+function EntryPage::print_comment_full (Comment c) {
     var Color background; var Color color;
 
     $color = $*entry_fgcolor;
@@ -2860,7 +2867,7 @@
             print_comment_top();
     }
 
-    print "<a name=\"t$c.talkid\"></a>";
+    # print "<a name=\"t$c.talkid\"></a>";
     print_comment_content_top($c);
 
     "\n\n<div style=\"background-color: $background; color: $color; margin-top: 10px;\">\n";
@@ -2942,10 +2949,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, 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