nightlight 0.0.1

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.
Files changed (44) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +13 -0
  3. data/Gemfile +4 -0
  4. data/Gemfile.lock +112 -0
  5. data/LICENSE.txt +22 -0
  6. data/README.md +63 -0
  7. data/Rakefile +2 -0
  8. data/app/assets/fonts/nightlight/FontAwesome.otf +0 -0
  9. data/app/assets/fonts/nightlight/fontawesome-webfont.eot +0 -0
  10. data/app/assets/fonts/nightlight/fontawesome-webfont.svg +399 -0
  11. data/app/assets/fonts/nightlight/fontawesome-webfont.ttf +0 -0
  12. data/app/assets/fonts/nightlight/fontawesome-webfont.woff +0 -0
  13. data/app/assets/javascripts/nightlight/application.js +2 -0
  14. data/app/assets/javascripts/nightlight/jquery.min.js +4 -0
  15. data/app/assets/javascripts/nightlight/jquery_ujs.js +469 -0
  16. data/app/assets/stylesheets/nightlight/application.css +14 -0
  17. data/app/assets/stylesheets/nightlight/bootstrap.min.css +5 -0
  18. data/app/assets/stylesheets/nightlight/font-awesome.min.css +403 -0
  19. data/app/assets/stylesheets/nightlight/pages.css +30 -0
  20. data/app/controllers/nightlight/activities_controller.rb +29 -0
  21. data/app/controllers/nightlight/base_controller.rb +16 -0
  22. data/app/controllers/nightlight/pages_controller.rb +132 -0
  23. data/app/helpers/nightlight/pages_helper.rb +24 -0
  24. data/app/models/nightlight/activity.rb +38 -0
  25. data/app/models/nightlight/page.rb +43 -0
  26. data/app/views/layouts/nightlight/_alert.html.erb +11 -0
  27. data/app/views/layouts/nightlight/application.html.erb +20 -0
  28. data/app/views/nightlight/pages/_activity.html.erb +19 -0
  29. data/app/views/nightlight/pages/_brightness.html.erb +3 -0
  30. data/app/views/nightlight/pages/_form.html.erb +34 -0
  31. data/app/views/nightlight/pages/_pages.html.erb +42 -0
  32. data/app/views/nightlight/pages/add.js.erb +13 -0
  33. data/app/views/nightlight/pages/edit.html.erb +17 -0
  34. data/app/views/nightlight/pages/index.html.erb +50 -0
  35. data/app/views/nightlight/pages/new.html.erb +11 -0
  36. data/app/views/nightlight/pages/show.html.erb +67 -0
  37. data/config/routes.rb +16 -0
  38. data/lib/generators/nightlight/install_generator.rb +29 -0
  39. data/lib/generators/nightlight/templates/install.rb +23 -0
  40. data/lib/nightlight/engine.rb +11 -0
  41. data/lib/nightlight/version.rb +3 -0
  42. data/lib/nightlight.rb +9 -0
  43. data/nightlight.gemspec +25 -0
  44. metadata +129 -0
@@ -0,0 +1,403 @@
1
+ @font-face{font-family:'FontAwesome';src:url('../nightlight/fontawesome-webfont.eot?v=3.2.1');src:url('../nightlight/fontawesome-webfont.eot?#iefix&v=3.2.1') format('embedded-opentype'),url('../nightlight/fontawesome-webfont.woff?v=3.2.1') format('woff'),url('../nightlight/fontawesome-webfont.ttf?v=3.2.1') format('truetype'),url('../nightlight/fontawesome-webfont.svg#fontawesomeregular?v=3.2.1') format('svg');font-weight:normal;font-style:normal;}[class^="icon-"],[class*=" icon-"]{font-family:FontAwesome;font-weight:normal;font-style:normal;text-decoration:inherit;-webkit-font-smoothing:antialiased;*margin-right:.3em;}
2
+ [class^="icon-"]:before,[class*=" icon-"]:before{text-decoration:inherit;display:inline-block;speak:none;}
3
+ .icon-large:before{vertical-align:-10%;font-size:1.3333333333333333em;}
4
+ a [class^="icon-"],a [class*=" icon-"]{display:inline;}
5
+ [class^="icon-"].icon-fixed-width,[class*=" icon-"].icon-fixed-width{display:inline-block;width:1.1428571428571428em;text-align:right;padding-right:0.2857142857142857em;}[class^="icon-"].icon-fixed-width.icon-large,[class*=" icon-"].icon-fixed-width.icon-large{width:1.4285714285714286em;}
6
+ .icons-ul{margin-left:2.142857142857143em;list-style-type:none;}.icons-ul>li{position:relative;}
7
+ .icons-ul .icon-li{position:absolute;left:-2.142857142857143em;width:2.142857142857143em;text-align:center;line-height:inherit;}
8
+ [class^="icon-"].hide,[class*=" icon-"].hide{display:none;}
9
+ .icon-muted{color:#eeeeee;}
10
+ .icon-light{color:#ffffff;}
11
+ .icon-dark{color:#333333;}
12
+ .icon-border{border:solid 1px #eeeeee;padding:.2em .25em .15em;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;}
13
+ .icon-2x{font-size:2em;}.icon-2x.icon-border{border-width:2px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}
14
+ .icon-3x{font-size:3em;}.icon-3x.icon-border{border-width:3px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;}
15
+ .icon-4x{font-size:4em;}.icon-4x.icon-border{border-width:4px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;}
16
+ .icon-5x{font-size:5em;}.icon-5x.icon-border{border-width:5px;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px;}
17
+ .pull-right{float:right;}
18
+ .pull-left{float:left;}
19
+ [class^="icon-"].pull-left,[class*=" icon-"].pull-left{margin-right:.3em;}
20
+ [class^="icon-"].pull-right,[class*=" icon-"].pull-right{margin-left:.3em;}
21
+ [class^="icon-"],[class*=" icon-"]{display:inline;width:auto;height:auto;line-height:normal;vertical-align:baseline;background-image:none;background-position:0% 0%;background-repeat:repeat;margin-top:0;}
22
+ .icon-white,.nav-pills>.active>a>[class^="icon-"],.nav-pills>.active>a>[class*=" icon-"],.nav-list>.active>a>[class^="icon-"],.nav-list>.active>a>[class*=" icon-"],.navbar-inverse .nav>.active>a>[class^="icon-"],.navbar-inverse .nav>.active>a>[class*=" icon-"],.dropdown-menu>li>a:hover>[class^="icon-"],.dropdown-menu>li>a:hover>[class*=" icon-"],.dropdown-menu>.active>a>[class^="icon-"],.dropdown-menu>.active>a>[class*=" icon-"],.dropdown-submenu:hover>a>[class^="icon-"],.dropdown-submenu:hover>a>[class*=" icon-"]{background-image:none;}
23
+ .btn [class^="icon-"].icon-large,.nav [class^="icon-"].icon-large,.btn [class*=" icon-"].icon-large,.nav [class*=" icon-"].icon-large{line-height:.9em;}
24
+ .btn [class^="icon-"].icon-spin,.nav [class^="icon-"].icon-spin,.btn [class*=" icon-"].icon-spin,.nav [class*=" icon-"].icon-spin{display:inline-block;}
25
+ .nav-tabs [class^="icon-"],.nav-pills [class^="icon-"],.nav-tabs [class*=" icon-"],.nav-pills [class*=" icon-"],.nav-tabs [class^="icon-"].icon-large,.nav-pills [class^="icon-"].icon-large,.nav-tabs [class*=" icon-"].icon-large,.nav-pills [class*=" icon-"].icon-large{line-height:.9em;}
26
+ .btn [class^="icon-"].pull-left.icon-2x,.btn [class*=" icon-"].pull-left.icon-2x,.btn [class^="icon-"].pull-right.icon-2x,.btn [class*=" icon-"].pull-right.icon-2x{margin-top:.18em;}
27
+ .btn [class^="icon-"].icon-spin.icon-large,.btn [class*=" icon-"].icon-spin.icon-large{line-height:.8em;}
28
+ .btn.btn-small [class^="icon-"].pull-left.icon-2x,.btn.btn-small [class*=" icon-"].pull-left.icon-2x,.btn.btn-small [class^="icon-"].pull-right.icon-2x,.btn.btn-small [class*=" icon-"].pull-right.icon-2x{margin-top:.25em;}
29
+ .btn.btn-large [class^="icon-"],.btn.btn-large [class*=" icon-"]{margin-top:0;}.btn.btn-large [class^="icon-"].pull-left.icon-2x,.btn.btn-large [class*=" icon-"].pull-left.icon-2x,.btn.btn-large [class^="icon-"].pull-right.icon-2x,.btn.btn-large [class*=" icon-"].pull-right.icon-2x{margin-top:.05em;}
30
+ .btn.btn-large [class^="icon-"].pull-left.icon-2x,.btn.btn-large [class*=" icon-"].pull-left.icon-2x{margin-right:.2em;}
31
+ .btn.btn-large [class^="icon-"].pull-right.icon-2x,.btn.btn-large [class*=" icon-"].pull-right.icon-2x{margin-left:.2em;}
32
+ .nav-list [class^="icon-"],.nav-list [class*=" icon-"]{line-height:inherit;}
33
+ .icon-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:-35%;}.icon-stack [class^="icon-"],.icon-stack [class*=" icon-"]{display:block;text-align:center;position:absolute;width:100%;height:100%;font-size:1em;line-height:inherit;*line-height:2em;}
34
+ .icon-stack .icon-stack-base{font-size:2em;*line-height:1em;}
35
+ .icon-spin{display:inline-block;-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;-webkit-animation:spin 2s infinite linear;animation:spin 2s infinite linear;}
36
+ a .icon-stack,a .icon-spin{display:inline-block;text-decoration:none;}
37
+ @-moz-keyframes spin{0%{-moz-transform:rotate(0deg);} 100%{-moz-transform:rotate(359deg);}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);} 100%{-webkit-transform:rotate(359deg);}}@-o-keyframes spin{0%{-o-transform:rotate(0deg);} 100%{-o-transform:rotate(359deg);}}@-ms-keyframes spin{0%{-ms-transform:rotate(0deg);} 100%{-ms-transform:rotate(359deg);}}@keyframes spin{0%{transform:rotate(0deg);} 100%{transform:rotate(359deg);}}.icon-rotate-90:before{-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);}
38
+ .icon-rotate-180:before{-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);}
39
+ .icon-rotate-270:before{-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-ms-transform:rotate(270deg);-o-transform:rotate(270deg);transform:rotate(270deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);}
40
+ .icon-flip-horizontal:before{-webkit-transform:scale(-1, 1);-moz-transform:scale(-1, 1);-ms-transform:scale(-1, 1);-o-transform:scale(-1, 1);transform:scale(-1, 1);}
41
+ .icon-flip-vertical:before{-webkit-transform:scale(1, -1);-moz-transform:scale(1, -1);-ms-transform:scale(1, -1);-o-transform:scale(1, -1);transform:scale(1, -1);}
42
+ a .icon-rotate-90:before,a .icon-rotate-180:before,a .icon-rotate-270:before,a .icon-flip-horizontal:before,a .icon-flip-vertical:before{display:inline-block;}
43
+ .icon-glass:before{content:"\f000";}
44
+ .icon-music:before{content:"\f001";}
45
+ .icon-search:before{content:"\f002";}
46
+ .icon-envelope-alt:before{content:"\f003";}
47
+ .icon-heart:before{content:"\f004";}
48
+ .icon-star:before{content:"\f005";}
49
+ .icon-star-empty:before{content:"\f006";}
50
+ .icon-user:before{content:"\f007";}
51
+ .icon-film:before{content:"\f008";}
52
+ .icon-th-large:before{content:"\f009";}
53
+ .icon-th:before{content:"\f00a";}
54
+ .icon-th-list:before{content:"\f00b";}
55
+ .icon-ok:before{content:"\f00c";}
56
+ .icon-remove:before{content:"\f00d";}
57
+ .icon-zoom-in:before{content:"\f00e";}
58
+ .icon-zoom-out:before{content:"\f010";}
59
+ .icon-power-off:before,.icon-off:before{content:"\f011";}
60
+ .icon-signal:before{content:"\f012";}
61
+ .icon-gear:before,.icon-cog:before{content:"\f013";}
62
+ .icon-trash:before{content:"\f014";}
63
+ .icon-home:before{content:"\f015";}
64
+ .icon-file-alt:before{content:"\f016";}
65
+ .icon-time:before{content:"\f017";}
66
+ .icon-road:before{content:"\f018";}
67
+ .icon-download-alt:before{content:"\f019";}
68
+ .icon-download:before{content:"\f01a";}
69
+ .icon-upload:before{content:"\f01b";}
70
+ .icon-inbox:before{content:"\f01c";}
71
+ .icon-play-circle:before{content:"\f01d";}
72
+ .icon-rotate-right:before,.icon-repeat:before{content:"\f01e";}
73
+ .icon-refresh:before{content:"\f021";}
74
+ .icon-list-alt:before{content:"\f022";}
75
+ .icon-lock:before{content:"\f023";}
76
+ .icon-flag:before{content:"\f024";}
77
+ .icon-headphones:before{content:"\f025";}
78
+ .icon-volume-off:before{content:"\f026";}
79
+ .icon-volume-down:before{content:"\f027";}
80
+ .icon-volume-up:before{content:"\f028";}
81
+ .icon-qrcode:before{content:"\f029";}
82
+ .icon-barcode:before{content:"\f02a";}
83
+ .icon-tag:before{content:"\f02b";}
84
+ .icon-tags:before{content:"\f02c";}
85
+ .icon-book:before{content:"\f02d";}
86
+ .icon-bookmark:before{content:"\f02e";}
87
+ .icon-print:before{content:"\f02f";}
88
+ .icon-camera:before{content:"\f030";}
89
+ .icon-font:before{content:"\f031";}
90
+ .icon-bold:before{content:"\f032";}
91
+ .icon-italic:before{content:"\f033";}
92
+ .icon-text-height:before{content:"\f034";}
93
+ .icon-text-width:before{content:"\f035";}
94
+ .icon-align-left:before{content:"\f036";}
95
+ .icon-align-center:before{content:"\f037";}
96
+ .icon-align-right:before{content:"\f038";}
97
+ .icon-align-justify:before{content:"\f039";}
98
+ .icon-list:before{content:"\f03a";}
99
+ .icon-indent-left:before{content:"\f03b";}
100
+ .icon-indent-right:before{content:"\f03c";}
101
+ .icon-facetime-video:before{content:"\f03d";}
102
+ .icon-picture:before{content:"\f03e";}
103
+ .icon-pencil:before{content:"\f040";}
104
+ .icon-map-marker:before{content:"\f041";}
105
+ .icon-adjust:before{content:"\f042";}
106
+ .icon-tint:before{content:"\f043";}
107
+ .icon-edit:before{content:"\f044";}
108
+ .icon-share:before{content:"\f045";}
109
+ .icon-check:before{content:"\f046";}
110
+ .icon-move:before{content:"\f047";}
111
+ .icon-step-backward:before{content:"\f048";}
112
+ .icon-fast-backward:before{content:"\f049";}
113
+ .icon-backward:before{content:"\f04a";}
114
+ .icon-play:before{content:"\f04b";}
115
+ .icon-pause:before{content:"\f04c";}
116
+ .icon-stop:before{content:"\f04d";}
117
+ .icon-forward:before{content:"\f04e";}
118
+ .icon-fast-forward:before{content:"\f050";}
119
+ .icon-step-forward:before{content:"\f051";}
120
+ .icon-eject:before{content:"\f052";}
121
+ .icon-chevron-left:before{content:"\f053";}
122
+ .icon-chevron-right:before{content:"\f054";}
123
+ .icon-plus-sign:before{content:"\f055";}
124
+ .icon-minus-sign:before{content:"\f056";}
125
+ .icon-remove-sign:before{content:"\f057";}
126
+ .icon-ok-sign:before{content:"\f058";}
127
+ .icon-question-sign:before{content:"\f059";}
128
+ .icon-info-sign:before{content:"\f05a";}
129
+ .icon-screenshot:before{content:"\f05b";}
130
+ .icon-remove-circle:before{content:"\f05c";}
131
+ .icon-ok-circle:before{content:"\f05d";}
132
+ .icon-ban-circle:before{content:"\f05e";}
133
+ .icon-arrow-left:before{content:"\f060";}
134
+ .icon-arrow-right:before{content:"\f061";}
135
+ .icon-arrow-up:before{content:"\f062";}
136
+ .icon-arrow-down:before{content:"\f063";}
137
+ .icon-mail-forward:before,.icon-share-alt:before{content:"\f064";}
138
+ .icon-resize-full:before{content:"\f065";}
139
+ .icon-resize-small:before{content:"\f066";}
140
+ .icon-plus:before{content:"\f067";}
141
+ .icon-minus:before{content:"\f068";}
142
+ .icon-asterisk:before{content:"\f069";}
143
+ .icon-exclamation-sign:before{content:"\f06a";}
144
+ .icon-gift:before{content:"\f06b";}
145
+ .icon-leaf:before{content:"\f06c";}
146
+ .icon-fire:before{content:"\f06d";}
147
+ .icon-eye-open:before{content:"\f06e";}
148
+ .icon-eye-close:before{content:"\f070";}
149
+ .icon-warning-sign:before{content:"\f071";}
150
+ .icon-plane:before{content:"\f072";}
151
+ .icon-calendar:before{content:"\f073";}
152
+ .icon-random:before{content:"\f074";}
153
+ .icon-comment:before{content:"\f075";}
154
+ .icon-magnet:before{content:"\f076";}
155
+ .icon-chevron-up:before{content:"\f077";}
156
+ .icon-chevron-down:before{content:"\f078";}
157
+ .icon-retweet:before{content:"\f079";}
158
+ .icon-shopping-cart:before{content:"\f07a";}
159
+ .icon-folder-close:before{content:"\f07b";}
160
+ .icon-folder-open:before{content:"\f07c";}
161
+ .icon-resize-vertical:before{content:"\f07d";}
162
+ .icon-resize-horizontal:before{content:"\f07e";}
163
+ .icon-bar-chart:before{content:"\f080";}
164
+ .icon-twitter-sign:before{content:"\f081";}
165
+ .icon-facebook-sign:before{content:"\f082";}
166
+ .icon-camera-retro:before{content:"\f083";}
167
+ .icon-key:before{content:"\f084";}
168
+ .icon-gears:before,.icon-cogs:before{content:"\f085";}
169
+ .icon-comments:before{content:"\f086";}
170
+ .icon-thumbs-up-alt:before{content:"\f087";}
171
+ .icon-thumbs-down-alt:before{content:"\f088";}
172
+ .icon-star-half:before{content:"\f089";}
173
+ .icon-heart-empty:before{content:"\f08a";}
174
+ .icon-signout:before{content:"\f08b";}
175
+ .icon-linkedin-sign:before{content:"\f08c";}
176
+ .icon-pushpin:before{content:"\f08d";}
177
+ .icon-external-link:before{content:"\f08e";}
178
+ .icon-signin:before{content:"\f090";}
179
+ .icon-trophy:before{content:"\f091";}
180
+ .icon-github-sign:before{content:"\f092";}
181
+ .icon-upload-alt:before{content:"\f093";}
182
+ .icon-lemon:before{content:"\f094";}
183
+ .icon-phone:before{content:"\f095";}
184
+ .icon-unchecked:before,.icon-check-empty:before{content:"\f096";}
185
+ .icon-bookmark-empty:before{content:"\f097";}
186
+ .icon-phone-sign:before{content:"\f098";}
187
+ .icon-twitter:before{content:"\f099";}
188
+ .icon-facebook:before{content:"\f09a";}
189
+ .icon-github:before{content:"\f09b";}
190
+ .icon-unlock:before{content:"\f09c";}
191
+ .icon-credit-card:before{content:"\f09d";}
192
+ .icon-rss:before{content:"\f09e";}
193
+ .icon-hdd:before{content:"\f0a0";}
194
+ .icon-bullhorn:before{content:"\f0a1";}
195
+ .icon-bell:before{content:"\f0a2";}
196
+ .icon-certificate:before{content:"\f0a3";}
197
+ .icon-hand-right:before{content:"\f0a4";}
198
+ .icon-hand-left:before{content:"\f0a5";}
199
+ .icon-hand-up:before{content:"\f0a6";}
200
+ .icon-hand-down:before{content:"\f0a7";}
201
+ .icon-circle-arrow-left:before{content:"\f0a8";}
202
+ .icon-circle-arrow-right:before{content:"\f0a9";}
203
+ .icon-circle-arrow-up:before{content:"\f0aa";}
204
+ .icon-circle-arrow-down:before{content:"\f0ab";}
205
+ .icon-globe:before{content:"\f0ac";}
206
+ .icon-wrench:before{content:"\f0ad";}
207
+ .icon-tasks:before{content:"\f0ae";}
208
+ .icon-filter:before{content:"\f0b0";}
209
+ .icon-briefcase:before{content:"\f0b1";}
210
+ .icon-fullscreen:before{content:"\f0b2";}
211
+ .icon-group:before{content:"\f0c0";}
212
+ .icon-link:before{content:"\f0c1";}
213
+ .icon-cloud:before{content:"\f0c2";}
214
+ .icon-beaker:before{content:"\f0c3";}
215
+ .icon-cut:before{content:"\f0c4";}
216
+ .icon-copy:before{content:"\f0c5";}
217
+ .icon-paperclip:before,.icon-paper-clip:before{content:"\f0c6";}
218
+ .icon-save:before{content:"\f0c7";}
219
+ .icon-sign-blank:before{content:"\f0c8";}
220
+ .icon-reorder:before{content:"\f0c9";}
221
+ .icon-list-ul:before{content:"\f0ca";}
222
+ .icon-list-ol:before{content:"\f0cb";}
223
+ .icon-strikethrough:before{content:"\f0cc";}
224
+ .icon-underline:before{content:"\f0cd";}
225
+ .icon-table:before{content:"\f0ce";}
226
+ .icon-magic:before{content:"\f0d0";}
227
+ .icon-truck:before{content:"\f0d1";}
228
+ .icon-pinterest:before{content:"\f0d2";}
229
+ .icon-pinterest-sign:before{content:"\f0d3";}
230
+ .icon-google-plus-sign:before{content:"\f0d4";}
231
+ .icon-google-plus:before{content:"\f0d5";}
232
+ .icon-money:before{content:"\f0d6";}
233
+ .icon-caret-down:before{content:"\f0d7";}
234
+ .icon-caret-up:before{content:"\f0d8";}
235
+ .icon-caret-left:before{content:"\f0d9";}
236
+ .icon-caret-right:before{content:"\f0da";}
237
+ .icon-columns:before{content:"\f0db";}
238
+ .icon-sort:before{content:"\f0dc";}
239
+ .icon-sort-down:before{content:"\f0dd";}
240
+ .icon-sort-up:before{content:"\f0de";}
241
+ .icon-envelope:before{content:"\f0e0";}
242
+ .icon-linkedin:before{content:"\f0e1";}
243
+ .icon-rotate-left:before,.icon-undo:before{content:"\f0e2";}
244
+ .icon-legal:before{content:"\f0e3";}
245
+ .icon-dashboard:before{content:"\f0e4";}
246
+ .icon-comment-alt:before{content:"\f0e5";}
247
+ .icon-comments-alt:before{content:"\f0e6";}
248
+ .icon-bolt:before{content:"\f0e7";}
249
+ .icon-sitemap:before{content:"\f0e8";}
250
+ .icon-umbrella:before{content:"\f0e9";}
251
+ .icon-paste:before{content:"\f0ea";}
252
+ .icon-lightbulb:before{content:"\f0eb";}
253
+ .icon-exchange:before{content:"\f0ec";}
254
+ .icon-cloud-download:before{content:"\f0ed";}
255
+ .icon-cloud-upload:before{content:"\f0ee";}
256
+ .icon-user-md:before{content:"\f0f0";}
257
+ .icon-stethoscope:before{content:"\f0f1";}
258
+ .icon-suitcase:before{content:"\f0f2";}
259
+ .icon-bell-alt:before{content:"\f0f3";}
260
+ .icon-coffee:before{content:"\f0f4";}
261
+ .icon-food:before{content:"\f0f5";}
262
+ .icon-file-text-alt:before{content:"\f0f6";}
263
+ .icon-building:before{content:"\f0f7";}
264
+ .icon-hospital:before{content:"\f0f8";}
265
+ .icon-ambulance:before{content:"\f0f9";}
266
+ .icon-medkit:before{content:"\f0fa";}
267
+ .icon-fighter-jet:before{content:"\f0fb";}
268
+ .icon-beer:before{content:"\f0fc";}
269
+ .icon-h-sign:before{content:"\f0fd";}
270
+ .icon-plus-sign-alt:before{content:"\f0fe";}
271
+ .icon-double-angle-left:before{content:"\f100";}
272
+ .icon-double-angle-right:before{content:"\f101";}
273
+ .icon-double-angle-up:before{content:"\f102";}
274
+ .icon-double-angle-down:before{content:"\f103";}
275
+ .icon-angle-left:before{content:"\f104";}
276
+ .icon-angle-right:before{content:"\f105";}
277
+ .icon-angle-up:before{content:"\f106";}
278
+ .icon-angle-down:before{content:"\f107";}
279
+ .icon-desktop:before{content:"\f108";}
280
+ .icon-laptop:before{content:"\f109";}
281
+ .icon-tablet:before{content:"\f10a";}
282
+ .icon-mobile-phone:before{content:"\f10b";}
283
+ .icon-circle-blank:before{content:"\f10c";}
284
+ .icon-quote-left:before{content:"\f10d";}
285
+ .icon-quote-right:before{content:"\f10e";}
286
+ .icon-spinner:before{content:"\f110";}
287
+ .icon-circle:before{content:"\f111";}
288
+ .icon-mail-reply:before,.icon-reply:before{content:"\f112";}
289
+ .icon-github-alt:before{content:"\f113";}
290
+ .icon-folder-close-alt:before{content:"\f114";}
291
+ .icon-folder-open-alt:before{content:"\f115";}
292
+ .icon-expand-alt:before{content:"\f116";}
293
+ .icon-collapse-alt:before{content:"\f117";}
294
+ .icon-smile:before{content:"\f118";}
295
+ .icon-frown:before{content:"\f119";}
296
+ .icon-meh:before{content:"\f11a";}
297
+ .icon-gamepad:before{content:"\f11b";}
298
+ .icon-keyboard:before{content:"\f11c";}
299
+ .icon-flag-alt:before{content:"\f11d";}
300
+ .icon-flag-checkered:before{content:"\f11e";}
301
+ .icon-terminal:before{content:"\f120";}
302
+ .icon-code:before{content:"\f121";}
303
+ .icon-reply-all:before{content:"\f122";}
304
+ .icon-mail-reply-all:before{content:"\f122";}
305
+ .icon-star-half-full:before,.icon-star-half-empty:before{content:"\f123";}
306
+ .icon-location-arrow:before{content:"\f124";}
307
+ .icon-crop:before{content:"\f125";}
308
+ .icon-code-fork:before{content:"\f126";}
309
+ .icon-unlink:before{content:"\f127";}
310
+ .icon-question:before{content:"\f128";}
311
+ .icon-info:before{content:"\f129";}
312
+ .icon-exclamation:before{content:"\f12a";}
313
+ .icon-superscript:before{content:"\f12b";}
314
+ .icon-subscript:before{content:"\f12c";}
315
+ .icon-eraser:before{content:"\f12d";}
316
+ .icon-puzzle-piece:before{content:"\f12e";}
317
+ .icon-microphone:before{content:"\f130";}
318
+ .icon-microphone-off:before{content:"\f131";}
319
+ .icon-shield:before{content:"\f132";}
320
+ .icon-calendar-empty:before{content:"\f133";}
321
+ .icon-fire-extinguisher:before{content:"\f134";}
322
+ .icon-rocket:before{content:"\f135";}
323
+ .icon-maxcdn:before{content:"\f136";}
324
+ .icon-chevron-sign-left:before{content:"\f137";}
325
+ .icon-chevron-sign-right:before{content:"\f138";}
326
+ .icon-chevron-sign-up:before{content:"\f139";}
327
+ .icon-chevron-sign-down:before{content:"\f13a";}
328
+ .icon-html5:before{content:"\f13b";}
329
+ .icon-css3:before{content:"\f13c";}
330
+ .icon-anchor:before{content:"\f13d";}
331
+ .icon-unlock-alt:before{content:"\f13e";}
332
+ .icon-bullseye:before{content:"\f140";}
333
+ .icon-ellipsis-horizontal:before{content:"\f141";}
334
+ .icon-ellipsis-vertical:before{content:"\f142";}
335
+ .icon-rss-sign:before{content:"\f143";}
336
+ .icon-play-sign:before{content:"\f144";}
337
+ .icon-ticket:before{content:"\f145";}
338
+ .icon-minus-sign-alt:before{content:"\f146";}
339
+ .icon-check-minus:before{content:"\f147";}
340
+ .icon-level-up:before{content:"\f148";}
341
+ .icon-level-down:before{content:"\f149";}
342
+ .icon-check-sign:before{content:"\f14a";}
343
+ .icon-edit-sign:before{content:"\f14b";}
344
+ .icon-external-link-sign:before{content:"\f14c";}
345
+ .icon-share-sign:before{content:"\f14d";}
346
+ .icon-compass:before{content:"\f14e";}
347
+ .icon-collapse:before{content:"\f150";}
348
+ .icon-collapse-top:before{content:"\f151";}
349
+ .icon-expand:before{content:"\f152";}
350
+ .icon-euro:before,.icon-eur:before{content:"\f153";}
351
+ .icon-gbp:before{content:"\f154";}
352
+ .icon-dollar:before,.icon-usd:before{content:"\f155";}
353
+ .icon-rupee:before,.icon-inr:before{content:"\f156";}
354
+ .icon-yen:before,.icon-jpy:before{content:"\f157";}
355
+ .icon-renminbi:before,.icon-cny:before{content:"\f158";}
356
+ .icon-won:before,.icon-krw:before{content:"\f159";}
357
+ .icon-bitcoin:before,.icon-btc:before{content:"\f15a";}
358
+ .icon-file:before{content:"\f15b";}
359
+ .icon-file-text:before{content:"\f15c";}
360
+ .icon-sort-by-alphabet:before{content:"\f15d";}
361
+ .icon-sort-by-alphabet-alt:before{content:"\f15e";}
362
+ .icon-sort-by-attributes:before{content:"\f160";}
363
+ .icon-sort-by-attributes-alt:before{content:"\f161";}
364
+ .icon-sort-by-order:before{content:"\f162";}
365
+ .icon-sort-by-order-alt:before{content:"\f163";}
366
+ .icon-thumbs-up:before{content:"\f164";}
367
+ .icon-thumbs-down:before{content:"\f165";}
368
+ .icon-youtube-sign:before{content:"\f166";}
369
+ .icon-youtube:before{content:"\f167";}
370
+ .icon-xing:before{content:"\f168";}
371
+ .icon-xing-sign:before{content:"\f169";}
372
+ .icon-youtube-play:before{content:"\f16a";}
373
+ .icon-dropbox:before{content:"\f16b";}
374
+ .icon-stackexchange:before{content:"\f16c";}
375
+ .icon-instagram:before{content:"\f16d";}
376
+ .icon-flickr:before{content:"\f16e";}
377
+ .icon-adn:before{content:"\f170";}
378
+ .icon-bitbucket:before{content:"\f171";}
379
+ .icon-bitbucket-sign:before{content:"\f172";}
380
+ .icon-tumblr:before{content:"\f173";}
381
+ .icon-tumblr-sign:before{content:"\f174";}
382
+ .icon-long-arrow-down:before{content:"\f175";}
383
+ .icon-long-arrow-up:before{content:"\f176";}
384
+ .icon-long-arrow-left:before{content:"\f177";}
385
+ .icon-long-arrow-right:before{content:"\f178";}
386
+ .icon-apple:before{content:"\f179";}
387
+ .icon-windows:before{content:"\f17a";}
388
+ .icon-android:before{content:"\f17b";}
389
+ .icon-linux:before{content:"\f17c";}
390
+ .icon-dribbble:before{content:"\f17d";}
391
+ .icon-skype:before{content:"\f17e";}
392
+ .icon-foursquare:before{content:"\f180";}
393
+ .icon-trello:before{content:"\f181";}
394
+ .icon-female:before{content:"\f182";}
395
+ .icon-male:before{content:"\f183";}
396
+ .icon-gittip:before{content:"\f184";}
397
+ .icon-sun:before{content:"\f185";}
398
+ .icon-moon:before{content:"\f186";}
399
+ .icon-archive:before{content:"\f187";}
400
+ .icon-bug:before{content:"\f188";}
401
+ .icon-vk:before{content:"\f189";}
402
+ .icon-weibo:before{content:"\f18a";}
403
+ .icon-renren:before{content:"\f18b";}
@@ -0,0 +1,30 @@
1
+ .brightness {
2
+ padding: 0.3em 0.5em;
3
+ border-radius: 50px;
4
+ color: #fff
5
+ }
6
+
7
+ .brightness-on {
8
+ }
9
+
10
+ .brightness-0, .brightness-off {
11
+ background-color: #13385C;
12
+ color: #000;
13
+ }
14
+ .brightness-1 {
15
+ background-color: #2A5978;
16
+ color: #67A192;
17
+ }
18
+ .brightness-2 {
19
+ background-color: #67A192;
20
+ color: #B6DE90;
21
+ }
22
+ .brightness-3 {
23
+ background-color: #B6DE90;
24
+ color: #FFFF99;
25
+ }
26
+ .brightness-4 {
27
+ background-color: #FFFF99;
28
+ color: #fff;
29
+ }
30
+
@@ -0,0 +1,29 @@
1
+ module Nightlight
2
+ class ActivitiesController < BaseController
3
+
4
+ before_action :set_page
5
+
6
+ def create
7
+ @status = @page.activities.status.new activity_params
8
+ @status.user = current_user if respond_to?(:current_user)
9
+ if @status.save
10
+ flash[:success] = "Status updated."
11
+ redirect_to page_url(@page)
12
+ else
13
+ flash.now[:error] = @status.errors.full_messages.first
14
+ render 'nightlight/pages/show'
15
+ end
16
+ end
17
+
18
+ private
19
+
20
+ def set_page
21
+ @page = Nightlight::Page.find(params[:page_id].to_s.split("-").first)
22
+ end
23
+
24
+ def activity_params
25
+ params.require(:activity).permit(:description)
26
+ end
27
+
28
+ end
29
+ end
@@ -0,0 +1,16 @@
1
+ module Nightlight
2
+ class BaseController < ApplicationController
3
+ # skip all filters
4
+ skip_filter(*_process_action_callbacks.map(&:filter))
5
+
6
+ helper Nightlight::Engine.helpers
7
+
8
+ protect_from_forgery with: :exception
9
+
10
+ if ENV["NIGHTLIGHT_PASSWORD"]
11
+ http_basic_authenticate_with name: ENV["NIGHTLIGHT_USERNAME"], password: ENV["NIGHTLIGHT_PASSWORD"]
12
+ end
13
+
14
+ layout "nightlight/application"
15
+ end
16
+ end
@@ -0,0 +1,132 @@
1
+ module Nightlight
2
+ class PagesController < BaseController
3
+ before_action :set_page, only: [:show, :edit, :update, :destroy, :assign, :unassign, :checked]
4
+ before_action :authorize_assignee, only: [:unassign]
5
+
6
+ def index
7
+ @pages = Nightlight::Page.where(hidden: false).order('last_checked_at ASC')
8
+ @new_pages = routes_pages.select do |r|
9
+ Nightlight::Page.where(path: r[:path]).none?
10
+ end
11
+ if params[:hidden]
12
+ @hidden_pages = Nightlight::Page.hidden
13
+ end
14
+ end
15
+
16
+ def show
17
+ @status = Nightlight::Activity.new
18
+ end
19
+
20
+ def edit
21
+ end
22
+
23
+ def new
24
+ @page = Nightlight::Page.new
25
+ end
26
+
27
+ def create
28
+ @page = Nightlight::Page.new page_params
29
+ if @page.save
30
+ flash[:success] = "Page saved."
31
+ redirect_to page_url(@page)
32
+ else
33
+ flash.now[:error] = @page.errors.full_messages.first
34
+ render 'nightlight/pages/new'
35
+ end
36
+ end
37
+
38
+ def update
39
+ if @page.update page_params
40
+ flash[:success] = "Page updated."
41
+ redirect_to page_url(@page)
42
+ else
43
+ flash.now[:error] = @page.errors.full_messages.first
44
+ render 'nightlight/pages/edit'
45
+ end
46
+ end
47
+
48
+ def add_yes
49
+ @page = Page.new page_params
50
+ @page.save
51
+ respond_to do |format|
52
+ format.js { render 'nightlight/pages/add' }
53
+ end
54
+ end
55
+
56
+ def add_no
57
+ @page = Page.new page_params
58
+ @page.hidden = true
59
+ @page.save
60
+ respond_to do |format|
61
+ format.js { render 'nightlight/pages/add' }
62
+ end
63
+ end
64
+
65
+ def assign
66
+ if @page.assignee
67
+ flash[:error] = "Someone is already assigned to this page"
68
+ redirect_to page_url(@page)
69
+ return
70
+ end
71
+ @page.assignee = current_user
72
+ if @page.save
73
+ flash[:success] = "You are now assigned to this page"
74
+ redirect_to page_url(@page)
75
+ else
76
+ flash.now[:error] = @page.errors.full_messages.first
77
+ render 'nightlight/pages/show'
78
+ end
79
+ end
80
+
81
+ def unassign
82
+ @page.assignee = nil
83
+ if @page.save
84
+ flash[:success] = "You are no longer assigned to this page"
85
+ redirect_to page_url(@page)
86
+ else
87
+ flash.now[:error] = @page.errors.full_messages.first
88
+ render 'nightlight/pages/show'
89
+ end
90
+ end
91
+
92
+ def checked
93
+ @page.checked! current_user
94
+ flash[:success] = "Nice job"
95
+ redirect_to page_url(@page)
96
+ end
97
+
98
+ def random
99
+ scope = Nightlight::Page.unhidden.unassigned
100
+ offset = rand(scope.count)
101
+ @page = scope.offset(offset).first
102
+ @page.update! assignee: current_user
103
+ flash[:success] = "You are now assigned to this page"
104
+ redirect_to page_url(@page)
105
+ end
106
+
107
+ private
108
+
109
+ def routes_pages
110
+ all_routes = Rails.application.routes.routes
111
+ require 'action_dispatch/routing/inspector'
112
+ inspector = ActionDispatch::Routing::RoutesInspector.new(all_routes)
113
+ routes = inspector.send(:collect_routes, all_routes)
114
+ routes.select{|r| r[:verb]=="GET" }
115
+ end
116
+
117
+ def set_page
118
+ @page = Nightlight::Page.find(params[:id].to_s.split("-").first)
119
+ end
120
+
121
+ def page_params
122
+ params.require(:page).permit(:name, :path, :sample_path, :reqs, :notes, :hidden)
123
+ end
124
+
125
+ def authorize_assignee
126
+ unless @page.assignee==current_user
127
+ flash[:error] = "You are not assigned to this page"
128
+ redirect_to page_url(@page)
129
+ end
130
+ end
131
+ end
132
+ end
@@ -0,0 +1,24 @@
1
+ module Nightlight
2
+ module PagesHelper
3
+
4
+ def avg_page_brightness pages
5
+ avg = pages.map(&:brightness).sum.to_f / pages.size.to_f
6
+ avg.to_i
7
+ end
8
+
9
+ def link_to_page page
10
+ path = page.sample_path.presence || page.path
11
+ path = path.sub(/\(\.:format\)$/,'')
12
+ link_to page.path, path, target: '_blank'
13
+ end
14
+
15
+ def last_checked_at page
16
+ if page.last_checked_at
17
+ "last checked #{time_ago_in_words(page.last_checked_at)} ago"
18
+ else
19
+ "last checked ??"
20
+ end
21
+ end
22
+
23
+ end
24
+ end
@@ -0,0 +1,38 @@
1
+ module Nightlight
2
+ class Activity < ActiveRecord::Base
3
+ belongs_to :user
4
+ belongs_to :page
5
+
6
+ validates :name, presence: true
7
+ validates :description, presence: true, if: :status?
8
+
9
+ default_scope ->{ order created_at: :desc }
10
+ scope :status, ->{ where name: 'status' }
11
+ scope :checked, ->{ where name: 'checked' }
12
+
13
+ def to_s
14
+ "#{user_name} #{verb_phrase}".humanize
15
+ end
16
+
17
+ def user_name
18
+ user.try(:name) || 'someone'
19
+ end
20
+
21
+ def status?
22
+ name=='status'
23
+ end
24
+ def checked?
25
+ name=='checked'
26
+ end
27
+
28
+ private
29
+
30
+ def verb_phrase
31
+ if status?
32
+ 'updated the status'
33
+ elsif checked?
34
+ 'checked the page'
35
+ end
36
+ end
37
+ end
38
+ end