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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dd88637ffa9a205a64a76b0c72b2af2a9aea05331094d563ad055f0347dcb49c
4
- data.tar.gz: '021851337256c69a63d69045caf809bad66f998949d6cf50433961290db4c726'
3
+ metadata.gz: dc4e6f4887d375faa443012dd432fc1dbf93ba0c54cf410cb94f0ed15dff2b1e
4
+ data.tar.gz: 46ba0a0fbafbe1dd43e5dc7e2db12a3025a5b92428515cec60fb1c0d67fd24f6
5
5
  SHA512:
6
- metadata.gz: 2d6c8787987ca3ebe4c5e4cd93fd8008b71107759612816e7f31eb0adc752b8cd9d174c42052ebcec9bded051447a40a2226723e4628134a95dbfeccd9b31e95
7
- data.tar.gz: 24417b0d9eb65d813f9b898ee3cd776ee22129bb37f865bd20eb0e0ec20b853112308af7931789b601c52486b1fce69aca8d3aa5c46adf427cce80b71e02eb08
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
@@ -1,5 +1,11 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 1.1.0
4
+
5
+ * Add a `.ruby-version` file.
6
+ * Adjust to upstream administrate changes.
7
+ * Add Japanese locale.
8
+
3
9
  ## 1.0.0
4
10
 
5
11
  * Add `rake` for testing and release tools ([#16][]).
data/README.md CHANGED
@@ -19,9 +19,9 @@ $ bundle install
19
19
  Add to your `FooDashboard`:
20
20
 
21
21
  ```ruby
22
- ATTRIBUTE_TYPES = [
22
+ ATTRIBUTE_TYPES = {
23
23
  bars: Field::NestedHasMany.with_options(skip: :foo),
24
- ]
24
+ }
25
25
  ```
26
26
 
27
27
  The `skip` option takes a single symbol or list of symbols.
@@ -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.0.0"
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
- resources: field.resources,
26
- table_title: field.name
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? %>
@@ -0,0 +1,8 @@
1
+ base_locale: en
2
+
3
+ data:
4
+ read:
5
+ - config/locales/administrate-field-nested_has_many.%{locale}.yml
6
+
7
+ ignore:
8
+ - 'administrate.fields.has_many.*'
@@ -3,5 +3,5 @@ en:
3
3
  administrate:
4
4
  fields:
5
5
  nested_has_many:
6
- add: "Add %{resource}"
7
- remove: "Remove %{resource}"
6
+ add: Add %{resource}
7
+ remove: Remove %{resource}
@@ -0,0 +1,7 @@
1
+ ---
2
+ ja:
3
+ administrate:
4
+ fields:
5
+ nested_has_many:
6
+ add: "%{resource}を追加"
7
+ remove: "%{resource}を削除"
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.0.0
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-10 00:00:00.000000000 Z
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.3
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