simple_calendar 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  Simple Calendar
2
2
  ===============
3
3
 
4
- This is a small gem for creating a quick and clean table calendar.
4
+ This is a small Rails 3.x gem for creating a quick and clean table calendar.
5
5
  Theming is up to you, but it works nicely with Twitter Bootstrap.
6
6
 
7
7
  Installation
@@ -9,7 +9,7 @@ Installation
9
9
 
10
10
  Just add this into your Gemfile followed by a bundle install:
11
11
 
12
- gem "simple_calendar", "~> 0.0.1"
12
+ gem "simple_calendar", "~> 0.0.3"
13
13
 
14
14
  Usage
15
15
  -----
@@ -36,8 +36,26 @@ has_calendar has options that can be passed to it for configuration:
36
36
 
37
37
  has_calendar :start_time => :my_start_column
38
38
 
39
- def whatever
40
- title + " ohai"
41
- end
39
+ The start_time option is the field for the start time of the event. This will use
40
+ my_start_column to determine which day to render the event on.
41
+
42
+
43
+ CSS
44
+ ---
45
+
46
+ You will probably want to customize the height of the calendar so that
47
+ all the rows are the same. You can do this by adding the following line
48
+ to your css:
49
+
50
+ .calendar td { height: 100px; width: 14.28%; }
51
+
52
+ By default simple_calendar will set the calendar to use .bordered-table
53
+ and .calendar classes.
54
+
55
+ TODO
56
+ ====
42
57
 
43
- Start_time is the field for the start time of the event.
58
+ * Add query helpers to grab events for a current month and the days into
59
+ the next and previous months for efficiency
60
+ * Customizable starting day of week
61
+ * More customization?
@@ -1,3 +1,3 @@
1
1
  module SimpleCalendar
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -63,10 +63,11 @@ module SimpleCalendar
63
63
 
64
64
  def day(date, events, block)
65
65
  content_tag :td do
66
- events = day_events(date, events)
67
- tags = [content_tag(:div, date.day, :class => "day")]
68
- tags += events.map { |e| content_tag(:div, block.call(e)) } unless events.empty?
69
- tags.join.html_safe
66
+ concat content_tag(:div, date.day, :class => "day")
67
+
68
+ day_events(date, events).map do |event|
69
+ block.call(event)
70
+ end.join.html_safe
70
71
  end
71
72
  end
72
73
 
@@ -1,4 +1,4 @@
1
1
  require "simple_calendar/version"
2
2
  require "simple_calendar/view_helpers"
3
3
  require "simple_calendar/model_additions"
4
- require "simple_calendar/railtie" if defined?(Rails)
4
+ require "simple_calendar/railtie"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_calendar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-20 00:00:00.000000000Z
12
+ date: 2012-02-22 00:00:00.000000000Z
13
13
  dependencies: []
14
14
  description: A simple Rails 3 calendar
15
15
  email: