carendar 0.0.2 → 0.0.3

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
  SHA1:
3
- metadata.gz: d470d2f36812c93ddcbb2f9a9618854e83515b42
4
- data.tar.gz: c2b26a5d02a38aee6f21e68b7eb3eba83f4db270
3
+ metadata.gz: fe6d60c4351f90eb53d7d2d823da0ccca163684b
4
+ data.tar.gz: 37042b6edd755512d67d09ee9d9553299c7f09fd
5
5
  SHA512:
6
- metadata.gz: 1bcb6b6255bdc80976b226f3ea2f89589aa17aafa1f0020676cc21c38b20425fb87e79e06555ef8bebcd35837e61870855f4bf2ab4f7efe102dbec9a598b90d2
7
- data.tar.gz: a758e2fa0ae553200592ca12b997cef43ea065ec85e37c956b4e1eb3cdeaed98f7cc57bdc702290703f57410d0f4b7153da0e3ef06bb970f49244a564bfd9cd2
6
+ metadata.gz: 36c1ab6bdbd4f9a3c29219c3f6bb4c0f8b7635ec31a19920dc214674ae23e1612816fb47235d0a313a832a1bc97f6df989e9a12a552baf9d3f178c83c73085e8
7
+ data.tar.gz: f294827831dc505da8b7ca285f1b880d54be5c0f7b80fd20c05dcc7c4b3721a6161a849e45757715855e67f8fde76e4a24d00d84e7054974eaf1776d65f4d3fd
data/README.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  Pure CSS rendering for week calendars.
4
4
 
5
+ ## Demo
6
+
7
+ Visit the [demo rails app](https://carendar-demo.herokuapp.com/)
8
+
5
9
  ## Installation
6
10
 
7
11
  Add this line to your application's Gemfile:
@@ -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 week">
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>
@@ -1,3 +1,3 @@
1
1
  module Carendar
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
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.2
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-21 00:00:00.000000000 Z
11
+ date: 2015-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler