decidim-templates 0.28.0 → 0.28.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/decidim/templates/admin/block_user_templates_controller.rb +2 -0
  3. data/app/controllers/decidim/templates/admin/proposal_answer_templates_controller.rb +5 -1
  4. data/app/controllers/decidim/templates/admin/questionnaire_templates_controller.rb +2 -0
  5. data/app/packs/src/decidim/templates/admin/proposal_answer_template_chooser.js +15 -4
  6. data/app/permissions/decidim/templates/admin/permissions.rb +30 -8
  7. data/app/views/decidim/templates/admin/block_user_templates/edit.html.erb +2 -2
  8. data/app/views/decidim/templates/admin/block_user_templates/index.html.erb +2 -2
  9. data/app/views/decidim/templates/admin/block_user_templates/new.html.erb +2 -2
  10. data/app/views/decidim/templates/admin/proposal_answer_templates/edit.html.erb +2 -2
  11. data/app/views/decidim/templates/admin/proposal_answer_templates/index.html.erb +2 -2
  12. data/app/views/decidim/templates/admin/proposal_answer_templates/new.html.erb +2 -2
  13. data/app/views/decidim/templates/admin/questionnaire_templates/_choose.html.erb +2 -2
  14. data/app/views/decidim/templates/admin/questionnaire_templates/_preview.html.erb +1 -1
  15. data/app/views/decidim/templates/admin/questionnaire_templates/edit.html.erb +2 -2
  16. data/app/views/decidim/templates/admin/questionnaire_templates/index.html.erb +2 -2
  17. data/app/views/decidim/templates/admin/questionnaire_templates/new.html.erb +2 -2
  18. data/app/views/decidim/templates/admin/questionnaire_templates/preview.js.erb +1 -1
  19. data/config/locales/bg.yml +111 -0
  20. data/config/locales/ca.yml +2 -1
  21. data/config/locales/cs.yml +2 -1
  22. data/config/locales/de.yml +2 -1
  23. data/config/locales/en.yml +2 -1
  24. data/config/locales/es-MX.yml +2 -1
  25. data/config/locales/es-PY.yml +2 -1
  26. data/config/locales/es.yml +2 -1
  27. data/config/locales/eu.yml +0 -1
  28. data/config/locales/fi-plain.yml +0 -1
  29. data/config/locales/fi.yml +0 -1
  30. data/config/locales/fr-CA.yml +1 -2
  31. data/config/locales/fr.yml +1 -2
  32. data/config/locales/he-IL.yml +1 -0
  33. data/config/locales/hu.yml +8 -0
  34. data/config/locales/ja.yml +16 -1
  35. data/config/locales/pl.yml +4 -0
  36. data/config/locales/pt-BR.yml +3 -0
  37. data/config/locales/tr-TR.yml +2 -0
  38. data/decidim-templates.gemspec +40 -0
  39. data/lib/decidim/templates/admin_engine.rb +1 -4
  40. data/lib/decidim/templates/test/factories.rb +15 -9
  41. data/lib/decidim/templates/test/shared_examples/uses_questionnaire_templates.rb +2 -2
  42. data/lib/decidim/templates/version.rb +1 -1
  43. metadata +46 -18
  44. data/LICENSE-AGPLv3.txt +0 -661
  45. data/config/environment.rb +0 -3
@@ -10,7 +10,6 @@ ja:
10
10
  decidim:
11
11
  admin:
12
12
  menu:
13
- manage: 管理
14
13
  templates: テンプレート
15
14
  templates:
16
15
  actions:
@@ -62,7 +61,22 @@ ja:
62
61
  edit:
63
62
  title: 提案回答テンプレートを編集
64
63
  form:
64
+ component_constraint_help: '「提案」型のコンポーネントを持つ参加型スペースのみが表示されることに注意してください。'
65
+ hint1_html: "<strong>%{organization}</strong> は組織名に置き換えられます"
66
+ hint2_html: "<strong>%{name}</strong> は作成者の名前に置き換えられます"
67
+ hint3_html: "<strong>%{admin}</strong> は管理者の名前(提案に回答した者)に置き換えられます"
68
+ hint_html: "<strong>ヒント:</strong> テンプレート使用時に置き換えられる回答テンプレート上の任意の場所でこれらの変数を使用できます"
65
69
  save: 保存
70
+ index:
71
+ component_constraint: 制約を追加
72
+ confirm_delete: このテンプレートを削除してもよろしいですか?
73
+ global_scope: グローバル (どこでも利用可能)
74
+ internal_state: 内部状態
75
+ title: 提案の回答
76
+ new:
77
+ title: 新しい提案回答テンプレート
78
+ template_chooser:
79
+ select_template: テンプレート回答を選択
66
80
  questionnaire_templates:
67
81
  choose:
68
82
  create_from_template: テンプレートから作る
@@ -94,4 +108,5 @@ ja:
94
108
  update: "%{user_name} が %{resource_name} アンケートテンプレートを更新しました"
95
109
  template_types:
96
110
  block_user: ユーザーメッセージをブロック
111
+ proposal_answer_templates: 提案の回答
97
112
  questionnaires: アンケート
@@ -30,9 +30,13 @@ pl:
30
30
  block_user_templates:
31
31
  form:
32
32
  save: Zapisz
33
+ index:
34
+ title: Blokuj wiadomości użytkownika
33
35
  proposal_answer_templates:
34
36
  form:
35
37
  save: Zapisz
38
+ index:
39
+ internal_state: Stan wewnętrzny
36
40
  questionnaire_templates:
37
41
  choose:
38
42
  create_from_template: Utwórz z szablonu
@@ -61,6 +61,9 @@ pt-BR:
61
61
  tos_agreement: Ao participar você aceita os Termos de Serviço
62
62
  admin_log:
63
63
  template:
64
+ create: "O %{user_name} criou o modelo de questionário %{resource_name}"
65
+ delete: "%{user_name} excluiu o modelo de questionário %{resource_name}"
66
+ duplicate: "%{user_name} duplicou o modelo de questionário %{resource_name}"
64
67
  update: "%{user_name} atualizou o modelo de questionário %{resource_name}"
65
68
  template_types:
66
69
  questionnaires: Questionários
@@ -35,6 +35,8 @@ tr:
35
35
  proposal_answer_templates:
36
36
  form:
37
37
  save: Kaydet
38
+ index:
39
+ internal_state: İçsel durum
38
40
  questionnaire_templates:
39
41
  choose:
40
42
  create_from_template: Şablondan Oluştur
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ $LOAD_PATH.push File.expand_path("lib", __dir__)
4
+
5
+ require "decidim/templates/version"
6
+
7
+ Gem::Specification.new do |s|
8
+ s.version = Decidim::Templates.version
9
+ s.authors = ["Vera Rojman"]
10
+ s.email = ["vrojman@protonmail.com"]
11
+ s.license = "AGPL-3.0"
12
+ s.homepage = "https://decidim.org"
13
+ s.metadata = {
14
+ "bug_tracker_uri" => "https://github.com/decidim/decidim/issues",
15
+ "documentation_uri" => "https://docs.decidim.org/",
16
+ "funding_uri" => "https://opencollective.com/decidim",
17
+ "homepage_uri" => "https://decidim.org",
18
+ "source_code_uri" => "https://github.com/decidim/decidim"
19
+ }
20
+ s.required_ruby_version = "~> 3.1.0"
21
+
22
+ s.name = "decidim-templates"
23
+ s.summary = "A decidim templates module"
24
+ s.description = "This module provides a solution to create templates for different Decidim models, such as Proposals and Questionnaires.."
25
+
26
+ s.files = Dir.chdir(__dir__) do
27
+ `git ls-files -z`.split("\x0").select do |f|
28
+ (File.expand_path(f) == __FILE__) ||
29
+ f.start_with?(*%w(app/ config/ db/ lib/ Rakefile README.md))
30
+ end
31
+ end
32
+
33
+ s.add_dependency "decidim-core", Decidim::Templates.version
34
+ s.add_dependency "decidim-forms", Decidim::Templates.version
35
+
36
+ s.add_development_dependency "decidim-admin", Decidim::Templates.version
37
+ s.add_development_dependency "decidim-dev", Decidim::Templates.version
38
+ s.add_development_dependency "decidim-participatory_processes", Decidim::Templates.version
39
+ s.add_development_dependency "decidim-surveys", Decidim::Templates.version
40
+ end
@@ -49,11 +49,8 @@ module Decidim
49
49
  root to: "questionnaire_templates#index"
50
50
  end
51
51
 
52
- initializer "decidim_templates_admin.participatory_processes_menu" do
53
- Decidim::Templates::Menu.register_admin_template_types_menu!
54
- end
55
-
56
52
  initializer "decidim_templates_admin.menu" do
53
+ Decidim::Templates::Menu.register_admin_template_types_menu!
57
54
  Decidim::Templates::Menu.register_admin_menu!
58
55
  end
59
56
 
@@ -5,11 +5,14 @@ require "decidim/dev"
5
5
 
6
6
  FactoryBot.define do
7
7
  factory :template, class: "Decidim::Templates::Template" do
8
+ transient do
9
+ skip_injection { false }
10
+ end
8
11
  organization
9
- name { Decidim::Faker::Localized.sentence }
10
- description { Decidim::Faker::Localized.sentence }
12
+ name { generate_localized_title(:template_name, skip_injection:) }
13
+ description { generate_localized_title(:template_description, skip_injection:) }
11
14
  target { "generic-template" }
12
- templatable { build(:dummy_resource) }
15
+ templatable { build(:dummy_resource, skip_injection:) }
13
16
 
14
17
  trait :user_block do
15
18
  templatable { organization }
@@ -24,24 +27,27 @@ FactoryBot.define do
24
27
 
25
28
  ## Questionnaire templates
26
29
  factory :questionnaire_template do
30
+ transient do
31
+ skip_injection { false }
32
+ end
27
33
  target { "questionnaire" }
28
34
 
29
35
  trait :with_questions do
30
- after(:create) do |template|
31
- template.templatable = create(:questionnaire, :with_questions, questionnaire_for: template)
36
+ after(:create) do |template, evaluator|
37
+ template.templatable = create(:questionnaire, :with_questions, questionnaire_for: template, skip_injection: evaluator.skip_injection)
32
38
  template.save!
33
39
  end
34
40
  end
35
41
 
36
42
  trait :with_all_questions do
37
- after(:create) do |template|
38
- template.templatable = create(:questionnaire, :with_all_questions, questionnaire_for: template)
43
+ after(:create) do |template, evaluator|
44
+ template.templatable = create(:questionnaire, :with_all_questions, questionnaire_for: template, skip_injection: evaluator.skip_injection)
39
45
  template.save!
40
46
  end
41
47
  end
42
48
 
43
- after(:create) do |template|
44
- template.templatable = create(:questionnaire, questionnaire_for: template)
49
+ after(:create) do |template, evaluator|
50
+ template.templatable = create(:questionnaire, questionnaire_for: template, skip_injection: evaluator.skip_injection)
45
51
  template.save!
46
52
  end
47
53
  end
@@ -20,7 +20,7 @@ shared_examples_for "uses questionnaire templates" do |_questionnaire_for|
20
20
  end
21
21
 
22
22
  context "when there are templates" do
23
- let!(:templates) { create_list(:questionnaire_template, 6, :with_questions, organization: questionnaire.questionnaire_for.organization) }
23
+ let!(:templates) { create_list(:questionnaire_template, 6, :with_questions, skip_injection: true, organization: questionnaire.questionnaire_for.organization) }
24
24
  let(:template) { templates.first }
25
25
  let(:question) { template.templatable.questions.first }
26
26
 
@@ -74,7 +74,7 @@ shared_examples_for "uses questionnaire templates" do |_questionnaire_for|
74
74
  end
75
75
 
76
76
  describe "apply a template" do
77
- let!(:templates) { create_list(:questionnaire_template, 6, :with_questions, organization: questionnaire.questionnaire_for.organization) }
77
+ let!(:templates) { create_list(:questionnaire_template, 6, :with_questions, skip_injection: true, organization: questionnaire.questionnaire_for.organization) }
78
78
  let(:template) { templates.first }
79
79
  let(:question) { template.templatable.questions.first }
80
80
  let(:questionnaire_question) { questionnaire.questions.first }
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds the decidim-templates version.
5
5
  module Templates
6
6
  def self.version
7
- "0.28.0"
7
+ "0.28.1"
8
8
  end
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-templates
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.28.0
4
+ version: 0.28.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vera Rojman
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-20 00:00:00.000000000 Z
11
+ date: 2024-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: decidim-core
@@ -16,56 +16,84 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.28.0
19
+ version: 0.28.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.28.0
26
+ version: 0.28.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: decidim-forms
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 0.28.0
33
+ version: 0.28.1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 0.28.0
40
+ version: 0.28.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: decidim-admin
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 0.28.0
47
+ version: 0.28.1
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 0.28.0
54
+ version: 0.28.1
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: decidim-dev
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 0.28.0
61
+ version: 0.28.1
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: 0.28.0
68
+ version: 0.28.1
69
+ - !ruby/object:Gem::Dependency
70
+ name: decidim-participatory_processes
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '='
74
+ - !ruby/object:Gem::Version
75
+ version: 0.28.1
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '='
81
+ - !ruby/object:Gem::Version
82
+ version: 0.28.1
83
+ - !ruby/object:Gem::Dependency
84
+ name: decidim-surveys
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '='
88
+ - !ruby/object:Gem::Version
89
+ version: 0.28.1
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '='
95
+ - !ruby/object:Gem::Version
96
+ version: 0.28.1
69
97
  description: This module provides a solution to create templates for different Decidim
70
98
  models, such as Proposals and Questionnaires..
71
99
  email:
@@ -74,7 +102,6 @@ executables: []
74
102
  extensions: []
75
103
  extra_rdoc_files: []
76
104
  files:
77
- - LICENSE-AGPLv3.txt
78
105
  - README.md
79
106
  - Rakefile
80
107
  - app/commands/decidim/templates/admin/apply_questionnaire_template.rb
@@ -133,7 +160,6 @@ files:
133
160
  - app/views/decidim/templates/admin/questionnaire_templates/preview.js.erb
134
161
  - app/views/layouts/decidim/admin/templates.html.erb
135
162
  - config/assets.rb
136
- - config/environment.rb
137
163
  - config/locales/am-ET.yml
138
164
  - config/locales/ar.yml
139
165
  - config/locales/bg.yml
@@ -158,6 +184,7 @@ files:
158
184
  - config/locales/ga-IE.yml
159
185
  - config/locales/gl.yml
160
186
  - config/locales/gn-PY.yml
187
+ - config/locales/he-IL.yml
161
188
  - config/locales/hr.yml
162
189
  - config/locales/hu.yml
163
190
  - config/locales/id-ID.yml
@@ -203,6 +230,7 @@ files:
203
230
  - db/migrate/20200518093819_create_decidim_templates.rb
204
231
  - db/migrate/20221006055954_add_field_values_and_target_to_decidim_templates.rb
205
232
  - db/seeds.rb
233
+ - decidim-templates.gemspec
206
234
  - lib/decidim/templates.rb
207
235
  - lib/decidim/templates/admin.rb
208
236
  - lib/decidim/templates/admin_engine.rb
@@ -221,23 +249,23 @@ metadata:
221
249
  funding_uri: https://opencollective.com/decidim
222
250
  homepage_uri: https://decidim.org
223
251
  source_code_uri: https://github.com/decidim/decidim
224
- post_install_message:
252
+ post_install_message:
225
253
  rdoc_options: []
226
254
  require_paths:
227
255
  - lib
228
256
  required_ruby_version: !ruby/object:Gem::Requirement
229
257
  requirements:
230
- - - ">="
258
+ - - "~>"
231
259
  - !ruby/object:Gem::Version
232
- version: '3.1'
260
+ version: 3.1.0
233
261
  required_rubygems_version: !ruby/object:Gem::Requirement
234
262
  requirements:
235
263
  - - ">="
236
264
  - !ruby/object:Gem::Version
237
265
  version: '0'
238
266
  requirements: []
239
- rubygems_version: 3.4.22
240
- signing_key:
267
+ rubygems_version: 3.5.9
268
+ signing_key:
241
269
  specification_version: 4
242
270
  summary: A decidim templates module
243
271
  test_files: []