decidim-templates 0.27.8 → 0.28.0.rc4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE-AGPLv3.txt +661 -0
  3. data/app/commands/decidim/templates/admin/apply_questionnaire_template.rb +1 -1
  4. data/app/commands/decidim/templates/admin/copy_proposal_answer_template.rb +21 -0
  5. data/app/commands/decidim/templates/admin/copy_questionnaire_template.rb +3 -33
  6. data/app/commands/decidim/templates/admin/copy_template.rb +43 -0
  7. data/app/commands/decidim/templates/admin/create_block_user_template.rb +15 -0
  8. data/app/commands/decidim/templates/admin/create_proposal_answer_template.rb +47 -0
  9. data/app/commands/decidim/templates/admin/create_questionnaire_template.rb +6 -19
  10. data/app/commands/decidim/templates/admin/create_template.rb +54 -0
  11. data/app/commands/decidim/templates/admin/destroy_questionnaire_template.rb +22 -0
  12. data/app/commands/decidim/templates/admin/update_proposal_answer_template.rb +51 -0
  13. data/app/commands/decidim/templates/admin/update_template.rb +6 -0
  14. data/app/controllers/decidim/templates/admin/application_controller.rb +0 -8
  15. data/app/controllers/decidim/templates/admin/block_user_templates_controller.rb +124 -0
  16. data/app/controllers/decidim/templates/admin/concerns/templatable.rb +1 -1
  17. data/app/controllers/decidim/templates/admin/proposal_answer_templates_controller.rb +173 -0
  18. data/app/controllers/decidim/templates/admin/questionnaire_templates_controller.rb +4 -4
  19. data/app/forms/decidim/templates/admin/proposal_answer_template_form.rb +23 -0
  20. data/app/helpers/decidim/templates/admin/application_helper.rb +18 -0
  21. data/app/models/decidim/templates/template.rb +0 -6
  22. data/app/packs/entrypoints/decidim_templates_admin.js +2 -0
  23. data/app/packs/src/decidim/templates/admin/block_user_template_chooser.js +20 -0
  24. data/app/packs/src/decidim/templates/admin/proposal_answer_template_chooser.js +31 -0
  25. data/app/packs/stylesheets/decidim/templates/templates.scss +3 -12
  26. data/app/presenters/decidim/templates/admin_log/template_presenter.rb +2 -2
  27. data/app/views/decidim/templates/admin/block_user_templates/_form.html.erb +13 -0
  28. data/app/views/decidim/templates/admin/block_user_templates/_template_chooser.html.erb +12 -0
  29. data/app/views/decidim/templates/admin/block_user_templates/edit.html.erb +18 -0
  30. data/app/views/decidim/templates/admin/block_user_templates/index.html.erb +45 -0
  31. data/app/views/decidim/templates/admin/block_user_templates/new.html.erb +18 -0
  32. data/app/views/decidim/templates/admin/proposal_answer_templates/_form.html.erb +38 -0
  33. data/app/views/decidim/templates/admin/proposal_answer_templates/_template_chooser.html.erb +16 -0
  34. data/app/views/decidim/templates/admin/proposal_answer_templates/edit.html.erb +18 -0
  35. data/app/views/decidim/templates/admin/proposal_answer_templates/index.html.erb +51 -0
  36. data/app/views/decidim/templates/admin/proposal_answer_templates/new.html.erb +18 -0
  37. data/app/views/decidim/templates/admin/questionnaire_templates/_choose.html.erb +35 -35
  38. data/app/views/decidim/templates/admin/questionnaire_templates/_form.html.erb +9 -12
  39. data/app/views/decidim/templates/admin/questionnaire_templates/_preview.html.erb +52 -60
  40. data/app/views/decidim/templates/admin/questionnaire_templates/edit.html.erb +31 -16
  41. data/app/views/decidim/templates/admin/questionnaire_templates/index.html.erb +6 -8
  42. data/app/views/decidim/templates/admin/questionnaire_templates/new.html.erb +18 -7
  43. data/app/views/decidim/templates/admin/questionnaire_templates/preview.js.erb +4 -1
  44. data/app/views/layouts/decidim/admin/templates.html.erb +1 -9
  45. data/config/assets.rb +2 -1
  46. data/config/locales/ar.yml +8 -2
  47. data/config/locales/bg.yml +0 -73
  48. data/config/locales/ca.yml +47 -8
  49. data/config/locales/cs.yml +47 -8
  50. data/config/locales/de.yml +47 -8
  51. data/config/locales/en.yml +47 -8
  52. data/config/locales/es-MX.yml +47 -8
  53. data/config/locales/es-PY.yml +47 -8
  54. data/config/locales/es.yml +47 -8
  55. data/config/locales/eu.yml +47 -8
  56. data/config/locales/fi-plain.yml +47 -8
  57. data/config/locales/fi.yml +47 -8
  58. data/config/locales/fr-CA.yml +33 -8
  59. data/config/locales/fr.yml +47 -8
  60. data/config/locales/ga-IE.yml +6 -2
  61. data/config/locales/gl.yml +6 -10
  62. data/config/locales/hu.yml +6 -10
  63. data/config/locales/it.yml +6 -10
  64. data/config/locales/ja.yml +28 -8
  65. data/config/locales/kaa.yml +4 -1
  66. data/config/locales/lt.yml +18 -8
  67. data/config/locales/nl.yml +6 -11
  68. data/config/locales/no.yml +6 -10
  69. data/config/locales/pl.yml +6 -24
  70. data/config/locales/pt-BR.yml +6 -16
  71. data/config/locales/pt.yml +6 -10
  72. data/config/locales/ro-RO.yml +18 -8
  73. data/config/locales/sv.yml +6 -2
  74. data/config/locales/tr-TR.yml +8 -10
  75. data/config/locales/zh-CN.yml +6 -11
  76. data/config/locales/zh-TW.yml +18 -8
  77. data/db/migrate/20221006055954_add_field_values_and_target_to_decidim_templates.rb +21 -0
  78. data/db/seeds.rb +6 -6
  79. data/lib/decidim/templates/admin_engine.rb +22 -17
  80. data/lib/decidim/templates/engine.rb +4 -0
  81. data/lib/decidim/templates/menu.rb +48 -0
  82. data/lib/decidim/templates/test/factories.rb +23 -15
  83. data/lib/decidim/templates/test/shared_examples/copies_all_questionnaire_contents_examples.rb +3 -3
  84. data/lib/decidim/templates/test/shared_examples/uses_questionnaire_templates.rb +10 -8
  85. data/lib/decidim/templates/version.rb +1 -1
  86. metadata +49 -47
  87. data/config/locales/he-IL.yml +0 -1
  88. data/decidim-templates.gemspec +0 -33
data/db/seeds.rb CHANGED
@@ -6,7 +6,7 @@ if !Rails.env.production? || ENV.fetch("SEED", nil)
6
6
  require "decidim/faker/localized"
7
7
 
8
8
  # Since we usually migrate and seed in the same process, make sure
9
- # that we don't have invalid or cached information after a migration.
9
+ # that we do not have invalid or cached information after a migration.
10
10
  decidim_tables = ActiveRecord::Base.connection.tables.select do |table|
11
11
  table.starts_with?("decidim_")
12
12
  end
@@ -17,7 +17,7 @@ if !Rails.env.production? || ENV.fetch("SEED", nil)
17
17
  organization = Decidim::Organization.first
18
18
 
19
19
  questionnaire_template = Decidim::Templates::Template.create!(
20
- organization: organization,
20
+ organization:,
21
21
  name: Decidim::Faker::Localized.sentence(word_count: 2),
22
22
  description: Decidim::Faker::Localized.paragraph
23
23
  )
@@ -35,7 +35,7 @@ if !Rails.env.production? || ENV.fetch("SEED", nil)
35
35
 
36
36
  %w(short_answer long_answer).each_with_index do |text_question_type, index|
37
37
  Decidim::Forms::Question.create!(
38
- questionnaire: questionnaire,
38
+ questionnaire:,
39
39
  body: Decidim::Faker::Localized.paragraph,
40
40
  question_type: text_question_type,
41
41
  position: index
@@ -44,7 +44,7 @@ if !Rails.env.production? || ENV.fetch("SEED", nil)
44
44
 
45
45
  %w(single_option multiple_option).each_with_index do |multiple_choice_question_type, index|
46
46
  question = Decidim::Forms::Question.create!(
47
- questionnaire: questionnaire,
47
+ questionnaire:,
48
48
  body: Decidim::Faker::Localized.paragraph,
49
49
  question_type: multiple_choice_question_type,
50
50
  position: index + 2
@@ -56,7 +56,7 @@ if !Rails.env.production? || ENV.fetch("SEED", nil)
56
56
 
57
57
  question.display_conditions.create!(
58
58
  condition_question: questionnaire.questions.find_by(position: question.position - 2),
59
- question: question,
59
+ question:,
60
60
  condition_type: :answered,
61
61
  mandatory: true
62
62
  )
@@ -64,7 +64,7 @@ if !Rails.env.production? || ENV.fetch("SEED", nil)
64
64
 
65
65
  %w(matrix_single matrix_multiple).each do |matrix_question_type|
66
66
  question = Decidim::Forms::Question.create!(
67
- questionnaire: questionnaire,
67
+ questionnaire:,
68
68
  body: Decidim::Faker::Localized.paragraph,
69
69
  question_type: matrix_question_type
70
70
  )
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "decidim/templates/menu"
4
+
3
5
  module Decidim
4
6
  module Templates
5
7
  # This is the engine that runs on the public interface of `Templates`.
@@ -10,6 +12,15 @@ module Decidim
10
12
  paths["lib/tasks"] = nil
11
13
 
12
14
  routes do
15
+ resources :proposal_answer_templates do
16
+ member do
17
+ post :copy
18
+ end
19
+ collection do
20
+ get :fetch
21
+ end
22
+ end
23
+
13
24
  ## Routes for Questionnaire Templates
14
25
  resources :questionnaire_templates do
15
26
  member do
@@ -24,32 +35,26 @@ module Decidim
24
35
  get :preview # To provide a preview for the template in the object creation view
25
36
  end
26
37
  end
38
+ resources :block_user_templates do
39
+ member do
40
+ post :copy
41
+ end
42
+ collection do
43
+ get :fetch
44
+ end
45
+ end
27
46
 
28
47
  get "/questionnaire_template/questionnaire/answer_options", to: "questionnaires#answer_options", as: "answer_options_template"
29
48
 
30
49
  root to: "questionnaire_templates#index"
31
50
  end
32
51
 
33
- initializer "decidim_participatory_processes.admin_participatory_processes_menu" do
34
- Decidim.menu :admin_template_types_menu do |menu|
35
- template_types.each_pair do |name, url|
36
- menu.add_item name, name, url,
37
- if: allowed_to?(:index, :templates),
38
- active: is_active_link?(url)
39
- end
40
- end
52
+ initializer "decidim_templates_admin.participatory_processes_menu" do
53
+ Decidim::Templates::Menu.register_admin_template_types_menu!
41
54
  end
42
55
 
43
56
  initializer "decidim_templates_admin.menu" do
44
- Decidim.menu :admin_menu do |menu|
45
- menu.add_item :questionnaire_templates,
46
- I18n.t("menu.templates", scope: "decidim.admin", default: "Templates"),
47
- decidim_admin_templates.questionnaire_templates_path,
48
- icon_name: "document",
49
- position: 12,
50
- active: :inclusive,
51
- if: allowed_to?(:read, :templates)
52
- end
57
+ Decidim::Templates::Menu.register_admin_menu!
53
58
  end
54
59
 
55
60
  def load_seed
@@ -15,6 +15,10 @@ module Decidim
15
15
  # root to: "templates#index"
16
16
  end
17
17
 
18
+ initializer "decidim_templates.register_icons" do
19
+ Decidim.icons.register(name: "user-forbid-line", icon: "user-forbid-line", category: "system", description: "", engine: :templates)
20
+ end
21
+
18
22
  initializer "decidim_templates.webpacker.assets_path" do
19
23
  Decidim.register_assets_path File.expand_path("app/packs", root)
20
24
  end
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Templates
5
+ class Menu
6
+ def self.register_admin_template_types_menu!
7
+ Decidim.menu :admin_template_types_menu do |menu|
8
+ menu.add_item :questionnaires,
9
+ I18n.t("template_types.questionnaires", scope: "decidim.templates"),
10
+ decidim_admin_templates.questionnaire_templates_path,
11
+ icon_name: "clipboard-line",
12
+ if: allowed_to?(:index, :templates),
13
+ active: (
14
+ is_active_link?(decidim_admin_templates.questionnaire_templates_path) ||
15
+ is_active_link?(decidim_admin_templates.root_path)
16
+ ) && !is_active_link?(decidim_admin_templates.block_user_templates_path) &&
17
+ !is_active_link?(decidim_admin_templates.proposal_answer_templates_path)
18
+
19
+ menu.add_item :user_reports,
20
+ I18n.t("template_types.block_user", scope: "decidim.templates"),
21
+ decidim_admin_templates.block_user_templates_path,
22
+ icon_name: "user-forbid-line",
23
+ if: allowed_to?(:index, :templates),
24
+ active: is_active_link?(decidim_admin_templates.block_user_templates_path)
25
+
26
+ menu.add_item :proposal_answers,
27
+ I18n.t("template_types.proposal_answer_templates", scope: "decidim.templates"),
28
+ decidim_admin_templates.proposal_answer_templates_path,
29
+ icon_name: "file-copy-line",
30
+ if: allowed_to?(:index, :templates),
31
+ active: is_active_link?(decidim_admin_templates.proposal_answer_templates_path)
32
+ end
33
+ end
34
+
35
+ def self.register_admin_menu!
36
+ Decidim.menu :admin_menu do |menu|
37
+ menu.add_item :questionnaire_templates,
38
+ I18n.t("menu.templates", scope: "decidim.admin", default: "Templates"),
39
+ decidim_admin_templates.questionnaire_templates_path,
40
+ icon_name: "file-copy-line",
41
+ position: 12,
42
+ active: is_active_link?(decidim_admin_templates.root_path),
43
+ if: allowed_to?(:read, :templates)
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
@@ -5,35 +5,43 @@ 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
11
8
  organization
12
- name { generate_localized_title(:template_name, skip_injection: skip_injection) }
13
- description { generate_localized_title(:template_description, skip_injection: skip_injection) }
14
- templatable { build(:dummy_resource, skip_injection: skip_injection) }
9
+ name { Decidim::Faker::Localized.sentence }
10
+ description { Decidim::Faker::Localized.sentence }
11
+ target { "generic-template" }
12
+ templatable { build(:dummy_resource) }
13
+
14
+ trait :user_block do
15
+ templatable { organization }
16
+ target { :user_block }
17
+ end
18
+
19
+ trait :proposal_answer do
20
+ templatable { organization }
21
+ target { :proposal_answer }
22
+ field_values { { internal_state: :accepted } }
23
+ end
15
24
 
16
25
  ## Questionnaire templates
17
26
  factory :questionnaire_template do
18
- transient do
19
- skip_injection { false }
20
- end
27
+ target { "questionnaire" }
28
+
21
29
  trait :with_questions do
22
- after(:create) do |template, evaluator|
23
- template.templatable = create(:questionnaire, :with_questions, questionnaire_for: template, skip_injection: evaluator.skip_injection)
30
+ after(:create) do |template|
31
+ template.templatable = create(:questionnaire, :with_questions, questionnaire_for: template)
24
32
  template.save!
25
33
  end
26
34
  end
27
35
 
28
36
  trait :with_all_questions do
29
- after(:create) do |template, evaluator|
30
- template.templatable = create(:questionnaire, :with_all_questions, questionnaire_for: template, skip_injection: evaluator.skip_injection)
37
+ after(:create) do |template|
38
+ template.templatable = create(:questionnaire, :with_all_questions, questionnaire_for: template)
31
39
  template.save!
32
40
  end
33
41
  end
34
42
 
35
- after(:create) do |template, evaluator|
36
- template.templatable = create(:questionnaire, questionnaire_for: template, skip_injection: evaluator.skip_injection)
43
+ after(:create) do |template|
44
+ template.templatable = create(:questionnaire, questionnaire_for: template)
37
45
  template.save!
38
46
  end
39
47
  end
@@ -31,7 +31,7 @@ shared_examples_for "copies all questionnaire contents" do
31
31
  end
32
32
 
33
33
  def check_answer_options(source_question, new_question)
34
- expect(source_question.answer_options.size).to eq(new_question.answer_options.size)
34
+ expect(source_question.answer_options.count).to eq(new_question.answer_options.count)
35
35
 
36
36
  source_question.answer_options.each_with_index do |source_answer_option, idx|
37
37
  new_answer_option = new_question.answer_options[idx]
@@ -41,7 +41,7 @@ shared_examples_for "copies all questionnaire contents" do
41
41
  end
42
42
 
43
43
  def check_matrix_rows(source_question, new_question)
44
- expect(source_question.matrix_rows.size).to eq(new_question.matrix_rows.size)
44
+ expect(source_question.matrix_rows.count).to eq(new_question.matrix_rows.count)
45
45
 
46
46
  source_question.matrix_rows.each_with_index do |source_matrix_row, idx|
47
47
  new_matrix_row = new_question.matrix_rows[idx]
@@ -52,7 +52,7 @@ shared_examples_for "copies all questionnaire contents" do
52
52
  end
53
53
 
54
54
  def check_display_conditions(source_display_conditions, new_display_conditions)
55
- expect(source_display_conditions.size).to eq(new_display_conditions.size)
55
+ expect(source_display_conditions.count).to eq(new_display_conditions.count)
56
56
 
57
57
  source_display_conditions.each_with_index do |source_matrix_row, idx|
58
58
  new_matrix_row = new_display_conditions[idx]
@@ -14,13 +14,13 @@ shared_examples_for "uses questionnaire templates" do |_questionnaire_for|
14
14
  )
15
15
  end
16
16
 
17
- it "doesn't show the template selection screen" do
18
- expect(page).to have_no_content("Choose template")
17
+ it "does not show the template selection screen" do
18
+ expect(page).not_to have_content("Choose template")
19
19
  end
20
20
  end
21
21
 
22
22
  context "when there are templates" do
23
- let!(:templates) { create_list(:questionnaire_template, 6, :with_questions, skip_injection: true, organization: questionnaire.questionnaire_for.organization) }
23
+ let!(:templates) { create_list(:questionnaire_template, 6, :with_questions, organization: questionnaire.questionnaire_for.organization) }
24
24
  let(:template) { templates.first }
25
25
  let(:question) { template.templatable.questions.first }
26
26
 
@@ -32,8 +32,8 @@ shared_examples_for "uses questionnaire templates" do |_questionnaire_for|
32
32
  )
33
33
  end
34
34
 
35
- it "doesn't show the template selection screen" do
36
- expect(page).to have_no_content("Choose template")
35
+ it "does not show the template selection screen" do
36
+ expect(page).not_to have_content("Choose template")
37
37
  end
38
38
  end
39
39
 
@@ -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, skip_injection: true, organization: questionnaire.questionnaire_for.organization) }
77
+ let!(:templates) { create_list(:questionnaire_template, 6, :with_questions, 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 }
@@ -91,9 +91,11 @@ shared_examples_for "uses questionnaire templates" do |_questionnaire_for|
91
91
 
92
92
  select(template.name["en"], from: "select-template")
93
93
 
94
- within ".create-from-template" do
95
- find("*[type=submit]").click
94
+ within ".questionnaire-template-preview" do
95
+ expect(page).to have_content(template.templatable.title["en"])
96
96
  end
97
+
98
+ click_button "Create from template"
97
99
  end
98
100
 
99
101
  it "copies the template data to the questionnaire on submit" do
@@ -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.27.8"
7
+ "0.28.0.rc4"
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.27.8
4
+ version: 0.28.0.rc4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vera Rojman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-30 00:00:00.000000000 Z
11
+ date: 2023-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: decidim-core
@@ -16,84 +16,56 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.27.8
19
+ version: 0.28.0.rc4
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.27.8
26
+ version: 0.28.0.rc4
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.27.8
33
+ version: 0.28.0.rc4
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.27.8
40
+ version: 0.28.0.rc4
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.27.8
47
+ version: 0.28.0.rc4
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.27.8
54
+ version: 0.28.0.rc4
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.27.8
61
+ version: 0.28.0.rc4
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.27.8
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.27.8
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - '='
81
- - !ruby/object:Gem::Version
82
- version: 0.27.8
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.27.8
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - '='
95
- - !ruby/object:Gem::Version
96
- version: 0.27.8
68
+ version: 0.28.0.rc4
97
69
  description: This module provides a solution to create templates for different Decidim
98
70
  models, such as Proposals and Questionnaires..
99
71
  email:
@@ -102,31 +74,56 @@ executables: []
102
74
  extensions: []
103
75
  extra_rdoc_files: []
104
76
  files:
77
+ - LICENSE-AGPLv3.txt
105
78
  - README.md
106
79
  - Rakefile
107
80
  - app/commands/decidim/templates/admin/apply_questionnaire_template.rb
81
+ - app/commands/decidim/templates/admin/copy_proposal_answer_template.rb
108
82
  - app/commands/decidim/templates/admin/copy_questionnaire_template.rb
83
+ - app/commands/decidim/templates/admin/copy_template.rb
84
+ - app/commands/decidim/templates/admin/create_block_user_template.rb
85
+ - app/commands/decidim/templates/admin/create_proposal_answer_template.rb
109
86
  - app/commands/decidim/templates/admin/create_questionnaire_template.rb
87
+ - app/commands/decidim/templates/admin/create_template.rb
88
+ - app/commands/decidim/templates/admin/destroy_questionnaire_template.rb
110
89
  - app/commands/decidim/templates/admin/destroy_template.rb
111
90
  - app/commands/decidim/templates/admin/questionnaire_copier.rb
91
+ - app/commands/decidim/templates/admin/update_proposal_answer_template.rb
112
92
  - app/commands/decidim/templates/admin/update_template.rb
113
93
  - app/controllers/decidim/templates/admin/application_controller.rb
94
+ - app/controllers/decidim/templates/admin/block_user_templates_controller.rb
114
95
  - app/controllers/decidim/templates/admin/concerns/templatable.rb
96
+ - app/controllers/decidim/templates/admin/proposal_answer_templates_controller.rb
115
97
  - app/controllers/decidim/templates/admin/questionnaire_templates/questionnaires_controller.rb
116
98
  - app/controllers/decidim/templates/admin/questionnaire_templates_controller.rb
117
99
  - app/controllers/decidim/templates/application_controller.rb
100
+ - app/forms/decidim/templates/admin/proposal_answer_template_form.rb
118
101
  - app/forms/decidim/templates/admin/template_form.rb
102
+ - app/helpers/decidim/templates/admin/application_helper.rb
119
103
  - app/helpers/decidim/templates/application_helper.rb
120
104
  - app/models/concerns/decidim/templates/templatable.rb
121
105
  - app/models/decidim/templates/application_record.rb
122
106
  - app/models/decidim/templates/template.rb
123
107
  - app/packs/entrypoints/decidim_templates.js
124
108
  - app/packs/entrypoints/decidim_templates.scss
109
+ - app/packs/entrypoints/decidim_templates_admin.js
125
110
  - app/packs/images/decidim/templates/decidim_templates.svg
111
+ - app/packs/src/decidim/templates/admin/block_user_template_chooser.js
126
112
  - app/packs/src/decidim/templates/admin/choose_template.js
113
+ - app/packs/src/decidim/templates/admin/proposal_answer_template_chooser.js
127
114
  - app/packs/stylesheets/decidim/templates/templates.scss
128
115
  - app/permissions/decidim/templates/admin/permissions.rb
129
116
  - app/presenters/decidim/templates/admin_log/template_presenter.rb
117
+ - app/views/decidim/templates/admin/block_user_templates/_form.html.erb
118
+ - app/views/decidim/templates/admin/block_user_templates/_template_chooser.html.erb
119
+ - app/views/decidim/templates/admin/block_user_templates/edit.html.erb
120
+ - app/views/decidim/templates/admin/block_user_templates/index.html.erb
121
+ - app/views/decidim/templates/admin/block_user_templates/new.html.erb
122
+ - app/views/decidim/templates/admin/proposal_answer_templates/_form.html.erb
123
+ - app/views/decidim/templates/admin/proposal_answer_templates/_template_chooser.html.erb
124
+ - app/views/decidim/templates/admin/proposal_answer_templates/edit.html.erb
125
+ - app/views/decidim/templates/admin/proposal_answer_templates/index.html.erb
126
+ - app/views/decidim/templates/admin/proposal_answer_templates/new.html.erb
130
127
  - app/views/decidim/templates/admin/questionnaire_templates/_choose.html.erb
131
128
  - app/views/decidim/templates/admin/questionnaire_templates/_form.html.erb
132
129
  - app/views/decidim/templates/admin/questionnaire_templates/_preview.html.erb
@@ -160,7 +157,6 @@ files:
160
157
  - config/locales/ga-IE.yml
161
158
  - config/locales/gl.yml
162
159
  - config/locales/gn-PY.yml
163
- - config/locales/he-IL.yml
164
160
  - config/locales/hr.yml
165
161
  - config/locales/hu.yml
166
162
  - config/locales/id-ID.yml
@@ -204,36 +200,42 @@ files:
204
200
  - config/locales/zh-CN.yml
205
201
  - config/locales/zh-TW.yml
206
202
  - db/migrate/20200518093819_create_decidim_templates.rb
203
+ - db/migrate/20221006055954_add_field_values_and_target_to_decidim_templates.rb
207
204
  - db/seeds.rb
208
- - decidim-templates.gemspec
209
205
  - lib/decidim/templates.rb
210
206
  - lib/decidim/templates/admin.rb
211
207
  - lib/decidim/templates/admin_engine.rb
212
208
  - lib/decidim/templates/engine.rb
209
+ - lib/decidim/templates/menu.rb
213
210
  - lib/decidim/templates/test/factories.rb
214
211
  - lib/decidim/templates/test/shared_examples/copies_all_questionnaire_contents_examples.rb
215
212
  - lib/decidim/templates/test/shared_examples/uses_questionnaire_templates.rb
216
213
  - lib/decidim/templates/version.rb
217
- homepage: https://github.com/decidim/decidim-module-templates
214
+ homepage: https://decidim.org
218
215
  licenses:
219
216
  - AGPL-3.0
220
- metadata: {}
217
+ metadata:
218
+ bug_tracker_uri: https://github.com/decidim/decidim/issues
219
+ documentation_uri: https://docs.decidim.org/
220
+ funding_uri: https://opencollective.com/decidim
221
+ homepage_uri: https://decidim.org
222
+ source_code_uri: https://github.com/decidim/decidim
221
223
  post_install_message:
222
224
  rdoc_options: []
223
225
  require_paths:
224
226
  - lib
225
227
  required_ruby_version: !ruby/object:Gem::Requirement
226
228
  requirements:
227
- - - "~>"
229
+ - - ">="
228
230
  - !ruby/object:Gem::Version
229
- version: 3.0.0
231
+ version: '3.1'
230
232
  required_rubygems_version: !ruby/object:Gem::Requirement
231
233
  requirements:
232
- - - ">="
234
+ - - ">"
233
235
  - !ruby/object:Gem::Version
234
- version: '0'
236
+ version: 1.3.1
235
237
  requirements: []
236
- rubygems_version: 3.5.14
238
+ rubygems_version: 3.4.20
237
239
  signing_key:
238
240
  specification_version: 4
239
241
  summary: A decidim templates module
@@ -1 +0,0 @@
1
- he:
@@ -1,33 +0,0 @@
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://github.com/decidim/decidim-module-templates"
13
- s.required_ruby_version = "~> 3.0.0"
14
-
15
- s.name = "decidim-templates"
16
- s.summary = "A decidim templates module"
17
- s.description = "This module provides a solution to create templates for different Decidim models, such as Proposals and Questionnaires.."
18
-
19
- s.files = Dir.chdir(__dir__) do
20
- `git ls-files -z`.split("\x0").select do |f|
21
- (File.expand_path(f) == __FILE__) ||
22
- f.start_with?(*%w(app/ config/ db/ lib/ Rakefile README.md))
23
- end
24
- end
25
-
26
- s.add_dependency "decidim-core", Decidim::Templates.version
27
- s.add_dependency "decidim-forms", Decidim::Templates.version
28
-
29
- s.add_development_dependency "decidim-admin", Decidim::Templates.version
30
- s.add_development_dependency "decidim-dev", Decidim::Templates.version
31
- s.add_development_dependency "decidim-participatory_processes", Decidim::Templates.version
32
- s.add_development_dependency "decidim-surveys", Decidim::Templates.version
33
- end