administrate-field-globalize-string 0.0.1.alpha1 → 0.0.1.alpha3
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc55d6c17469561087a728c56661c9497b77ca00f9c0925eca37d661e4c66c44
|
4
|
+
data.tar.gz: feff2590a920c998d65c39a594506138050e94c18981291f40005e99ab829a62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7e4e4add7132fa9ff27477bd3ffef4decba28019c19e743ddd7715dd53cab12315ea74bae24567bf3f2e093eef1aeb7d9350d44c40f41819ca132438836dd65
|
7
|
+
data.tar.gz: aad2b70db5ba86b5920576df06fa8fa05237d01cd9ebe23cb1921541a674cd2d0e168ad1bba1104ea64f9b34b5a99d843541cb4adcb01d88a8d625bca2db4209
|
@@ -3,7 +3,7 @@
|
|
3
3
|
</div>
|
4
4
|
<div class="field-unit__field">
|
5
5
|
<% I18n.available_locales.each do |locale| %>
|
6
|
-
<%= f.text_field "#{field.attribute}_#{locale
|
6
|
+
<%= f.text_field "#{field.attribute}_#{locale}".downcase.underscore %>
|
7
7
|
(<%= locale %>)
|
8
8
|
<% end %>
|
9
9
|
</div>
|
@@ -1 +1 @@
|
|
1
|
-
<%= field.
|
1
|
+
<%= field.truncate %>
|
@@ -9,7 +9,9 @@ module Administrate
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def self.permitted_attribute(attr, _options = nil)
|
12
|
-
I18n.available_locales.map
|
12
|
+
I18n.available_locales.map do |locale|
|
13
|
+
"#{attr}_#{locale}".downcase.underscore
|
14
|
+
end
|
13
15
|
end
|
14
16
|
|
15
17
|
def truncate
|
@@ -24,6 +26,10 @@ module Administrate
|
|
24
26
|
true
|
25
27
|
end
|
26
28
|
|
29
|
+
def to_partial_path
|
30
|
+
"/fields/globalize/string/#{page}"
|
31
|
+
end
|
32
|
+
|
27
33
|
private
|
28
34
|
|
29
35
|
def truncation_length
|
@@ -4,11 +4,11 @@ describe Administrate::Field::Globalize::String do
|
|
4
4
|
describe "#to_partial_path" do
|
5
5
|
it "returns a partial based on the page being rendered" do
|
6
6
|
page = :show
|
7
|
-
field = Administrate::Field::Globalize::String.new(:
|
7
|
+
field = Administrate::Field::Globalize::String.new(:name, "foo", page)
|
8
8
|
|
9
9
|
path = field.to_partial_path
|
10
10
|
|
11
|
-
expect(path).to eq("/fields/string/#{page}")
|
11
|
+
expect(path).to eq("/fields/globalize/string/#{page}")
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: administrate-field-globalize-string
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.1.
|
4
|
+
version: 0.0.1.alpha3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Armin Kirchner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-08-
|
11
|
+
date: 2018-08-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: administrate
|