kizu (ki_zu) wrote in changelog,
kizu
ki_zu
changelog

[ljcom] r7573: LJSUP-4604: adding zero comments conditi...

Committer: rkomarov
LJSUP-4604: adding zero comments condition

U   trunk/bin/upgrading/s2layers/flexiblesquares/layout.s2
U   trunk/bin/upgrading/s2layers/sup/layout.s2
U   trunk/bin/upgrading/s2layers/voxhtml/layout.s2
Modified: trunk/bin/upgrading/s2layers/flexiblesquares/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/flexiblesquares/layout.s2	2009-08-18 04:29:06 UTC (rev 7572)
+++ trunk/bin/upgrading/s2layers/flexiblesquares/layout.s2	2009-08-18 09:04:26 UTC (rev 7573)
@@ -2085,6 +2085,11 @@
     } else {
         $comments_count = get_plural_phrase($.entry.comments.count, "text_read_comments");
     }
+    if ($.entry.comments.count > 0) {
+        $comments_count = """$comments_count — """;
+    } else {
+        $comments_count = "";
+    }
 
     if ($.entry.comments.enabled)
     {
@@ -2094,7 +2099,7 @@
             <center>""";
              $.comment_pages->print();
             """
-            <b>( $comments_count — """;
+            <b>( $comments_count""";
             $this->print_reply_link({"target" => "topcomment", "linktext" => "Post a new comment"});
             """ )</b></center>""";
             $this->print_reply_container({"target" => "topcomment"});
@@ -2111,7 +2116,7 @@
         $this->print_multiform_end();
             """
             <center>
-            <b>( $comments_count — <a href="$.entry.comments.post_url">Post a new comment</a> )</b>""";
+            <b>( $comments_count<a href="$.entry.comments.post_url">Post a new comment</a> )</b>""";
             $.comment_pages->print();
             """
                <br />
@@ -2426,9 +2431,9 @@
             $.entry->print_ebox();
             "</div>";
 
-    """<div class="box">
-    <center><b>( <a href="$.entry.permalink_url#comments">"""+ get_plural_phrase($.entry.comments.count, "text_read_all_comments") +"""</a> )</b> </center>
-    Post a comment in response:<br/>""";
+    """<div class="box">""";
+    print $.entry.comments.count > 0 ? (""" <center><b>( <a href="$.entry.permalink_url#comments">"""+ get_plural_phrase($.entry.comments.count, "text_read_all_comments") +"""</a> )</b> </center>""") : "";
+    """Post a comment in response:<br/>""";
     $.form->print();
     "
     </div>

Modified: trunk/bin/upgrading/s2layers/sup/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/sup/layout.s2	2009-08-18 04:29:06 UTC (rev 7572)
+++ trunk/bin/upgrading/s2layers/sup/layout.s2	2009-08-18 09:04:26 UTC (rev 7573)
@@ -889,6 +889,11 @@
     } else {
         $comments_count = get_plural_phrase($e.comments.count, "text_read_comments");
     }
+    if ($e.comments.count > 0) {
+        $comments_count = """<span class="comments-count">$comments_count</span> — """;
+    } else {
+        $comments_count = "";
+    }
     _print_entry($e);
     if ($.entry.comments.enabled) {
 """
@@ -897,13 +902,13 @@
                         <div class="entry-text"><div class="entry-comments-text">
 """;
         "<a name='comments'></a>";
-        """<div class="comments-links">( <span class="comments-count">$comments_count</span> — <span class="replylink">"""; $this->print_reply_link({ "linktext" => $*text_post_comment, "target" => "topcomment" });"""</span> )</div>""";
+        """<div class="comments-links">( $comments_count<span class="replylink">"""; $this->print_reply_link({ "linktext" => $*text_post_comment, "target" => "topcomment" });"""</span> )</div>""";
         $this->print_reply_container({ "target" => "topcomment" });
         if ($.comment_pages.total_subitems > 0) {
             $.comment_pages->print();
             $this->print_multiform_start();
             $this->print_comments($.comments);
-            """<div class="comments-links">( <span class="comments-count">$comments_count</span> — <span class="replylink">"""; $this->print_reply_link({ "linktext" => $*text_post_comment, "target" => "bottomcomment" }); """</span> )</div>""";
+            """<div class="comments-links">( $comments_count<span class="replylink">"""; $this->print_reply_link({ "linktext" => $*text_post_comment, "target" => "bottomcomment" }); """</span> )</div>""";
             $this->print_reply_container({"target" => "bottomcomment"});
             if ($.comment_pages.all_subitems_displayed) { """<div class="hr"><hr /></div>"""; }
             $this->print_multiform_actionline();
@@ -938,7 +943,7 @@
                         <div class="entry-text"><div class="entry-comments-text">
 """;
 
-    print safe """<div class="comments-links">( <a href="$.entry.permalink_url#comments">"""+ get_plural_phrase($e.comments.count, "text_read_all_comments") +"""</a> )</div>""";
+    print $e.comments.count > 0 ? """<div class="comments-links">( <a href="$.entry.permalink_url#comments">"""+ get_plural_phrase($e.comments.count, "text_read_all_comments") +"""</a> )</div>""" : "";
     if (not $.entry.comments.enabled) {
         print safe "<h1>$*text_reply_nocomments_header</h1><p>$*text_reply_nocomments</p>";
     } else {

Modified: trunk/bin/upgrading/s2layers/voxhtml/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/voxhtml/layout.s2	2009-08-18 04:29:06 UTC (rev 7572)
+++ trunk/bin/upgrading/s2layers/voxhtml/layout.s2	2009-08-18 09:04:26 UTC (rev 7573)
@@ -1924,6 +1924,11 @@
         } else {
             $comments_count = get_plural_phrase($.entry.comments.count, "text_read_comments");
         }
+        if ($.entry.comments.count > 0) {
+            $comments_count = """$comments_count — """;
+        } else {
+            $comments_count = "";
+        }
 
     """<a id="comments"></a>
 <div id="comments">
@@ -1931,7 +1936,7 @@
             <h2 class="comments-header page-header2">$*text_comments</h2>
             <div class="comments-body">
               <div class="comments-nav">
-                ( $comments_count — """; $this->print_reply_link({"target" => "topcomment", "linktext" => $*text_post_comment}); """ )""";
+                ( $comments_count"""; $this->print_reply_link({"target" => "topcomment", "linktext" => $*text_post_comment}); """ )""";
     $this->print_reply_container({"target" => "topcomment"});
     """</div>""";
 
@@ -1960,7 +1965,7 @@
 
 """
               <div class="comments-nav">
-                ( $comments_count —  """; $this->print_reply_link({"target" => "bottomcomment", "linktext" => $*text_post_comment}); """ )""";
+                ( $comments_count"""; $this->print_reply_link({"target" => "bottomcomment", "linktext" => $*text_post_comment}); """ )""";
     $this->print_reply_container({"target" => "bottomcomment"});
 
 """
@@ -2407,20 +2412,19 @@
     container_open("comments");
     """
     <h2 class="comments-header page-header2">$*text_replyform_header</h2>
-    <div class="comments-body">
-      <div class="comments-nav">
+    <div class="comments-body">""";
+      print $.entry.comments.count > 0 ? ("""<div class="comments-nav">
         ( <a href="$.entry.permalink_url#comments">"""+ get_plural_phrase($.entry.comments.count, "text_read_all_comments") +"""</a> )
-      </div>
-      <a name="replyform"></a>
+      </div>""") : "";
+      """<a name="replyform"></a>
       <div class="replyform">""";
 
     $.form->print();
 
-    """
-        <div class="comments-nav">
+    print $.entry.comments.count > 0 ? ("""<div class="comments-nav">
           ( <a href="$.entry.permalink_url#comments">"""+ get_plural_phrase($.entry.comments.count, "text_read_all_comments") +"""</a> )
-        </div>
-      </div>
+        </div>""") : "";
+      """</div>
     </div>""";
 
     container_close();

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