volt-daterange 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +17 -0
  3. data/.rspec +2 -0
  4. data/CODE_OF_CONDUCT.md +13 -0
  5. data/Gemfile +15 -0
  6. data/LICENSE.txt +22 -0
  7. data/README.md +29 -0
  8. data/Rakefile +1 -0
  9. data/app/daterange/assets/css/daterangepicker.css +341 -0
  10. data/app/daterange/assets/js/01_moment.js +3112 -0
  11. data/app/daterange/assets/js/daterangepicker.js +1458 -0
  12. data/app/daterange/config/dependencies.rb +1 -0
  13. data/app/daterange/config/initializers/boot.rb +10 -0
  14. data/app/daterange/config/routes.rb +1 -0
  15. data/app/daterange/controllers/main_controller.rb +106 -0
  16. data/app/daterange/views/main/index.html +4 -0
  17. data/lib/volt/daterange.rb +18 -0
  18. data/lib/volt/daterange/version.rb +5 -0
  19. data/spec/dummy/.gitignore +9 -0
  20. data/spec/dummy/README.md +4 -0
  21. data/spec/dummy/app/main/assets/css/app.css.scss +1 -0
  22. data/spec/dummy/app/main/config/dependencies.rb +11 -0
  23. data/spec/dummy/app/main/config/initializers/boot.rb +10 -0
  24. data/spec/dummy/app/main/config/routes.rb +14 -0
  25. data/spec/dummy/app/main/controllers/main_controller.rb +27 -0
  26. data/spec/dummy/app/main/models/user.rb +12 -0
  27. data/spec/dummy/app/main/views/main/about.html +7 -0
  28. data/spec/dummy/app/main/views/main/index.html +6 -0
  29. data/spec/dummy/app/main/views/main/main.html +29 -0
  30. data/spec/dummy/config.ru +4 -0
  31. data/spec/dummy/config/app.rb +137 -0
  32. data/spec/dummy/config/base/index.html +15 -0
  33. data/spec/dummy/config/initializers/boot.rb +4 -0
  34. data/spec/integration/sample_integration_spec.rb +11 -0
  35. data/spec/sample_spec.rb +7 -0
  36. data/spec/spec_helper.rb +18 -0
  37. data/volt-daterange.gemspec +38 -0
  38. metadata +280 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 8699dbc4d1309addc52c5588c0b19bd353f8df92
4
+ data.tar.gz: 3b820bad99a2b852dcc386af1ebf0ae953929c99
5
+ SHA512:
6
+ metadata.gz: fddcf0d0f0a38c47481e6c6dd301132f3142e088f3c980a00db65a6714e7779569babb9bdfacf0bfe5df8f45e2517602720d67acf73a37c60858b3aa8733e477
7
+ data.tar.gz: a4a13029221196d8a8fb4908f7914a08d5c6a1c6c5651151a34c039270b4bcd6e46617d39bfad4e41792d11835bde99b65b3720e8776e1955a7e89dca6834d15
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/Gemfile ADDED
@@ -0,0 +1,15 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in volt-daterange.gemspec
4
+ gemspec
5
+
6
+ # Optional Gems for testing/dev
7
+
8
+ # The implementation of ReadWriteLock in Volt uses concurrent ruby and ext helps performance.
9
+ gem 'concurrent-ruby-ext', '~> 0.8.0'
10
+
11
+ # For mongo (optional)
12
+ gem 'bson_ext', '~> 1.9.0'
13
+
14
+ # Gems you use for development should be added to the gemspec file as
15
+ # development dependencies.
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Ryan Stout
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,29 @@
1
+ # Volt::Daterange
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'volt-daterange'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install volt-daterange
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it ( http://github.com/[my-github-username]/volt-daterange/fork )
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create new Pull Request
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,341 @@
1
+ /**
2
+ * A stylesheet for use with Bootstrap 3.x
3
+ * @author: Dan Grossman http://www.dangrossman.info/
4
+ * @copyright: Copyright (c) 2012-2015 Dan Grossman. All rights reserved.
5
+ * @license: Licensed under the MIT license. See http://www.opensource.org/licenses/mit-license.php
6
+ * @website: https://www.improvely.com/
7
+ */
8
+
9
+ /* Container Appearance */
10
+
11
+ .daterangepicker {
12
+ position: absolute;
13
+ background: #fff;
14
+ top: 100px;
15
+ left: 20px;
16
+ padding: 4px;
17
+ margin-top: 1px;
18
+ border-radius: 4px;
19
+ }
20
+
21
+ .daterangepicker.opensleft:before {
22
+ position: absolute;
23
+ top: -7px;
24
+ right: 9px;
25
+ display: inline-block;
26
+ border-right: 7px solid transparent;
27
+ border-bottom: 7px solid #ccc;
28
+ border-left: 7px solid transparent;
29
+ border-bottom-color: rgba(0, 0, 0, 0.2);
30
+ content: '';
31
+ }
32
+
33
+ .daterangepicker.opensleft:after {
34
+ position: absolute;
35
+ top: -6px;
36
+ right: 10px;
37
+ display: inline-block;
38
+ border-right: 6px solid transparent;
39
+ border-bottom: 6px solid #fff;
40
+ border-left: 6px solid transparent;
41
+ content: '';
42
+ }
43
+
44
+ .daterangepicker.openscenter:before {
45
+ position: absolute;
46
+ top: -7px;
47
+ left: 0;
48
+ right: 0;
49
+ width: 0;
50
+ margin-left: auto;
51
+ margin-right: auto;
52
+ display: inline-block;
53
+ border-right: 7px solid transparent;
54
+ border-bottom: 7px solid #ccc;
55
+ border-left: 7px solid transparent;
56
+ border-bottom-color: rgba(0, 0, 0, 0.2);
57
+ content: '';
58
+ }
59
+
60
+ .daterangepicker.openscenter:after {
61
+ position: absolute;
62
+ top: -6px;
63
+ left: 0;
64
+ right: 0;
65
+ width: 0;
66
+ margin-left: auto;
67
+ margin-right: auto;
68
+ display: inline-block;
69
+ border-right: 6px solid transparent;
70
+ border-bottom: 6px solid #fff;
71
+ border-left: 6px solid transparent;
72
+ content: '';
73
+ }
74
+
75
+ .daterangepicker.opensright:before {
76
+ position: absolute;
77
+ top: -7px;
78
+ left: 9px;
79
+ display: inline-block;
80
+ border-right: 7px solid transparent;
81
+ border-bottom: 7px solid #ccc;
82
+ border-left: 7px solid transparent;
83
+ border-bottom-color: rgba(0, 0, 0, 0.2);
84
+ content: '';
85
+ }
86
+
87
+ .daterangepicker.opensright:after {
88
+ position: absolute;
89
+ top: -6px;
90
+ left: 10px;
91
+ display: inline-block;
92
+ border-right: 6px solid transparent;
93
+ border-bottom: 6px solid #fff;
94
+ border-left: 6px solid transparent;
95
+ content: '';
96
+ }
97
+
98
+ .daterangepicker.dropup{
99
+ margin-top: -5px;
100
+ }
101
+ .daterangepicker.dropup:before{
102
+ top: initial;
103
+ bottom:-7px;
104
+ border-bottom: initial;
105
+ border-top: 7px solid #ccc;
106
+ }
107
+ .daterangepicker.dropup:after{
108
+ top: initial;
109
+ bottom:-6px;
110
+ border-bottom: initial;
111
+ border-top: 6px solid #fff;
112
+ }
113
+
114
+ .daterangepicker.dropdown-menu {
115
+ max-width: none;
116
+ z-index: 3000;
117
+ }
118
+
119
+ .daterangepicker .ranges, .daterangepicker .calendar {
120
+ float: left;
121
+ }
122
+
123
+ .daterangepicker.single .ranges, .daterangepicker.single .calendar {
124
+ float: none;
125
+ }
126
+
127
+ .daterangepicker .ranges {
128
+ margin: 4px;
129
+ text-align: left;
130
+ }
131
+
132
+ .daterangepicker .calendar {
133
+ display: none;
134
+ max-width: 270px;
135
+ }
136
+
137
+ .daterangepicker.show-calendar .calendar {
138
+ display: block;
139
+ }
140
+
141
+ .daterangepicker .calendar.single .calendar-table {
142
+ border: none;
143
+ }
144
+
145
+ /* Calendars */
146
+
147
+ .daterangepicker .calendar th, .daterangepicker .calendar td {
148
+ white-space: nowrap;
149
+ text-align: center;
150
+ min-width: 32px;
151
+ }
152
+
153
+ .daterangepicker .calendar-table {
154
+ border: 1px solid #ddd;
155
+ padding: 4px;
156
+ border-radius: 4px;
157
+ background: #fff;
158
+ }
159
+
160
+ .daterangepicker .calendar.left .calendar-table {
161
+ border-right: none;
162
+ border-top-right-radius: 0;
163
+ border-bottom-right-radius: 0;
164
+ }
165
+
166
+ .daterangepicker .calendar.right .calendar-table {
167
+ border-left: none;
168
+ border-top-left-radius: 0;
169
+ border-bottom-left-radius: 0;
170
+ }
171
+
172
+ .daterangepicker .calendar.left {
173
+ margin: 4px 0 4px 4px;
174
+ }
175
+
176
+ .daterangepicker .calendar.right {
177
+ margin: 4px 4px 4px 0;
178
+ }
179
+
180
+ .daterangepicker .calendar.left .calendar-table {
181
+ padding-right: 12px;
182
+ }
183
+
184
+ .daterangepicker table {
185
+ width: 100%;
186
+ margin: 0;
187
+ }
188
+
189
+ .daterangepicker td, .daterangepicker th {
190
+ text-align: center;
191
+ width: 20px;
192
+ height: 20px;
193
+ border-radius: 4px;
194
+ white-space: nowrap;
195
+ cursor: pointer;
196
+ }
197
+
198
+ .daterangepicker td.off, .daterangepicker td.off.in-range, .daterangepicker td.off.start-date, .daterangepicker td.off.end-date {
199
+ color: #999;
200
+ background: #fff;
201
+ }
202
+
203
+ .daterangepicker td.disabled, .daterangepicker option.disabled {
204
+ color: #999;
205
+ }
206
+
207
+ .daterangepicker td.available:hover, .daterangepicker th.available:hover {
208
+ background: #eee;
209
+ }
210
+
211
+ .daterangepicker td.in-range {
212
+ background: #ebf4f8;
213
+ border-radius: 0;
214
+ }
215
+
216
+ .daterangepicker td.start-date {
217
+ border-radius: 4px 0 0 4px;
218
+ }
219
+
220
+ .daterangepicker td.end-date {
221
+ border-radius: 0 4px 4px 0;
222
+ }
223
+
224
+ .daterangepicker td.start-date.end-date {
225
+ border-radius: 4px;
226
+ }
227
+
228
+ .daterangepicker td.active, .daterangepicker td.active:hover {
229
+ background-color: #357ebd;
230
+ border-color: #3071a9;
231
+ color: #fff;
232
+ }
233
+
234
+ .daterangepicker td.week, .daterangepicker th.week {
235
+ font-size: 80%;
236
+ color: #ccc;
237
+ }
238
+
239
+ .daterangepicker select.monthselect, .daterangepicker select.yearselect {
240
+ font-size: 12px;
241
+ padding: 1px;
242
+ height: auto;
243
+ margin: 0;
244
+ cursor: default;
245
+ }
246
+
247
+ .daterangepicker select.monthselect {
248
+ margin-right: 2%;
249
+ width: 56%;
250
+ }
251
+
252
+ .daterangepicker select.yearselect {
253
+ width: 40%;
254
+ }
255
+
256
+ .daterangepicker select.hourselect, .daterangepicker select.minuteselect, .daterangepicker select.secondselect, .daterangepicker select.ampmselect {
257
+ width: 50px;
258
+ margin-bottom: 0;
259
+ }
260
+
261
+ .daterangepicker th.month {
262
+ width: auto;
263
+ }
264
+
265
+ /* Text Input Above Each Calendar */
266
+
267
+ .daterangepicker .input-mini {
268
+ border: 1px solid #ccc;
269
+ border-radius: 4px;
270
+ color: #555;
271
+ display: block;
272
+ height: 30px;
273
+ line-height: 30px;
274
+ vertical-align: middle;
275
+ margin: 0 0 5px 0;
276
+ padding: 0 6px 0 28px;
277
+ width: 100%;
278
+ }
279
+
280
+ .daterangepicker .input-mini.active {
281
+ border: 1px solid #357ebd;
282
+ }
283
+
284
+ .daterangepicker .daterangepicker_input i {
285
+ position: absolute;
286
+ left: 8px;
287
+ top: 8px;
288
+ }
289
+
290
+ .daterangepicker .left .daterangepicker_input {
291
+ padding-right: 12px;
292
+ }
293
+
294
+ .daterangepicker .daterangepicker_input {
295
+ position: relative;
296
+ }
297
+
298
+ /* Time Picker */
299
+
300
+ .daterangepicker .calendar-time {
301
+ text-align: center;
302
+ margin: 5px auto;
303
+ line-height: 30px;
304
+ position: relative;
305
+ padding-left: 28px;
306
+ }
307
+
308
+ .daterangepicker .calendar-time select.disabled {
309
+ color: #ccc;
310
+ cursor: not-allowed;
311
+ }
312
+
313
+ /* Predefined Ranges */
314
+
315
+ .daterangepicker .ranges {
316
+ font-size: 11px;
317
+ }
318
+
319
+ .daterangepicker .ranges ul {
320
+ list-style: none;
321
+ margin: 0;
322
+ padding: 0;
323
+ width: 160px;
324
+ }
325
+
326
+ .daterangepicker .ranges li {
327
+ font-size: 13px;
328
+ background: #f5f5f5;
329
+ border: 1px solid #f5f5f5;
330
+ color: #08c;
331
+ padding: 3px 12px;
332
+ margin-bottom: 8px;
333
+ border-radius: 5px;
334
+ cursor: pointer;
335
+ }
336
+
337
+ .daterangepicker .ranges li.active, .daterangepicker .ranges li:hover {
338
+ background: #08c;
339
+ border: 1px solid #08c;
340
+ color: #fff;
341
+ }