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

[ljcom] r10613: LJSUP-8956: Minimalism Calendar

Committer: esavintcev
LJSUP-8956: Minimalism Calendar
U   trunk/bin/upgrading/s2layers/sup/layout.s2
U   trunk/bin/upgrading/s2layers/sup/themes.s2
Modified: trunk/bin/upgrading/s2layers/sup/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/sup/layout.s2	2011-06-08 09:12:33 UTC (rev 10612)
+++ trunk/bin/upgrading/s2layers/sup/layout.s2	2011-06-09 04:19:08 UTC (rev 10613)
@@ -434,7 +434,7 @@
 }
 
 
-function _calendar(YearMonth mon) {
+function _calendar(YearMonth mon, string place) { ### $place eq "sidebar" or "page"
     var string month = $mon->month_format("%%mon%%");
     var string year = $mon->month_format("%%yyyy%%");
     var int[] weekdays = weekdays();
@@ -467,22 +467,26 @@
         }
     }
 
-"""<p class="sbar-cal-nav">""";
-"""<span class="sbar-cal-nav-month"><i class="sbar-cal-nav-prev" title="$*text_month_prev"><i class="sbar-cal-nav-arr"></i></i><span class="sbar-cal-month"><a href="$mon.url" class="month">$month</a></span><i class="sbar-cal-nav-next" title="$*text_month_next"><i class="sbar-cal-nav-arr"></i></i></span>&nbsp;""";
-"""<span class="sbar-cal-nav-year"><i class="sbar-cal-nav-prev" title="$*text_year_prev"><i class="sbar-cal-nav-arr"></i></i><span class="sbar-cal-year"><a href="$*base_url/$year/" class="year">$year</a></span><i class="sbar-cal-nav-next" title="$*text_year_next"><i class="sbar-cal-nav-arr"></i></i></span>""";
-"""</p>""";
+if ($place == "sidebar") {
+    """<p class="sbar-cal-nav">""";
+    """<span class="sbar-cal-nav-month"><i class="sbar-cal-nav-prev" title="$*text_month_prev"><i class="sbar-cal-nav-arr"></i></i><span class="sbar-cal-month"><a href="$mon.url" class="month">$month</a></span><i class="sbar-cal-nav-next" title="$*text_month_next"><i class="sbar-cal-nav-arr"></i></i></span>&nbsp;""";
+    """<span class="sbar-cal-nav-year"><i class="sbar-cal-nav-prev" title="$*text_year_prev"><i class="sbar-cal-nav-arr"></i></i><span class="sbar-cal-year"><a href="$*base_url/$year/" class="year">$year</a></span><i class="sbar-cal-nav-next" title="$*text_year_next"><i class="sbar-cal-nav-arr"></i></i></span>""";
+    """</p>""";
+}
 
 
 if($*active_theme == "x3") {
-"""
-<table cellspacing="0">
-""";
+    """<table cellspacing="0">""";
 } else {
-"""
-<table cellspacing="1">
-""";
+    """<table cellspacing="1">""";
 }
 
+if ($place == "page") {
+    """
+    <caption><a href="$mon.url" class="month">$month</a>&nbsp;<a href="$*base_url/$year/" class="year">$year</a></caption>
+    """;
+}
+
 """
     <thead>
         <tr>""";
@@ -518,6 +522,9 @@
 }
 
 
+function _calendar(YearMonth mon) {
+    return _calendar($mon, "page");
+}
 
 
 
@@ -748,8 +755,7 @@
 """
                     <dl class="sidebar-block sidebar-cal">
                         <dt>$*text_view_archive</dt>
-
-                        <dd class="calendar-wrap">"""; _calendar($p->get_latest_month()); """</dd>
+                        <dd class="calendar-wrap">"""; _calendar($p->get_latest_month(), "sidebar"); """</dd>
                     </dl>
 """;
     }
@@ -1097,7 +1103,7 @@
 
         <div class="calendar-wrap">
 """;
-_calendar($m);
+_calendar($m, "page");
 
 
 """

Modified: trunk/bin/upgrading/s2layers/sup/themes.s2
===================================================================
--- trunk/bin/upgrading/s2layers/sup/themes.s2	2011-06-08 09:12:33 UTC (rev 10612)
+++ trunk/bin/upgrading/s2layers/sup/themes.s2	2011-06-09 04:19:08 UTC (rev 10613)
@@ -219,8 +219,8 @@
         "</li>";
     }
 }
-function _calendar(YearMonth mon) {
-    var string month = $mon->month_format("%%month%%");
+function _calendar(YearMonth mon, string place) { ### $place eq "sidebar" or "page"
+    var string month = $mon->month_format("%%mon%%");
     var string year = $mon->month_format("%%yyyy%%");
     var int[] weekdays = weekdays();
     var int pre_empty = $mon.weeks[0].pre_empty;
@@ -251,13 +251,22 @@
         }
     }
 
-"""<p class="sbar-cal-nav">""";
-"""<span class="sbar-cal-nav-month"><i class="sbar-cal-nav-prev" title="$*text_month_prev"><i class="sbar-cal-nav-arr"></i></i><span class="sbar-cal-month"><a href="$mon.url" class="month">$month</a></span><i class="sbar-cal-nav-next" title="$*text_month_next"><i class="sbar-cal-nav-arr"></i></i></span>&nbsp;""";
-"""<span class="sbar-cal-nav-year"><i class="sbar-cal-nav-prev" title="$*text_year_prev"><i class="sbar-cal-nav-arr"></i></i><span class="sbar-cal-year"><a href="$*base_url/$year/" class="year">$year</a></span><i class="sbar-cal-nav-next" title="$*text_year_next"><i class="sbar-cal-nav-arr"></i></i></span>""";
-"""</p>""";
+if ($place == "sidebar") {
+    """<p class="sbar-cal-nav">""";
+    """<span class="sbar-cal-nav-month"><i class="sbar-cal-nav-prev" title="$*text_month_prev"><i class="sbar-cal-nav-arr"></i></i><span class="sbar-cal-month"><a href="$mon.url" class="month">$month</a></span><i class="sbar-cal-nav-next" title="$*text_month_next"><i class="sbar-cal-nav-arr"></i></i></span>&nbsp;""";
+    """<span class="sbar-cal-nav-year"><i class="sbar-cal-nav-prev" title="$*text_year_prev"><i class="sbar-cal-nav-arr"></i></i><span class="sbar-cal-year"><a href="$*base_url/$year/" class="year">$year</a></span><i class="sbar-cal-nav-next" title="$*text_year_next"><i class="sbar-cal-nav-arr"></i></i></span>""";
+    """</p>""";
+}
 
 """
 <table cellspacing="1">
+""";
+if ($place == "page") {
+    """
+    <caption><a href="$mon.url" class="month">$month</a>&nbsp;<a href="$*base_url/$year/" class="year">$year</a></caption>
+    """;
+}
+"""
     <thead>
         <tr>""";
     var int i = 1;

Tags: 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