Janine (janinedog) wrote in changelog,
Janine
janinedog
changelog

[ljcom] r6129: Bug ID: 69291

Committer: janine
Bug ID: 69291

* Add security icons to the ReplyPage of all layouts (when replying to an entry).
* Add entry metadata to the ReplyPage when replying to an entry in some layouts (wherever it was easy to do while adding the security icon).

U   trunk/bin/upgrading/s2layers/3column/layout.s2
U   trunk/bin/upgrading/s2layers/cuteness/layout.s2
U   trunk/bin/upgrading/s2layers/flexiblesquares/layout.s2
U   trunk/bin/upgrading/s2layers/nebula/layout.s2
U   trunk/bin/upgrading/s2layers/opal/layout.s2
U   trunk/bin/upgrading/s2layers/tranquilityii/layout.s2
Modified: trunk/bin/upgrading/s2layers/3column/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/3column/layout.s2	2008-03-10 20:54:25 UTC (rev 6128)
+++ trunk/bin/upgrading/s2layers/3column/layout.s2	2008-03-10 23:15:08 UTC (rev 6129)
@@ -849,35 +849,42 @@
     var string time = $e.time->time_format();
     var string date = $e.time->date_format("long");
 
-    var UserLite name;
-    """
-    <div class="entry">
-<h3>$date</h3>""";
-if(defined $e.userpic and $*comment_userpic_style != "off") {
-        $name = $e.poster;
-        """<div class="userpic_reply">""";
-        if (defined $e.userpic or (defined $e.userpic and $.view == "entry" and $*show_entry_userpic)) {
-            """<img src="$e.userpic.url" width="$e.userpic.width" height="$e.userpic.height" alt="" />""";
-        }
-        """</div>""";
-    } """
+    if ($e isa Entry) {
+        var Entry en = $e as Entry;
 
-<h1>$e.subject</h1>
-    <div class="entrytext">
-    <p>""";
-        $e->print_text();
-print safe """</p></div>
-<div class="entrylinks">Posted at $time $*t_divider <a href="$.entry.comments.read_url" class="comments">$*t_reply_back</a>""";
+        $this->print_entry($en);
+    } else {
+        var UserLite name;
+        """
+        <div class="entry">
+    <h3>$date</h3>""";
+    if(defined $e.userpic and $*comment_userpic_style != "off") {
+            $name = $e.poster;
+            """<div class="userpic_reply">""";
+            if (defined $e.userpic or (defined $e.userpic and $.view == "entry" and $*show_entry_userpic)) {
+                """<img src="$e.userpic.url" width="$e.userpic.width" height="$e.userpic.height" alt="" />""";
+            }
+            """</div>""";
+        } """
 
+    <h1>$e.subject</h1>
+        <div class="entrytext">
+        <p>""";
+            $e->print_text();
+    print safe """</p></div>
+    <div class="entrylinks">Posted at $time $*t_divider <a href="$.entry.comments.read_url" class="comments">$*t_reply_back</a>""";
 
-    foreach var string key ($e.link_keyseq) {
-        var Link link = $e->get_link($key);
-        if ($link) {
-            print safe """$*t_divider <a href="$link.url">$link.caption</a>""";
+
+        foreach var string key ($e.link_keyseq) {
+            var Link link = $e->get_link($key);
+            if ($link) {
+                print safe """$*t_divider <a href="$link.url">$link.caption</a>""";
+            }
         }
+        print safe """ $*t_divider <a href="$e.permalink_url">$*text_permalink</a></div>""";
     }
-    print safe """ $*t_divider <a href="$e.permalink_url">$*text_permalink</a></div>
-    <div class="replyform">
+
+    """<div class="replyform">
     """;
     $.form->print();
     """

Modified: trunk/bin/upgrading/s2layers/cuteness/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/cuteness/layout.s2	2008-03-10 20:54:25 UTC (rev 6128)
+++ trunk/bin/upgrading/s2layers/cuteness/layout.s2	2008-03-10 23:15:08 UTC (rev 6129)
@@ -1561,50 +1561,56 @@
                 print "<div id=\"entries\">\n";
                 print "<div id=\"entriesbg\">\n";
                 print "<div id=\"entries-content\">\n";
-                # get date
-                var string datetime;
-                $datetime = $.replyto.time->date_format($*date_format) + " | " + $.replyto.time->time_format($*time_format);
+                if ($.replyto isa Entry) {
+                    var Entry en = $.replyto as Entry;
 
-                # get any extra user info (if posting to community, etc)
-                var string poster = "";
-                var string userpic = "";
-                if ( defined $.replyto.poster ) {
-                        $poster = "<a href=\"" + $.replyto.poster->base_url() + "\" title=\"$.replyto.poster.username\">$.replyto.poster.username</a>";
-                        if ( defined $.replyto.userpic ) {
-                                $userpic = "<h3 class=\"userpic\"><img border=\"0\" src=\"$.replyto.userpic.url\" width=\"$.replyto.userpic.width\" height=\"$.replyto.userpic.height\" alt=\"$.replyto.poster.username\" /></h3>";
-                        }
+                    $this->print_entry($en);
                 } else {
-                        $poster = "<i>$*text_comment_anonymous</i>";
-                }
+                    # get date
+                    var string datetime;
+                    $datetime = $.replyto.time->date_format($*date_format) + " | " + $.replyto.time->time_format($*time_format);
 
+                    # get any extra user info (if posting to community, etc)
+                    var string poster = "";
+                    var string userpic = "";
+                    if ( defined $.replyto.poster ) {
+                            $poster = "<a href=\"" + $.replyto.poster->base_url() + "\" title=\"$.replyto.poster.username\">$.replyto.poster.username</a>";
+                            if ( defined $.replyto.userpic ) {
+                                    $userpic = "<h3 class=\"userpic\"><img border=\"0\" src=\"$.replyto.userpic.url\" width=\"$.replyto.userpic.width\" height=\"$.replyto.userpic.height\" alt=\"$.replyto.poster.username\" /></h3>";
+                            }
+                    } else {
+                            $poster = "<i>$*text_comment_anonymous</i>";
+                    }
 
-                # print the entry now:
-                print "<div class=\"ind-entry\">";
-                        # print icon (if needed)
-                        if ( $userpic != "" ) {
-                                print "$userpic";
-                        }
-                        print "<h2>";
-                        if ( $.replyto.subject == "" ) {
-                                print "";
-                        } else {
-                                print "$.replyto.subject";
-                        }
-                        print "</h2>";
 
-                        print "<h4>\n";
-                        print "<b>$datetime</b><br />";
-                        print safe "<b>$*text_comment_from:</b> $poster";
-                        if ( $.replyto.metadata{"poster_ip"} ) {
-                                print safe "<b>$*text_comment_ipaddr</b> " + $.replyto.metadata{"poster_ip"} + "<br />";
-                        }
-                        print "</h4>";
-                        print "<div class=\"entry-item\">"; $.replyto->print_text(); "</div>\n";
-                        print "<h4>";
-                        print safe get_permalink($.replyto.permalink_url) + " | <a href=\"$.entry.comments.read_url\" title=\"$*text_comment_viewall\">$*text_comment_viewall</a>\n";
-                        print "</h4>";
-                print "</div>\n";
-                print "<hr />";
+                    # print the entry now:
+                    print "<div class=\"ind-entry\">";
+                            # print icon (if needed)
+                            if ( $userpic != "" ) {
+                                    print "$userpic";
+                            }
+                            print "<h2>";
+                            if ( $.replyto.subject == "" ) {
+                                    print "";
+                            } else {
+                                    print "$.replyto.subject";
+                            }
+                            print "</h2>";
+
+                            print "<h4>\n";
+                            print "<b>$datetime</b><br />";
+                            print safe "<b>$*text_comment_from:</b> $poster";
+                            if ( $.replyto.metadata{"poster_ip"} ) {
+                                    print safe "<b>$*text_comment_ipaddr</b> " + $.replyto.metadata{"poster_ip"} + "<br />";
+                            }
+                            print "</h4>";
+                            print "<div class=\"entry-item\">"; $.replyto->print_text(); "</div>\n";
+                            print "<h4>";
+                            print safe get_permalink($.replyto.permalink_url) + " | <a href=\"$.entry.comments.read_url\" title=\"$*text_comment_viewall\">$*text_comment_viewall</a>\n";
+                            print "</h4>";
+                    print "</div>\n";
+                    print "<hr />";
+                }
                 print "<div class=\"entry-form\">\n";
                         print "<h2>Reply</h2>\n";
                         $.form->print();
@@ -1613,7 +1619,7 @@
                 print "</div>";
                 print "</div>";
                 print "<div id=\"entrybottom\">\n";
-        print "</div>";
+                print "</div>";
         }
 }
 

Modified: trunk/bin/upgrading/s2layers/flexiblesquares/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/flexiblesquares/layout.s2	2008-03-10 20:54:25 UTC (rev 6128)
+++ trunk/bin/upgrading/s2layers/flexiblesquares/layout.s2	2008-03-10 23:15:08 UTC (rev 6129)
@@ -1769,7 +1769,7 @@
     var string userpic = "";
     if ($*show_entry_userpic)
     {
-        if ($p.view == "friends" or $p.view == "entry")
+        if ($p.view == "friends" or $p.view == "entry" or $p.view == "reply")
         {
             if (defined $e.userpic)
                  {
@@ -1818,7 +1818,7 @@
 
     # Poster
 
-            if ($p.view == "friends" or $p.view == "entry")
+            if ($p.view == "friends" or $p.view == "entry" or $p.view == "reply")
             {
                 var UserLite linkto;
                 $linkto = $e.poster;
@@ -1834,7 +1834,7 @@
                 """<br /><a href=\"""" + $linkto->base_url() + "\">";
                  "$linkto.username</a>";
             }
-            if (($p.view == "friends" or $p.view == "entry") and $e.poster.username != $e.journal.username)
+            if (($p.view == "friends" or $p.view == "entry" or $p.view == "reply") and $e.poster.username != $e.journal.username)
             {
                     var UserLite linkto;
                 $linkto = $e.journal;
@@ -1937,6 +1937,10 @@
     print_entry($this, $e, $*entry_bgcolor, $*entry_fgcolor);
 }
 
+function ReplyPage::print_entry(Entry e) {
+    print_entry($this, $e, $*entry_bgcolor, $*entry_fgcolor);
+}
+
 function Entry::print_metadata() {
        if (size $.metadata)
     {
@@ -2288,38 +2292,45 @@
         return;
     }
 
-    $.entry->print_linkbar();
+    if ($.replyto isa Entry) {
+        var Entry en = $.replyto as Entry;
 
-    """<div class="subcontent">""";
-        if (defined $.replyto.userpic)
-        {
-            print """<div class="userpic">$.replyto.userpic</div>""";
-        }
+        $this->print_entry($en);
+    } else {
+        $.entry->print_linkbar();
 
-            var string poster = isnull $.replyto.poster ? $*text_poster_anonymous : $.replyto.poster->as_string();
-            var Page p;
-        print """
-        <div class="datesubject">
-            <div class="replytoposter">""";
-            print $.replyto.poster.name + " (";
-            print $poster + ") ";
-            print "wrote";
-            if ($.journal_type == "C")
+        """<div class="subcontent">""";
+            if (defined $.replyto.userpic)
             {
-            print " in ";
-            print $.replyto.journal;
-            print " ";
+                print """<div class="userpic">$.replyto.userpic</div>""";
             }
-            print " "+lang_at_datetime($.replyto.time);
 
+                var string poster = isnull $.replyto.poster ? $*text_poster_anonymous : $.replyto.poster->as_string();
+                var Page p;
             print """
+            <div class="datesubject">
+                <div class="replytoposter">""";
+                print $.replyto.poster.name + " (";
+                print $poster + ") ";
+                print "wrote";
+                if ($.journal_type == "C")
+                {
+                print " in ";
+                print $.replyto.journal;
+                print " ";
+                }
+                print " "+lang_at_datetime($.replyto.time);
+
+                print """
+                </div>
+                <div class="replytosubject">$.replyto.subject</div>
             </div>
-            <div class="replytosubject">$.replyto.subject</div>
+            <div class="entry">"""; $.replyto->print_text(); """</div>
         </div>
-        <div class="entry">"""; $.replyto->print_text(); """</div>
-    </div>
-    <div class="clear"> </div>
-    <div class="box">
+        <div class="clear"> </div>""";
+    }
+
+    """<div class="box">
     <center><b>( <a href="$.entry.permalink_url">Read comments</a> )</b> </center>
     Post a comment in response:<br/>""";
     $.form->print();

Modified: trunk/bin/upgrading/s2layers/nebula/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/nebula/layout.s2	2008-03-10 20:54:25 UTC (rev 6128)
+++ trunk/bin/upgrading/s2layers/nebula/layout.s2	2008-03-10 23:15:08 UTC (rev 6129)
@@ -1634,19 +1634,26 @@
         return;
     }
 
-    var string time = $.replyto.time->time_format($*text_time_format);
-    var string date = $.replyto.time->date_format($*text_date_format);
-    """<div class="entry"><div class="entryBar">""";
-    if (defined $.replyto.userpic) {
-        """<div class="userpic"><img border="0" src="$.replyto.userpic.url" width="$.replyto.userpic.width" height="$.replyto.userpic.height" vspace="5" hspace="5" alt="" /></div>""";
+    if ($.replyto isa Entry) {
+        var Entry en = $.replyto as Entry;
+
+        print_entry ( $this, $en, null Color, null Color, false );
+    } else {
+        var string time = $.replyto.time->time_format($*text_time_format);
+        var string date = $.replyto.time->date_format($*text_date_format);
+        """<div class="entry"><div class="entryBar">""";
+        if (defined $.replyto.userpic) {
+            """<div class="userpic"><img border="0" src="$.replyto.userpic.url" width="$.replyto.userpic.width" height="$.replyto.userpic.height" vspace="5" hspace="5" alt="" /></div>""";
+        }
+        if ( $.replyto.subject ) { print "<h3>$.replyto.subject</h3>"; }
+        "<span class=\"subHeading\">Posted by ";
+        print defined $.replyto.poster ? $.replyto.poster->as_string() : "<i>(Anonymous)</i>";
+        " on $date at $time</span></div>";
+        "<div class=\"entryText\">"; $.replyto->print_text(); "</div>";
+        """<div class="entryFooter"><div class="commentsInfo">""";
+        print safe "<a href='$.entry.permalink_url'>$*text_reply_back</a></div> </div></div><hr />";
     }
-    if ( $.replyto.subject ) { print "<h3>$.replyto.subject</h3>"; }
-    "<span class=\"subHeading\">Posted by ";
-    print defined $.replyto.poster ? $.replyto.poster->as_string() : "<i>(Anonymous)</i>";
-    " on $date at $time</span></div>";
-    "<div class=\"entryText\">"; $.replyto->print_text(); "</div>";
-    """<div class="entryFooter"><div class="commentsInfo">""";
-    print safe "<a href='$.entry.permalink_url'>$*text_reply_back</a></div> </div></div><hr />";
+
     """<div class="commentBarOne"><div class="commentInfo">""";
     var string what = $.replyto.permalink_url == $.entry.permalink_url ? "entry" : "comment" ;
     "<h3>Reply to this $what:</h3></div>";

Modified: trunk/bin/upgrading/s2layers/opal/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/opal/layout.s2	2008-03-10 20:54:25 UTC (rev 6128)
+++ trunk/bin/upgrading/s2layers/opal/layout.s2	2008-03-10 23:15:08 UTC (rev 6129)
@@ -1287,39 +1287,52 @@
         }
         """                                    </div>""";
     }
-    print safe """
-                                    <div class="entry">
-                                        <div class="entrydivider"></div>
-                                        <div class="entryinfo">$name</div>
-                                        <div class="entrydivider"></div>
-                                        <div class="entryinfo">$time $date</div>
-                                        <div class="entrydivider"></div>
-                                        <div class="entrylinks">
-                                        <a href="$.entry.comments.read_url" class="comments">   $*text_reply_back   </a>""";
 
+    if ($.replyto isa Entry) {
+        var Entry en = $.replyto as Entry;
 
-    var Link link;
-    foreach var string key ($e.link_keyseq) {
-        $link = $e->get_link($key);
-        if (defined $link) {
-            """<a href=\"$link.url\">   $link.caption   </a>""";
+        print safe """
+                                        <div class="entry">
+                                            <div class="entrydivider"></div>
+                                            <div class="entryinfo">$name</div>""";
+
+        $this->print_entry($en);
+        """</div>""";
+    } else {
+        print safe """
+                                        <div class="entry">
+                                            <div class="entrydivider"></div>
+                                            <div class="entryinfo">$name</div>
+                                            <div class="entrydivider"></div>
+                                            <div class="entryinfo">$time $date</div>
+                                            <div class="entrydivider"></div>
+                                            <div class="entrylinks">
+                                            <a href="$.entry.comments.read_url" class="comments">   $*text_reply_back   </a>""";
+
+
+        var Link link;
+        foreach var string key ($e.link_keyseq) {
+            $link = $e->get_link($key);
+            if (defined $link) {
+                """<a href=\"$link.url\">   $link.caption   </a>""";
+            }
         }
-    }
-    """<a href="$e.permalink_url">   $*text_permalink   </a>
-                                        </div>
-    """;
+        """<a href="$e.permalink_url">   $*text_permalink   </a>
+                                            </div>
+        """;
 
-    """
-                                        <div class="entrytext">
-                                            <div class="subject">$e.subject</div>
-                                                                                        <p>
-        """;
-        $e->print_text();
         """
-                                                                                        </p>
-                                        </div>
+                                            <div class="entrytext">
+                                                <div class="subject">$e.subject</div>
+                                                                                            <p>
+            """;
+            $e->print_text();
+            """
+                                                                                            </p>
+                                            </div>""";
+    }
 
-                                        <div class="messageholder"><div class="systemmessage">
+                                        """<div class="messageholder"><div class="systemmessage">
     """;
     $.form->print();
     """

Modified: trunk/bin/upgrading/s2layers/tranquilityii/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/tranquilityii/layout.s2	2008-03-10 20:54:25 UTC (rev 6128)
+++ trunk/bin/upgrading/s2layers/tranquilityii/layout.s2	2008-03-10 23:15:08 UTC (rev 6129)
@@ -1336,51 +1336,56 @@
 
    } else {
         print "<div id=\"entries\">\n";
+        if ($.replyto isa Entry) {
+            var Entry en = $.replyto as Entry;
 
-        # get date
-        var string datetime;
-        $datetime = $.replyto.time->date_format($*date_format) + " | " + $.replyto.time->time_format($*time_format);
-
-        # get any extra user info (if posting to community, etc)
-        var string poster = "";
-        var string userpic = "";
-        if ( defined $.replyto.poster ) {
-            $poster = "<a href=\"" + $.replyto.poster->base_url() + "\" title=\"$.replyto.poster.username\">$.replyto.poster.username</a>";
-            if ( defined $.replyto.userpic ) {
-                $userpic = "<h3 class=\"userpic\"><img border=\"0\" src=\"$.replyto.userpic.url\" width=\"$.replyto.userpic.width\" height=\"$.replyto.userpic.height\" alt=\"$.replyto.poster.username\" /></h3>";
-            }
+            $this->print_entry ( $en );
         } else {
-            $poster = "<i>$*text_comment_anonymous</i>";
-        }
+            # get date
+            var string datetime;
+            $datetime = $.replyto.time->date_format($*date_format) + " | " + $.replyto.time->time_format($*time_format);
 
-
-        # print the entry now:
-        print "<div class=\"ind-entry\">";
-            # print icon (if needed)
-            if ( $userpic != "" ) {
-                print "$userpic";
-            }
-            print "<h2>";
-            if ( $.replyto.subject == "" ) {
-                print safe "<i>$*text_nosubject</i>";
+            # get any extra user info (if posting to community, etc)
+            var string poster = "";
+            var string userpic = "";
+            if ( defined $.replyto.poster ) {
+                $poster = "<a href=\"" + $.replyto.poster->base_url() + "\" title=\"$.replyto.poster.username\">$.replyto.poster.username</a>";
+                if ( defined $.replyto.userpic ) {
+                    $userpic = "<h3 class=\"userpic\"><img border=\"0\" src=\"$.replyto.userpic.url\" width=\"$.replyto.userpic.width\" height=\"$.replyto.userpic.height\" alt=\"$.replyto.poster.username\" /></h3>";
+                }
             } else {
-                print "$.replyto.subject";
+                $poster = "<i>$*text_comment_anonymous</i>";
             }
-            print "</h2>";
 
-            print "<h4>\n";
-            print "<b>$datetime</b><br />";
-            print safe "<b>$*text_comment_from:</b> $poster";
-            if ( $.replyto.metadata{"poster_ip"} ) {
-                print safe "<b>$*text_comment_ipaddr</b> " + $.replyto.metadata{"poster_ip"} + "<br />";
-            }
-            print "</h4>";
-            print "<div class=\"entry-item\">"; $.replyto->print_text(); "</div>\n";
-            print "<h4>";
-            print safe get_permalink($.replyto.permalink_url) + " | <a href=\"$.entry.comments.read_url\" title=\"$*text_comment_viewall\">$*text_comment_viewall</a>\n";
-            print "</h4>";
-        print "</div>\n";
 
+            # print the entry now:
+            print "<div class=\"ind-entry\">";
+                # print icon (if needed)
+                if ( $userpic != "" ) {
+                    print "$userpic";
+                }
+                print "<h2>";
+                if ( $.replyto.subject == "" ) {
+                    print safe "<i>$*text_nosubject</i>";
+                } else {
+                    print "$.replyto.subject";
+                }
+                print "</h2>";
+
+                print "<h4>\n";
+                print "<b>$datetime</b><br />";
+                print safe "<b>$*text_comment_from:</b> $poster";
+                if ( $.replyto.metadata{"poster_ip"} ) {
+                    print safe "<b>$*text_comment_ipaddr</b> " + $.replyto.metadata{"poster_ip"} + "<br />";
+                }
+                print "</h4>";
+                print "<div class=\"entry-item\">"; $.replyto->print_text(); "</div>\n";
+                print "<h4>";
+                print safe get_permalink($.replyto.permalink_url) + " | <a href=\"$.entry.comments.read_url\" title=\"$*text_comment_viewall\">$*text_comment_viewall</a>\n";
+                print "</h4>";
+            print "</div>\n";
+        }
+
         print "<div class=\"entry-form\">\n";
             print "<h2>Reply</h2>\n";
             $.form->print();

  • 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