From fa44b1f132b05bcc22e7f1a2ba29d0ef36885c58 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Wed, 22 Jun 2016 17:36:18 +0200 Subject: added buttons to scroll in rd week view diff --git a/www/js/calendar.js b/www/js/calendar.js index 8bdf033..c6b4f61 100644 --- a/www/js/calendar.js +++ b/www/js/calendar.js @@ -21,6 +21,8 @@ 'use strict'; +var current_week_offset = -4; + function getLastMonday() { var d = new Date(); d.setHours(0, 0, 0, 0); @@ -55,13 +57,13 @@ function addWeekClass(row, week) { } } -function calendar_redraw() { +function calendar_redraw(weekstart) { var cal = $('#calendar'); cal.find("tr:gt(0)").remove(); var date = getLastMonday(); - date = addDeltaDays(date, -28); - for(var w = 0; w < 42; w++) { + date = addDeltaDays(date, weekstart * 7); + for(var w = 0; w < 20; w++) { var week = get_rd_week(date.valueOf()); var row = $(''); addWeekClass(row, week); @@ -82,5 +84,17 @@ function calendar_redraw() { } function calendar_init() { - calendar_redraw() + $('#btn-earlier').click(calendar_prev); + $('#btn-later').click(calendar_next); + calendar_redraw(current_week_offset) +} + +function calendar_prev() { + current_week_offset--; + calendar_redraw(current_week_offset) +} + +function calendar_next() { + current_week_offset++; + calendar_redraw(current_week_offset) } diff --git a/www/styles/main.css b/www/styles/main.css index 65b04de..638f4d2 100644 --- a/www/styles/main.css +++ b/www/styles/main.css @@ -21,6 +21,7 @@ body { background-color: #eee; + font-family: Sans-Serif; } #container { diff --git a/www/styles/week.css b/www/styles/week.css index 5ff75cd..211f1ad 100644 --- a/www/styles/week.css +++ b/www/styles/week.css @@ -19,7 +19,32 @@ * along with rhrdweb. If not, see . */ +#leftcol { + float: left; + width: 42%; + min-width: 25em; + margin-top: 5em; + margin-bottom: 5em; +} + +#buttons { + margin-top: 3em; +} + +#buttons input[type=button] { + font-size: 1.3em; + font-weight: bold; + padding: 0.3em 3em; +} + +#rightcol { + float: left; + width: 58%; + min-width: 25em; +} + #calendar { + margin-top: 2em; border-collapse: collapse; } @@ -47,4 +72,3 @@ border-left: 2px solid white; border-right: 2px solid white; } - diff --git a/www/weeks.html b/www/weeks.html index 13ee0e5..42c8e29 100644 --- a/www/weeks.html +++ b/www/weeks.html @@ -15,33 +15,44 @@
-
- - - -
+
+
+

Rivendell Wochenplan

+
-
+
+

aktuelle Woche:

+ + + +
-
- - - - - - - - - - - - - -
MoDiMiDoFrSaSo
+
+ + +
+
+ +
+ + + + + + + + + + + + + +
MoDiMiDoFrSaSo
+
-- cgit v0.10.2