administrate-field-nested_has_many 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -0
- data/CHANGELOG.md +6 -0
- data/README.md +2 -2
- data/administrate-field-nested_has_many.gemspec +2 -1
- data/app/views/fields/nested_has_many/_show.html.erb +7 -3
- data/config/i18n-tasks.yml +8 -0
- data/config/locales/administrate-field-nested_has_many.en.yml +2 -2
- data/config/locales/administrate-field-nested_has_many.ja.yml +7 -0
- data/spec/i18n_spec.rb +29 -0
- metadata +22 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc4e6f4887d375faa443012dd432fc1dbf93ba0c54cf410cb94f0ed15dff2b1e
|
4
|
+
data.tar.gz: 46ba0a0fbafbe1dd43e5dc7e2db12a3025a5b92428515cec60fb1c0d67fd24f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19ca8ea2726af27214269cf1720a261b9fea189f3e6baee3e1dbeb6d884898f0562fe8a626e21f4b9b5d384bc3e7da7060de087302b03e410bb126e0c2c7e305
|
7
|
+
data.tar.gz: 2fd50695bf285688a893181c6443854a513cea9a492bcc06d29ce2a3506fd99ca0807fdd966b59c48364a189fb758392776baed8ec0fd03e4de4af1af2f193c2
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby-2.5.3
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -2,7 +2,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |gem|
|
4
4
|
gem.name = "administrate-field-nested_has_many"
|
5
|
-
gem.version = "1.
|
5
|
+
gem.version = "1.1.0"
|
6
6
|
gem.authors = ["Nick Charlton", "Grayson Wright"]
|
7
7
|
gem.email = ["nick@nickcharlton.net", "wright.grayson@gmail.com"]
|
8
8
|
gem.homepage = "https://github.com/nickcharlton/" \
|
@@ -20,4 +20,5 @@ Gem::Specification.new do |gem|
|
|
20
20
|
|
21
21
|
gem.add_development_dependency "rake"
|
22
22
|
gem.add_development_dependency "rspec"
|
23
|
+
gem.add_development_dependency "i18n-tasks"
|
23
24
|
end
|
@@ -19,11 +19,15 @@ from the associated resource class's dashboard.
|
|
19
19
|
%>
|
20
20
|
|
21
21
|
<% if field.resources.any? %>
|
22
|
+
<% order = field.order_from_params(params.fetch(field.name, {})) %>
|
23
|
+
<% page_number = params.fetch(field.name, {}).fetch(:page, nil) %>
|
22
24
|
<%= render(
|
23
25
|
"collection",
|
24
|
-
collection_presenter: field.associated_collection,
|
25
|
-
|
26
|
-
|
26
|
+
collection_presenter: field.associated_collection(order),
|
27
|
+
collection_field_name: field.name,
|
28
|
+
page: page,
|
29
|
+
resources: field.resources(page_number, order),
|
30
|
+
table_title: field.name,
|
27
31
|
) %>
|
28
32
|
|
29
33
|
<% if field.more_than_limit? %>
|
data/spec/i18n_spec.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "i18n/tasks"
|
4
|
+
|
5
|
+
RSpec.describe "I18n" do
|
6
|
+
let(:i18n) { I18n::Tasks::BaseTask.new }
|
7
|
+
let(:missing_keys) { i18n.missing_keys }
|
8
|
+
let(:unused_keys) { i18n.unused_keys }
|
9
|
+
|
10
|
+
it "does not have missing keys" do
|
11
|
+
expect(missing_keys).to be_empty,
|
12
|
+
"Missing #{missing_keys.leaves.count} i18n keys,
|
13
|
+
run `i18n-tasks missing' to show them"
|
14
|
+
end
|
15
|
+
|
16
|
+
it "does not have unused keys" do
|
17
|
+
expect(unused_keys).to be_empty,
|
18
|
+
"#{unused_keys.leaves.count} unused i18n keys,
|
19
|
+
run `i18n-tasks unused' to show them"
|
20
|
+
end
|
21
|
+
|
22
|
+
it "files are normalized" do
|
23
|
+
non_normalized = i18n.non_normalized_paths
|
24
|
+
message = "The following files need to be normalized:\n" \
|
25
|
+
"#{non_normalized.map { |path| " #{path}" }.join("\n")}\n" \
|
26
|
+
"Please run `i18n-tasks normalize` to fix"
|
27
|
+
expect(non_normalized).to be_empty, message
|
28
|
+
end
|
29
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: administrate-field-nested_has_many
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Charlton
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-03
|
12
|
+
date: 2018-12-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: administrate
|
@@ -79,6 +79,20 @@ dependencies:
|
|
79
79
|
- - ">="
|
80
80
|
- !ruby/object:Gem::Version
|
81
81
|
version: '0'
|
82
|
+
- !ruby/object:Gem::Dependency
|
83
|
+
name: i18n-tasks
|
84
|
+
requirement: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
type: :development
|
90
|
+
prerelease: false
|
91
|
+
version_requirements: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0'
|
82
96
|
description: Plugin for nested has_many forms in Administrate
|
83
97
|
email:
|
84
98
|
- nick@nickcharlton.net
|
@@ -88,6 +102,7 @@ extensions: []
|
|
88
102
|
extra_rdoc_files: []
|
89
103
|
files:
|
90
104
|
- ".gitignore"
|
105
|
+
- ".ruby-version"
|
91
106
|
- CHANGELOG.md
|
92
107
|
- Gemfile
|
93
108
|
- README.md
|
@@ -100,8 +115,11 @@ files:
|
|
100
115
|
- app/views/fields/nested_has_many/_form.html.erb
|
101
116
|
- app/views/fields/nested_has_many/_index.html.erb
|
102
117
|
- app/views/fields/nested_has_many/_show.html.erb
|
118
|
+
- config/i18n-tasks.yml
|
103
119
|
- config/locales/administrate-field-nested_has_many.en.yml
|
120
|
+
- config/locales/administrate-field-nested_has_many.ja.yml
|
104
121
|
- lib/administrate/field/nested_has_many.rb
|
122
|
+
- spec/i18n_spec.rb
|
105
123
|
- spec/lib/administrate/field/nested_has_many_spec.rb
|
106
124
|
homepage: https://github.com/nickcharlton/administrate-field-nested_has_many
|
107
125
|
licenses:
|
@@ -123,9 +141,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
141
|
version: '0'
|
124
142
|
requirements: []
|
125
143
|
rubyforge_project:
|
126
|
-
rubygems_version: 2.7.
|
144
|
+
rubygems_version: 2.7.6
|
127
145
|
signing_key:
|
128
146
|
specification_version: 4
|
129
147
|
summary: Plugin for nested has_many forms in Administrate
|
130
148
|
test_files:
|
149
|
+
- spec/i18n_spec.rb
|
131
150
|
- spec/lib/administrate/field/nested_has_many_spec.rb
|