decidim-templates 0.23.5 → 0.24.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of decidim-templates might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c124f78b7202120a324bcdd0e2cd93f78c772fd43566c1519df48665189de481
4
- data.tar.gz: 5e83d6dc749b42c216c787af557b681e5349939eefafa9e20830afb58835771c
3
+ metadata.gz: d57faab60878f78ed3c7c63faa1ac919674bf920080249ebbfb323bfa6e57df5
4
+ data.tar.gz: 6a850da108de14c4ceaf2d280ba6f8f077d65b0a5390ed881914f88a68422eb5
5
5
  SHA512:
6
- metadata.gz: d4bd5abc5a44498ef089205a1dd7463ac498cec0252ed2b23ade492415e14025056730d0ab159ae7281ff03269a0b3f2d01bb2c7cec19479a28468f71e1953f3
7
- data.tar.gz: 20e455c8c970bfae0d83d9422a318315989bc04fca16407464b22e6079c38477fd2702976aff0f0759b2c63ea2e94382ba373beffa6af656b7e20e70ff8e5fdd
6
+ metadata.gz: c9da2902f2187a731c23d051b713b2a687baeab2c9d60e6d021c24094af625532e6dcd0cd7ae3784f964e683bcc4290e5d345c30741e51df5d7a141b01ff496b
7
+ data.tar.gz: a250304aac44fe007f3557e9a4693c8b40db4be110780cdd7f5119fcca47a7d9c5e5575eb88c3699a3745f0f6f284f5744e2a7e857ba7d1286a4af54b5963dfd
@@ -26,6 +26,10 @@ module Decidim
26
26
  nil
27
27
  end
28
28
 
29
+ def edit_questionnaire_title
30
+ t(:title, scope: "decidim.templates.admin.questionnaire_templates.form", questionnaire_for: translated_attribute(template.name))
31
+ end
32
+
29
33
  private
30
34
 
31
35
  def template
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Templates
5
+ module Admin
6
+ module TemplatesMenuHelper
7
+ include Decidim::Admin::SidebarMenuHelper
8
+
9
+ def template_types_menu
10
+ @template_types_menu ||= sidebar_menu(:admin_template_types_menu)
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -15,7 +15,7 @@ module Decidim
15
15
  foreign_key: "decidim_organization_id",
16
16
  class_name: "Decidim::Organization"
17
17
 
18
- belongs_to :templatable, foreign_key: "templatable_id", foreign_type: "templatable_type", polymorphic: true, optional: true
18
+ belongs_to :templatable, foreign_type: "templatable_type", polymorphic: true, optional: true
19
19
 
20
20
  before_destroy :destroy_templatable
21
21
 
@@ -3,7 +3,7 @@
3
3
  <h2 class="card-title">
4
4
  <%= t ".title" %>
5
5
  <% if allowed_to?(:create, :template) %>
6
- <%= link_to t("actions.new", scope: "decidim.admin", name: t("template.name", scope: "decidim.models").downcase), ["new", "questionnaire_template"], class: "button tiny button--title new" %>
6
+ <%= link_to t("actions.new", scope: "decidim.admin", name: t("template.name", scope: "decidim.models").downcase), [:new, :questionnaire_template], class: "button tiny button--title new" %>
7
7
  <% end %>
8
8
  </h2>
9
9
  </div>
@@ -1,13 +1,5 @@
1
- <% content_for :secondary_nav do %>
2
- <div class="secondary-nav secondary-nav--subnav">
3
- <ul>
4
- <% template_types.each_pair do |name, url| %>
5
- <li <% if is_active_link?(url) %> class="is-active" <% end %>>
6
- <%= aria_selected_link_to name, url %>
7
- </li>
8
- <% end %>
9
- </ul>
10
- </div>
1
+ <% content_for :sidebar_menu_nav do %>
2
+ <%= template_types_menu.render %>
11
3
  <% end %>
12
4
 
13
5
  <%= render "layouts/decidim/admin/application" do %>
@@ -48,7 +48,7 @@ ca:
48
48
  form:
49
49
  save: Desar
50
50
  template_title: Informació de la plantilla
51
- title: Qüestionari
51
+ title: Plantilla del qüestionari %{questionnaire_for}
52
52
  index:
53
53
  confirm_delete: Segur que vols eliminar aquesta plantilla?
54
54
  title: Plantilles de qüestionari
@@ -48,7 +48,7 @@ cs:
48
48
  form:
49
49
  save: Uložit
50
50
  template_title: Informace o šabloně
51
- title: Dotazník
51
+ title: Šablona dotazníku %{questionnaire_for}
52
52
  index:
53
53
  confirm_delete: Jste si jisti, že chcete odstranit tuto šablonu?
54
54
  title: Šablony dotazníků
@@ -48,7 +48,7 @@ de:
48
48
  form:
49
49
  save: Speichern
50
50
  template_title: Vorlageninformation
51
- title: Fragebogen
51
+ title: Fragebogenvorlage %{questionnaire_for}
52
52
  index:
53
53
  confirm_delete: Möchten Sie diese Vorlage wirklich löschen?
54
54
  title: Fragebogenvorlagen
@@ -49,7 +49,7 @@ en:
49
49
  form:
50
50
  save: Save
51
51
  template_title: Template information
52
- title: Questionnaire
52
+ title: Questionnaire template %{questionnaire_for}
53
53
  index:
54
54
  confirm_delete: Are you sure you want to delete this template?
55
55
  title: Questionnaire templates
@@ -48,7 +48,7 @@ es-MX:
48
48
  form:
49
49
  save: Guardar
50
50
  template_title: Información de la plantilla
51
- title: Cuestionario
51
+ title: Plantilla de cuestionario %{questionnaire_for}
52
52
  index:
53
53
  confirm_delete: '¿Seguro que quieres eliminar esta plantilla?'
54
54
  title: Plantillas de cuestionario
@@ -48,7 +48,7 @@ es-PY:
48
48
  form:
49
49
  save: Guardar
50
50
  template_title: Información de la plantilla
51
- title: Cuestionario
51
+ title: Plantilla de cuestionario %{questionnaire_for}
52
52
  index:
53
53
  confirm_delete: '¿Seguro que quieres eliminar esta plantilla?'
54
54
  title: Plantillas de cuestionario
@@ -48,7 +48,7 @@ es:
48
48
  form:
49
49
  save: Guardar
50
50
  template_title: Información de la plantilla
51
- title: Cuestionario
51
+ title: Plantilla de cuestionario %{questionnaire_for}
52
52
  index:
53
53
  confirm_delete: '¿Seguro que quieres eliminar esta plantilla?'
54
54
  title: Plantillas de cuestionario
@@ -48,7 +48,7 @@ fi-pl:
48
48
  form:
49
49
  save: Tallenna
50
50
  template_title: Mallipohjan tiedot
51
- title: Kysely
51
+ title: Kyselylomakemalli %{questionnaire_for}
52
52
  index:
53
53
  confirm_delete: Haluatko varmasti poistaa tämän mallipohjan?
54
54
  title: Kyselymallit
@@ -48,7 +48,7 @@ fi:
48
48
  form:
49
49
  save: Tallenna
50
50
  template_title: Mallipohjan tiedot
51
- title: Kysely
51
+ title: Kyselylomakemalli %{questionnaire_for}
52
52
  index:
53
53
  confirm_delete: Haluatko varmasti poistaa tämän mallipohjan?
54
54
  title: Kyselymallit
@@ -48,7 +48,7 @@ fr-CA:
48
48
  form:
49
49
  save: Sauvegarder
50
50
  template_title: Informations sur le modèle
51
- title: Questionnaire
51
+ title: Modèle de questionnaire %{questionnaire_for}
52
52
  index:
53
53
  confirm_delete: Êtes-vous sûr de vouloir supprimer ce modèle?
54
54
  title: Modèles de questionnaire
@@ -48,7 +48,7 @@ fr:
48
48
  form:
49
49
  save: Sauvegarder
50
50
  template_title: Informations sur le modèle
51
- title: Questionnaire
51
+ title: Modèle de questionnaire %{questionnaire_for}
52
52
  index:
53
53
  confirm_delete: Êtes-vous sûr de vouloir supprimer ce modèle?
54
54
  title: Modèles de questionnaire
@@ -48,7 +48,7 @@ gl:
48
48
  form:
49
49
  save: Gardar
50
50
  template_title: Información do padrón
51
- title: Cuestionario
51
+ title: Padrón de cuestionario %{questionnaire_for}
52
52
  index:
53
53
  confirm_delete: Tes a certeza de querer eliminar este padrón?
54
54
  title: Padróns de cuestionario
@@ -48,7 +48,6 @@ it:
48
48
  form:
49
49
  save: Salva
50
50
  template_title: Informazioni del modello
51
- title: Questionario
52
51
  index:
53
52
  confirm_delete: Sei sicuro di voler eliminare questo modello?
54
53
  title: Modelli di questionari
@@ -48,7 +48,7 @@ ja:
48
48
  form:
49
49
  save: 保存
50
50
  template_title: テンプレート情報
51
- title: アンケート
51
+ title: アンケートテンプレート %{questionnaire_for}
52
52
  index:
53
53
  confirm_delete: このテンプレートを削除してもよろしいですか?
54
54
  title: アンケートテンプレート
@@ -48,7 +48,6 @@ nl:
48
48
  form:
49
49
  save: Opslaan
50
50
  template_title: Template informatie
51
- title: Vragenlijst
52
51
  index:
53
52
  confirm_delete: Weet je zeker dat je dit template wilt verwijderen?
54
53
  title: Vragenlijst templates
@@ -48,7 +48,7 @@ pl:
48
48
  form:
49
49
  save: Zapisz
50
50
  template_title: Informacje o szablonie
51
- title: Kwestionariusz
51
+ title: Szablon kwestionariusza %{questionnaire_for}
52
52
  index:
53
53
  confirm_delete: Czy na pewno chcesz usunąć ten szablon?
54
54
  title: Szablony kwestionariusza
@@ -48,7 +48,7 @@ ro:
48
48
  form:
49
49
  save: Salveaza
50
50
  template_title: Informatii Sablon
51
- title: Chestionar
51
+ title: Sablon chestionar %{questionnaire_for}
52
52
  index:
53
53
  confirm_delete: Sunteți sigur că doriți să ștergeți acest șablon?
54
54
  title: Şabloane chestionar
@@ -20,6 +20,5 @@ sv:
20
20
  questionnaire: Enkät
21
21
  form:
22
22
  save: Spara
23
- title: Enkät
24
23
  preview:
25
24
  current_step: Steg %{step} av
@@ -48,7 +48,7 @@ tr:
48
48
  form:
49
49
  save: Kaydet
50
50
  template_title: Şablon Bilgisi
51
- title: Anket
51
+ title: '%{questionnaire_for} için anket şablonu'
52
52
  index:
53
53
  confirm_delete: Bu şablonu silmek istediğinizden emin misiniz?
54
54
  title: Anket şablonları
@@ -48,7 +48,6 @@ zh-CN:
48
48
  form:
49
49
  save: 保存
50
50
  template_title: 模板信息
51
- title: Questionnaire
52
51
  index:
53
52
  confirm_delete: 您确定要删除此模板吗?
54
53
  title: 问卷模板
data/db/seeds.rb CHANGED
@@ -18,7 +18,7 @@ if !Rails.env.production? || ENV["SEED"]
18
18
 
19
19
  questionnaire_template = Decidim::Templates::Template.create!(
20
20
  organization: organization,
21
- name: Decidim::Faker::Localized.sentence(2),
21
+ name: Decidim::Faker::Localized.sentence(word_count: 2),
22
22
  description: Decidim::Faker::Localized.paragraph
23
23
  )
24
24
 
@@ -26,10 +26,10 @@ if !Rails.env.production? || ENV["SEED"]
26
26
  questionnaire_for: questionnaire_template,
27
27
  title: Decidim::Faker::Localized.paragraph,
28
28
  description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
29
- Decidim::Faker::Localized.paragraph(3)
29
+ Decidim::Faker::Localized.paragraph(sentence_count: 3)
30
30
  end,
31
31
  tos: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
32
- Decidim::Faker::Localized.paragraph(2)
32
+ Decidim::Faker::Localized.paragraph(sentence_count: 2)
33
33
  end
34
34
  )
35
35
 
@@ -30,6 +30,22 @@ module Decidim
30
30
  root to: "questionnaire_templates#index"
31
31
  end
32
32
 
33
+ initializer "decidim_templates.action_controller" do |_app|
34
+ ActiveSupport.on_load :action_controller do
35
+ helper Decidim::Templates::Admin::TemplatesMenuHelper if respond_to?(:helper)
36
+ end
37
+ end
38
+
39
+ initializer "decidim_participatory_processes.admin_participatory_processes_menu" do
40
+ Decidim.menu :admin_template_types_menu do |menu|
41
+ template_types.each_pair do |name, url|
42
+ menu.item name, url,
43
+ if: allowed_to?(:index, :templates),
44
+ active: is_active_link?(url)
45
+ end
46
+ end
47
+ end
48
+
33
49
  initializer "decidim_templates.admin_mount_routes" do
34
50
  Decidim::Core::Engine.routes do
35
51
  mount Decidim::Templates::AdminEngine, at: "/admin/templates", as: "decidim_admin_templates"
@@ -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.23.5"
7
+ "0.24.2"
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.23.5
4
+ version: 0.24.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vera Rojman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-08 00:00:00.000000000 Z
11
+ date: 2021-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: decidim-core
@@ -16,56 +16,56 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.23.5
19
+ version: 0.24.2
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.23.5
26
+ version: 0.24.2
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.23.5
33
+ version: 0.24.2
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.23.5
40
+ version: 0.24.2
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.23.5
47
+ version: 0.24.2
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.23.5
54
+ version: 0.24.2
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.23.5
61
+ version: 0.24.2
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.23.5
68
+ version: 0.24.2
69
69
  description: This module provides a solution to create templates for different Decidim
70
70
  models, such as Proposals and Questionnaires..
71
71
  email:
@@ -93,6 +93,7 @@ files:
93
93
  - app/controllers/decidim/templates/application_controller.rb
94
94
  - app/forms/decidim/templates/admin/template_form.rb
95
95
  - app/helpers/decidim/templates/admin/templates_helper.rb
96
+ - app/helpers/decidim/templates/admin/templates_menu_helper.rb
96
97
  - app/helpers/decidim/templates/application_helper.rb
97
98
  - app/models/concerns/decidim/templates/templatable.rb
98
99
  - app/models/decidim/templates/application_record.rb
@@ -181,14 +182,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
181
182
  requirements:
182
183
  - - ">="
183
184
  - !ruby/object:Gem::Version
184
- version: '2.6'
185
+ version: '2.7'
185
186
  required_rubygems_version: !ruby/object:Gem::Requirement
186
187
  requirements:
187
188
  - - ">="
188
189
  - !ruby/object:Gem::Version
189
190
  version: '0'
190
191
  requirements: []
191
- rubygems_version: 3.0.3
192
+ rubygems_version: 3.1.2
192
193
  signing_key:
193
194
  specification_version: 4
194
195
  summary: A decidim templates module