simple_calendar 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/simple_calendar/calendar.rb +13 -8
- data/lib/simple_calendar/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 08c146f5a7b38c2327df0f20dc4026598a0f9d8a
|
4
|
+
data.tar.gz: ac0162169f6c8fb91de3ec38db5fea38e9a82678
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 761eaa0a862661b6a6e50794f7ed4a7ff286eae058019abd49b70ec298dd0b5d1971a73e475da816114298007aadcf8eac59a90474c6988e66f541c99012ec80
|
7
|
+
data.tar.gz: ca7d0f0b8cbbfcd82d2543d769f6d92cd78b16ec8c397e5e1f226ebc490e7fc5199dd4e3956000326a93a8811a9fd7ba43c6b15bac0faf769168c097a3c1e3de
|
@@ -4,14 +4,19 @@ module SimpleCalendar
|
|
4
4
|
|
5
5
|
attr_reader :block, :events, :options, :view_context
|
6
6
|
|
7
|
-
def initialize(view_context,
|
7
|
+
def initialize(view_context, opts={})
|
8
8
|
@view_context = view_context
|
9
|
-
@events =
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
9
|
+
@events = opts.delete(:events) { [] }
|
10
|
+
|
11
|
+
opts.reverse_merge!(
|
12
|
+
previous_link: default_previous_link,
|
13
|
+
header: default_header,
|
14
|
+
next_link: default_next_link,
|
15
|
+
td: default_td_classes,
|
16
|
+
header_div: {class: "calendar-header"}
|
17
|
+
)
|
18
|
+
|
19
|
+
@options = opts
|
15
20
|
end
|
16
21
|
|
17
22
|
def render(block)
|
@@ -25,7 +30,7 @@ module SimpleCalendar
|
|
25
30
|
|
26
31
|
def render_header
|
27
32
|
capture do
|
28
|
-
content_tag :div do
|
33
|
+
content_tag :div, get_option(:header_div) do
|
29
34
|
concat get_option(:previous_link, param_name, date_range)
|
30
35
|
concat get_option(:header, start_date)
|
31
36
|
concat get_option(:next_link, param_name, date_range)
|