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

[ljcom] r10612: 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
U   trunk/htdocs/stc/sup/s/style.css
U   trunk/htdocs/stc/sup/s/x-1-1.css
U   trunk/htdocs/stc/sup/s/x-3-1.css
U   trunk/htdocs/stc/sup/s/x-3-2.css
U   trunk/htdocs/stc/sup/s/x-3-3.css
U   trunk/htdocs/stc/sup/s/x-3-4.css
U   trunk/htdocs/stc/sup/s/x-3-5.css
U   trunk/htdocs/stc/sup/s/x-4-1.css
U   trunk/htdocs/stc/sup/s/x-4-5.css
U   trunk/htdocs/stc/sup/s/x-5-1.css
U   trunk/htdocs/stc/sup/s/x-5-2.css
Modified: trunk/bin/upgrading/s2layers/sup/layout.s2
===================================================================
--- trunk/bin/upgrading/s2layers/sup/layout.s2	2011-06-08 08:40:22 UTC (rev 10611)
+++ trunk/bin/upgrading/s2layers/sup/layout.s2	2011-06-08 09:12:33 UTC (rev 10612)
@@ -112,6 +112,10 @@
     property use text_read_spam_comments;
     property use text_read_all_spam_comments;
     property use text_view_games;
+    property use text_month_prev;
+    property use text_month_next;
+    property use text_year_prev;
+    property use text_year_next;
 }
 
 propgroup sidebars = "Sidebars";
@@ -431,13 +435,14 @@
 
 
 function _calendar(YearMonth mon) {
-    var string month = $mon->month_format("%%month%%");
+    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;
     var int post_empty = $mon.weeks[size $mon.weeks-1].post_empty;
     var YearDay[] Days;
     var YearDay noday;
+    var DateTime currentDate = journal_current_datetime();
 
     $noday.day = 0;
     $noday.num_entries = 0;
@@ -462,18 +467,23 @@
         }
     }
 
-    if($*active_theme == "x3") {
+"""<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">
 """;
-    } else {
+} else {
 """
 <table cellspacing="1">
 """;
-    }
+}
 
 """
-    <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;
@@ -490,25 +500,21 @@
     var int counter = 1;
 
     foreach var YearDay day ($Days) {
-        if ($counter%7 == 1) {
-"""
-        <tr>""";
-        }
-        """<td>""";
-        if ($day.num_entries > 0) { """<a href="$day.url">"""; }
-        print $day.day == 0?" ":string($day.day);
-        if ($day.num_entries > 0) { """</a>"""; }
-
-        """</td>""";
-        if ($counter%7 == 0) {
-"""    </tr>
-""";
-        }
+        if ($counter%7 == 1) {"""<tr>""";}
+            if ($mon.year == $currentDate.year and $mon.month == $currentDate.month and $day.day == $currentDate.day) {
+                """<td class="today">""";
+            } else {
+                """<td>""";
+            }
+            if ($day.num_entries > 0) { """<a href="$day.url">"""; }
+            print $day.day == 0?" ":string($day.day);
+            if ($day.num_entries > 0) { """</a>"""; }
+            """</td>""";
+        if ($counter%7 == 0) {"""</tr>\n""";}
         $counter++;
     }
     "</tbody></table>";
 
-
 }
 
 

Modified: trunk/bin/upgrading/s2layers/sup/themes.s2
===================================================================
--- trunk/bin/upgrading/s2layers/sup/themes.s2	2011-06-08 08:40:22 UTC (rev 10611)
+++ trunk/bin/upgrading/s2layers/sup/themes.s2	2011-06-08 09:12:33 UTC (rev 10612)
@@ -227,6 +227,7 @@
     var int post_empty = $mon.weeks[size $mon.weeks-1].post_empty;
     var YearDay[] Days;
     var YearDay noday;
+    var DateTime currentDate = journal_current_datetime();
     $noday.day = 0;
     $noday.num_entries = 0;
     if ($*reg_firstdayofweek == "monday") {
@@ -249,9 +250,14 @@
             $Days[size $Days] = $noday;
         }
     }
+
+"""<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">
-    <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;
@@ -269,7 +275,11 @@
 """
         <tr>""";
         }
-        """<td>""";
+        if ($mon.year == $currentDate.year and $mon.month == $currentDate.month and $day.day == $currentDate.day) {
+            """<td class="today">""";
+        } else {
+            """<td>""";
+        }
         if ($day.num_entries > 0) { """<a href="$day.url">"""; }
         print $day.day == 0?" ":string($day.day);
         if ($day.num_entries > 0) { """</a>"""; }

Modified: trunk/htdocs/stc/sup/s/style.css
===================================================================
--- trunk/htdocs/stc/sup/s/style.css	2011-06-08 08:40:22 UTC (rev 10611)
+++ trunk/htdocs/stc/sup/s/style.css	2011-06-08 09:12:33 UTC (rev 10612)
@@ -537,6 +537,80 @@
 .theme-x2 #page .entry-text .calendar-wrap {
 	font-size:.76923em;
 	}
+
+.sbar-cal-nav {
+	overflow: hidden;
+	margin: 0;
+	padding: 0;
+	color: #000;
+	font-size: 15px;
+	}
+	.sbar-cal-nav-month {
+		float: left;
+		}
+	.sbar-cal-nav-year {
+		float: right;
+		}
+	#js .sbar-cal-month,
+	#js .sbar-cal-year {
+		margin: 0;
+		padding: 0 3px;
+		vertical-align: middle;
+		}
+	#js .sbar-cal-month {
+		display: inline-block;
+		min-width: 35px;
+		text-align: center;
+		}
+	.sbar-cal-nav-prev,
+	.sbar-cal-nav-next {
+		display: none;
+		}
+	#js .sbar-cal-nav-prev,
+	#js .sbar-cal-nav-next {
+		position: relative;
+		display: inline-block;
+		width: 15px;
+		height: 20px;
+		vertical-align: top;
+		cursor: pointer;
+		}
+		.sbar-cal-nav-prev .sbar-cal-nav-arr,
+		.sbar-cal-nav-next .sbar-cal-nav-arr {
+			position: absolute;
+			top: 50%;
+			display: block;
+			width: 0;
+			margin: -5px 0 0;
+			border-top: 5px solid transparent;
+			border-bottom: 5px solid transparent;
+			font: 0/0 serif;
+			line-height: 0;
+			}
+		.sbar-cal-nav-prev .sbar-cal-nav-arr {
+			left: 5px;
+			border-right: 5px solid #FFF;
+			}
+		.sbar-cal-nav-next .sbar-cal-nav-arr {
+			right: 5px;
+			border-left: 5px solid #FFF;
+			}
+	.sbar-cal-nav-prev.disabled,
+	.sbar-cal-nav-next.disabled {
+		cursor: default;
+		}
+		.sbar-cal-nav-prev.disabled .sbar-cal-nav-arr,
+		.sbar-cal-nav-next.disabled .sbar-cal-nav-arr {
+			-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
+			filter: alpha(opacity=50);
+			-moz-opacity: 0.5;
+			opacity: 0.5;
+			}
+
+
+
+
+
 	
 /* Comments */
 .entry-comments-text {

Modified: trunk/htdocs/stc/sup/s/x-1-1.css
===================================================================
--- trunk/htdocs/stc/sup/s/x-1-1.css	2011-06-08 08:40:22 UTC (rev 10611)
+++ trunk/htdocs/stc/sup/s/x-1-1.css	2011-06-08 09:12:33 UTC (rev 10612)
@@ -103,10 +103,18 @@
 	background:#3F64B6;
 	color:#FFF;
 	}
-	
+
+.sbar-cal-nav-prev .sbar-cal-nav-arr {
+	border-right-color: #999;
+	}
+.sbar-cal-nav-next .sbar-cal-nav-arr {
+	border-left-color: #999;
+	}
+
 .comment-wrap .odd {
 	background-color:#D7D7D7;
 	}
 .comment-wrap .even {
 	background-color:#C6C6C6;
 	}
+

Modified: trunk/htdocs/stc/sup/s/x-3-1.css
===================================================================
--- trunk/htdocs/stc/sup/s/x-3-1.css	2011-06-08 08:40:22 UTC (rev 10611)
+++ trunk/htdocs/stc/sup/s/x-3-1.css	2011-06-08 09:12:33 UTC (rev 10612)
@@ -87,6 +87,11 @@
 		text-decoration:underline;
 		}
 
+.sbar-cal-nav {
+	padding: 0 10px;
+	background: #660404;
+	}
+
 .header .nav .item-selected A {
 	color:#000;
 	}

Modified: trunk/htdocs/stc/sup/s/x-3-2.css
===================================================================
--- trunk/htdocs/stc/sup/s/x-3-2.css	2011-06-08 08:40:22 UTC (rev 10611)
+++ trunk/htdocs/stc/sup/s/x-3-2.css	2011-06-08 09:12:33 UTC (rev 10612)
@@ -87,6 +87,11 @@
 		text-decoration:underline;
 		}
 
+.sbar-cal-nav {
+	padding: 0 10px;
+	background: #00304E;
+	}
+
 .header .nav .item-selected A {
 	color:#000;
 	}

Modified: trunk/htdocs/stc/sup/s/x-3-3.css
===================================================================
--- trunk/htdocs/stc/sup/s/x-3-3.css	2011-06-08 08:40:22 UTC (rev 10611)
+++ trunk/htdocs/stc/sup/s/x-3-3.css	2011-06-08 09:12:33 UTC (rev 10612)
@@ -86,6 +86,11 @@
 		text-decoration:underline;
 		}
 
+.sbar-cal-nav {
+	padding: 0 10px;
+	background: #213841;
+	}
+
 .header .nav .item-selected A {
 	color:#000;
 	}

Modified: trunk/htdocs/stc/sup/s/x-3-4.css
===================================================================
--- trunk/htdocs/stc/sup/s/x-3-4.css	2011-06-08 08:40:22 UTC (rev 10611)
+++ trunk/htdocs/stc/sup/s/x-3-4.css	2011-06-08 09:12:33 UTC (rev 10612)
@@ -86,6 +86,11 @@
 		text-decoration:underline;
 		}
 
+.sbar-cal-nav {
+	padding: 0 10px;
+	background: #015F2D;
+	}
+
 .header .nav .item-selected A {
 	color:#000;
 	}

Modified: trunk/htdocs/stc/sup/s/x-3-5.css
===================================================================
--- trunk/htdocs/stc/sup/s/x-3-5.css	2011-06-08 08:40:22 UTC (rev 10611)
+++ trunk/htdocs/stc/sup/s/x-3-5.css	2011-06-08 09:12:33 UTC (rev 10612)
@@ -87,6 +87,11 @@
 		text-decoration:underline;
 		}
 
+.sbar-cal-nav {
+	padding: 0 10px;
+	background: #980600;
+	}
+
 .header .nav .item-selected A {
 	color:#000;
 	}

Modified: trunk/htdocs/stc/sup/s/x-4-1.css
===================================================================
--- trunk/htdocs/stc/sup/s/x-4-1.css	2011-06-08 08:40:22 UTC (rev 10611)
+++ trunk/htdocs/stc/sup/s/x-4-1.css	2011-06-08 09:12:33 UTC (rev 10612)
@@ -83,6 +83,13 @@
 	background:url(../i/x-4-1.png?v=1) repeat-x 0 -64px;
 	}
 
+.sbar-cal-nav-prev .sbar-cal-nav-arr {
+	border-right-color: #DFECE6;
+	}
+.sbar-cal-nav-next .sbar-cal-nav-arr {
+	border-left-color: #DFECE6;
+	}
+
 .comment-wrap .odd {
 	background-color:#FFC6CB;
 	}

Modified: trunk/htdocs/stc/sup/s/x-4-5.css
===================================================================
--- trunk/htdocs/stc/sup/s/x-4-5.css	2011-06-08 08:40:22 UTC (rev 10611)
+++ trunk/htdocs/stc/sup/s/x-4-5.css	2011-06-08 09:12:33 UTC (rev 10612)
@@ -90,6 +90,13 @@
 	background:url(../i/x-4-5.png?v=1) repeat-x 0 -64px;
 	}
 
+.sbar-cal-nav-prev .sbar-cal-nav-arr {
+border-right-color: #DFECE6;
+}
+.sbar-cal-nav-next .sbar-cal-nav-arr {
+border-left-color: #DFECE6;
+}
+
 .comment-wrap .odd {
 	background-color:#FFD57A;
 	}

Modified: trunk/htdocs/stc/sup/s/x-5-1.css
===================================================================
--- trunk/htdocs/stc/sup/s/x-5-1.css	2011-06-08 08:40:22 UTC (rev 10611)
+++ trunk/htdocs/stc/sup/s/x-5-1.css	2011-06-08 09:12:33 UTC (rev 10612)
@@ -88,6 +88,13 @@
 	background:#727272 url(../i/x-5-1.png?v=1) repeat-x 0 -64px;
 	}
 
+.sbar-cal-nav-prev .sbar-cal-nav-arr {
+	border-right-color: #DFECE6;
+	}
+.sbar-cal-nav-next .sbar-cal-nav-arr {
+	border-left-color: #DFECE6;
+	}
+
 .comment-wrap .odd {
 	background-color:#D7D7D7;
 	}

Modified: trunk/htdocs/stc/sup/s/x-5-2.css
===================================================================
--- trunk/htdocs/stc/sup/s/x-5-2.css	2011-06-08 08:40:22 UTC (rev 10611)
+++ trunk/htdocs/stc/sup/s/x-5-2.css	2011-06-08 09:12:33 UTC (rev 10612)
@@ -77,6 +77,13 @@
 	background:#FFF6B0 url(../i/x-5-2.png?v=1) repeat-x 0 -64px;
 	}
 
+.sbar-cal-nav-prev .sbar-cal-nav-arr {
+	border-right-color: #DFECE6;
+	}
+.sbar-cal-nav-next .sbar-cal-nav-arr {
+	border-left-color: #DFECE6;
+	}
+
 .comment-wrap .odd {
 	background-color:#DDD9BA;
 	}

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