polyrex-calendar 0.3.3 → 0.3.4

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: 9ee67cdc9cf7e8ef17a88e97a1aff15b99ad56ad
4
- data.tar.gz: 00e56cf7bc853849f8a0d8e308d927c327450d29
3
+ metadata.gz: a0551aea7879043e0a3e8caf6d166519d3492103
4
+ data.tar.gz: 638adedfaefbe0848546464cc2446be27e5637f5
5
5
  SHA512:
6
- metadata.gz: 840501bd85c72c56d571d5c85829f1c8f36997047489f9c968384105fdc38e349777dce4fe4102d055722933d0d492ffa4a7fb5fed6998b8cdf5a2297d3f6dae
7
- data.tar.gz: c054c3879133dd8079cae13fc3bb69ad3737613d511e095a6aba203629dbbf773388a88f7d01200584b8cf42d496ab0fd018d835e7eda7ae9db49e0130ee1b4b
6
+ metadata.gz: 42dede41e97bf3bedb1a66fc75ed3b31f16d38d168c5ddd3fec0818ab1a6895b0a366593c536cdcc150affc2c11907ada8017639876c47e653ef7ac3c72e78ca
7
+ data.tar.gz: 243758ab6490f564138222d1e15e2cc25c2eadba858f9d4c02c720efcf8709c59c93bffcb8a818537fbfdf6bf2208bede68326c151a4910e7fef9c6fa5f0527c
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -6,7 +6,7 @@ body {background-color: transparent }
6
6
  margin-bottom: 0.6em;
7
7
  overflow: hidden;
8
8
  padding-bottom: 0.5em;
9
- width: 690px;
9
+ width: 680px;
10
10
  }
11
11
 
12
12
  #wrap h1 {
@@ -18,7 +18,7 @@ body {background-color: transparent }
18
18
  #wrap>div:first-child {
19
19
  background-color: #458;
20
20
  float:left;
21
- width:405px;
21
+ width:400px;
22
22
  }
23
23
 
24
24
  #wrap>div:first-child>div {
@@ -31,7 +31,8 @@ body {background-color: transparent }
31
31
 
32
32
  #wrap table {
33
33
  background-color: transparent;
34
-
34
+ font-family: Helvetica, Verdana, Serif;
35
+ font-size: 0.7em;
35
36
  }
36
37
  #wrap table td {text-align: center}
37
38
 
@@ -46,6 +47,7 @@ body {background-color: transparent }
46
47
  #wrap>div:nth-child(2) {
47
48
  background-color: #444;
48
49
  float: left;
50
+ width: 250px;
49
51
  page-break-after: always;
50
52
 
51
53
  }
@@ -2,6 +2,25 @@
2
2
  background-color: rgba(180, 180, 150, 0.1);
3
3
  }
4
4
 
5
+ #wrap>header {
6
+ background-color: transparent;
7
+ }
8
+
9
+ #wrap>header>nav:first-child>ul{
10
+ background-color: transparent;
11
+ list-style-type: none;
12
+ }
13
+ #wrap>header>nav:first-child>ul>li {
14
+ background-color: transparent;
15
+ display: inline;
16
+ }
17
+
18
+ #wrap>header>nav:first-child>ul>li~li:before {
19
+ background-color: transparent;
20
+ content: "> ";
21
+ }
22
+
23
+
5
24
  #wrap>h1{
6
25
  background-color: transparent;
7
26
  color: rgba(80, 80, 50, 0.8);
@@ -3,13 +3,23 @@ body {background-color: transparent }
3
3
  #wrap {
4
4
  background-color: transparent;
5
5
  margin: 0 auto;
6
- width: 1000px;
6
+ width: 970px;
7
7
  }
8
8
 
9
+ #wrap header>nav {
10
+ background-color: #aba;
11
+ float: left;
12
+ }
13
+
14
+ #wrap header>nav+nav {
15
+ background-color: #a98;
16
+ float: right;
17
+ }
9
18
  #wrap h1 {
10
19
  background-color: transparent;
11
20
  margin: 0.5em 0.3em;
12
21
  padding: 0.2em 0.2em;
22
+ clear: both
13
23
  }
14
24
 
15
25
  #wrap table {background-color: transparent; }
@@ -0,0 +1,94 @@
1
+ body {
2
+ background-color: #39a;
3
+ margin: 0em; 0.1em padding: 0em 0.1em;
4
+ }
5
+ #wrap {
6
+ background-color: #49b;
7
+ border: none;
8
+ font-family: helvetica, verdana, sans;
9
+ margin: 0em 0.1em; padding: 0em 0.1em;
10
+ }
11
+ #wrap header{
12
+ background-color: #99b;
13
+ overflow: hidden
14
+ margin: 0em; 0.1em padding: 0em 0.1em;
15
+ }
16
+
17
+ #wrap>header>nav:first-child>ul{
18
+ background-color: transparent;
19
+ list-style-type: none;
20
+ }
21
+ #wrap>header>nav:first-child>ul>li {
22
+ background-color: transparent;
23
+ display: inline;
24
+ }
25
+
26
+ #wrap>header>nav:first-child>ul>li~li:before {
27
+ background-color: transparent;
28
+ content: "> ";
29
+ }
30
+
31
+ #wrap header>h1{
32
+ background-color: transparent;
33
+ color: rgba(180,180,180, 0.8);
34
+ font-size: 2.3em;
35
+ margin: 0em; 0.1em padding: 0em 0.1em;
36
+ }
37
+ #wrap header>h2{
38
+ background-color: transparent;
39
+ color: #fff;
40
+ font-size: 2.3em;
41
+ margin: 0em; 0.1em padding: 0em 0.1em;
42
+ }
43
+ #wrap>ul>li>div{
44
+
45
+ background-color: #341;
46
+ float:left;
47
+ }
48
+ #wrap>ul>li>div:first-child{
49
+ background-color: rgba(50, 50, 50, 0.4);
50
+ color: #fff;
51
+ font-size: 1.7em;
52
+ margin-top: 0.1em;
53
+ padding: 0.2em 0.1em 0.2em 0.1em;
54
+ text-align: right;
55
+ width: 1.1em;
56
+ }
57
+ #wrap>ul>li>div:nth-child(2){
58
+ background-color: transparent;
59
+ color: rgba(50, 50, 50, 0.8);
60
+ font-size: 1.3em;
61
+ margin: 0.2em 0.2em;
62
+ padding: 0.4em 0.3em 0.3em 0.3em;
63
+ width: 2.4em;
64
+
65
+ }
66
+ #wrap>ul>li>div:nth-child(3){
67
+ background-color: transparent;
68
+ color: #000;
69
+ float: right;
70
+ font-size: 0.65em;
71
+ margin: 3.4em 0.0em 0.1em 0.2em;
72
+ padding: 0.1em 0.2em;
73
+
74
+ }
75
+
76
+ #wrap>ul>li>div:nth-child(3)>span{
77
+ background-color: transparent;
78
+ font-weight: 700;
79
+ }
80
+ #wrap>ul {
81
+ background-color: rgba(250,230,230, 0.5);
82
+ list-style-type: none;
83
+ margin:0.1em 0.2em; padding: 0.1em 0.2em;
84
+ page-break-after: always;
85
+ }
86
+
87
+ #wrap>ul>li {
88
+ background-color: transparent;
89
+ border-bottom: 1px solid black;
90
+ margin:0em 0em; padding: 0.1em;
91
+ display: inline-block;
92
+ height: 3.15em;
93
+ width: 19em;
94
+ }
@@ -0,0 +1,29 @@
1
+ body {
2
+ background-color: #39a;
3
+ margin: 0.1em;
4
+ padding: 0.2em;
5
+ }
6
+ #wrap {
7
+ background-color: #49b;
8
+ border: 1px solid black;
9
+ width: 640px;
10
+ }
11
+ #wrap header{
12
+ background-color: #99b;
13
+ height: 3.5em;
14
+ }
15
+ #wrap header>h1{
16
+ background-color: #abb;
17
+ float: right;
18
+ }
19
+ #wrap header>h2{
20
+ background-color: #ccb;
21
+ float: left;
22
+ }
23
+
24
+ #wrap>ul {
25
+ background-color: #acc;
26
+ -moz-column-count: 2; -moz-column-gap: 1em; -moz-column-rule: 1px solid black;
27
+ -webkit-column-count: 2; -webkit-column-gap: 1em; -webkit-column-rule: 1px solid black;
28
+ margin:0.2em 0.5em; padding: 0.3em;
29
+ }
@@ -15,7 +15,7 @@ MONTH = DAY * 30
15
15
  h = {
16
16
  calendar: 'calendar[year]',
17
17
  month: 'month[n, title]',
18
- week: 'week[n]',
18
+ week: 'week[n, mon, no, label]',
19
19
  day: 'day[sdate, xday, event, bankholiday, title, sunrise, sunset]',
20
20
  entry: 'entry[time_start, time_end, duration, title]'
21
21
  }
@@ -126,7 +126,7 @@ class PolyrexObjects::Week
126
126
  # add a css selector for the current day
127
127
  date = Time.now.strftime("%Y-%b-%d")
128
128
  doc = Rexle.new self.to_xml
129
- e = doc.root.element("records/day/summary[date='#{date}']")
129
+ e = doc.root.element("records/day/summary[sdate='#{date}']")
130
130
 
131
131
  e.add Rexle::Element.new('css_style').add_text('selected')
132
132
 
@@ -169,7 +169,7 @@ class PolyrexCalendar
169
169
  day: 'day[sdate, xday, event, bankholiday, title, sunrise, sunset]',
170
170
  entry: 'entry[time_start, time_end, duration, title]'
171
171
  }
172
- schema = %i(calendar month day entry).map{|x| h[x]}.join '/'
172
+ @schema = %i(calendar month day entry).map{|x| h[x]}.join '/'
173
173
 
174
174
 
175
175
  if calendar_file then
@@ -182,14 +182,14 @@ class PolyrexCalendar
182
182
 
183
183
  a = (Date.parse(@year + '-01-01')...Date.parse(@year.succ + '-01-01')).to_a
184
184
 
185
- @polyrex = Polyrex.new(schema, id_counter: @id)
185
+ @polyrex = Polyrex.new(@schema, id_counter: @id)
186
186
  @polyrex.summary.year = @year
187
187
 
188
188
  a.group_by(&:month).each do |month, days|
189
189
 
190
190
  @polyrex.create.month no: month.to_s, title: Date::MONTHNAMES[month] do |create|
191
191
  days.each do |x|
192
- create.day sdate: x.strftime("%Y-%b-%d"), xday: x.day.to_s
192
+ create.day sdate: x.strftime("%Y-%b-%d"), xday: x.day.to_s, title: Date::DAYNAMES[x.wday]
193
193
  end
194
194
  end
195
195
  end
@@ -226,14 +226,15 @@ class PolyrexCalendar
226
226
 
227
227
  def kitchen_planner()
228
228
 
229
- px = Polyrex.new(@schema, id_counter: @id)
230
- px.summary.year = @year
231
- (1..12).each {|n| px.add self.month(n, moday_week: true) }
229
+ #px = Polyrex.new(@schema, id_counter: @id)
230
+ #px.summary.year = @year
231
+ #(1..12).each {|n| px.add self.month(n, monday_week: true) }
232
+ px = @polyrex
232
233
 
233
234
  px.xslt = 'kplanner.xsl'
234
235
  px.css_layout = 'monthday_layout.css'
235
236
  px.css_style = 'monthday.css'
236
- px.filename = summary.year.to_s + '-kitchen-planner.html'
237
+ px.filename = @year + '-kitchen-planner.html'
237
238
 
238
239
  px
239
240
 
@@ -243,7 +244,7 @@ class PolyrexCalendar
243
244
 
244
245
  px = Polyrex.new(@schema, id_counter: @id)
245
246
  px.summary.year = @year
246
- (1..12).each {|n| px.add self.month(n, strict: true) }
247
+ (1..12).each {|n| px.add self.month(n, monday_week: true) }
247
248
 
248
249
  px.xslt = 'calendar.xsl'
249
250
  px.css_layout = 'layout.css'
@@ -312,6 +313,8 @@ class PolyrexCalendar
312
313
  end
313
314
 
314
315
  end
316
+ def month_day()
317
+ end
315
318
 
316
319
  def months
317
320
  @polyrex.records
@@ -339,31 +342,17 @@ class PolyrexCalendar
339
342
 
340
343
  def this_week()
341
344
 
342
- m = DateTime.now.month
343
- thisweek = self.month(m).records.find do |week|
344
-
345
- now = DateTime.now
346
- #week_no = now.cwday < 7 ? now.cweek - 1: now.cweek
347
- week_no = now.cweek
348
- week.no == week_no.to_s
349
- end
350
-
351
- day = (Time.now - DAY * (Time.now.wday - 1)).day
352
-
353
- days_in_week = self.this_month.xpath('records/week/records/.')\
354
- .select {|x| x.text('summary/xday').to_i >= day}\
355
- .take 7
356
-
357
- doc_week = Rexle.new thisweek.to_xml
358
- records = doc_week.root.element 'records'
359
- records.insert_before Rexle::Element.new('records')
360
-
361
- records.delete
345
+ dt = DateTime.now
346
+ days = @polyrex.records[dt.month-1].day
362
347
 
363
- week = doc_week.root.element 'records'
364
- days_in_week.each {|day| week.add day }
365
- PolyrexObjects::Week.new doc_week.root
348
+ r = days.find {|day| day.date.cweek == dt.cweek }
349
+ pxweek = PolyrexObjects::Week.new
350
+ pxweek.mon = Date::MONTHNAMES[dt.month]
351
+ pxweek.no = dt.cweek.to_s
352
+ pxweek.label = ''
353
+ days[days.index(r),7].each{|day| pxweek.add day }
366
354
 
355
+ pxweek
367
356
  end
368
357
 
369
358
  def this_month()
@@ -0,0 +1,63 @@
1
+ #wrap {
2
+ background-color: #d93;
3
+ margin: 0;
4
+ margin-bottom: 0.6em;
5
+ overflow: hidden;
6
+ padding-bottom: 0.5em;
7
+ /* width: 900px; */
8
+ }
9
+
10
+ #wrap h1 {
11
+ background-color: transparent;
12
+ font-family: Helvetica, Verdana;
13
+ font-size: 1.1em;
14
+ margin: 0.5em;
15
+ padding: 0.2em 0.4em;
16
+ }
17
+
18
+ #wrap>div>header>nav:first-child>ul{
19
+ background-color: transparent;
20
+ list-style-type: none;
21
+ }
22
+ #wrap>div>header>nav:first-child>ul>li {
23
+ background-color: transparent;
24
+ display: inline;
25
+ }
26
+
27
+ #wrap>div>header>nav:first-child>ul>li~li:before {
28
+ background-color: transparent;
29
+ content: "> ";
30
+ }
31
+
32
+
33
+ #wrap>div:nth-child(2) {
34
+ background-color: #777;
35
+ padding: 0.3em;
36
+ margin: 0.1em;
37
+ }
38
+ #wrap>div>ul {
39
+ background-color: #777;
40
+ list-style-type: none;
41
+ padding: 0.3em;
42
+ margin: 0.1em;
43
+ }
44
+
45
+ #wrap>div:nth-child(2)>ul>li, #wrap>div:last-child>ul>li {
46
+ background-color: #aaa;
47
+ padding: 0.3em;
48
+ margin: 0.1em;
49
+ }
50
+
51
+ #wrap>div:nth-child(2)>ul>li>span, #wrap>div:last-child>ul>li>span {
52
+ background-color: #9ab;
53
+ display: block; float: left; width: 4.4em;
54
+
55
+ }
56
+
57
+ #wrap>div:last-child {
58
+ background-color: #acc;
59
+ clear: both;
60
+ -moz-column-count: 2; -moz-column-gap: 1em; -moz-column-rule: 1px solid black; -webkit-column-count: 2; -webkit-column-gap: 1em; -webkit-column-rule: 1px solid black;
61
+ margin:0.1em 0.3em;
62
+ padding: 0.3em;
63
+ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polyrex-calendar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -29,7 +29,7 @@ cert_chain:
29
29
  CIpMEIXEnQwmcmWL07xvpUquKTab0tCXtmcfjr74KP2KCm5guZyxeXaj9lD1OrnC
30
30
  Kgt/mRI2beG8K7QY81GGMsQjiG95Dcko
31
31
  -----END CERTIFICATE-----
32
- date: 2014-01-21 00:00:00.000000000 Z
32
+ date: 2014-01-23 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: polyrex
@@ -106,6 +106,7 @@ files:
106
106
  - lib/calendar.xsl~
107
107
  - lib/kplanner.xsl
108
108
  - lib/monthday.css
109
+ - lib/year.css
109
110
  - lib/month_layout.css
110
111
  - lib/month.css
111
112
  homepage: https://github.com/jrobertson/polyrex-calendar
metadata.gz.sig CHANGED
@@ -1,2 +1 @@
1
- ,jK���?�/�a�~�WzR�>�4Iy����ɚgx���ok]}j�­�O2סKSt����!#1gT�؏�֎�c#�cLVQ���������$
2
- ���C|.-f��ȯ �—X!ꐧ �L���m͵|�f;� � ����dj�8��S7��dv�8��jq;r�Z窀E]��^o��':z׹�4EK1T���M��M�
1
+ �xj�Vb��ժ �\��55Z�I~��L�a\Ѻ[�82I�r'=&���-����8!=�>�:X��dko�s�AD3