simple_form_datetimepicker 0.0.5 → 0.0.6
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.
- checksums.yaml +4 -4
- data/lib/generators/simple_form_datetimepicker/install/templates/simple_form_datetimepicker.rb +17 -11
- data/lib/simple_form_datetimepicker/capybara_helpers.rb +9 -0
- data/lib/simple_form_datetimepicker/version.rb +1 -1
- data/lib/simple_form_datetimepicker.rb +1 -0
- metadata +3 -7
- data/.gitignore +0 -19
- data/Gemfile +0 -4
- data/LICENSE.txt +0 -22
- data/README.md +0 -29
- data/simple_form_datetimepicker.gemspec +0 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e6375ea8b0718386a75995084e8f1343861514f
|
4
|
+
data.tar.gz: b12618649d7ce9700f70c80e6c5308fa241d0e79
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 918b692aa65c305bea348ab0c3c29bc78918f338f28bdcc9cc102c303f1dfdf68d74c1add802b5eefa729f48ca614276ba8c1274ac3ba3cc96af408fb537bd80
|
7
|
+
data.tar.gz: 073cbfd4aac16ca4dc3ddaebab492fee06096b69b6e77f877a8d374541a3657ed435a376309861678421af6bb3e47e1d7ba1587b738ffc02aa8c27e7737e732e
|
data/lib/generators/simple_form_datetimepicker/install/templates/simple_form_datetimepicker.rb
CHANGED
@@ -1,28 +1,30 @@
|
|
1
1
|
module SimpleForm
|
2
2
|
module Inputs
|
3
3
|
class DateTimeInput < Base
|
4
|
-
def input
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
def input(wrapper_options)
|
5
|
+
merged_input_options = merge_wrapper_options input_html_options, wrapper_options
|
6
|
+
icon = merged_input_options.delete(:icon) || 'glyphicon-calendar'
|
7
|
+
icon_lib = merged_input_options.delete(:iconlib) || icon.split('-')[0]
|
8
|
+
defaultvalue = merged_input_options.delete(:defaultvalue)
|
8
9
|
if defaultvalue.present? && defaultvalue.is_a?(Hash)
|
9
10
|
day_offset = defaultvalue.delete(:day_offset)
|
10
11
|
defaulttime = Time.zone.now.change(defaultvalue)
|
11
12
|
defaulttime += day_offset.days if day_offset.present?
|
12
13
|
defaultvalue = defaulttime
|
13
14
|
end
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
# merged_input_options[:class] << 'dtp'
|
16
|
+
input_html_classes.push 'dtp'
|
17
|
+
no_group = if merged_input_options.key?(:data)
|
18
|
+
merged_input_options[:data][:defaultvalue] = defaultvalue if defaultvalue.present?
|
19
|
+
merged_input_options[:data].key? :no_group
|
18
20
|
else
|
19
|
-
|
21
|
+
merged_input_options[:data] = {:defaultvalue => defaultvalue} if defaultvalue.present?
|
20
22
|
false
|
21
23
|
end
|
22
24
|
|
23
25
|
out = ''
|
24
26
|
out << '<div class="input-group">' unless no_group
|
25
|
-
out << @builder.text_field(attribute_name,
|
27
|
+
out << @builder.text_field(attribute_name, merged_input_options)
|
26
28
|
unless no_group
|
27
29
|
out << '<span class="input-group-addon">'
|
28
30
|
out << "<span class='#{icon_lib} #{icon}'></span>"
|
@@ -31,6 +33,10 @@ module SimpleForm
|
|
31
33
|
end
|
32
34
|
out.html_safe
|
33
35
|
end
|
36
|
+
|
37
|
+
def label_target
|
38
|
+
:"#{attribute_name}"
|
39
|
+
end
|
34
40
|
end
|
35
41
|
end
|
36
|
-
end
|
42
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_form_datetimepicker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- smit1625
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -87,16 +87,12 @@ executables: []
|
|
87
87
|
extensions: []
|
88
88
|
extra_rdoc_files: []
|
89
89
|
files:
|
90
|
-
- ".gitignore"
|
91
|
-
- Gemfile
|
92
|
-
- LICENSE.txt
|
93
|
-
- README.md
|
94
90
|
- Rakefile
|
95
91
|
- lib/generators/simple_form_datetimepicker/install/install_generator.rb
|
96
92
|
- lib/generators/simple_form_datetimepicker/install/templates/simple_form_datetimepicker.rb
|
97
93
|
- lib/simple_form_datetimepicker.rb
|
94
|
+
- lib/simple_form_datetimepicker/capybara_helpers.rb
|
98
95
|
- lib/simple_form_datetimepicker/version.rb
|
99
|
-
- simple_form_datetimepicker.gemspec
|
100
96
|
- vendor/assets/javascripts/simple_form_datetimepicker/bootstrap-datetimepicker.js
|
101
97
|
- vendor/assets/javascripts/simple_form_datetimepicker/init.js
|
102
98
|
- vendor/assets/javascripts/simple_form_datetimepicker/moment.js
|
data/.gitignore
DELETED
data/Gemfile
DELETED
data/LICENSE.txt
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
Copyright (c) 2014 smit1625
|
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.
|
data/README.md
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
# SimpleFormDatetimepicker
|
2
|
-
|
3
|
-
TODO: Write a gem description
|
4
|
-
|
5
|
-
## Installation
|
6
|
-
|
7
|
-
Add this line to your application's Gemfile:
|
8
|
-
|
9
|
-
gem 'simple_form_datetimepicker'
|
10
|
-
|
11
|
-
And then execute:
|
12
|
-
|
13
|
-
$ bundle
|
14
|
-
|
15
|
-
Or install it yourself as:
|
16
|
-
|
17
|
-
$ gem install simple_form_datetimepicker
|
18
|
-
|
19
|
-
## Usage
|
20
|
-
|
21
|
-
TODO: Write usage instructions here
|
22
|
-
|
23
|
-
## Contributing
|
24
|
-
|
25
|
-
1. Fork it
|
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
|
@@ -1,26 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'simple_form_datetimepicker/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = "simple_form_datetimepicker"
|
8
|
-
spec.version = SimpleFormDatetimepicker::VERSION
|
9
|
-
spec.authors = ["smit1625"]
|
10
|
-
spec.email = ["smit1625@msu.edu"]
|
11
|
-
spec.description = %q{Beautifies the default datetime input for SimpleForm}
|
12
|
-
spec.summary = %q{Uses bootstrap-datetimepicker to enhance SimpleForm's default datetime input}
|
13
|
-
spec.homepage = ""
|
14
|
-
spec.license = "MIT"
|
15
|
-
|
16
|
-
spec.files = `git ls-files`.split($/)
|
17
|
-
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
-
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
-
spec.require_paths = ["lib"]
|
20
|
-
|
21
|
-
spec.add_development_dependency "bundler", "~> 1.3"
|
22
|
-
spec.add_development_dependency "rake"
|
23
|
-
spec.add_dependency "railties"
|
24
|
-
spec.add_dependency "simple_form"
|
25
|
-
spec.add_dependency "american_date"
|
26
|
-
end
|