yamlandar 1.0.8 → 1.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/views/index.erb +42 -1
  3. data/lib/yamlandar.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1f5c097a14ff1e52e9922266513f9e91f64278ec
4
- data.tar.gz: 5c3499b64b2c14f1b551192409c1a757b3d5f9f9
3
+ metadata.gz: 233532d88db45de093486a134bf9cdbeb39ce810
4
+ data.tar.gz: e922b702f8fa27e91dd20d08a9aa550f022ece3f
5
5
  SHA512:
6
- metadata.gz: 002796fbac8a15685606fb1990a3fe2b04fd86623dcf323b60e1449a86dcdada9e9b8a7d426d71db6270c9f75ddec905592530f6a050222356831f28efcd4799
7
- data.tar.gz: 9231dd3b37be1ef3fd340321b427d6e1433cc17b3b6b69d1273f80dd3001ed8c8919a3d7e48f23e03a0c436a2d6208d5f03968098a8aa2c7a15d6989b0b2b20a
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
- <%= @html %>
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 container'>"
14
+ @html += "<div class='day'>"
15
15
  is_saturday = (start + counter).wday == 6
16
16
  if is_saturday
17
17
  counter += 2
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yamlandar
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 1.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Olds