datetime_picker_input 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +15 -0
  3. data/.travis.yml +15 -0
  4. data/Gemfile +25 -0
  5. data/LICENSE +21 -0
  6. data/README.md +114 -0
  7. data/Rakefile +12 -0
  8. data/app/inputs/date_time_picker_input.rb +53 -0
  9. data/datetime_picker_input.gemspec +23 -0
  10. data/lib/datetime_picker_input.rb +8 -0
  11. data/lib/datetime_picker_input/version.rb +3 -0
  12. data/lib/generators/datetime_picker_input.rb/install_generator.rb +15 -0
  13. data/lib/generators/templates/inputs/date_time_picker_input.rb +53 -0
  14. data/spec/dummy/README.rdoc +28 -0
  15. data/spec/dummy/Rakefile +6 -0
  16. data/spec/dummy/app/assets/images/.keep +0 -0
  17. data/spec/dummy/app/assets/javascripts/application.js +6 -0
  18. data/spec/dummy/app/assets/stylesheets/application.scss +3 -0
  19. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  20. data/spec/dummy/app/controllers/appointments_controller.rb +15 -0
  21. data/spec/dummy/app/controllers/concerns/.keep +0 -0
  22. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  23. data/spec/dummy/app/mailers/.keep +0 -0
  24. data/spec/dummy/app/models/.keep +0 -0
  25. data/spec/dummy/app/models/appointment.rb +3 -0
  26. data/spec/dummy/app/models/concerns/.keep +0 -0
  27. data/spec/dummy/app/views/appointments/index.html.slim +13 -0
  28. data/spec/dummy/app/views/appointments/new.html.slim +6 -0
  29. data/spec/dummy/app/views/layouts/application.html.slim +11 -0
  30. data/spec/dummy/bin/bundle +3 -0
  31. data/spec/dummy/bin/rails +4 -0
  32. data/spec/dummy/bin/rake +4 -0
  33. data/spec/dummy/bin/setup +29 -0
  34. data/spec/dummy/config.ru +4 -0
  35. data/spec/dummy/config/application.rb +40 -0
  36. data/spec/dummy/config/boot.rb +5 -0
  37. data/spec/dummy/config/database.yml +25 -0
  38. data/spec/dummy/config/environment.rb +5 -0
  39. data/spec/dummy/config/environments/development.rb +41 -0
  40. data/spec/dummy/config/environments/production.rb +79 -0
  41. data/spec/dummy/config/environments/test.rb +42 -0
  42. data/spec/dummy/config/initializers/assets.rb +11 -0
  43. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  44. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  45. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  46. data/spec/dummy/config/initializers/inflections.rb +16 -0
  47. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  48. data/spec/dummy/config/initializers/session_store.rb +3 -0
  49. data/spec/dummy/config/initializers/simple_form.rb +166 -0
  50. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  51. data/spec/dummy/config/locales/en.yml +23 -0
  52. data/spec/dummy/config/locales/simple_form.en.yml +31 -0
  53. data/spec/dummy/config/routes.rb +5 -0
  54. data/spec/dummy/config/secrets.yml +22 -0
  55. data/spec/dummy/db/development.sqlite3 +0 -0
  56. data/spec/dummy/db/migrate/20150224051923_create_appointments.rb +7 -0
  57. data/spec/dummy/db/schema.rb +20 -0
  58. data/spec/dummy/db/test.sqlite3 +0 -0
  59. data/spec/dummy/lib/assets/.keep +0 -0
  60. data/spec/dummy/lib/templates/erb/scaffold/_form.html.erb +13 -0
  61. data/spec/dummy/log/.keep +0 -0
  62. data/spec/dummy/log/development.log +3657 -0
  63. data/spec/dummy/log/test.log +2263 -0
  64. data/spec/dummy/public/404.html +67 -0
  65. data/spec/dummy/public/422.html +67 -0
  66. data/spec/dummy/public/500.html +66 -0
  67. data/spec/dummy/public/favicon.ico +0 -0
  68. data/spec/feature_helper.rb +37 -0
  69. data/spec/features/datetime_picker_input_spec.rb +12 -0
  70. data/spec/rails_helper.rb +19 -0
  71. data/vendor/assets/javascripts/datetime_picker_input.js +9 -0
  72. data/vendor/assets/stylesheets/datetime_picker_input.scss +1 -0
  73. metadata +196 -0
@@ -0,0 +1,67 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body>
58
+ <!-- This file lives in public/404.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>The page you were looking for doesn't exist.</h1>
62
+ <p>You may have mistyped the address or the page may have moved.</p>
63
+ </div>
64
+ <p>If you are the application owner check the logs for more information.</p>
65
+ </div>
66
+ </body>
67
+ </html>
@@ -0,0 +1,67 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body>
58
+ <!-- This file lives in public/422.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>The change you wanted was rejected.</h1>
62
+ <p>Maybe you tried to change something you didn't have access to.</p>
63
+ </div>
64
+ <p>If you are the application owner check the logs for more information.</p>
65
+ </div>
66
+ </body>
67
+ </html>
@@ -0,0 +1,66 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body>
58
+ <!-- This file lives in public/500.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>We're sorry, but something went wrong.</h1>
62
+ </div>
63
+ <p>If you are the application owner check the logs for more information.</p>
64
+ </div>
65
+ </body>
66
+ </html>
File without changes
@@ -0,0 +1,37 @@
1
+ require "rails_helper"
2
+
3
+ require "capybara/rails"
4
+ require "capybara/rspec"
5
+ require "capybara/poltergeist"
6
+ require "database_cleaner"
7
+
8
+ Capybara.register_driver :poltergeist do |app|
9
+ Capybara::Poltergeist::Driver.new(
10
+ app,
11
+ window_size: [1280, 1024],
12
+ js_errors: false, debug: false
13
+ )
14
+ end
15
+
16
+ Capybara.configure do |config|
17
+ config.javascript_driver = :poltergeist
18
+ end
19
+
20
+ RSpec.configure do |config|
21
+ config.use_transactional_fixtures = false
22
+
23
+ config.before(:suite) do
24
+ DatabaseCleaner.strategy = :truncation
25
+ DatabaseCleaner.clean_with(:truncation)
26
+ end
27
+
28
+ config.before(:each) do
29
+ DatabaseCleaner.start
30
+ end
31
+
32
+ config.after(:each) do
33
+ DatabaseCleaner.clean
34
+ require "fileutils"
35
+ FileUtils.rm_rf "#{Rails.root}/tmp/"
36
+ end
37
+ end
@@ -0,0 +1,12 @@
1
+ require "feature_helper"
2
+
3
+ feature "datetime input", js: true do
4
+ scenario "can create a new appointment with specific datetime" do
5
+ visit root_path
6
+ click_on "New Appointment"
7
+ expect(page).to have_content "Scheduled at"
8
+ page.execute_script("$('input.date_time_picker').val('01/01/2046')")
9
+ click_button "Create Appointment"
10
+ expect(page).to have_content "2046-01-01 00:00:00 UTC"
11
+ end
12
+ end
@@ -0,0 +1,19 @@
1
+ ENV["RAILS_ENV"] = "test"
2
+ require File.expand_path("../dummy/config/environment", __FILE__)
3
+ require "rspec/rails"
4
+
5
+ ActiveRecord::Migration.maintain_test_schema!
6
+
7
+ RSpec.configure do |config|
8
+ config.fixture_path = "#{::Rails.root}/spec/fixtures"
9
+ config.use_transactional_fixtures = true
10
+ config.infer_spec_type_from_file_location!
11
+
12
+ config.expect_with :rspec do |expectations|
13
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
14
+ end
15
+
16
+ config.mock_with :rspec do |mocks|
17
+ mocks.verify_partial_doubles = true
18
+ end
19
+ end
@@ -0,0 +1,9 @@
1
+ //= require moment
2
+ //= require bootstrap-datetimepicker
3
+
4
+ $(document).on('ready page:change', function() {
5
+ $('input.date_time_picker').datetimepicker();
6
+ $('.input-group.date_time_picker .input-group-btn').on('click', function() {
7
+ $(this).prev('input.date_time_picker').focus().click();
8
+ });
9
+ });
@@ -0,0 +1 @@
1
+ @import 'bootstrap-datetimepicker';
metadata ADDED
@@ -0,0 +1,196 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: datetime_picker_input
3
+ version: !ruby/object:Gem::Version
4
+ version: 4.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Juanito
8
+ - Fatas
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2015-02-27 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: bootstrap3-datetimepicker-rails
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - "~>"
19
+ - !ruby/object:Gem::Version
20
+ version: 4.0.0
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - "~>"
26
+ - !ruby/object:Gem::Version
27
+ version: 4.0.0
28
+ - !ruby/object:Gem::Dependency
29
+ name: momentjs-rails
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: 2.9.0
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: 2.9.0
42
+ description: Datetime picker wrapper of https://github.com/TrevorS/bootstrap3-datetimepicker-rails,
43
+ for use with simple_form on Rails 4+.
44
+ email:
45
+ - katehuang0320@gmail.com
46
+ executables: []
47
+ extensions: []
48
+ extra_rdoc_files: []
49
+ files:
50
+ - ".gitignore"
51
+ - ".travis.yml"
52
+ - Gemfile
53
+ - LICENSE
54
+ - README.md
55
+ - Rakefile
56
+ - app/inputs/date_time_picker_input.rb
57
+ - datetime_picker_input.gemspec
58
+ - lib/datetime_picker_input.rb
59
+ - lib/datetime_picker_input/version.rb
60
+ - lib/generators/datetime_picker_input.rb/install_generator.rb
61
+ - lib/generators/templates/inputs/date_time_picker_input.rb
62
+ - spec/dummy/README.rdoc
63
+ - spec/dummy/Rakefile
64
+ - spec/dummy/app/assets/images/.keep
65
+ - spec/dummy/app/assets/javascripts/application.js
66
+ - spec/dummy/app/assets/stylesheets/application.scss
67
+ - spec/dummy/app/controllers/application_controller.rb
68
+ - spec/dummy/app/controllers/appointments_controller.rb
69
+ - spec/dummy/app/controllers/concerns/.keep
70
+ - spec/dummy/app/helpers/application_helper.rb
71
+ - spec/dummy/app/mailers/.keep
72
+ - spec/dummy/app/models/.keep
73
+ - spec/dummy/app/models/appointment.rb
74
+ - spec/dummy/app/models/concerns/.keep
75
+ - spec/dummy/app/views/appointments/index.html.slim
76
+ - spec/dummy/app/views/appointments/new.html.slim
77
+ - spec/dummy/app/views/layouts/application.html.slim
78
+ - spec/dummy/bin/bundle
79
+ - spec/dummy/bin/rails
80
+ - spec/dummy/bin/rake
81
+ - spec/dummy/bin/setup
82
+ - spec/dummy/config.ru
83
+ - spec/dummy/config/application.rb
84
+ - spec/dummy/config/boot.rb
85
+ - spec/dummy/config/database.yml
86
+ - spec/dummy/config/environment.rb
87
+ - spec/dummy/config/environments/development.rb
88
+ - spec/dummy/config/environments/production.rb
89
+ - spec/dummy/config/environments/test.rb
90
+ - spec/dummy/config/initializers/assets.rb
91
+ - spec/dummy/config/initializers/backtrace_silencers.rb
92
+ - spec/dummy/config/initializers/cookies_serializer.rb
93
+ - spec/dummy/config/initializers/filter_parameter_logging.rb
94
+ - spec/dummy/config/initializers/inflections.rb
95
+ - spec/dummy/config/initializers/mime_types.rb
96
+ - spec/dummy/config/initializers/session_store.rb
97
+ - spec/dummy/config/initializers/simple_form.rb
98
+ - spec/dummy/config/initializers/wrap_parameters.rb
99
+ - spec/dummy/config/locales/en.yml
100
+ - spec/dummy/config/locales/simple_form.en.yml
101
+ - spec/dummy/config/routes.rb
102
+ - spec/dummy/config/secrets.yml
103
+ - spec/dummy/db/development.sqlite3
104
+ - spec/dummy/db/migrate/20150224051923_create_appointments.rb
105
+ - spec/dummy/db/schema.rb
106
+ - spec/dummy/db/test.sqlite3
107
+ - spec/dummy/lib/assets/.keep
108
+ - spec/dummy/lib/templates/erb/scaffold/_form.html.erb
109
+ - spec/dummy/log/.keep
110
+ - spec/dummy/log/development.log
111
+ - spec/dummy/log/test.log
112
+ - spec/dummy/public/404.html
113
+ - spec/dummy/public/422.html
114
+ - spec/dummy/public/500.html
115
+ - spec/dummy/public/favicon.ico
116
+ - spec/feature_helper.rb
117
+ - spec/features/datetime_picker_input_spec.rb
118
+ - spec/rails_helper.rb
119
+ - vendor/assets/javascripts/datetime_picker_input.js
120
+ - vendor/assets/stylesheets/datetime_picker_input.scss
121
+ homepage: https://github.com/jollygoodcode/datetime_picker_input
122
+ licenses:
123
+ - MIT
124
+ metadata: {}
125
+ post_install_message:
126
+ rdoc_options: []
127
+ require_paths:
128
+ - lib
129
+ required_ruby_version: !ruby/object:Gem::Requirement
130
+ requirements:
131
+ - - ">="
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
134
+ required_rubygems_version: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ requirements: []
140
+ rubyforge_project:
141
+ rubygems_version: 2.4.5
142
+ signing_key:
143
+ specification_version: 4
144
+ summary: Datetime picker wrapper of https://github.com/TrevorS/bootstrap3-datetimepicker-rails,
145
+ for use with simple_form on Rails 4+.
146
+ test_files:
147
+ - spec/dummy/app/assets/javascripts/application.js
148
+ - spec/dummy/app/assets/stylesheets/application.scss
149
+ - spec/dummy/app/controllers/application_controller.rb
150
+ - spec/dummy/app/controllers/appointments_controller.rb
151
+ - spec/dummy/app/helpers/application_helper.rb
152
+ - spec/dummy/app/models/appointment.rb
153
+ - spec/dummy/app/views/appointments/index.html.slim
154
+ - spec/dummy/app/views/appointments/new.html.slim
155
+ - spec/dummy/app/views/layouts/application.html.slim
156
+ - spec/dummy/bin/bundle
157
+ - spec/dummy/bin/rails
158
+ - spec/dummy/bin/rake
159
+ - spec/dummy/bin/setup
160
+ - spec/dummy/config/application.rb
161
+ - spec/dummy/config/boot.rb
162
+ - spec/dummy/config/database.yml
163
+ - spec/dummy/config/environment.rb
164
+ - spec/dummy/config/environments/development.rb
165
+ - spec/dummy/config/environments/production.rb
166
+ - spec/dummy/config/environments/test.rb
167
+ - spec/dummy/config/initializers/assets.rb
168
+ - spec/dummy/config/initializers/backtrace_silencers.rb
169
+ - spec/dummy/config/initializers/cookies_serializer.rb
170
+ - spec/dummy/config/initializers/filter_parameter_logging.rb
171
+ - spec/dummy/config/initializers/inflections.rb
172
+ - spec/dummy/config/initializers/mime_types.rb
173
+ - spec/dummy/config/initializers/session_store.rb
174
+ - spec/dummy/config/initializers/simple_form.rb
175
+ - spec/dummy/config/initializers/wrap_parameters.rb
176
+ - spec/dummy/config/locales/en.yml
177
+ - spec/dummy/config/locales/simple_form.en.yml
178
+ - spec/dummy/config/routes.rb
179
+ - spec/dummy/config/secrets.yml
180
+ - spec/dummy/config.ru
181
+ - spec/dummy/db/development.sqlite3
182
+ - spec/dummy/db/migrate/20150224051923_create_appointments.rb
183
+ - spec/dummy/db/schema.rb
184
+ - spec/dummy/db/test.sqlite3
185
+ - spec/dummy/lib/templates/erb/scaffold/_form.html.erb
186
+ - spec/dummy/log/development.log
187
+ - spec/dummy/log/test.log
188
+ - spec/dummy/public/404.html
189
+ - spec/dummy/public/422.html
190
+ - spec/dummy/public/500.html
191
+ - spec/dummy/public/favicon.ico
192
+ - spec/dummy/Rakefile
193
+ - spec/dummy/README.rdoc
194
+ - spec/feature_helper.rb
195
+ - spec/features/datetime_picker_input_spec.rb
196
+ - spec/rails_helper.rb