Permalink
Browse files

fix stylesheets

  • Loading branch information...
1 parent 6a43992 commit 3c9b6cc6a9085f924c66392df0c91054e40c4d64 @shuber committed Jan 21, 2010
View
@@ -10,8 +10,8 @@ INCOMPLETE
== Usage
- @calendar = EventCalendar.new(2009, 10, :events => Event.all)
- puts @calendar.to_html
+ @event_calendar = EventCalendar.new(2009, 10, :events => Event.all)
+ puts @event_calendar.to_html
== Note on Patches/Pull Requests
@@ -36,35 +36,35 @@
border-top-width: 0px;
height: 0px; }
-.calendar {
+.event_calendar {
border-bottom: 1px solid #d4d5d4; }
- .calendar table td {
+ .event_calendar table td {
border-color: #d4d5d4;
border-width: 1px; }
- .calendar .navigation td {
+ .event_calendar .navigation td {
border-color: transparent; }
- .calendar table.grid {
+ .event_calendar table.grid {
background-color: #fefffe;
height: 125px; }
- .calendar .label {
+ .event_calendar .label {
background-color: #ebede2;
border-top-width: 1px;
color: black; }
- .calendar .header .label {
+ .event_calendar .header .label {
background-color: #2f302f;
color: white; }
- .calendar .days .events td {
+ .event_calendar .days .events td {
border-top-width: 3px; }
- .calendar .days .events td a {
+ .event_calendar .days .events td a {
background-color: #9aac9a;
color: white;
-khtml-border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px; }
- .calendar .days .events td:hover a, .calendar .days .events td.hover a {
+ .event_calendar .days .events td:hover a, .event_calendar .days .events td.hover a {
background-color: #6f7f6f; }
- .calendar .days .events td.continuation a {
+ .event_calendar .days .events td.continuation a {
-khtml-border-radius-bottomleft: 0px;
-moz-border-radius-bottomleft: 0px;
-webkit-border-bottom-left-radius: 0px;
@@ -73,7 +73,7 @@
-moz-border-radius-topleft: 0px;
-webkit-border-top-left-radius: 0px;
border-top-left-radius: 0px; }
- .calendar .days .events td.continued a {
+ .event_calendar .days .events td.continued a {
-khtml-border-radius-bottomright: 0px;
-moz-border-radius-bottomright: 0px;
-webkit-border-bottom-right-radius: 0px;
View
@@ -91,7 +91,7 @@ def render
end
def render_with_markaby
- Markaby::Builder.new(:calendar => self, :template => File.read(template)) { eval(template) }.to_s
+ Markaby::Builder.new(:event_calendar => self, :template => File.read(template)) { eval(template) }.to_s
end
end
@@ -92,7 +92,7 @@
!label_background_color = #EBEDE2
!label_color = #000
-.calendar
+.event_calendar
border-bottom= !border_width "solid" !border_color
table td
@@ -1,71 +1,71 @@
-div.event_calendar.send(calendar.date.strftime('%B').downcase).send("#{calendar.id}!") do
+div.event_calendar.send(event_calendar.date.strftime('%B').downcase).send("#{event_calendar.id}!") do
div.header do
table do
tbody do
tr.navigation do
td.previous_month(:colspan => 2) do
- a(:rel => 'previous', :href => calendar.navigation_url.call(calendar.date.last_month)) do
- calendar.evaluate_date_format_option(:navigation_label, calendar.date.last_month, calendar.date)
+ a(:rel => 'previous', :href => event_calendar.navigation_url.call(event_calendar.date.last_month)) do
+ event_calendar.evaluate_date_format_option(:navigation_label, event_calendar.date.last_month, event_calendar.date)
end
end
- td.current_month calendar.evaluate_date_format_option(:header_label, calendar.date), :colspan => 3
+ td.current_month event_calendar.evaluate_date_format_option(:header_label, event_calendar.date), :colspan => 3
td.next_month(:colspan => 2) do
- a(:rel => 'next', :href => calendar.navigation_url.call(calendar.date.next_month)) do
- calendar.evaluate_date_format_option(:navigation_label, calendar.date.next_month, calendar.date)
+ a(:rel => 'next', :href => event_calendar.navigation_url.call(event_calendar.date.next_month)) do
+ event_calendar.evaluate_date_format_option(:navigation_label, event_calendar.date.next_month, event_calendar.date)
end
end
end
tr.labels do
- calendar.weeks.first.each_with_index do |day, index|
+ event_calendar.weeks.first.each_with_index do |day, index|
day_label = td.day
day_label = day_label.send(day.strftime('%A').downcase)
day_label = day_label.today if day.cwday == Time.now.to_date.cwday
- day_label.label calendar.evaluate_date_format_option(:header_day_label, day)
+ day_label.label event_calendar.evaluate_date_format_option(:header_day_label, day)
end
end
end
end
end
div.body do
- calendar.weeks.each do |week|
- div.week.send("#{calendar.id}_week_#{week.first}_#{week.last}!") do
- table.send("#{calendar.id}_labels_#{week.first}_#{week.last}!") do
+ event_calendar.weeks.each do |week|
+ div.week.send("#{event_calendar.id}_week_#{week.first}_#{week.last}!") do
+ table.send("#{event_calendar.id}_labels_#{week.first}_#{week.last}!") do
tbody do
tr.labels do
week.each do |day|
day_label = td.day
- day_label = day_label.send(day.month == calendar.date.month ? 'current_month' : day < calendar.date ? 'previous_month' : 'next_month')
+ day_label = day_label.send(day.month == event_calendar.date.month ? 'current_month' : day < event_calendar.date ? 'previous_month' : 'next_month')
day_label = day_label.send([6, 7].include?(day.cwday) ? 'weekend' : 'weekday')
day_label = day_label.send(day.strftime('%A').downcase)
day_label = day_label.send(day.strftime('%B').downcase)
day_label = day_label.send("day_#{day.strftime('%d').gsub(/^0/, '')}")
day_label = day_label.today if day == Time.now.to_date
- day_label = day_label.scheduled if calendar.events.any? { |event| event.start_date <= day && event.end_date >= day }
- day_label.label calendar.evaluate_date_format_option(:day_label, day)
+ day_label = day_label.scheduled if event_calendar.events.any? { |event| event.start_date <= day && event.end_date >= day }
+ day_label.label event_calendar.evaluate_date_format_option(:day_label, day)
end
end
end
end
- div.days.send("#{calendar.id}_days_#{week.first}_#{week.last}!") do
- table.grid.send("#{calendar.id}_grid_#{week.first}_#{week.last}!") do
+ div.days.send("#{event_calendar.id}_days_#{week.first}_#{week.last}!") do
+ table.grid.send("#{event_calendar.id}_grid_#{week.first}_#{week.last}!") do
tbody do
tr do
week.each do |day|
day_grid = td.day
- day_grid = day_grid.send(day.month == calendar.date.month ? 'current_month' : day < calendar.date ? 'previous_month' : 'next_month')
+ day_grid = day_grid.send(day.month == event_calendar.date.month ? 'current_month' : day < event_calendar.date ? 'previous_month' : 'next_month')
day_grid = day_grid.send([6, 7].include?(day.cwday) ? 'weekend' : 'weekday')
day_grid = day_grid.send(day.strftime('%A').downcase)
day_grid = day_grid.send(day.strftime('%B').downcase)
day_grid = day_grid.send("day_#{day.strftime('%d').gsub(/^0/, '')}")
day_grid = day_grid.today if day == Time.now.to_date
- day_grid = day_grid.scheduled if calendar.events.any? { |event| event.start_date <= day && event.end_date >= day }
- day_grid.send("#{calendar.id}_day_#{day}!") {}
+ day_grid = day_grid.scheduled if event_calendar.events.any? { |event| event.start_date <= day && event.end_date >= day }
+ day_grid.send("#{event_calendar.id}_day_#{day}!") {}
end
end
end
end
unless week.events.empty?
- table.events.send("#{calendar.id}_events_#{week.first}_#{week.last}!") do
+ table.events.send("#{event_calendar.id}_events_#{week.first}_#{week.last}!") do
tbody do
tr.grid do
week.each { |day| td('') }
@@ -78,16 +78,16 @@ div.event_calendar.send(calendar.date.strftime('%B').downcase).send("#{calendar.
else
html_options = { :class => 'event' }
html_options[:colspan] = cell[:span] unless cell[:span] == 1
- html_options[:class] << " #{calendar.event_class}" unless calendar.event_class.nil?
+ html_options[:class] << " #{event_calendar.event_class}" unless event_calendar.event_class.nil?
if cell[:continued]
html_options[:class] << ' continuation' if cell[:event].start_date < week.first
html_options[:class] << ' continued' if cell[:event].end_date > week.last
end
event_id = "event_#{cell[:event].id}"
begin
td.send("#{event_id}!", html_options) do
- calendar.event_output.call(cell[:event]) + div.fields do
- calendar.event_fields.each do |field|
+ event_calendar.event_output.call(cell[:event]) + div.fields do
+ event_calendar.event_fields.each do |field|
span(cell[:event].send(field), :title => field)
end
end
View
@@ -13,7 +13,7 @@ namespace :calendar do
desc 'Generates js for the calendar'
task :js do
- puts File.read(File.join(ASSETS_ROOT, 'javascripts', 'event_calendar.js'))
+ puts File.read(File.join(ASSETS_ROOT, 'javascripts', 'event_calendar.prototype.js'))
end
desc 'Creates a sandbox in the gem root for testing'
@@ -42,7 +42,7 @@ namespace :calendar do
Event.new('Event 4 has a longer title', 3.days.from_now, 5.days.from_now),
Event.new('Event 5 spans across multiple weeks', 4.days.from_now, 12.days.from_now)
]
- @calendar = EventCalendar.new(Time.now.year, Time.now.month, :events => events)
+ @event_calendar = EventCalendar.new(Time.now.year, Time.now.month, :events => events)
end
File.open(File.join(SANDBOX_ROOT, 'index.html'), 'w+') do |file|
@@ -67,7 +67,7 @@ namespace :calendar do
</script>
</head>
<body>
- #{@calendar}
+ #{@event_calendar}
</body>
</html>
EOF

0 comments on commit 3c9b6cc

Please sign in to comment.