decidim-initiatives 0.28.5 → 0.29.0.rc1

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.
Files changed (117) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/app/cells/decidim/initiatives/initiative_g_cell.rb +6 -4
  4. data/app/cells/decidim/initiatives_votes/vote_cell.rb +1 -3
  5. data/app/commands/decidim/initiatives/admin/create_initiative_type.rb +9 -58
  6. data/app/commands/decidim/initiatives/admin/create_initiative_type_scope.rb +5 -43
  7. data/app/commands/decidim/initiatives/admin/update_initiative.rb +25 -42
  8. data/app/commands/decidim/initiatives/admin/update_initiative_answer.rb +3 -4
  9. data/app/commands/decidim/initiatives/admin/update_initiative_type.rb +11 -61
  10. data/app/commands/decidim/initiatives/admin/update_initiative_type_scope.rb +2 -33
  11. data/app/commands/decidim/initiatives/admin/update_initiatives_settings.rb +2 -35
  12. data/app/commands/decidim/initiatives/approve_membership_request.rb +1 -1
  13. data/app/commands/decidim/initiatives/create_initiative.rb +6 -7
  14. data/app/commands/decidim/initiatives/revoke_membership_request.rb +1 -1
  15. data/app/commands/decidim/initiatives/spawn_committee_request.rb +4 -5
  16. data/app/commands/decidim/initiatives/update_initiative.rb +3 -3
  17. data/app/commands/decidim/initiatives/validate_sms_code.rb +3 -3
  18. data/app/controllers/concerns/decidim/initiatives/needs_initiative.rb +1 -1
  19. data/app/controllers/decidim/initiatives/admin/answers_controller.rb +1 -1
  20. data/app/controllers/decidim/initiatives/admin/initiatives_controller.rb +7 -6
  21. data/app/controllers/decidim/initiatives/admin/initiatives_settings_controller.rb +1 -1
  22. data/app/controllers/decidim/initiatives/admin/initiatives_type_scopes_controller.rb +2 -2
  23. data/app/controllers/decidim/initiatives/admin/initiatives_types_controller.rb +2 -2
  24. data/app/controllers/decidim/initiatives/application_controller.rb +5 -2
  25. data/app/controllers/decidim/initiatives/committee_requests_controller.rb +1 -2
  26. data/app/controllers/decidim/initiatives/create_initiative_controller.rb +1 -1
  27. data/app/controllers/decidim/initiatives/initiatives_controller.rb +2 -2
  28. data/app/events/decidim/initiatives/approve_membership_request_event.rb +9 -29
  29. data/app/events/decidim/initiatives/create_initiative_event.rb +17 -36
  30. data/app/events/decidim/initiatives/revoke_membership_request_event.rb +10 -33
  31. data/app/events/decidim/initiatives/spawn_committee_request_event.rb +10 -33
  32. data/app/forms/decidim/initiatives/admin/initiative_answer_form.rb +1 -1
  33. data/app/forms/decidim/initiatives/admin/initiative_form.rb +3 -3
  34. data/app/forms/decidim/initiatives/admin/initiative_type_form.rb +2 -2
  35. data/app/forms/decidim/initiatives/initiative_form.rb +11 -1
  36. data/app/forms/decidim/initiatives/vote_form.rb +2 -2
  37. data/app/helpers/decidim/initiatives/initiative_helper.rb +0 -74
  38. data/app/helpers/decidim/initiatives/initiatives_helper.rb +0 -7
  39. data/app/models/decidim/initiative.rb +1 -1
  40. data/app/packs/entrypoints/decidim_initiatives_admin.js +0 -2
  41. data/app/packs/src/decidim/initiatives/admin/invite_users.js +1 -1
  42. data/app/permissions/decidim/initiatives/admin/permissions.rb +2 -2
  43. data/app/permissions/decidim/initiatives/permissions.rb +0 -14
  44. data/app/serializers/decidim/initiatives/initiative_serializer.rb +1 -1
  45. data/app/views/decidim/initiatives/admin/answers/_info_initiative.html.erb +1 -1
  46. data/app/views/decidim/initiatives/admin/committee_requests/index.html.erb +1 -2
  47. data/app/views/decidim/initiatives/admin/exports/_dropdown.html.erb +6 -6
  48. data/app/views/decidim/initiatives/admin/initiatives/index.html.erb +65 -59
  49. data/app/views/decidim/initiatives/admin/initiatives_type_scopes/_form.html.erb +1 -1
  50. data/app/views/decidim/initiatives/admin/initiatives_types/_initiative_type_scopes.html.erb +1 -1
  51. data/app/views/decidim/initiatives/admin/initiatives_types/index.html.erb +1 -1
  52. data/app/views/decidim/initiatives/committee_requests/new.html.erb +3 -4
  53. data/app/views/decidim/initiatives/initiative_signatures/fill_personal_data.html.erb +1 -1
  54. data/app/views/decidim/initiatives/initiatives/_interactions.html.erb +1 -1
  55. data/app/views/decidim/initiatives/initiatives/_new_initiative_button.html.erb +1 -1
  56. data/app/views/decidim/initiatives/initiatives/_vote_button.html.erb +1 -1
  57. data/app/views/decidim/initiatives/initiatives/print.html.erb +2 -2
  58. data/app/views/decidim/initiatives/initiatives/show.html.erb +2 -3
  59. data/app/views/layouts/decidim/_initiative_header.html.erb +6 -6
  60. data/app/views/layouts/decidim/initiative.html.erb +2 -2
  61. data/app/views/layouts/decidim/initiative_head.html.erb +1 -1
  62. data/config/initializers/wicked_pdf.rb +6 -4
  63. data/config/locales/ar.yml +0 -7
  64. data/config/locales/bg.yml +1 -3
  65. data/config/locales/ca.yml +7 -14
  66. data/config/locales/cs.yml +5 -13
  67. data/config/locales/de.yml +7 -14
  68. data/config/locales/el.yml +0 -4
  69. data/config/locales/en.yml +6 -13
  70. data/config/locales/es-MX.yml +7 -14
  71. data/config/locales/es-PY.yml +7 -14
  72. data/config/locales/es.yml +6 -13
  73. data/config/locales/eu.yml +51 -58
  74. data/config/locales/fi-plain.yml +6 -13
  75. data/config/locales/fi.yml +21 -28
  76. data/config/locales/fr-CA.yml +3 -5
  77. data/config/locales/fr.yml +2 -4
  78. data/config/locales/ga-IE.yml +0 -1
  79. data/config/locales/gl.yml +0 -4
  80. data/config/locales/he-IL.yml +0 -6
  81. data/config/locales/hu.yml +1 -4
  82. data/config/locales/id-ID.yml +0 -4
  83. data/config/locales/is-IS.yml +0 -8
  84. data/config/locales/it.yml +1 -3
  85. data/config/locales/ja.yml +8 -15
  86. data/config/locales/lb.yml +1 -1
  87. data/config/locales/lt.yml +0 -3
  88. data/config/locales/lv.yml +0 -4
  89. data/config/locales/nl.yml +0 -4
  90. data/config/locales/no.yml +0 -2
  91. data/config/locales/pl.yml +5 -2
  92. data/config/locales/pt-BR.yml +1 -17
  93. data/config/locales/pt.yml +0 -2
  94. data/config/locales/ro-RO.yml +0 -12
  95. data/config/locales/ru.yml +0 -9
  96. data/config/locales/sk.yml +0 -4
  97. data/config/locales/sv.yml +69 -194
  98. data/config/locales/tr-TR.yml +1 -3
  99. data/config/locales/uk.yml +0 -9
  100. data/config/locales/zh-CN.yml +0 -3
  101. data/config/locales/zh-TW.yml +0 -3
  102. data/decidim-initiatives.gemspec +3 -2
  103. data/lib/decidim/api/initiative_api_type.rb +2 -2
  104. data/lib/decidim/initiatives/engine.rb +1 -0
  105. data/lib/decidim/initiatives/menu.rb +12 -1
  106. data/lib/decidim/initiatives/seeds.rb +89 -64
  107. data/lib/decidim/initiatives/version.rb +1 -1
  108. data/lib/decidim/initiatives.rb +0 -12
  109. data/lib/tasks/decidim_initiatives.rake +3 -3
  110. data/lib/tasks/initiatives/upgrade/decidim_initiatives_upgrade_tasks.rake +9 -11
  111. metadata +33 -25
  112. data/app/forms/decidim/initiatives/previous_form.rb +0 -24
  113. data/app/packs/entrypoints/decidim_initiatives_admin.scss +0 -1
  114. data/app/packs/stylesheets/decidim/initiatives/admin/initiatives.scss +0 -13
  115. data/app/queries/decidim/initiatives/similar_initiatives.rb +0 -54
  116. data/config/locales/bn-BD.yml +0 -1
  117. data/config/locales/bs-BA.yml +0 -1
@@ -1,54 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module Initiatives
5
- # Class uses to retrieve similar initiatives types.
6
- class SimilarInitiatives < Decidim::Query
7
- include Decidim::TranslationsHelper
8
- include CurrentLocale
9
-
10
- # Syntactic sugar to initialize the class and return the queried objects.
11
- #
12
- # organization - Decidim::Organization
13
- # form - Decidim::Initiatives::PreviousForm
14
- def self.for(organization, form)
15
- new(organization, form).query
16
- end
17
-
18
- # Initializes the class.
19
- #
20
- # organization - Decidim::Organization
21
- # form - Decidim::Initiatives::PreviousForm
22
- def initialize(organization, form)
23
- @organization = organization
24
- @form = form
25
- end
26
-
27
- # Retrieves similar initiatives
28
- def query
29
- Initiative
30
- .published
31
- .where(organization: @organization)
32
- .where(
33
- Arel.sql("GREATEST(#{title_similarity}, #{description_similarity}) >= ?").to_s,
34
- translated_attribute(form.title),
35
- translated_attribute(form.description),
36
- Decidim::Initiatives.similarity_threshold
37
- )
38
- .limit(Decidim::Initiatives.similarity_limit)
39
- end
40
-
41
- private
42
-
43
- attr_reader :form
44
-
45
- def title_similarity
46
- "similarity(title->>'#{current_locale}', ?)"
47
- end
48
-
49
- def description_similarity
50
- "similarity(description->>'#{current_locale}', ?)"
51
- end
52
- end
53
- end
54
- end
@@ -1 +0,0 @@
1
- bn:
@@ -1 +0,0 @@
1
- bs: