Савинцев Егор 🚶 (savintsev_egor) wrote in changelog,
Савинцев Егор 🚶
savintsev_egor
changelog

[ljcom] r11331: LJSUP-10959: Add "View classic comments"...

Committer: esavintcev
LJSUP-10959: Add "View classic comments" minimalism setting
U   trunk/bin/upgrading/s2layers/sup/layout.s2
Modified: trunk/bin/upgrading/s2layers/sup/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/sup/layout.s2	2012-01-19 12:08:59 UTC (rev 11330)
+++ trunk/bin/upgrading/s2layers/sup/layout.s2	2012-01-19 14:44:51 UTC (rev 11331)
@@ -45,6 +45,11 @@
         values = "2CR|Sidebar on the right|2CL|Sidebar on the left";
         } set layout_type = "2CR";
 
+    property bool old_s1 {
+        des = "Show old style Entry page";
+        note = "'Disable customized comment pages for your journal ' should be 'No'";
+        } set old_s1 = false;
+
     property bool recent_show_date { des = "Show dates on Recent Entries page";
         } set recent_show_date = true;
     property bool friends_show_date { des = "Show dates on Friends page";
@@ -256,32 +261,37 @@
 
 function _print_CSS {
     var Page p = get_page();
-    
+
     if ($*use_stylesheets) {
         $p->need_res({"args" => "media=\"screen\"" }, ["stc/sup/s/style.css"]);
         $p->need_res({"args" => "media=\"print\"" }, ["stc/sup/s/print.css"]);
-        
-        if ($*use_theme_stylesheet) {
-            if ($*active_theme == "x0") {
-                $p->need_res({"args" => "media=\"screen\"" }, ["stc/sup/s/x-0.css"]);
-            } elseif ($*active_theme == "x1") {
-                $p->need_res({"args" => "media=\"screen\"" }, ["stc/sup/s/x-0.css"]);
-                $p->need_res({"args" => "media=\"screen\"" }, ["stc/sup/s/x-1.css"]);
-            } elseif ($*active_theme == "x2") {
-                $p->need_res({"args" => "media=\"screen\"" }, ["stc/sup/s/x-2.css"]);
-            } elseif ($*active_theme == "x3") {                
-                $p->need_res({"args" => "media=\"screen\"" }, ["stc/sup/s/x-3.css"]);
-            } elseif ($*active_theme == "x4") {                
-                $p->need_res({"args" => "media=\"screen\"" }, ["stc/sup/s/x-4.css"]);
-            } elseif ($*active_theme == "x5") {
-                $p->need_res({"args" => "media=\"screen\"" }, ["stc/sup/s/x-4.css"]);
-                $p->need_res({"args" => "media=\"screen\"" }, ["stc/sup/s/x-5.css"]);
+
+        if ($*old_s1 and ($p.view == "entry" or $p.view == "reply")) {
+            $p->need_res({"args" => "media=\"screen\"" }, ["stc/sup/s/old_s1.css"]);
+        } else {
+            if ($*use_theme_stylesheet) {
+                if ($*active_theme == "x0") {
+                    $p->need_res({"args" => "media=\"screen\"" }, ["stc/sup/s/x-0.css"]);
+                } elseif ($*active_theme == "x1") {
+                    $p->need_res({"args" => "media=\"screen\"" }, ["stc/sup/s/x-0.css"]);
+                    $p->need_res({"args" => "media=\"screen\"" }, ["stc/sup/s/x-1.css"]);
+                } elseif ($*active_theme == "x2") {
+                    $p->need_res({"args" => "media=\"screen\"" }, ["stc/sup/s/x-2.css"]);
+                } elseif ($*active_theme == "x3") {                
+                    $p->need_res({"args" => "media=\"screen\"" }, ["stc/sup/s/x-3.css"]);
+                } elseif ($*active_theme == "x4") {                
+                    $p->need_res({"args" => "media=\"screen\"" }, ["stc/sup/s/x-4.css"]);
+                } elseif ($*active_theme == "x5") {
+                    $p->need_res({"args" => "media=\"screen\"" }, ["stc/sup/s/x-4.css"]);
+                    $p->need_res({"args" => "media=\"screen\"" }, ["stc/sup/s/x-5.css"]);
+                }
+                if ($*theme_css) {
+                    $p->need_res({"args" => "media=\"screen\"" }, ["stc/sup/s/$*theme_css"]);
+                }
             }
-            if ($*theme_css) {
-                $p->need_res({"args" => "media=\"screen\"" }, ["stc/sup/s/$*theme_css"]);
-            }
-            $p->need_res({"condition" => "IE","args" => "media=\"screen\"" }, ["stc/sup/s/ie.css"]);
         }
+
+        $p->need_res({"condition" => "IE","args" => "media=\"screen\"" }, ["stc/sup/s/ie.css"]);
     }
 }
 
@@ -321,6 +331,10 @@
     var Page p = get_page();
     var string entrydate = _dateTime($e.time);
     var string isodate = $e.time->date_format("%%yyyy%%-%%mm%%-%%dd%%T%%HH%%:%%min%%:%%sec%%+03:00");
+    var string entrydate_year = $e.time->date_format("%%yyyy%%");
+    var string entrydate_month = $e.time->date_format("%%mm%%");
+    var string entrydate_day = $e.time->date_format("%%dd%%");
+    var string olds1date = """<a href="$*base_url/$entrydate_year/">$entrydate_year</a>-<a href="$*base_url/$entrydate_year/$entrydate_month/">$entrydate_month</a>-<a href="$*base_url/$entrydate_year/$entrydate_month/$entrydate_day">$entrydate_day</a> """ + $e.time->date_format("%%HH%%:%%min%%:%%sec%%");
     var string extraclasses = "";
     #cornerz things need refactoring, cause now it's so messed up
     var string corners1 = "";
@@ -351,14 +365,28 @@
                 <dl class="entry hentry$extraclasses" id="post-$e.journal.username-$e.itemid">
 """;
     if ($p.view=="entry" or $p.view=="reply") {
-        """<dt class="entry-title entry-linkbar">""";
+        if ($*old_s1) {
+            """
+            <dl class="vcard author author-olds1">
+                """;
+                if ($e.userpic) { """<dt"""; if ($e.poster.username!=$e.journal.username and not ($p.journal.journal_type == "C" and $p.view == "recent" )){ print " data-journal=\"" + $e.journal->base_url() + "\""; }""">"""; $e.userpic->print(); """</dt>"""; } else { """<dt></dt>"""; }
+                """
+                <dd class="username">$e.journal.name """; if ($e.poster.username!=$e.journal.username and not ($p.journal.journal_type == "C" and $p.view == "recent" )){ print _user_print_journal($e.poster, "inside", $e.journal.username); " $*text_user_posts_in "; print _user_print($e.journal,"simple");} else { print _user_print($e.poster,"inside"); } """</dd>
+                <dd class="entry-date"><abbr class="updated" title="$isodate">@ $olds1date</abbr></dd>
+            </dl>
+            """;
+        }
+        """<dt class="entry-title entry-linkbar"><span class="entry-linkbar-inner">""";
         $e->print_linkbar();
-        """$corners1_2</dt>""";
+        """$corners1_2</span></dt>""";
     }
 
 """
                     <dt class="entry-title">$_entry_title$corners1_3</dt>
                     <dd class="entry-text">
+""";
+                    if (not $*old_s1) {
+"""
                         <dl class="vcard author">
                             """;
                             if ($e.userpic) { """<dt"""; if ($e.poster.username!=$e.journal.username and not ($p.journal.journal_type == "C" and $p.view == "recent" )){ print " data-journal=\"" + $e.journal->base_url() + "\""; }""">"""; $e.userpic->print(); """</dt>"""; } else { """<dt></dt>"""; }
@@ -367,6 +395,7 @@
                             <dd class="entry-date"><abbr class="updated" title="$isodate">$entrydate</abbr></dd>
                         </dl>
 """;
+                    }
 $e->print_metadata();
 """<div class="entry-content">""";$e->print_text();"""</div>""";
 """

Tags: esavintcev, ljcom, s2, savintsev_egor
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