Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hello #54

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions generators/event_calendar/templates/stylesheet.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@
/* Containers */
.ec-body {
position: relative;
border-right: 1px solid #303030;
border-right: 1px solid #D5D5D5;
white-space: nowrap;
}

/* Day names */
.ec-day-names {
position: absolute;
top: 0;
top: -21px;
left: 0;
width: 100%;
table-layout: fixed;
Expand All @@ -64,7 +64,7 @@

/* Rows container and Row */
.ec-rows {
position: absolute;
position: relative;
left: 0;
bottom: 0;
width: 100%;
Expand All @@ -74,7 +74,7 @@
}

.ec-row {
position: absolute;
position: relative;
left: 0;
width: 100%;
overflow: hidden;
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -145,6 +145,8 @@ a.ec-day-link {
vertical-align: top;
padding-right: 1px;
padding-left: 2px;
border-left: 1px solid #D5D5D5;
background-color: #fff9ea;
}

.ec-event-cell a {
Expand Down Expand Up @@ -234,4 +236,8 @@ a.ec-day-link {
-webkit-border-radius: 2px;
-khtml-border-radius: 2px;
-moz-border-radius: 2px;
}
}

table.ec-row-table {
margin-bottom: 0 auto;
}
9 changes: 4 additions & 5 deletions lib/event_calendar/calendar_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def calendar(options = {}, &block)
end

# body container (holds day names and the calendar rows)
cal << %(<div class="ec-body" style="height: #{height}px;">)
cal << %(<div class="ec-body">)

# day names
cal << %(<table class="ec-day-names" style="height: #{options[:day_names_height]}px;" cellpadding="0" cellspacing="0">)
Expand All @@ -147,8 +147,7 @@ def calendar(options = {}, &block)
cal << %(</tr></tbody></table>)

# container for all the calendar rows
cal << %(<div class="ec-rows" style="top: #{options[:day_names_height]}px; )
cal << %(height: #{height - options[:day_names_height]}px;">)
cal << %(<div class="ec-rows">)

# initialize loop variables
first_day_of_week = beginning_of_week(first, options[:first_day_of_week])
Expand All @@ -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 << %(<div class="ec-row" style="top: #{top}px; height: #{row_heights[row_num]}px;">)
cal << %(<div class="ec-row">)
top += row_heights[row_num]

# this weeks background table
Expand Down Expand Up @@ -307,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
%(<span class="ec-event-time">#{t}</span>)
else
Expand Down
18 changes: 12 additions & 6 deletions lib/generators/event_calendar/templates/stylesheet.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@
/* Containers */
.ec-body {
position: relative;
border-right: 1px solid #303030;
border-right: 1px solid #D5D5D5;
white-space: nowrap;
}

/* Day names */
.ec-day-names {
position: absolute;
top: 0;
top: -21px;
left: 0;
width: 100%;
table-layout: fixed;
Expand All @@ -64,7 +64,7 @@

/* Rows container and Row */
.ec-rows {
position: absolute;
position: relative;
left: 0;
bottom: 0;
width: 100%;
Expand All @@ -74,7 +74,7 @@
}

.ec-row {
position: absolute;
position: relative;
left: 0;
width: 100%;
overflow: hidden;
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -145,6 +145,8 @@ a.ec-day-link {
vertical-align: top;
padding-right: 1px;
padding-left: 2px;
border-left: 1px solid #D5D5D5;
background-color: #fff9ea;
}

.ec-event-cell a {
Expand Down Expand Up @@ -234,4 +236,8 @@ a.ec-day-link {
-webkit-border-radius: 2px;
-khtml-border-radius: 2px;
-moz-border-radius: 2px;
}
}

table.ec-row-table {
margin-bottom: 0 auto;
}