yamlandar 1.0.8 → 1.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/views/index.erb +42 -1
- data/lib/yamlandar.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 233532d88db45de093486a134bf9cdbeb39ce810
|
4
|
+
data.tar.gz: e922b702f8fa27e91dd20d08a9aa550f022ece3f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c62a3111be30cf0a4787b6c492c479a621c587ed6cc977a378b525fc1950017b09cc529b1de96eca1174c7f95416c16d323affacaa12c5fafcac9d41db916aa1
|
7
|
+
data.tar.gz: dfa263d536ff726181eb8d4f00c576fb0dca0e4597ef47fb4abae436ed9918883fffbfd6733ad88b0e7fae7535f41f6945ed965f507cd2b0dd96c0f7aeb6fbda
|
data/lib/views/index.erb
CHANGED
@@ -20,6 +20,31 @@
|
|
20
20
|
margin:0;
|
21
21
|
padding:1em 0;
|
22
22
|
}
|
23
|
+
.compact .sticky, .compact .sticky-wrapper{
|
24
|
+
display: none;
|
25
|
+
}
|
26
|
+
.compact h2{
|
27
|
+
font-size:1.2em;
|
28
|
+
border-bottom: 1px solid #ccc;
|
29
|
+
}
|
30
|
+
.compact h3{
|
31
|
+
font-size:1em;
|
32
|
+
}
|
33
|
+
.compact .day{
|
34
|
+
float:left;
|
35
|
+
width:20%;
|
36
|
+
margin-bottom:8em;
|
37
|
+
}
|
38
|
+
.compact .day:nth-of-type(5n + 2){
|
39
|
+
clear:both;
|
40
|
+
}
|
41
|
+
.compact hr{
|
42
|
+
display:none;
|
43
|
+
}
|
44
|
+
.compact ul{
|
45
|
+
padding-left:1.5em;
|
46
|
+
font-size:.8em;
|
47
|
+
}
|
23
48
|
</style>
|
24
49
|
<script>
|
25
50
|
function formatDate(date) {
|
@@ -49,17 +74,33 @@
|
|
49
74
|
<body>
|
50
75
|
<div class='page-header'>
|
51
76
|
<h1 class='container'><img src='https://avatars2.githubusercontent.com/u/11040407?v=3&s=200'>Schedule</h1>
|
77
|
+
<div class='container'>
|
78
|
+
<input type='checkbox' id='view'>
|
79
|
+
<label for='view'>Compact</label>
|
80
|
+
</div>
|
52
81
|
</div>
|
53
82
|
<div class='container'>
|
54
83
|
<a href='#' class='js-jump'>Jump to Today</a>
|
55
84
|
</div>
|
56
|
-
|
85
|
+
<div class='container'>
|
86
|
+
<%= @html %>
|
87
|
+
</div>
|
57
88
|
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js'></script>
|
58
89
|
<script src='jquery.sticky.js'></script>
|
59
90
|
<script>
|
60
91
|
$(".sticky").each(function(){
|
61
92
|
$(this).sticky({topSpacing:0});
|
62
93
|
})
|
94
|
+
var $view = $("#view")
|
95
|
+
var view = localStorage.getItem("yamlandar-view")
|
96
|
+
if(view === 'compact'){
|
97
|
+
document.body.classList.add('compact')
|
98
|
+
$view.attr('checked', 'checked')
|
99
|
+
}
|
100
|
+
$view.on("change", e => {
|
101
|
+
localStorage.setItem('yamlandar-view', view == "compact" ? '' : 'compact')
|
102
|
+
document.body.classList.toggle('compact')
|
103
|
+
})
|
63
104
|
</script>
|
64
105
|
</body>
|
65
106
|
</html>
|
data/lib/yamlandar.rb
CHANGED
@@ -11,7 +11,7 @@ class Yamlandar < Sinatra::Base
|
|
11
11
|
start = Date.parse(days[0]["start-date"])
|
12
12
|
@html += "<div class='container'><h2 class='sticky '>Week #{weeknum}</h2></div>"
|
13
13
|
days[1]["days"].each_with_index do |day, index|
|
14
|
-
@html += "<div class='day
|
14
|
+
@html += "<div class='day'>"
|
15
15
|
is_saturday = (start + counter).wday == 6
|
16
16
|
if is_saturday
|
17
17
|
counter += 2
|