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

[ljcom] r10431: LJSUP-8563: new thread expander

Committer: mchervonniy
LJSUP-8563: new thread expander
U   trunk/bin/upgrading/s2layers/3column/layout.s2
Modified: trunk/bin/upgrading/s2layers/3column/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/3column/layout.s2	2011-04-22 08:46:38 UTC (rev 10430)
+++ trunk/bin/upgrading/s2layers/3column/layout.s2	2011-04-22 09:30:42 UTC (rev 10431)
@@ -270,7 +270,7 @@
 .comment_links { text-align:right; padding:3px; margin:0px; border-top: 1px dashed $*entries_border; }
 .comment_links a { padding:2px; text-decoration:none; }
 .comment_child { margin: 0px 0px 0px 20px; }
-.minicomment {padding: 4px; border: 1px solid $*entries_border; }
+.minicomment {padding: 4px; border: 1px solid $*entries_border; text-align: justify; }
 .minicommentholder { border: 1px solid $*entries_border; }
 
 .box-vertical2 {padding: 10px 0 0 10px;}
@@ -537,21 +537,28 @@
 
 function EntryPage::print_comments(Comment[] cs) {
     if (size $cs == 0) { return; }
-    var Page p = get_page();
     foreach var Comment c ($cs) {
-        if ($c.spam and not $p.showspam and (size $c.replies) > 0) {
+        $this->print_comment($c);
+    }
+}
+
+function EntryPage::print_comment(Comment c) {
+        var Page p = get_page();
+        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) {
             """<div class="comment_wrapper"><div class="entrytext"><strong>$*text_spam_comment</strong></div></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);
         }
-    }
 }
 
-function EntryPage::print_comment(Comment c) {
+function EntryPage::print_comment_full(Comment c) {
+    var Page p = get_page();
     var string datetime;
     $datetime = $c->time_display("long", "");
     var string picword;
@@ -560,16 +567,15 @@
     }
     var string parent;
     var string thread;
-    var string expand;
     if ($c.parent_url != "") {
         $parent = """<a href="$c.parent_url">$*text_comment_parent</a>$*t_divider""";
     }
-    if ($c.thread_url != "") {
+    if (($c.thread_url != "") and (not $c.spam)) {
         $thread = """<a href="$c.thread_url">$*text_comment_thread</a>$*t_divider""";
-        var Link expand_link = $c->get_link("expand_comments");
-        if (defined $expand_link) {
-            $expand = $c->expand_link() + $*t_divider;
-        }
+        # var Link expand_link = $c->get_link("expand_comments");
+        # if (defined $expand_link) {
+        #     $expand = $c->expand_link() + $*t_divider;
+        # }
     }
     var string subjecticon;
     if (defined $c.subject_icon) {
@@ -616,22 +622,27 @@
 $c->print_text();
 print safe """</p> </div>
 <div class="comment_links"> """;
-    
-        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
-if (not $.entry.comments.locked) {
-            $c->print_reply_link({ "linktext" => $*text_comment_reply });
-}
-        }
-    
+
+	if ((not $c.spam) or ($p.showspam)) {
+            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
+                if (not $.entry.comments.locked) {
+                     $c->print_reply_link({ "linktext" => $*text_comment_reply });
+                }
+            }
+	}
+
     ###<a href="$c.reply_url">$*text_comment_reply</a>$*t_divider;
-    print """<a href="$c.permalink_url">$*text_permalink</a>$*t_divider $parent$thread$expand
- </div>""";
+    print """<a href="$c.permalink_url">$*text_permalink</a>$*t_divider $parent$thread""";
+    if (($c.thread_url != "") and (not $c.spam)) {
+        $c->print_expand_collapse_links();
+    }
+ """</div>""";
         $c->print_reply_container({"class" => "quickreply"});
     """
     </div></div>
@@ -669,12 +680,14 @@
     var string subj = $c.subject != "" ? $c.subject : """<i class="nosubject">$*t_nosubject</i>""";
     var string indent = ($c.depth - 1) * 25 + "px";
     print safe """
-    <div style="margin-left: $indent;"><div id="$c.dom_id"><div class="entry">
+    <a name='$c.anchor'></a><div style="margin-left: $indent;" id="$c.dom_id"><div><div class="entry">
         <div class="minicomment">$poster - <a href="$c.permalink_url">$subj</a>""";
 
-    var Link expand_link = $c->get_link("expand_comments");
-    if ($c.thread_url != "" and defined $expand_link) {
-        print " " + $c->expand_link() + $*t_divider;
+    # var Link expand_link = $c->get_link("expand_comments");
+    # if ($c.thread_url != "" and defined $expand_link) {
+    if ($c.thread_url != "") {
+    #     print " " + $c->expand_link() + $*t_divider;
+        $c->print_expand_collapse_links();
     }
     print """</div></div></div></div>""";
     $this->print_comments($c.replies);

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