carendar 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/app/assets/stylesheets/_carendar.sass +25 -4
- data/app/helpers/carendar/carendar_helper.rb +2 -2
- data/app/views/carendar/_carendar.html.erb +2 -3
- data/lib/carendar/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe6d60c4351f90eb53d7d2d823da0ccca163684b
|
4
|
+
data.tar.gz: 37042b6edd755512d67d09ee9d9553299c7f09fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36c1ab6bdbd4f9a3c29219c3f6bb4c0f8b7635ec31a19920dc214674ae23e1612816fb47235d0a313a832a1bc97f6df989e9a12a552baf9d3f178c83c73085e8
|
7
|
+
data.tar.gz: f294827831dc505da8b7ca285f1b880d54be5c0f7b80fd20c05dcc7c4b3721a6161a849e45757715855e67f8fde76e4a24d00d84e7054974eaf1776d65f4d3fd
|
data/README.md
CHANGED
@@ -3,10 +3,10 @@
|
|
3
3
|
margin: 0
|
4
4
|
list-style-type: none
|
5
5
|
|
6
|
-
=carendar($day-height: 500px, $min-per-slot: 5)
|
6
|
+
=carendar($week-day-height: 500px, $month-day-height: 50px, $min-per-slot: 5)
|
7
7
|
$min-per-day: 60 * 24
|
8
8
|
$slots-per-day: $min-per-day / $min-per-slot
|
9
|
-
$slot-height: $day-height / $slots-per-day
|
9
|
+
$slot-height: $week-day-height / $slots-per-day
|
10
10
|
+unstyled-carender-list
|
11
11
|
width: 100%
|
12
12
|
&.week
|
@@ -14,10 +14,10 @@
|
|
14
14
|
flex-direction: row
|
15
15
|
flex-wrap: wrap
|
16
16
|
.day
|
17
|
-
width: (100.0% / 7)
|
17
|
+
width: (100.0% / 7.1)
|
18
18
|
.items
|
19
19
|
+unstyled-carender-list
|
20
|
-
height: $day-height
|
20
|
+
height: $week-day-height
|
21
21
|
position: relative
|
22
22
|
&:after
|
23
23
|
clear: both
|
@@ -38,4 +38,25 @@
|
|
38
38
|
left: $i * 10%
|
39
39
|
&[data-offset-right='#{$i}']
|
40
40
|
right: $i * 10%
|
41
|
+
&.month
|
42
|
+
display: flex
|
43
|
+
flex-direction: row
|
44
|
+
flex-wrap: wrap
|
45
|
+
.day
|
46
|
+
width: (100.0% / 7)
|
47
|
+
.items
|
48
|
+
+unstyled-carender-list
|
49
|
+
height: $month-day-height
|
50
|
+
position: relative
|
51
|
+
&:after
|
52
|
+
clear: both
|
53
|
+
|
54
|
+
.item
|
55
|
+
width: 10px
|
56
|
+
height: 10px
|
57
|
+
float: left
|
41
58
|
|
59
|
+
border-radius: 50%
|
60
|
+
margin: 2px
|
61
|
+
> *
|
62
|
+
display: none
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Carendar
|
2
2
|
module CarendarHelper
|
3
|
-
def carendar(calendar)
|
4
|
-
render partial: 'carendar/carendar', locals: {calendar: calendar}
|
3
|
+
def carendar(calendar, options = {}, &blk)
|
4
|
+
render partial: 'carendar/carendar', locals: {calendar: calendar, options: options, block: blk}
|
5
5
|
end
|
6
6
|
end
|
7
7
|
end
|
@@ -1,12 +1,11 @@
|
|
1
|
-
<ol class="carendar
|
1
|
+
<ol class="carendar <%= Array.wrap(options[:class]).join(' ') %>">
|
2
2
|
<%- calendar.days.each do |day| %>
|
3
3
|
<li class="day">
|
4
4
|
<div class="dayName"><%= l(day.day.to_date, format: :short) %> </div>
|
5
5
|
<ol class="items">
|
6
6
|
<%- day.items.each do |i| %>
|
7
7
|
<%= content_tag 'li', {data: {start: i.start_min , duration: i.duration, offset_left: i.offset_left, offset_right: i.offset_right}, class: ['item'] + Array.wrap(i.options[:class])} do %>
|
8
|
-
|
9
|
-
<div class="title"><%=i.options[:title]%></div>
|
8
|
+
<%= block.call(i.options).html_safe %>
|
10
9
|
<% end %>
|
11
10
|
<% end %>
|
12
11
|
</ol>
|
data/lib/carendar/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: carendar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Axel Tetzlaff
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|