simple_form_extension 1.1.3 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/generators/simple_form_extension/templates/config/locales/simple_form_extension.en.yml +6 -2
- data/lib/generators/simple_form_extension/templates/config/locales/simple_form_extension.fr.yml +6 -2
- data/lib/simple_form_extension/inputs/date_time_input.rb +19 -10
- data/lib/simple_form_extension/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40b76905f993c1d85fe6d87f2e13c042f985891b
|
4
|
+
data.tar.gz: edc4518dda7d58a0e2d8a3d6c3117f183a3f4b7a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: daa96cc685910fe4514132b286881ddcd02992f0303c94f1cdcaf7d2d1aaa8f1dd11fc95a52bb3c6143879a382a16fc502498923b211927f97917be07d94f0a2
|
7
|
+
data.tar.gz: 01cbf739c86556795d51eb057d163b95347528192c8037b12f95fae7cd3706db1d9d1f036e487bccf6bad375ef1018046d2a529c43275e97f58f639a8b4757dc
|
data/lib/generators/simple_form_extension/templates/config/locales/simple_form_extension.en.yml
CHANGED
@@ -9,9 +9,13 @@ en:
|
|
9
9
|
select: "Select image"
|
10
10
|
change: "Change image"
|
11
11
|
date:
|
12
|
-
format:
|
12
|
+
format:
|
13
|
+
js: 'Y/m/d'
|
14
|
+
rails: '%Y/%m/%d'
|
13
15
|
datetime:
|
14
|
-
format:
|
16
|
+
format:
|
17
|
+
js: 'Y/m/d H:i'
|
18
|
+
rails: '%Y/%m/%d %H:%M'
|
15
19
|
shared:
|
16
20
|
week_start_day: 0
|
17
21
|
selectize:
|
data/lib/generators/simple_form_extension/templates/config/locales/simple_form_extension.fr.yml
CHANGED
@@ -9,9 +9,13 @@ fr:
|
|
9
9
|
select: "Sélectionnez une image"
|
10
10
|
change: "Changer"
|
11
11
|
date:
|
12
|
-
format:
|
12
|
+
format:
|
13
|
+
js: 'd/m/Y'
|
14
|
+
rails: '%d/%m/%Y'
|
13
15
|
datetime:
|
14
|
-
format:
|
16
|
+
format:
|
17
|
+
js: 'd/m/Y H:i'
|
18
|
+
rails: '%d/%m/%Y %H:%M'
|
15
19
|
shared:
|
16
20
|
week_start_day: 1
|
17
21
|
selectize:
|
@@ -3,24 +3,33 @@ module SimpleFormExtension
|
|
3
3
|
class DateTimeInput < SimpleForm::Inputs::DateTimeInput
|
4
4
|
include SimpleFormExtension::Translations
|
5
5
|
|
6
|
+
delegate :content_tag, to: :template
|
7
|
+
|
6
8
|
def input(wrapper_options = nil)
|
7
9
|
input_html_options[:class] << "form-control"
|
8
10
|
|
9
11
|
input_html_options[:data] ||= {}
|
10
12
|
input_html_options[:data].merge!(
|
11
|
-
:'date-format' => _translate('date.format'),
|
12
|
-
:'datetime-format' => _translate('datetime.format'),
|
13
|
+
:'date-format' => _translate('date.format.js'),
|
14
|
+
:'datetime-format' => _translate('datetime.format.js'),
|
13
15
|
:'week-start-day' => _translate('shared.week_start_day')
|
14
16
|
)
|
15
17
|
|
16
|
-
|
17
|
-
#{
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
18
|
+
if (value = object.send(attribute_name)) && !input_html_options.key?(:value)
|
19
|
+
format = _translate("#{ input_type }.format.rails")
|
20
|
+
input_html_options[:value] = I18n.l(value, format: format)
|
21
|
+
end
|
22
|
+
|
23
|
+
|
24
|
+
content_tag(:div, class: 'input-group') do
|
25
|
+
@builder.text_field(attribute_name, input_html_options) +
|
26
|
+
|
27
|
+
content_tag(:span, class: 'input-group-btn') do
|
28
|
+
content_tag(:button, class: 'btn btn-default datetimepicker-trigger') do
|
29
|
+
content_tag(:i, '', class: 'fa fa-calendar')
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
24
33
|
end
|
25
34
|
end
|
26
35
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_form_extension
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexandre Vasseur
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|