decidim-term_customizer 0.16.1 → 0.16.2

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: c56c7da03b27c3f194772872e09e573a25bf780149a6f1486baf8577fc991e6a
4
- data.tar.gz: fc23655eee6230889d6f859458e5a46b8d636a09d61f8749cb186ada121c3f46
3
+ metadata.gz: 27b03f1b6e89c49590b0dd6f2e1249345840dfcce3ee28207222076f9913960b
4
+ data.tar.gz: 2ec7693099979699e50afc5c07c7dcab103e2baef08b26fa0e1d34a07cf06d43
5
5
  SHA512:
6
- metadata.gz: a205919d276b877c7cbd4b94edf21e6bfebffd62d5c94f1a458cfe0d3147c11b92d14801e96bbb6dad02b37a4595fc02a4dfcdbec953b6b71e46e0ab45ef42f4
7
- data.tar.gz: bd83fd4e13a93a15a71ba2dbffcfe23731d9c75541ff0bf76e930f933ed43db853457658fbc246702148c6873787266011c6cce8e54abbe2a838a6d146bcc0fa
6
+ metadata.gz: 81aec8dcf529a1dc7168633f431923499b0bc7bd40dd194b465fac5c9aab1d07ad552ccd36a025430ef42ba907feb85142567d3c6af7daec937c6b4477edd086
7
+ data.tar.gz: 6146ac4df2e01822ca8b2d1b94faae3bcd02c91f3e8a44fdf6c6154202b9144c5f92fe8439f3d002eaec18612a3bb18344e64dbf1ca1b07cf984bd2e6d6c2f25
@@ -34,14 +34,14 @@ end
34
34
  <div class="manifest-container" data-manifest="<%= manifest.name %>">
35
35
  <% models = manifest.model_class_name.constantize.where(organization: current_organization) %>
36
36
 
37
- <%= fields_for "constraints[#{index}][subject_model][#{manifest.name}]" do |subject_fields| %>
37
+ <%= fields_for "constraints[#{index}][subject_model][#{manifest.name}]", constraint do |subject_fields| %>
38
38
  <div class="row column">
39
39
  <%= subject_fields.hidden_field :subject_manifest, value: manifest.name.to_s %>
40
40
  <%= subject_fields.select :subject_id, models.map { |m| [translated_attribute(m.title), m.id] }, { selected: selected_space, include_blank: true }, class: "constraint-subject-model-selector" %>
41
41
  </div>
42
42
 
43
43
  <% models.each do |model| %>
44
- <%= fields_for "constraints[#{index}][subject_model][#{manifest.name}][component_model][#{model.id}]" do |component_fields| %>
44
+ <%= fields_for "constraints[#{index}][subject_model][#{manifest.name}][component_model][#{model.id}]", constraint do |component_fields| %>
45
45
  <div class="row column component-container" data-components="<%= model.id %>">
46
46
  <%= component_fields.hidden_field :subject_id, value: model.id %>
47
47
  <%= component_fields.select :component_id, model.components.map { |c| [translated_attribute(c.name), c.id] }, selected: selected_component, include_blank: true %>
@@ -1,4 +1,15 @@
1
1
  en:
2
+ activemodel:
3
+ attributes:
4
+ constraint:
5
+ component_id: Component
6
+ subject_id: Participatory space
7
+ subject_manifest: Participatory space type
8
+ translation:
9
+ key: Translation key
10
+ value: Customized term
11
+ translation_set:
12
+ name: Name
2
13
  decidim:
3
14
  admin:
4
15
  actions:
@@ -12,7 +23,7 @@ en:
12
23
  name: Name
13
24
  translations:
14
25
  fields:
15
- key: Key
26
+ key: Translation key
16
27
  original_term: Original term
17
28
  term: Customized term
18
29
  titles:
@@ -1,4 +1,15 @@
1
1
  fi:
2
+ activemodel:
3
+ attributes:
4
+ constraint:
5
+ component_id: Komponentti
6
+ subject_id: Osallisuustila
7
+ subject_manifest: Osallisuustilan tyyppi
8
+ translation:
9
+ key: Käännösavain
10
+ value: Kustomoitu termi
11
+ translation_set:
12
+ name: Nimi
2
13
  decidim:
3
14
  admin:
4
15
  actions:
@@ -12,7 +23,7 @@ fi:
12
23
  name: Nimi
13
24
  translations:
14
25
  fields:
15
- key: Avain
26
+ key: Käännösavain
16
27
  original_term: Alkuperäinen termi
17
28
  term: Kustomoitu termi
18
29
  titles:
@@ -1,4 +1,15 @@
1
1
  sv:
2
+ activemodel:
3
+ attributes:
4
+ constraint:
5
+ component_id: Component
6
+ subject_id: Participatory space
7
+ subject_manifest: Participatory space type
8
+ translation:
9
+ key: Translation key
10
+ value: Customized term
11
+ translation_set:
12
+ name: Name
2
13
  decidim:
3
14
  admin:
4
15
  actions:
@@ -12,7 +23,7 @@ sv:
12
23
  name: Name
13
24
  translations:
14
25
  fields:
15
- key: Key
26
+ key: Translation key
16
27
  original_term: Original term
17
28
  term: Customized term
18
29
  titles:
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ class CreateDecidimTermCustomizerTranslationSets < ActiveRecord::Migration[5.2]
4
+ def change
5
+ create_table :decidim_term_customizer_translation_sets do |t|
6
+ t.jsonb :name
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ class CreateDecidimTermCustomizerTranslations < ActiveRecord::Migration[5.2]
4
+ def change
5
+ create_table :decidim_term_customizer_translations do |t|
6
+ t.string :locale
7
+ t.string :key
8
+ t.text :value
9
+
10
+ t.references(
11
+ :translation_set,
12
+ null: false,
13
+ foreign_key: { to_table: :decidim_term_customizer_translation_sets },
14
+ index: { name: "decidim_term_customizer_translation_translation_set" }
15
+ )
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ class CreateDecidimTermCustomizerConstraints < ActiveRecord::Migration[5.2]
4
+ def change
5
+ create_table :decidim_term_customizer_constraints do |t|
6
+ t.references :decidim_organization, null: false, foreign_key: true, index: { name: "decidim_term_customizer_constraint_organization" }
7
+ t.references :subject, polymorphic: true, index: { name: "decidim_term_customizer_constraint_subject" }
8
+
9
+ t.references(
10
+ :translation_set,
11
+ null: false,
12
+ foreign_key: { to_table: :decidim_term_customizer_translation_sets },
13
+ index: { name: "decidim_term_customizer_constraint_translation_set" }
14
+ )
15
+ end
16
+ end
17
+ end
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Decidim
4
4
  module TermCustomizer
5
- VERSION = "0.16.1"
5
+ VERSION = "0.16.2"
6
6
  DECIDIM_VERSION = "~> 0.16.0"
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-term_customizer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.1
4
+ version: 0.16.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Antti Hukkanen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-24 00:00:00.000000000 Z
11
+ date: 2019-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: decidim-admin
@@ -133,6 +133,9 @@ files:
133
133
  - config/locales/en.yml
134
134
  - config/locales/fi.yml
135
135
  - config/locales/sv.yml
136
+ - db/migrate/20190217132503_create_decidim_term_customizer_translation_sets.rb
137
+ - db/migrate/20190217132654_create_decidim_term_customizer_translations.rb
138
+ - db/migrate/20190217132726_create_decidim_term_customizer_constraints.rb
136
139
  - lib/decidim/term_customizer.rb
137
140
  - lib/decidim/term_customizer/admin.rb
138
141
  - lib/decidim/term_customizer/admin_engine.rb