simple_calendar-timeslot 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f52c61db709b554fc0b83bd23ede3fd67eef7d30a6c2ca56653bedfb07aa36e1
|
4
|
+
data.tar.gz: 85c84c537e0f6c838bd6cfbb1e9d91524e0ffe391d45380dba3d8dda0aed8b10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd7ea8c241c235e106c838f474d357b066bef07cdb67ec2e5df0a046b4fb0b8586b71e19ee32137ca2e78b5f269ced9d55b75003cd471251498387336f9c720b
|
7
|
+
data.tar.gz: 503206dbd8a107c38cae4f4957904a27a55db2f342a1a001346095d49b71a90ea1b945b1521da7bf180953d0343df0bb7509476670ec844044accbaceac2f39d
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [0.8.0] - 2021-11-15
|
4
|
+
### Changed
|
5
|
+
- Shuffle html layout around a bit for easier css styling like sticky
|
6
|
+
|
3
7
|
## [0.7.0] - 2021-11-15
|
4
8
|
### Added
|
5
9
|
- new option to display a current time indicator line (based on Time.zone.now), that is invisible unless styled, the css-class is
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
simple_calendar-timeslot (0.
|
4
|
+
simple_calendar-timeslot (0.8.0)
|
5
5
|
simple_calendar (~> 2.0)
|
6
6
|
|
7
7
|
GEM
|
@@ -90,8 +90,6 @@ GEM
|
|
90
90
|
nokogiri (1.12.5)
|
91
91
|
mini_portile2 (~> 2.6.1)
|
92
92
|
racc (~> 1.4)
|
93
|
-
nokogiri (1.12.5-x86_64-darwin)
|
94
|
-
racc (~> 1.4)
|
95
93
|
parallel (1.21.0)
|
96
94
|
parser (3.0.2.0)
|
97
95
|
ast (~> 2.4.1)
|
data/README.md
CHANGED
@@ -75,13 +75,13 @@ Shortversion in the meantime:
|
|
75
75
|
- `orientation` (`:vertical`, `:horizontal`, default: :vertical)
|
76
76
|
- `px_per_minute` (defines size of calendar, default: 0.65)
|
77
77
|
- `horizontal_height_px` default: 300
|
78
|
-
- `
|
78
|
+
- `horizontal_scroll_split` (scroll days separately or together, default: false)
|
79
79
|
- `split_by_type` (model function to call in case of bucketing f.ex.`:event_type`, default: false)
|
80
80
|
- `display_bucket_title` (model function to call in case of bucketing f.ex.`:event_type_name`, default: false)
|
81
81
|
- `bucket_title_size` default: 20
|
82
82
|
- `grid_width` default: 20px
|
83
83
|
- `display_grid` default: true
|
84
|
-
- `
|
84
|
+
- `display_current_time_indicator` (display a stylable div across the timeline that display the current time, css-class: `current_time_indicator`, default: false)
|
85
85
|
|
86
86
|
## Development
|
87
87
|
|
@@ -1,14 +1,30 @@
|
|
1
1
|
.timeslot-calendar div {
|
2
2
|
box-sizing: border-box;
|
3
3
|
}
|
4
|
-
.timeslot-calendar .days-wrapper-vertical {
|
4
|
+
.timeslot-calendar .days-wrapper-vertical .days-body {
|
5
5
|
display: flex;
|
6
6
|
flex-direction: row;
|
7
7
|
}
|
8
|
+
.timeslot-calendar .days-wrapper-vertical .days-heading {
|
9
|
+
width: 100%;
|
10
|
+
display: flex;
|
11
|
+
flex-direction: row;
|
12
|
+
top: 0;
|
13
|
+
/*position: sticky;*/
|
14
|
+
}
|
15
|
+
.timeslot-calendar .days-wrapper-vertical .days-heading .day-title-row{
|
16
|
+
flex: 1;
|
17
|
+
}
|
18
|
+
|
8
19
|
.timeslot-calendar .days-wrapper-horizontal {
|
9
20
|
display: flex;
|
10
21
|
flex-direction: column;
|
11
22
|
}
|
23
|
+
.timeslot-calendar .days-wrapper-horizontal .day-title-row {
|
24
|
+
display: inline-block;
|
25
|
+
left: 0;
|
26
|
+
/*position: sticky;*/
|
27
|
+
}
|
12
28
|
.timeslot-calendar .days-wrapper-horizontal.scroll-link {
|
13
29
|
overflow-x: auto;
|
14
30
|
overflow-y: hidden;
|
@@ -7,8 +7,8 @@
|
|
7
7
|
|
8
8
|
<% if calendar.orientation == :vertical %>
|
9
9
|
<div class="days-wrapper-vertical">
|
10
|
-
|
11
|
-
|
10
|
+
<div class="days-heading">
|
11
|
+
<% date_range.slice(0, 7).each do |day| %>
|
12
12
|
<div class="day-title-row">
|
13
13
|
<span class="day-weekday">
|
14
14
|
<%= t('date.abbr_day_names')[day.wday] %>
|
@@ -17,56 +17,62 @@
|
|
17
17
|
<%= day %>
|
18
18
|
</span>
|
19
19
|
</div>
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
20
|
+
<% end %>
|
21
|
+
</div>
|
22
|
+
<div class="days-body">
|
23
|
+
<% date_range.slice(0, 7).each do |day| %>
|
24
|
+
<div class="day-wrapper">
|
25
|
+
<%= content_tag :div, class: calendar.td_classes_for(day) do %>
|
26
|
+
<div class="day-content-vertical" style="height:<%=calendar.height%>px;">
|
27
|
+
<% if calendar.display_grid %>
|
28
|
+
<div class="hour-indicator-col-vertical">
|
29
|
+
<% if calendar.display_bucket_title %>
|
30
|
+
<div class="bucket-title" style="height:<%=calendar.bucket_title_size%>px"></div>
|
31
|
+
<% end %>
|
32
|
+
<% (0..23).each do |hour| %>
|
33
|
+
<div class="hour-indicator-vertical" id="hour-<%=hour %>">
|
34
|
+
<%=hour%>
|
35
|
+
</div>
|
36
|
+
<% end %>
|
37
|
+
</div>
|
36
38
|
<% end %>
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
<% events_size = calendar.slot_events(bucket, day) %>
|
51
|
-
<% bucket.each do |event| %>
|
52
|
-
<div class="event-wrapper" style="width:<%=events_size[event][0]%>%;top:<%=events_size[event][3]%>px;left:<%=events_size[event][1]%>%;height:<%=events_size[event][2]%>px">
|
53
|
-
<% if defined?(Haml) && respond_to?(:block_is_haml?) && block_is_haml?(passed_block) %>
|
54
|
-
<% capture_haml(event, &passed_block) %>
|
55
|
-
<% else %>
|
56
|
-
<% passed_block.call event %>
|
57
|
-
<% end %>
|
39
|
+
<% if calendar.display_current_time_indicator %>
|
40
|
+
<div class="current_time_indicator" style="top:<%=calendar.current_time_offset %>px;left:0;right:0;height:0;"></div>
|
41
|
+
<% end %>
|
42
|
+
<% events = sorted_events.fetch(day, []) %>
|
43
|
+
<% buckets = calendar.split_into_buckets(events) %>
|
44
|
+
<div class="buckets-wrapper" style="left:<%=calendar.grid_width%>;right:0">
|
45
|
+
<div class="buckets-vertical">
|
46
|
+
<% buckets.each do |bucket| %>
|
47
|
+
<div class="bucket-wrapper">
|
48
|
+
<div class="bucket-vertical">
|
49
|
+
<% if calendar.display_bucket_title %>
|
50
|
+
<div class="bucket-title" style="height:<%=calendar.bucket_title_size%>px">
|
51
|
+
<%= bucket&.first&.send calendar.display_bucket_title %>
|
58
52
|
</div>
|
59
53
|
<% end %>
|
54
|
+
<div class="events-wrapper">
|
55
|
+
<% events_size = calendar.slot_events(bucket, day) %>
|
56
|
+
<% bucket.each do |event| %>
|
57
|
+
<div class="event-wrapper" style="width:<%=events_size[event][0]%>%;top:<%=events_size[event][3]%>px;left:<%=events_size[event][1]%>%;height:<%=events_size[event][2]%>px">
|
58
|
+
<% if defined?(Haml) && respond_to?(:block_is_haml?) && block_is_haml?(passed_block) %>
|
59
|
+
<% capture_haml(event, &passed_block) %>
|
60
|
+
<% else %>
|
61
|
+
<% passed_block.call event %>
|
62
|
+
<% end %>
|
63
|
+
</div>
|
64
|
+
<% end %>
|
65
|
+
</div>
|
60
66
|
</div>
|
61
67
|
</div>
|
62
|
-
|
63
|
-
|
68
|
+
<% end %>
|
69
|
+
</div>
|
64
70
|
</div>
|
65
71
|
</div>
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
72
|
+
<% end %>
|
73
|
+
</div>
|
74
|
+
<% end %>
|
75
|
+
</div>
|
70
76
|
</div>
|
71
77
|
<% elsif calendar.orientation == :horizontal %>
|
72
78
|
<div class="days-wrapper-horizontal <%= calendar.horizontal_scroll_split ? "" : "scroll-link" %>">
|