decidim-initiatives 0.19.1 → 0.23.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (194) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +22 -0
  3. data/app/assets/config/admin_decidim_initiatives_manifest.js +2 -1
  4. data/app/assets/images/decidim/gamification/badges/initiatives.svg +1 -87
  5. data/app/assets/images/decidim/initiatives/icon.svg +1 -3
  6. data/app/assets/javascripts/decidim/initiatives/admin/initiatives_types.js.es6 +38 -0
  7. data/app/assets/stylesheet/decidim/initiatives/initiatives-votes.css.scss +0 -1
  8. data/app/assets/stylesheet/decidim/initiatives/initiatives.scss +6 -8
  9. data/app/assets/stylesheet/decidim/initiatives/popularity_item.css.scss +0 -1
  10. data/app/assets/stylesheet/decidim/initiatives/print-initiative.css.scss +0 -3
  11. data/app/cells/decidim/initiatives/content_blocks/highlighted_initiatives/show.erb +4 -3
  12. data/app/cells/decidim/initiatives/initiative_m/footer.erb +1 -1
  13. data/app/cells/decidim/initiatives/initiative_m_cell.rb +25 -0
  14. data/app/cells/decidim/initiatives_votes/vote/show.erb +12 -9
  15. data/app/cells/decidim/initiatives_votes/vote_cell.rb +7 -0
  16. data/app/commands/decidim/initiatives/admin/create_initiative_type.rb +8 -2
  17. data/app/commands/decidim/initiatives/admin/send_initiative_to_technical_validation.rb +17 -0
  18. data/app/commands/decidim/initiatives/admin/update_initiative.rb +29 -10
  19. data/app/commands/decidim/initiatives/admin/update_initiative_type.rb +10 -6
  20. data/app/commands/decidim/initiatives/attachment_methods.rb +37 -0
  21. data/app/commands/decidim/initiatives/create_initiative.rb +25 -3
  22. data/app/commands/decidim/initiatives/unvote_initiative.rb +4 -10
  23. data/app/commands/decidim/initiatives/vote_initiative.rb +47 -31
  24. data/app/controllers/concerns/decidim/initiatives/admin/filterable.rb +51 -0
  25. data/app/controllers/concerns/decidim/initiatives/orderable.rb +3 -1
  26. data/app/controllers/concerns/decidim/initiatives/single_initiative_type.rb +26 -0
  27. data/app/controllers/decidim/initiatives/admin/answers_controller.rb +2 -3
  28. data/app/controllers/decidim/initiatives/admin/initiatives_controller.rb +28 -15
  29. data/app/controllers/decidim/initiatives/create_initiative_controller.rb +43 -9
  30. data/app/controllers/decidim/initiatives/initiative_signatures_controller.rb +19 -23
  31. data/app/controllers/decidim/initiatives/initiative_votes_controller.rb +11 -5
  32. data/app/controllers/decidim/initiatives/initiatives_controller.rb +28 -13
  33. data/app/controllers/decidim/initiatives/initiatives_type_scopes_controller.rb +9 -1
  34. data/app/controllers/decidim/initiatives/versions_controller.rb +20 -0
  35. data/app/controllers/decidim/initiatives/{initiative_widgets_controller.rb → widgets_controller.rb} +2 -2
  36. data/app/events/decidim/initiatives/admin/initiative_sent_to_technical_validation_event.rb +21 -0
  37. data/app/events/decidim/initiatives/admin/support_threshold_reached_event.rb +13 -0
  38. data/app/forms/decidim/initiatives/admin/initiative_form.rb +50 -8
  39. data/app/forms/decidim/initiatives/admin/initiative_type_form.rb +28 -6
  40. data/app/forms/decidim/initiatives/admin/initiative_type_scope_form.rb +0 -1
  41. data/app/forms/decidim/initiatives/initiative_form.rb +69 -2
  42. data/app/forms/decidim/initiatives/vote_form.rb +133 -76
  43. data/app/helpers/decidim/initiatives/application_helper.rb +104 -0
  44. data/app/helpers/decidim/initiatives/create_initiative_helper.rb +10 -11
  45. data/app/helpers/decidim/initiatives/initiative_helper.rb +13 -0
  46. data/app/helpers/decidim/initiatives/initiatives_helper.rb +10 -0
  47. data/app/jobs/decidim/initiatives/export_initiatives_job.rb +25 -0
  48. data/app/mailers/decidim/initiatives/initiatives_mailer.rb +0 -21
  49. data/app/models/concerns/decidim/initiatives/has_area.rb +30 -0
  50. data/app/models/decidim/initiative.rb +200 -51
  51. data/app/models/decidim/initiatives_type.rb +14 -14
  52. data/app/models/decidim/initiatives_type_scope.rb +9 -2
  53. data/app/models/decidim/initiatives_vote.rb +19 -23
  54. data/app/permissions/decidim/initiatives/admin/permissions.rb +21 -10
  55. data/app/permissions/decidim/initiatives/permissions.rb +38 -14
  56. data/app/presenters/decidim/initiatives/initiative_stats_presenter.rb +1 -5
  57. data/app/queries/decidim/initiatives/admin/manageable_initiatives.rb +7 -39
  58. data/app/serializers/decidim/initiatives/initiative_serializer.rb +32 -0
  59. data/app/services/decidim/initiatives/diff_renderer.rb +18 -0
  60. data/app/services/decidim/initiatives/initiative_search.rb +59 -15
  61. data/app/services/decidim/initiatives/status_change_notifier.rb +4 -5
  62. data/app/types/decidim/initiatives/initiative_api_type.rb +26 -0
  63. data/app/types/decidim/initiatives/initiative_committee_member_type.rb +18 -0
  64. data/app/types/decidim/initiatives/initiative_type.rb +42 -0
  65. data/app/views/decidim/initiatives/admin/answers/_info_initiative.html.erb +1 -1
  66. data/app/views/decidim/initiatives/admin/exports/_dropdown.html.erb +8 -0
  67. data/app/views/decidim/initiatives/admin/initiatives/_form.html.erb +60 -15
  68. data/app/views/decidim/initiatives/admin/initiatives/_initiative_attachments.erb +43 -0
  69. data/app/views/decidim/initiatives/admin/initiatives/export_pdf_signatures.pdf.erb +12 -9
  70. data/app/views/decidim/initiatives/admin/initiatives/index.html.erb +10 -45
  71. data/app/views/decidim/initiatives/admin/initiatives_types/_form.html.erb +55 -12
  72. data/app/views/decidim/initiatives/admin/initiatives_types/_initiative_type_scopes.html.erb +28 -25
  73. data/app/views/decidim/initiatives/create_initiative/fill_data.html.erb +61 -16
  74. data/app/views/decidim/initiatives/create_initiative/finish.html.erb +17 -10
  75. data/app/views/decidim/initiatives/create_initiative/previous_form.html.erb +2 -1
  76. data/app/views/decidim/initiatives/create_initiative/promotal_committee.html.erb +1 -1
  77. data/app/views/decidim/initiatives/create_initiative/select_initiative_type.html.erb +1 -2
  78. data/app/views/decidim/initiatives/create_initiative/show_similar_initiatives.html.erb +1 -1
  79. data/app/views/decidim/initiatives/initiative_signatures/fill_personal_data.html.erb +1 -1
  80. data/app/views/decidim/initiatives/initiative_signatures/update_buttons_and_counters.js.erb +1 -1
  81. data/app/views/decidim/initiatives/initiative_votes/update_buttons_and_counters.js.erb +1 -1
  82. data/app/views/decidim/initiatives/initiatives/_author.html.erb +1 -1
  83. data/app/views/decidim/initiatives/initiatives/_filters.html.erb +16 -28
  84. data/app/views/decidim/initiatives/initiatives/_index_header.html.erb +39 -5
  85. data/app/views/decidim/initiatives/initiatives/_initiatives.html.erb +11 -1
  86. data/app/views/decidim/initiatives/initiatives/_interactions.html.erb +2 -3
  87. data/app/views/decidim/initiatives/initiatives/_progress_bar.html.erb +24 -9
  88. data/app/views/decidim/initiatives/initiatives/_tags.html.erb +4 -1
  89. data/app/views/decidim/initiatives/initiatives/_vote_cabin.html.erb +1 -13
  90. data/app/views/decidim/initiatives/initiatives/index.html.erb +1 -1
  91. data/app/views/decidim/initiatives/initiatives/show.html.erb +5 -6
  92. data/app/views/decidim/initiatives/initiatives_type_scopes/search.html.erb +1 -1
  93. data/app/views/decidim/initiatives/versions/index.html.erb +8 -0
  94. data/app/views/decidim/initiatives/versions/show.html.erb +10 -0
  95. data/app/views/layouts/decidim/_initiative_creation_header.html.erb +3 -1
  96. data/app/views/layouts/decidim/_initiative_header.html.erb +2 -1
  97. data/app/views/layouts/decidim/_initiative_signature_creation_header.html.erb +1 -1
  98. data/app/views/layouts/decidim/admin/initiative.html.erb +1 -1
  99. data/app/views/layouts/decidim/initiative.html.erb +1 -0
  100. data/app/views/layouts/decidim/initiative_creation.html.erb +1 -2
  101. data/app/views/layouts/decidim/initiative_signature_creation.html.erb +2 -2
  102. data/config/locales/am-ET.yml +1 -0
  103. data/config/locales/ar.yml +17 -21
  104. data/config/locales/bg-BG.yml +13 -0
  105. data/config/locales/bg.yml +13 -0
  106. data/config/locales/ca.yml +101 -22
  107. data/config/locales/cs.yml +111 -32
  108. data/config/locales/da-DK.yml +1 -0
  109. data/config/locales/da.yml +1 -0
  110. data/config/locales/de.yml +75 -21
  111. data/config/locales/el-GR.yml +1 -0
  112. data/config/locales/el.yml +525 -0
  113. data/config/locales/en.yml +103 -24
  114. data/config/locales/eo.yml +1 -0
  115. data/config/locales/es-MX.yml +100 -21
  116. data/config/locales/es-PY.yml +100 -21
  117. data/config/locales/es.yml +104 -25
  118. data/config/locales/et-EE.yml +1 -0
  119. data/config/locales/et.yml +1 -0
  120. data/config/locales/eu.yml +4 -21
  121. data/config/locales/fi-plain.yml +100 -21
  122. data/config/locales/fi.yml +118 -39
  123. data/config/locales/fr-CA.yml +557 -0
  124. data/config/locales/fr.yml +102 -23
  125. data/config/locales/ga-IE.yml +1 -0
  126. data/config/locales/gl.yml +4 -21
  127. data/config/locales/hr-HR.yml +1 -0
  128. data/config/locales/hr.yml +1 -0
  129. data/config/locales/hu.yml +31 -24
  130. data/config/locales/id-ID.yml +4 -21
  131. data/config/locales/is-IS.yml +251 -0
  132. data/config/locales/is.yml +251 -0
  133. data/config/locales/it.yml +117 -61
  134. data/config/locales/ja-JP.yml +529 -0
  135. data/config/locales/ja.yml +549 -0
  136. data/config/locales/ko-KR.yml +1 -0
  137. data/config/locales/ko.yml +1 -0
  138. data/config/locales/lt-LT.yml +1 -0
  139. data/config/locales/lt.yml +1 -0
  140. data/config/locales/lv.yml +525 -0
  141. data/config/locales/mt-MT.yml +1 -0
  142. data/config/locales/mt.yml +1 -0
  143. data/config/locales/nl.yml +77 -21
  144. data/config/locales/no.yml +368 -9
  145. data/config/locales/om-ET.yml +1 -0
  146. data/config/locales/pl.yml +260 -189
  147. data/config/locales/pt-BR.yml +5 -22
  148. data/config/locales/pt.yml +231 -179
  149. data/config/locales/ro-RO.yml +533 -0
  150. data/config/locales/ru.yml +4 -21
  151. data/config/locales/sk-SK.yml +468 -0
  152. data/config/locales/sk.yml +458 -0
  153. data/config/locales/sl.yml +24 -0
  154. data/config/locales/so-SO.yml +1 -0
  155. data/config/locales/sr-CS.yml +8 -0
  156. data/config/locales/sv.yml +102 -31
  157. data/config/locales/ti-ER.yml +1 -0
  158. data/config/locales/tr-TR.yml +4 -21
  159. data/config/locales/uk.yml +4 -21
  160. data/config/locales/vi-VN.yml +1 -0
  161. data/config/locales/vi.yml +1 -0
  162. data/config/locales/zh-CN.yml +549 -0
  163. data/config/locales/zh-TW.yml +1 -0
  164. data/db/migrate/20190925145648_add_promoting_committee_option.rb +7 -0
  165. data/db/migrate/20191002082220_move_signature_type_to_initative_type.rb +38 -0
  166. data/db/migrate/20191106144259_add_settings_to_initiatives_types.rb +8 -0
  167. data/db/migrate/20191107134847_add_scopes_to_initiatives_votes.rb +28 -0
  168. data/db/migrate/20191116170841_allow_multiple_initiative_votes_counter_caches.rb +32 -0
  169. data/db/migrate/20191118105634_allow_multiple_offline_votes.rb +34 -0
  170. data/db/migrate/20200320105920_index_foreign_keys_in_decidim_initiatives.rb +8 -0
  171. data/db/migrate/20200320105921_index_foreign_keys_in_decidim_initiatives_votes.rb +8 -0
  172. data/db/migrate/20200417120551_add_custom_signature_end_time_option.rb +7 -0
  173. data/db/migrate/20200424110930_add_attachments_enabled_option.rb +7 -0
  174. data/db/migrate/20200514085422_add_area_to_initiatives.rb +7 -0
  175. data/db/migrate/20200514102631_add_area_enabled_option_to_initiatives.rb +7 -0
  176. data/db/migrate/20200528151456_remove_user_groups_from_initiative_votes.rb +7 -0
  177. data/db/migrate/20200827154214_add_commentable_counter_cache_to_initiatives.rb +9 -0
  178. data/db/seeds/city.jpeg +0 -0
  179. data/db/seeds/city2.jpeg +0 -0
  180. data/lib/decidim/api/initiative_type_interface.rb +13 -0
  181. data/lib/decidim/initiatives.rb +0 -14
  182. data/lib/decidim/initiatives/admin_engine.rb +6 -1
  183. data/lib/decidim/initiatives/api.rb +7 -0
  184. data/lib/decidim/initiatives/engine.rb +11 -2
  185. data/lib/decidim/initiatives/participatory_space.rb +20 -1
  186. data/lib/decidim/initiatives/query_extensions.rb +40 -0
  187. data/lib/decidim/initiatives/test/factories.rb +69 -8
  188. data/lib/decidim/initiatives/version.rb +1 -1
  189. data/lib/tasks/decidim_initiatives.rake +1 -3
  190. metadata +96 -20
  191. data/app/views/decidim/initiatives/initiative_widgets/show.html.erb +0 -4
  192. data/app/views/decidim/initiatives/initiatives/_supports.html.erb +0 -22
  193. data/app/views/decidim/initiatives/initiatives/signature_identities.html.erb +0 -42
  194. data/app/views/decidim/initiatives/initiatives_mailer/notify_validating_request.html.erb +0 -3
@@ -1,4 +0,0 @@
1
- <% content_for(:title, translated_attribute(model.title)) %>
2
-
3
- <%= render partial: "decidim/initiatives/initiatives/initiative_badge", locals: { initiative: model } %>
4
- <p><%= truncate(translated_attribute(model.description), length: 100) %></p>
@@ -1,22 +0,0 @@
1
- <% if initiative.votes.supports.any? %>
2
- <div class="row">
3
- <div class="columns large-12">
4
- <div class="section committee">
5
- <h4 class="section-heading"><%= t(".title") %></h4>
6
- </div>
7
- </div>
8
-
9
- <div class="columns large-12 supports-list">
10
- <% initiative.votes.supports.each do |s| %>
11
- <div class="author author--inline">
12
- <span class="author__avatar author__avatar--small">
13
- <%= image_tag s.user_group.avatar_url %>
14
- </span>
15
- <span class="author__name">
16
- <%= s.user_group.name %>
17
- </span>
18
- </div>
19
- <% end %>
20
- </div>
21
- </div>
22
- <% end %>
@@ -1,42 +0,0 @@
1
- <div class="reveal__header">
2
- <h1 class="reveal__title"><%= t ".select_identity" %></h1>
3
- </div>
4
-
5
- <%= render partial: "decidim/initiatives/initiatives/vote_button",
6
- locals: {
7
- initiative: current_initiative,
8
- vote_label: current_user.name,
9
- unvote_label: current_user.name,
10
- verification_label: current_user.name,
11
- steps: signature_has_steps?
12
- } unless current_initiative.offline? %>
13
-
14
- <% Decidim::UserGroups::ManageableUserGroups.for(current_user).verified.each do |g| %>
15
- <br>
16
- <% if @voted_groups.include? g.id %>
17
- <%= button_to(
18
- g.name,
19
- initiative_initiative_vote_path(initiative_slug: current_initiative.slug, group_id: g.id),
20
- method: :delete,
21
- remote: true,
22
- data: { disable: true },
23
- class: "button expanded light button--sc success"
24
- ) %>
25
- <% else %>
26
- <% if signature_has_steps? %>
27
- <%= link_to(
28
- g.name,
29
- initiative_initiative_signatures_path(initiative_slug: current_initiative.slug, group_id: g.id),
30
- class: "button expanded light button--sc"
31
- ) %>
32
- <% else %>
33
- <%= button_to(
34
- g.name,
35
- initiative_initiative_signatures_path(initiative_slug: current_initiative.slug, group_id: g.id),
36
- remote: true,
37
- data: { disable: true },
38
- class: "button expanded light button--sc"
39
- ) %>
40
- <% end %>
41
- <% end %>
42
- <% end %>
@@ -1,3 +0,0 @@
1
- <%= decidim_sanitize @body %>
2
- <br><br>
3
- <%= render partial: "initiative_link" %>