polyrex-calendar 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +1 -1
- data.tar.gz.sig +0 -0
- data/lib/month.css +81 -18
- data/lib/month_calendar.xsl +16 -18
- data/lib/month_layout.css +3 -21
- data/lib/polyrex-calendar.rb +11 -5
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb357f66bd26411d7b77b42e3aa168c6049c85b5
|
4
|
+
data.tar.gz: 887154a11d78f09fe78e43f8d683c433e390b24e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c321836fbc67016918a0f498de0d68457c822265abd0088230e5c97cf982a2b952cf420cce2d0ac0a5bdc54c42f4da2572042c7815f400ddb47a5262e5dad7fb
|
7
|
+
data.tar.gz: a3eb8c8b1c61563d904adb8cda68198123459708170ef12911d1d8434e054766822686f30017c2bd0c2d8d679d5e9dd17cdc2f0d9ce200345f357f896d76c797
|
checksums.yaml.gz.sig
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
��!Rn~ʻ�}�)�����D�(�a!�u��@��VNR�Ȉ[���䰌l�h܅R��;���b�/\:�A���Y����dr����!�.���We�q��N�����-�k{i"3��汒�A�������`��0=��_0|�B���(�FH�4�c��V(V�|A.Iތ=W��D�|v�@h�f�0��� !�>Fl���n�,�XS�U�.�SmE���<�'ٹ@.����~�0�ه�
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/month.css
CHANGED
@@ -8,37 +8,100 @@
|
|
8
8
|
|
9
9
|
}
|
10
10
|
|
11
|
+
table,th, td
|
12
|
+
{
|
13
|
+
border: 1px solid #494;
|
14
|
+
}
|
11
15
|
#wrap table{
|
12
16
|
background-color: rgba(230, 230, 170, 0.6);
|
13
17
|
border: none;
|
18
|
+
border-collapse:collapse;
|
14
19
|
font-family: Helvetica, Verdana, Serif;
|
15
20
|
font-size: 1.2em;
|
16
21
|
}
|
17
22
|
|
18
|
-
#wrap>table th{
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
}
|
23
|
+
#wrap>table th{
|
24
|
+
background-color: rgba(180, 180, 150, 0.8);
|
25
|
+
color: rgba(80, 80, 50, 0.8);
|
26
|
+
border: 1px solid rgba(80, 80, 50, 0.8);
|
27
|
+
}
|
23
28
|
|
24
|
-
#wrap>table tr{
|
25
|
-
|
26
|
-
}
|
29
|
+
#wrap>table tr{
|
30
|
+
background-color: transparent;
|
31
|
+
}
|
27
32
|
|
28
|
-
#wrap>table tr>td{
|
29
|
-
|
30
|
-
}
|
33
|
+
#wrap>table tr>td{
|
34
|
+
background-color: transparent;
|
35
|
+
}
|
31
36
|
|
32
|
-
#wrap>table tr>td>div{
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
}
|
37
|
+
#wrap>table tr>td>div{
|
38
|
+
background-color: rgba(230, 230, 70, 0.4);
|
39
|
+
color: rgba(80, 80, 30, 1);
|
40
|
+
margin: 0.3em;
|
41
|
+
}
|
42
|
+
|
43
|
+
/* label: day of month */
|
44
|
+
#wrap table td div:first-child {
|
45
|
+
background-color: #9a1;
|
37
46
|
|
38
|
-
|
47
|
+
width: 1em; height: 1em;
|
48
|
+
margin: 0; padding: 0.3em 0.3em;
|
49
|
+
font: 1.0em Helvetica;
|
50
|
+
text-align: center;
|
51
|
+
}
|
52
|
+
#wrap table td div:last-child {
|
53
|
+
background-color: transparent;
|
54
|
+
margin: 0 0.4em 0 0.5em; padding: 0.2em 0.13em;
|
55
|
+
font: 0.8em Helvetica;
|
56
|
+
width: 7.5em; min-height: 5.6em;
|
57
|
+
/*overflow: hidden; */
|
58
|
+
text-align: left
|
59
|
+
}
|
60
|
+
|
61
|
+
#wrap>table tr>td>div>div{
|
62
|
+
background-color: transparent;
|
63
|
+
color: rgba(180, 80, 30, 1);
|
64
|
+
float: left;
|
65
|
+
margin: 0.3em; padding: 0.5em;
|
66
|
+
border: none;
|
67
|
+
}
|
68
|
+
|
69
|
+
#wrap>table tr>td>div>div:first-child{
|
70
|
+
background-color: rgba(200, 200, 170, 0.4);
|
71
|
+
color: rgba(200, 80, 30, 1);
|
72
|
+
font-size: 0.9em;
|
73
|
+
|
74
|
+
border: 1px solid rgba(100, 90, 90, 0.7);
|
75
|
+
}
|
76
|
+
|
77
|
+
#wrap>table tr>td>div>div:nth-child(2){
|
78
|
+
background-color: transparent;
|
79
|
+
color: rgba(200, 80, 30, 1);
|
80
|
+
width: 8.5em;
|
81
|
+
font-size: 0.6em;
|
82
|
+
float:left;
|
83
|
+
margin: 0.1em; padding: 0.1em 0.4em;
|
84
|
+
text-align: left;
|
85
|
+
}
|
86
|
+
|
87
|
+
#wrap>table tr>td>div ul{
|
88
|
+
background-color: transparent;
|
89
|
+
color: rgba(200, 80, 30, 1);
|
90
|
+
font-size: 1.0em;
|
91
|
+
margin: 2.9em 0.1em 0.1em 0.1em; padding: 0.1em 0.2em;
|
92
|
+
text-align: left;
|
93
|
+
}
|
94
|
+
|
95
|
+
#wrap>table tr>td>div ul>li{
|
96
|
+
background-color: transparent;
|
97
|
+
margin: 0.2em;
|
98
|
+
padding: 0.4em;
|
99
|
+
|
100
|
+
}
|
101
|
+
#wrap>table tr>td.selected{
|
39
102
|
/*background-color: transparent;*/
|
40
103
|
border: 5px solid rgba(240, 150, 100, 0.9);
|
41
|
-
|
104
|
+
|
42
105
|
}
|
43
106
|
|
44
107
|
#wrap>table tr>td:nth-child(1)>div, #wrap>table tr>td:nth-child(7)>div{
|
data/lib/month_calendar.xsl
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
<body>
|
16
16
|
<div id="wrap">
|
17
17
|
<h1><xsl:value-of select="summary/title"/><xsl:text> </xsl:text><xsl:value-of select="summary/year"/></h1>
|
18
|
-
<table
|
18
|
+
<table>
|
19
19
|
<tr><th>Sunday</th><th>Monday</th><th>Tuesday</th><th>Wednesday</th><th>Thursday</th><th>Friday</th><th>Saturday</th></tr>
|
20
20
|
<xsl:apply-templates select="records"/>
|
21
21
|
</table>
|
@@ -43,31 +43,29 @@
|
|
43
43
|
|
44
44
|
<xsl:template match="records/day">
|
45
45
|
<td>
|
46
|
+
<xsl:if test="summary/css_style">
|
47
|
+
<xsl:attribute name="class"><xsl:value-of select="summary/css_style"/></xsl:attribute>
|
48
|
+
</xsl:if>
|
49
|
+
|
46
50
|
<div>
|
47
|
-
|
48
|
-
|
51
|
+
<div><xsl:value-of select="summary/xday"/></div>
|
52
|
+
<div><xsl:value-of select="summary/bankholiday"/></div>
|
53
|
+
<ul>
|
54
|
+
<xsl:if test="summary/event and not(summary/event='')">
|
55
|
+
<li><strong><xsl:value-of select="summary/event"/></strong></li>
|
56
|
+
</xsl:if>
|
57
|
+
<xsl:apply-templates select="records"/>
|
58
|
+
</ul>
|
49
59
|
</div>
|
50
60
|
</td>
|
51
61
|
</xsl:template>
|
52
62
|
|
53
|
-
<xsl:template match="day/summary">
|
54
|
-
|
55
|
-
<xsl:if test="css_style">
|
56
|
-
<xsl:attribute name="class"><xsl:value-of select="css_style"/></xsl:attribute>
|
57
|
-
</xsl:if>
|
58
|
-
|
59
|
-
<div><xsl:value-of select="xday"/></div>
|
60
|
-
<div><xsl:value-of select="bankholiday"/></div>
|
61
|
-
<div><xsl:value-of select="event"/></div>
|
62
|
-
|
63
|
-
</xsl:template>
|
64
63
|
|
65
64
|
<xsl:template match="records/entry">
|
66
|
-
<xsl:
|
65
|
+
<xsl:if test="summary/title and not(summary/title='')">
|
66
|
+
<li><xsl:value-of select="summary/title"/></li>
|
67
|
+
</xsl:if>
|
67
68
|
</xsl:template>
|
68
69
|
|
69
|
-
<xsl:template match="entry/summary">
|
70
|
-
<strong><xsl:value-of select="title"/></strong>
|
71
|
-
</xsl:template>
|
72
70
|
|
73
71
|
</xsl:stylesheet>
|
data/lib/month_layout.css
CHANGED
@@ -3,7 +3,7 @@ body {background-color: transparent }
|
|
3
3
|
#wrap {
|
4
4
|
background-color: transparent;
|
5
5
|
margin: 0 auto;
|
6
|
-
width:
|
6
|
+
width: 1000px;
|
7
7
|
}
|
8
8
|
|
9
9
|
#wrap h1 {
|
@@ -17,25 +17,7 @@ body {background-color: transparent }
|
|
17
17
|
#wrap table td div {
|
18
18
|
background-color: transparent;
|
19
19
|
font: 0.6em Serif;
|
20
|
-
margin: 0.
|
21
|
-
|
22
|
-
padding: 0.2em 0.3em;
|
20
|
+
margin: 0.3em;
|
21
|
+
padding: 0.3em;
|
23
22
|
text-align: right;
|
24
23
|
}
|
25
|
-
#wrap table td div:first-child {
|
26
|
-
background-color: transparent;
|
27
|
-
float: left;
|
28
|
-
width: 1em; height: 1em;
|
29
|
-
margin: 0; padding: 0.3em 0.3em;
|
30
|
-
font: 1.0em Serif;
|
31
|
-
text-align: right;
|
32
|
-
}
|
33
|
-
#wrap table td div:last-child {
|
34
|
-
background-color: transparent;
|
35
|
-
margin: 0 0.4em 0 0.5em; padding: 0.2em 0.13em;
|
36
|
-
font: 0.8em Sans;
|
37
|
-
width: 9.0em; min-height: 4.0em;
|
38
|
-
overflow: hidden;
|
39
|
-
text-align: left
|
40
|
-
}
|
41
|
-
|
data/lib/polyrex-calendar.rb
CHANGED
@@ -26,8 +26,11 @@ module LIBRARY
|
|
26
26
|
|
27
27
|
def fetch_file(filename)
|
28
28
|
|
29
|
-
lib = File.dirname(__FILE__)
|
30
|
-
File.read filename
|
29
|
+
#lib = File.dirname(__FILE__)
|
30
|
+
#File.read filename
|
31
|
+
lib = 'http://rorbuilder.info/r/ruby/polyrex-calendar'
|
32
|
+
open(File.join(lib, filename),
|
33
|
+
'UserAgent' => 'PolyrexCalendar'){|x| x.read }
|
31
34
|
end
|
32
35
|
|
33
36
|
def generate_webpage(xml, xsl)
|
@@ -80,8 +83,6 @@ class PolyrexObjects::Month
|
|
80
83
|
month_layout_css = fetch_file self.css_layout
|
81
84
|
month_css = fetch_file self.css_style
|
82
85
|
|
83
|
-
File.write 'self.xml', self.to_xml(pretty: true)
|
84
|
-
File.write 'month.xsl', month_xsl
|
85
86
|
#html = Rexslt.new(month_xsl, self.to_xml).to_xml
|
86
87
|
|
87
88
|
# add a css selector for the current day
|
@@ -90,6 +91,10 @@ class PolyrexObjects::Month
|
|
90
91
|
e = doc.root.element("records/week/records/day/summary[sdate='#{date}']")
|
91
92
|
e.add Rexle::Element.new('css_style').add_text('selected')
|
92
93
|
|
94
|
+
File.write 'self.xml', self.to_xml(pretty: true)
|
95
|
+
File.write 'month.xsl', month_xsl
|
96
|
+
|
97
|
+
|
93
98
|
html = generate_webpage doc.xml, month_xsl
|
94
99
|
{self.title.downcase[0..2] + '_calendar.html' => html,
|
95
100
|
self.css_layout => month_layout_css, self.css_style => month_css}
|
@@ -393,7 +398,8 @@ class PolyrexCalendar
|
|
393
398
|
|
394
399
|
dt = DateTime.parse(event[:date])
|
395
400
|
m, d = dt.month, dt.day
|
396
|
-
|
401
|
+
event_label = "%s at %s" % [event[:title], dt.strftime("%H:%M%p")]
|
402
|
+
@polyrex.records[m-1].day[d-1].method(daytype).call event_label
|
397
403
|
end
|
398
404
|
end
|
399
405
|
|
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.
|
4
|
+
version: 0.3.2
|
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-
|
32
|
+
date: 2014-01-19 00:00:00.000000000 Z
|
33
33
|
dependencies:
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: polyrex
|
metadata.gz.sig
CHANGED
Binary file
|