simple_calendar-timeslot 0.1.0 → 0.2.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 +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/README.md +2 -0
- data/app/assets/stylesheets/simple_calendar-timeslot.css +99 -0
- data/app/views/simple_calendar/timeslot/_timeslot_calendar.html.erb +24 -24
- data/lib/simple_calendar/timeslot/version.rb +1 -1
- data/lib/simple_calendar/timeslot.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c7fac7ecd11cc8d00a90b849a3c73300851dd429fa7e497bcb8cd4d4e14a9e1
|
4
|
+
data.tar.gz: 7f7ba6d87d31f912f633e0bc3f834141951907744073eab32b29d913d2d001ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5150b9e8ac40ab7a75f6128222f0c4feb6d6367b2f1088887466351586b738e06cad16fd82399e9297e9239ca4154994a7b59240699e91a3165e6db39d703a8c
|
7
|
+
data.tar.gz: d5d2aa091297a2302ee416571561a75a4a3c3377b8bb399a8c31e361070719e0dbc5fcece8ad62cf76d661e4ff6fcd622f7f166f7e2f9abbc4b34ea700b04263
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -0,0 +1,99 @@
|
|
1
|
+
.timeslot-calendar div {
|
2
|
+
box-sizing: border-box;
|
3
|
+
}
|
4
|
+
.timeslot-calendar .days-wrapper-vertical {
|
5
|
+
display: flex;
|
6
|
+
flex-direction: row;
|
7
|
+
}
|
8
|
+
.timeslot-calendar .days-wrapper-horizontal {
|
9
|
+
display: flex;
|
10
|
+
flex-direction: column;
|
11
|
+
}
|
12
|
+
.timeslot-calendar .day-wrapper {
|
13
|
+
flex: 1 1 0;
|
14
|
+
}
|
15
|
+
.timeslot-calendar .day-content-vertical {
|
16
|
+
display: flex;
|
17
|
+
flex-direction: column;
|
18
|
+
position: relative;
|
19
|
+
}
|
20
|
+
.timeslot-calendar .day-content-horizontal {
|
21
|
+
display: flex;
|
22
|
+
flex-direction: column;
|
23
|
+
position: relative;
|
24
|
+
overflow-x: auto;
|
25
|
+
overflow-y: hidden;
|
26
|
+
}
|
27
|
+
.timeslot-calendar .day-content-horizontal-inner {
|
28
|
+
position: relative;
|
29
|
+
}
|
30
|
+
|
31
|
+
.timeslot-calendar .hour-indicator-col-vertical {
|
32
|
+
display: flex;
|
33
|
+
flex: 1 1 0;
|
34
|
+
flex-direction: column;
|
35
|
+
z-index: 0;
|
36
|
+
}
|
37
|
+
.timeslot-calendar .hour-indicator-col-horizontal {
|
38
|
+
display: flex;
|
39
|
+
flex: 1 1 0;
|
40
|
+
flex-direction: row;
|
41
|
+
height: 100%;
|
42
|
+
z-index: 0;
|
43
|
+
}
|
44
|
+
.timeslot-calendar .hour-indicator-vertical {
|
45
|
+
border-style: solid;
|
46
|
+
flex: 1 1 0;
|
47
|
+
border-width: 2px 0 0;
|
48
|
+
border-color: rgba(229, 231, 235, 0.5);
|
49
|
+
box-sizing: border-box;
|
50
|
+
}
|
51
|
+
.timeslot-calendar .hour-indicator-horizontal {
|
52
|
+
border-style: solid;
|
53
|
+
flex: 1 1 0;
|
54
|
+
border-width: 0 0 0 2px;
|
55
|
+
border-color: rgba(229, 231, 235, 0.5);
|
56
|
+
box-sizing: border-box;
|
57
|
+
}
|
58
|
+
.timeslot-calendar .buckets-wrapper {
|
59
|
+
position: absolute;
|
60
|
+
|
61
|
+
}
|
62
|
+
.timeslot-calendar .buckets-vertical {
|
63
|
+
display: flex;
|
64
|
+
flex-direction: row;
|
65
|
+
}
|
66
|
+
.timeslot-calendar .buckets-horizontal {
|
67
|
+
position: absolute;
|
68
|
+
display: flex;
|
69
|
+
flex-direction: column;
|
70
|
+
}
|
71
|
+
.timeslot-calendar .bucket-wrapper {
|
72
|
+
flex: 1 1 0;
|
73
|
+
}
|
74
|
+
.timeslot-calendar .bucket-horizontal {
|
75
|
+
flex: 1 1 0;
|
76
|
+
display: flex;
|
77
|
+
flex-direction: row;
|
78
|
+
}
|
79
|
+
.timeslot-calendar .bucket-inner-horizontal {
|
80
|
+
position: relative;
|
81
|
+
}
|
82
|
+
.timeslot-calendar .events-wrapper {
|
83
|
+
position: relative;
|
84
|
+
}
|
85
|
+
.timeslot-calendar .event-wrapper {
|
86
|
+
position: absolute;
|
87
|
+
z-index: 1;
|
88
|
+
box-sizing: border-box;
|
89
|
+
}
|
90
|
+
/*--- Event example style ----*/
|
91
|
+
.timeslot-event {
|
92
|
+
width: 100%;
|
93
|
+
height: 100%;
|
94
|
+
border-width: 2px;
|
95
|
+
border-style: solid;
|
96
|
+
border-color: rgba(0, 0, 0, 0.5);
|
97
|
+
border-radius: 0.25rem;
|
98
|
+
background-color: white;
|
99
|
+
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<div class="
|
1
|
+
<div class="simple-calendar timeslot-calendar">
|
2
2
|
<div class="calendar-heading">
|
3
3
|
<%= link_to t('simple_calendar.previous', default: 'Previous'), calendar.url_for_previous_view %>
|
4
4
|
<span class="calendar-title"><%= t('date.month_names')[start_date.month] %> <%= start_date.year %></span>
|
@@ -6,9 +6,9 @@
|
|
6
6
|
</div>
|
7
7
|
|
8
8
|
<% if calendar.orientation == :vertical %>
|
9
|
-
<div class="
|
9
|
+
<div class="days-wrapper-vertical">
|
10
10
|
<% date_range.slice(0, 7).each do |day| %>
|
11
|
-
<div class="
|
11
|
+
<div class="day-wrapper">
|
12
12
|
<div class="day-title-row">
|
13
13
|
<span class="day-weekday">
|
14
14
|
<%= t('date.abbr_day_names')[day.wday] %>
|
@@ -18,14 +18,14 @@
|
|
18
18
|
</span>
|
19
19
|
</div>
|
20
20
|
<%= content_tag :div, class: calendar.td_classes_for(day) do %>
|
21
|
-
<div class="
|
21
|
+
<div class="day-content-vertical" style="height:<%=calendar.height%>px;">
|
22
22
|
<% if calendar.display_grid %>
|
23
|
-
<div class="
|
23
|
+
<div class="hour-indicator-col-vertical">
|
24
24
|
<% if calendar.display_bucket_title %>
|
25
25
|
<div class="bucket-title" style="height:<%=calendar.bucket_title_size%>px"></div>
|
26
26
|
<% end %>
|
27
27
|
<% (0..23).each do |hour| %>
|
28
|
-
<div class="
|
28
|
+
<div class="hour-indicator-vertical" id="hour-<%=hour %>">
|
29
29
|
<%=hour%>
|
30
30
|
</div>
|
31
31
|
<% end %>
|
@@ -33,20 +33,20 @@
|
|
33
33
|
<% end %>
|
34
34
|
<% events = sorted_events.fetch(day, []) %>
|
35
35
|
<% buckets = calendar.split_into_buckets(events) %>
|
36
|
-
<div class="
|
37
|
-
<div class="buckets
|
36
|
+
<div class="buckets-wrapper" style="left:<%=calendar.grid_width%>;right:0">
|
37
|
+
<div class="buckets-vertical">
|
38
38
|
<% buckets.each do |bucket| %>
|
39
|
-
<div class="
|
40
|
-
<div class="bucket">
|
39
|
+
<div class="bucket-wrapper">
|
40
|
+
<div class="bucket-vertical">
|
41
41
|
<% if calendar.display_bucket_title %>
|
42
42
|
<div class="bucket-title" style="height:<%=calendar.bucket_title_size%>px">
|
43
43
|
<%= bucket&.first&.send calendar.display_bucket_title %>
|
44
44
|
</div>
|
45
45
|
<% end %>
|
46
|
-
<div class="
|
46
|
+
<div class="events-wrapper">
|
47
47
|
<% events_size = calendar.slot_events(bucket, day) %>
|
48
48
|
<% bucket.each do |event| %>
|
49
|
-
<div class="
|
49
|
+
<div class="event-wrapper" style="z-index:20;width:<%=events_size[event][0]%>%;top:<%=events_size[event][3]%>px;left:<%=events_size[event][1]%>%;height:<%=events_size[event][2]%>px">
|
50
50
|
<% if defined?(Haml) && respond_to?(:block_is_haml?) && block_is_haml?(passed_block) %>
|
51
51
|
<% capture_haml(event, &passed_block) %>
|
52
52
|
<% else %>
|
@@ -66,9 +66,9 @@
|
|
66
66
|
<% end %>
|
67
67
|
</div>
|
68
68
|
<% elsif calendar.orientation == :horizontal %>
|
69
|
-
<div class="
|
69
|
+
<div class="days-wrapper-horizontal">
|
70
70
|
<% date_range.slice(0, 7).each do |day| %>
|
71
|
-
<div class="
|
71
|
+
<div class="day-wrapper">
|
72
72
|
<div class="day-title-row">
|
73
73
|
<span class="day-weekday">
|
74
74
|
<%= t('date.abbr_day_names')[day.wday] %>
|
@@ -78,15 +78,15 @@
|
|
78
78
|
</span>
|
79
79
|
</div>
|
80
80
|
<%= content_tag :div, class: calendar.td_classes_for(day) do %>
|
81
|
-
<div class="
|
82
|
-
<div class="
|
81
|
+
<div class="day-content-horizontal">
|
82
|
+
<div class="day-content-horizontal-inner" style="width:<%=calendar.height%>px;height:<%=calendar.horizontal_height_px%>px">
|
83
83
|
<% if calendar.display_grid %>
|
84
|
-
<div class="
|
84
|
+
<div class="hour-indicator-col-horizontal" style="z-index:-10;">
|
85
85
|
<% if calendar.display_bucket_title %>
|
86
86
|
<div class="bucket-title" style="width:<%=calendar.bucket_title_size%>px;"></div>
|
87
87
|
<% end %>
|
88
88
|
<% (0..23).each do |hour| %>
|
89
|
-
<div class="
|
89
|
+
<div class="hour-indicator-horizontal" id="hour-<%=hour %>">
|
90
90
|
<div style="height:20px">
|
91
91
|
<%=hour%>
|
92
92
|
</div>
|
@@ -96,10 +96,10 @@
|
|
96
96
|
<% end %>
|
97
97
|
<% events = sorted_events.fetch(day, []) %>
|
98
98
|
<% buckets = calendar.split_into_buckets(events) %>
|
99
|
-
<div class="
|
100
|
-
<div class="buckets
|
99
|
+
<div class="buckets-wrapper" style="top:<%=calendar.grid_width%>;bottom:0">
|
100
|
+
<div class="buckets" >
|
101
101
|
<% buckets.each do |bucket| %>
|
102
|
-
<div class="
|
102
|
+
<div class="bucket-horizontal">
|
103
103
|
<% if calendar.display_bucket_title %>
|
104
104
|
<div class="bucket-title-size-wrap" style="width:<%=calendar.bucket_title_size%>px;">
|
105
105
|
<div class="bucket-title-text-wrapper">
|
@@ -109,11 +109,11 @@
|
|
109
109
|
</div>
|
110
110
|
</div>
|
111
111
|
<% end %>
|
112
|
-
<div class="
|
113
|
-
<div class="
|
112
|
+
<div class="events-wrapper" style="height:<%=(calendar.horizontal_height_px-(calendar.display_grid ? 20 : 0)) / buckets.size%>px;">
|
113
|
+
<div class="events-inner-horizontal">
|
114
114
|
<% events_size = calendar.slot_events(bucket, day) %>
|
115
115
|
<% bucket.each do |event| %>
|
116
|
-
<div class="
|
116
|
+
<div class="event-wrapper" style="height:<%=events_size[event][0]%>%;left:<%=events_size[event][3]%>px;top:<%=events_size[event][1]%>%;width:<%=events_size[event][2]%>px">
|
117
117
|
<% if defined?(Haml) && respond_to?(:block_is_haml?) && block_is_haml?(passed_block) %>
|
118
118
|
<% capture_haml(event, &passed_block) %>
|
119
119
|
<% else %>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_calendar-timeslot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kim Laplume
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-11-
|
11
|
+
date: 2021-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: simple_calendar
|