From d86e01c70d84952d00e71c11bc7bd64dcab8b998 Mon Sep 17 00:00:00 2001 From: Yann Date: Mon, 29 Aug 2011 17:28:07 +0200 Subject: [PATCH 1/3] put height size automatically --- lib/event_calendar/calendar_helper.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/event_calendar/calendar_helper.rb b/lib/event_calendar/calendar_helper.rb index 61c984e..8621075 100644 --- a/lib/event_calendar/calendar_helper.rb +++ b/lib/event_calendar/calendar_helper.rb @@ -136,7 +136,7 @@ def calendar(options = {}, &block) end # body container (holds day names and the calendar rows) - cal << %(
) + cal << %(
) # day names cal << %() @@ -148,7 +148,6 @@ def calendar(options = {}, &block) # container for all the calendar rows cal << %(
) # initialize loop variables first_day_of_week = beginning_of_week(first, options[:first_day_of_week]) @@ -159,7 +158,7 @@ def calendar(options = {}, &block) # go through a week at a time, until we reach the end of the month while(last_day_of_week <= last_day_of_cal) - cal << %(
) + cal << %(
) top += row_heights[row_num] # this weeks background table From b24f95966ef8415635bf376a8dd23fddae05594a Mon Sep 17 00:00:00 2001 From: Yann Date: Mon, 29 Aug 2011 17:52:17 +0200 Subject: [PATCH 2/3] modify css --- generators/event_calendar/templates/stylesheet.css | 13 +++++++++---- .../event_calendar/templates/stylesheet.css | 13 +++++++++---- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/generators/event_calendar/templates/stylesheet.css b/generators/event_calendar/templates/stylesheet.css index e821653..27c2c89 100644 --- a/generators/event_calendar/templates/stylesheet.css +++ b/generators/event_calendar/templates/stylesheet.css @@ -42,7 +42,7 @@ /* Containers */ .ec-body { position: relative; - border-right: 1px solid #303030; + border-right: 1px solid #D5D5D5; white-space: nowrap; } @@ -64,7 +64,7 @@ /* Rows container and Row */ .ec-rows { - position: absolute; + position: relative; left: 0; bottom: 0; width: 100%; @@ -74,7 +74,7 @@ } .ec-row { - position: absolute; + position: relative; left: 0; width: 100%; overflow: hidden; @@ -145,6 +145,7 @@ a.ec-day-link { vertical-align: top; padding-right: 1px; padding-left: 2px; + border-left: 1px solid #D5D5D5; } .ec-event-cell a { @@ -234,4 +235,8 @@ a.ec-day-link { -webkit-border-radius: 2px; -khtml-border-radius: 2px; -moz-border-radius: 2px; -} \ No newline at end of file +} + +table.ec-row-table { + margin-bottom: 0 auto; +} diff --git a/lib/generators/event_calendar/templates/stylesheet.css b/lib/generators/event_calendar/templates/stylesheet.css index e821653..27c2c89 100644 --- a/lib/generators/event_calendar/templates/stylesheet.css +++ b/lib/generators/event_calendar/templates/stylesheet.css @@ -42,7 +42,7 @@ /* Containers */ .ec-body { position: relative; - border-right: 1px solid #303030; + border-right: 1px solid #D5D5D5; white-space: nowrap; } @@ -64,7 +64,7 @@ /* Rows container and Row */ .ec-rows { - position: absolute; + position: relative; left: 0; bottom: 0; width: 100%; @@ -74,7 +74,7 @@ } .ec-row { - position: absolute; + position: relative; left: 0; width: 100%; overflow: hidden; @@ -145,6 +145,7 @@ a.ec-day-link { vertical-align: top; padding-right: 1px; padding-left: 2px; + border-left: 1px solid #D5D5D5; } .ec-event-cell a { @@ -234,4 +235,8 @@ a.ec-day-link { -webkit-border-radius: 2px; -khtml-border-radius: 2px; -moz-border-radius: 2px; -} \ No newline at end of file +} + +table.ec-row-table { + margin-bottom: 0 auto; +} From 3027534918002b7d1b9a5e0a7d09c94f1e565f10 Mon Sep 17 00:00:00 2001 From: Yann Date: Tue, 30 Aug 2011 10:07:40 +0200 Subject: [PATCH 3/3] modify css template and helper --- generators/event_calendar/templates/stylesheet.css | 5 +++-- lib/event_calendar/calendar_helper.rb | 4 ++-- lib/generators/event_calendar/templates/stylesheet.css | 5 +++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/generators/event_calendar/templates/stylesheet.css b/generators/event_calendar/templates/stylesheet.css index 27c2c89..13ddc02 100644 --- a/generators/event_calendar/templates/stylesheet.css +++ b/generators/event_calendar/templates/stylesheet.css @@ -49,7 +49,7 @@ /* Day names */ .ec-day-names { position: absolute; - top: 0; + top: -21px; left: 0; width: 100%; table-layout: fixed; @@ -113,7 +113,7 @@ border-top: 1px solid #d5d5d5; border-left: 1px solid #d5d5d5; border-bottom: 1px dotted #bbbbbb; - background-color: #ecede2; + background-color: #ffebce; overflow: hidden; } @@ -146,6 +146,7 @@ a.ec-day-link { padding-right: 1px; padding-left: 2px; border-left: 1px solid #D5D5D5; + background-color: #fff9ea; } .ec-event-cell a { diff --git a/lib/event_calendar/calendar_helper.rb b/lib/event_calendar/calendar_helper.rb index 8621075..e438499 100644 --- a/lib/event_calendar/calendar_helper.rb +++ b/lib/event_calendar/calendar_helper.rb @@ -147,7 +147,7 @@ def calendar(options = {}, &block) cal << %(
) # container for all the calendar rows - cal << %(
) # initialize loop variables first_day_of_week = beginning_of_week(first, options[:first_day_of_week]) @@ -306,7 +306,7 @@ def display_event_time(event, day) # try to make it display as short as possible format = (time.min == 0) ? "%l" : "%l:%M" t = time.strftime(format) - am_pm = time.strftime("%p") == "PM" ? "p" : "" + am_pm = time.strftime("%p") == "PM" ? "pm" : "am" t += am_pm %(#{t}) else diff --git a/lib/generators/event_calendar/templates/stylesheet.css b/lib/generators/event_calendar/templates/stylesheet.css index 27c2c89..13ddc02 100644 --- a/lib/generators/event_calendar/templates/stylesheet.css +++ b/lib/generators/event_calendar/templates/stylesheet.css @@ -49,7 +49,7 @@ /* Day names */ .ec-day-names { position: absolute; - top: 0; + top: -21px; left: 0; width: 100%; table-layout: fixed; @@ -113,7 +113,7 @@ border-top: 1px solid #d5d5d5; border-left: 1px solid #d5d5d5; border-bottom: 1px dotted #bbbbbb; - background-color: #ecede2; + background-color: #ffebce; overflow: hidden; } @@ -146,6 +146,7 @@ a.ec-day-link { padding-right: 1px; padding-left: 2px; border-left: 1px solid #D5D5D5; + background-color: #fff9ea; } .ec-event-cell a {