decidim-initiatives 0.27.10 → 0.28.0.rc4

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 (240) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -3
  3. data/app/cells/decidim/initiatives/content_blocks/highlighted_initiatives_cell.rb +17 -18
  4. data/app/cells/decidim/initiatives/initiative_cell.rb +6 -1
  5. data/app/cells/decidim/initiatives/initiative_dropdown_metadata_cell.rb +19 -0
  6. data/app/cells/decidim/initiatives/initiative_g_cell.rb +31 -0
  7. data/app/cells/decidim/initiatives/initiative_metadata_g_cell.rb +62 -0
  8. data/app/cells/decidim/initiatives/initiative_s_cell.rb +15 -0
  9. data/app/cells/decidim/initiatives_votes/vote/show.erb +25 -19
  10. data/app/cells/decidim/initiatives_votes/vote_cell.rb +3 -1
  11. data/app/commands/decidim/initiatives/admin/accept_initiative.rb +40 -0
  12. data/app/commands/decidim/initiatives/admin/create_initiative_type.rb +1 -1
  13. data/app/commands/decidim/initiatives/admin/create_initiative_type_scope.rb +1 -1
  14. data/app/commands/decidim/initiatives/admin/discard_initiative.rb +40 -0
  15. data/app/commands/decidim/initiatives/admin/publish_initiative.rb +1 -1
  16. data/app/commands/decidim/initiatives/admin/reject_initiative.rb +40 -0
  17. data/app/commands/decidim/initiatives/admin/send_initiative_to_technical_validation.rb +2 -2
  18. data/app/commands/decidim/initiatives/admin/unpublish_initiative.rb +1 -1
  19. data/app/commands/decidim/initiatives/admin/update_initiative.rb +1 -1
  20. data/app/commands/decidim/initiatives/admin/update_initiative_answer.rb +1 -1
  21. data/app/commands/decidim/initiatives/admin/update_initiative_type.rb +1 -1
  22. data/app/commands/decidim/initiatives/admin/update_initiative_type_scope.rb +1 -1
  23. data/app/commands/decidim/initiatives/admin/update_initiatives_settings.rb +1 -1
  24. data/app/commands/decidim/initiatives/attachment_methods.rb +2 -24
  25. data/app/commands/decidim/initiatives/create_initiative.rb +19 -14
  26. data/app/commands/decidim/initiatives/send_initiative_to_technical_validation.rb +2 -2
  27. data/app/commands/decidim/initiatives/spawn_committee_request.rb +1 -1
  28. data/app/commands/decidim/initiatives/unvote_initiative.rb +1 -1
  29. data/app/commands/decidim/initiatives/update_initiative.rb +9 -2
  30. data/app/commands/decidim/initiatives/validate_mobile_phone.rb +2 -2
  31. data/app/commands/decidim/initiatives/vote_initiative.rb +5 -5
  32. data/app/constraints/decidim/initiatives/current_initiative.rb +1 -1
  33. data/app/controllers/concerns/decidim/initiatives/admin/filterable.rb +2 -2
  34. data/app/controllers/concerns/decidim/initiatives/needs_initiative.rb +1 -1
  35. data/app/controllers/decidim/initiatives/admin/answers_controller.rb +3 -0
  36. data/app/controllers/decidim/initiatives/admin/committee_requests_controller.rb +2 -0
  37. data/app/controllers/decidim/initiatives/admin/components_controller.rb +3 -0
  38. data/app/controllers/decidim/initiatives/admin/initiative_attachments_controller.rb +2 -0
  39. data/app/controllers/decidim/initiatives/admin/initiatives_controller.rb +17 -6
  40. data/app/controllers/decidim/initiatives/admin/initiatives_permissions_controller.rb +3 -0
  41. data/app/controllers/decidim/initiatives/admin/initiatives_settings_controller.rb +2 -0
  42. data/app/controllers/decidim/initiatives/admin/initiatives_type_scopes_controller.rb +30 -0
  43. data/app/controllers/decidim/initiatives/admin/initiatives_types_controller.rb +14 -0
  44. data/app/controllers/decidim/initiatives/admin/initiatives_types_permissions_controller.rb +21 -0
  45. data/app/controllers/decidim/initiatives/admin/moderations/reports_controller.rb +2 -2
  46. data/app/controllers/decidim/initiatives/admin/moderations_controller.rb +4 -2
  47. data/app/controllers/decidim/initiatives/application_controller.rb +0 -1
  48. data/app/controllers/decidim/initiatives/authorization_create_modals_controller.rb +25 -0
  49. data/app/controllers/decidim/initiatives/authorization_sign_modals_controller.rb +2 -2
  50. data/app/controllers/decidim/initiatives/committee_requests_controller.rb +0 -2
  51. data/app/controllers/decidim/initiatives/create_initiative_controller.rb +62 -115
  52. data/app/controllers/decidim/initiatives/initiative_signatures_controller.rb +113 -81
  53. data/app/controllers/decidim/initiatives/initiative_types_controller.rb +7 -0
  54. data/app/controllers/decidim/initiatives/initiatives_controller.rb +37 -17
  55. data/app/controllers/decidim/initiatives/versions_controller.rb +0 -1
  56. data/app/events/decidim/initiatives/admin/initiative_sent_to_technical_validation_event.rb +2 -2
  57. data/app/events/decidim/initiatives/admin/support_threshold_reached_event.rb +1 -1
  58. data/app/events/decidim/initiatives/approve_membership_request_event.rb +16 -13
  59. data/app/events/decidim/initiatives/create_initiative_event.rb +10 -7
  60. data/app/events/decidim/initiatives/endorse_initiative_event.rb +1 -1
  61. data/app/events/decidim/initiatives/extend_initiative_event.rb +1 -1
  62. data/app/events/decidim/initiatives/initiative_sent_to_technical_validation_event.rb +2 -2
  63. data/app/events/decidim/initiatives/milestone_completed_event.rb +1 -1
  64. data/app/events/decidim/initiatives/revoke_membership_request_event.rb +16 -13
  65. data/app/events/decidim/initiatives/spawn_committee_request_event.rb +16 -13
  66. data/app/forms/decidim/initiatives/admin/initiative_form.rb +1 -1
  67. data/app/forms/decidim/initiatives/initiative_form.rb +22 -31
  68. data/app/forms/decidim/initiatives/previous_form.rb +4 -0
  69. data/app/forms/decidim/initiatives/vote_form.rb +11 -11
  70. data/app/helpers/decidim/initiatives/admin/initiatives_helper.rb +1 -1
  71. data/app/helpers/decidim/initiatives/application_helper.rb +5 -62
  72. data/app/helpers/decidim/initiatives/initiative_helper.rb +48 -5
  73. data/app/helpers/decidim/initiatives/initiatives_helper.rb +33 -12
  74. data/app/jobs/decidim/initiatives/export_initiatives_job.rb +1 -1
  75. data/app/models/decidim/initiative.rb +16 -14
  76. data/app/models/decidim/initiatives_vote.rb +1 -1
  77. data/app/packs/entrypoints/decidim_initiatives.js +3 -0
  78. data/app/packs/images/decidim/gamification/badges/decidim_gamification_badges_initiatives.svg +42 -1
  79. data/app/packs/src/decidim/initiatives/application.js +0 -1
  80. data/app/packs/src/decidim/initiatives/scoped_type.js +1 -1
  81. data/app/packs/stylesheets/decidim/initiatives/initiatives-votes.scss +21 -21
  82. data/app/packs/stylesheets/decidim/initiatives/print-initiative.scss +47 -35
  83. data/app/packs/stylesheets/initiatives.scss +171 -0
  84. data/app/permissions/decidim/initiatives/permissions.rb +3 -13
  85. data/app/presenters/decidim/initiatives/admin_log/initiative_presenter.rb +2 -2
  86. data/app/presenters/decidim/initiatives/admin_log/initiatives_settings_presenter.rb +2 -2
  87. data/app/presenters/decidim/initiatives/admin_log/initiatives_type_presenter.rb +2 -2
  88. data/app/queries/decidim/initiatives/organization_prioritized_initiatives.rb +1 -1
  89. data/app/queries/decidim/initiatives/similar_initiatives.rb +2 -2
  90. data/app/queries/decidim/initiatives/support_period_finished_initiatives.rb +1 -1
  91. data/app/queries/decidim/initiatives/user_authorizations.rb +1 -1
  92. data/app/services/decidim/initiatives/pdf_signature_example.rb +44 -52
  93. data/app/views/decidim/initiatives/_modal.html.erb +15 -0
  94. data/app/views/decidim/initiatives/admin/answers/_info_initiative.html.erb +21 -19
  95. data/app/views/decidim/initiatives/admin/answers/edit.html.erb +41 -27
  96. data/app/views/decidim/initiatives/admin/committee_requests/index.html.erb +41 -48
  97. data/app/views/decidim/initiatives/admin/exports/_dropdown.html.erb +8 -7
  98. data/app/views/decidim/initiatives/admin/initiatives/_form.html.erb +111 -95
  99. data/app/views/decidim/initiatives/admin/initiatives/_initiative_attachments.erb +7 -7
  100. data/app/views/decidim/initiatives/admin/initiatives/_signatures.html.erb +87 -0
  101. data/app/views/decidim/initiatives/admin/initiatives/edit.html.erb +72 -60
  102. data/app/views/decidim/initiatives/admin/initiatives/export_pdf_signatures.html.erb +8 -0
  103. data/app/views/decidim/initiatives/admin/initiatives/export_pdf_signatures.pdf.erb +5 -78
  104. data/app/views/decidim/initiatives/admin/initiatives/index.html.erb +76 -75
  105. data/app/views/decidim/initiatives/admin/initiatives_settings/_form.html.erb +7 -8
  106. data/app/views/decidim/initiatives/admin/initiatives_settings/edit.html.erb +17 -5
  107. data/app/views/decidim/initiatives/admin/initiatives_type_scopes/_form.html.erb +11 -6
  108. data/app/views/decidim/initiatives/admin/initiatives_type_scopes/edit.html.erb +16 -22
  109. data/app/views/decidim/initiatives/admin/initiatives_type_scopes/new.html.erb +17 -15
  110. data/app/views/decidim/initiatives/admin/initiatives_types/_form.html.erb +93 -76
  111. data/app/views/decidim/initiatives/admin/initiatives_types/_initiative_type_scopes.html.erb +35 -33
  112. data/app/views/decidim/initiatives/admin/initiatives_types/edit.html.erb +16 -12
  113. data/app/views/decidim/initiatives/admin/initiatives_types/index.html.erb +39 -48
  114. data/app/views/decidim/initiatives/admin/initiatives_types/new.html.erb +16 -9
  115. data/app/views/decidim/initiatives/committee_requests/new.html.erb +21 -19
  116. data/app/views/decidim/initiatives/create_initiative/_share_committee_link.html.erb +15 -20
  117. data/app/views/decidim/initiatives/create_initiative/fill_data.html.erb +62 -100
  118. data/app/views/decidim/initiatives/create_initiative/finish.html.erb +24 -28
  119. data/app/views/decidim/initiatives/create_initiative/promotal_committee.html.erb +15 -17
  120. data/app/views/decidim/initiatives/create_initiative/select_initiative_type.html.erb +32 -46
  121. data/app/views/decidim/initiatives/initiative_signatures/_wizard_steps.html.erb +15 -19
  122. data/app/views/decidim/initiatives/initiative_signatures/fill_personal_data.html.erb +25 -36
  123. data/app/views/decidim/initiatives/initiative_signatures/finish.html.erb +5 -16
  124. data/app/views/decidim/initiatives/initiative_signatures/sms_code.html.erb +8 -19
  125. data/app/views/decidim/initiatives/initiative_signatures/sms_phone_number.html.erb +8 -20
  126. data/app/views/decidim/initiatives/initiatives/_committee_members.html.erb +48 -66
  127. data/app/views/decidim/initiatives/initiatives/_form.html.erb +49 -95
  128. data/app/views/decidim/initiatives/initiatives/_initiative_badge.html.erb +3 -5
  129. data/app/views/decidim/initiatives/initiatives/_initiative_hero.html.erb +13 -0
  130. data/app/views/decidim/initiatives/initiatives/_initiatives.html.erb +6 -15
  131. data/app/views/decidim/initiatives/initiatives/_interactions.html.erb +1 -1
  132. data/app/views/decidim/initiatives/initiatives/_new_initiative_button.html.erb +28 -0
  133. data/app/views/decidim/initiatives/initiatives/_progress_bar.html.erb +2 -6
  134. data/app/views/decidim/initiatives/initiatives/_result.html.erb +15 -21
  135. data/app/views/decidim/initiatives/initiatives/_send_to_technical_validation.html.erb +3 -3
  136. data/app/views/decidim/initiatives/initiatives/_tags_type.html.erb +1 -0
  137. data/app/views/decidim/initiatives/initiatives/_vote_button.html.erb +9 -9
  138. data/app/views/decidim/initiatives/initiatives/_vote_cabin.html.erb +7 -7
  139. data/app/views/decidim/initiatives/initiatives/edit.html.erb +63 -68
  140. data/app/views/decidim/initiatives/initiatives/index.html.erb +17 -18
  141. data/app/views/decidim/initiatives/initiatives/index.js.erb +0 -5
  142. data/app/views/decidim/initiatives/initiatives/print.html.erb +123 -120
  143. data/app/views/decidim/initiatives/initiatives/show.html.erb +188 -72
  144. data/app/views/decidim/initiatives/initiatives_mailer/notify_creation.html.erb +2 -2
  145. data/app/views/decidim/initiatives/initiatives_type_scopes/search.html.erb +2 -1
  146. data/app/views/decidim/initiatives/versions/show.html.erb +15 -6
  147. data/app/views/layouts/decidim/_initiative_creation_header.html.erb +17 -28
  148. data/app/views/layouts/decidim/_initiative_header.html.erb +3 -23
  149. data/app/views/layouts/decidim/_initiative_header_steps.html.erb +4 -12
  150. data/app/views/layouts/decidim/_initiative_signature_creation_header.html.erb +5 -26
  151. data/app/views/layouts/decidim/admin/initiative.html.erb +12 -13
  152. data/app/views/layouts/decidim/admin/initiatives.html.erb +40 -11
  153. data/app/views/layouts/decidim/initiative.html.erb +16 -11
  154. data/app/views/layouts/decidim/initiative_creation.html.erb +7 -18
  155. data/app/views/layouts/decidim/initiative_head.html.erb +15 -0
  156. data/app/views/layouts/decidim/initiative_signature_creation.html.erb +3 -11
  157. data/config/assets.rb +0 -1
  158. data/config/initializers/wicked_pdf.rb +1 -1
  159. data/config/locales/ar.yml +1 -96
  160. data/config/locales/bg.yml +0 -642
  161. data/config/locales/ca.yml +76 -115
  162. data/config/locales/cs.yml +70 -109
  163. data/config/locales/de.yml +78 -117
  164. data/config/locales/el.yml +1 -98
  165. data/config/locales/en.yml +69 -108
  166. data/config/locales/es-MX.yml +65 -104
  167. data/config/locales/es-PY.yml +65 -104
  168. data/config/locales/es.yml +73 -112
  169. data/config/locales/eu.yml +66 -105
  170. data/config/locales/fi-plain.yml +67 -106
  171. data/config/locales/fi.yml +68 -107
  172. data/config/locales/fr-CA.yml +69 -108
  173. data/config/locales/fr.yml +67 -106
  174. data/config/locales/ga-IE.yml +0 -35
  175. data/config/locales/gl.yml +1 -89
  176. data/config/locales/hu.yml +25 -114
  177. data/config/locales/id-ID.yml +1 -89
  178. data/config/locales/is-IS.yml +1 -60
  179. data/config/locales/it.yml +6 -111
  180. data/config/locales/ja.yml +65 -111
  181. data/config/locales/lb.yml +6 -88
  182. data/config/locales/lt.yml +52 -103
  183. data/config/locales/lv.yml +1 -99
  184. data/config/locales/nl.yml +6 -104
  185. data/config/locales/no.yml +6 -114
  186. data/config/locales/pl.yml +6 -158
  187. data/config/locales/pt-BR.yml +23 -146
  188. data/config/locales/pt.yml +6 -111
  189. data/config/locales/ro-RO.yml +13 -108
  190. data/config/locales/ru.yml +1 -68
  191. data/config/locales/sk.yml +1 -85
  192. data/config/locales/sl.yml +3 -5
  193. data/config/locales/sv.yml +25 -120
  194. data/config/locales/tr-TR.yml +9 -110
  195. data/config/locales/uk.yml +1 -68
  196. data/config/locales/zh-CN.yml +6 -102
  197. data/config/locales/zh-TW.yml +31 -95
  198. data/db/migrate/20171017091734_add_scopes_for_all_initiative_types.rb +1 -1
  199. data/db/migrate/20171017095143_update_initiative_scoped_type.rb +1 -1
  200. data/db/migrate/20191002082220_move_signature_type_to_initative_type.rb +1 -1
  201. data/lib/decidim/api/initiative_committee_member_type.rb +2 -2
  202. data/lib/decidim/initiatives/admin_engine.rb +13 -93
  203. data/lib/decidim/initiatives/content_blocks/registry_manager.rb +22 -0
  204. data/lib/decidim/initiatives/engine.rb +45 -23
  205. data/lib/decidim/initiatives/menu.rb +150 -0
  206. data/lib/decidim/initiatives/participatory_space.rb +6 -91
  207. data/lib/decidim/initiatives/query_extensions.rb +5 -5
  208. data/lib/decidim/initiatives/seeds.rb +95 -0
  209. data/lib/decidim/initiatives/test/factories.rb +43 -48
  210. data/lib/decidim/initiatives/version.rb +1 -1
  211. data/lib/decidim/initiatives.rb +1 -1
  212. data/lib/tasks/decidim_initiatives.rake +2 -2
  213. data/lib/tasks/initiatives/upgrade/decidim_initiatives_upgrade_tasks.rake +1 -1
  214. metadata +51 -81
  215. data/app/cells/decidim/initiatives/content_blocks/highlighted_initiatives/show.erb +0 -28
  216. data/app/cells/decidim/initiatives/initiative_m/author.erb +0 -10
  217. data/app/cells/decidim/initiatives/initiative_m/footer.erb +0 -28
  218. data/app/cells/decidim/initiatives/initiative_m/tags.erb +0 -9
  219. data/app/cells/decidim/initiatives/initiative_m_cell.rb +0 -77
  220. data/app/controllers/decidim/initiatives/widgets_controller.rb +0 -44
  221. data/app/packs/stylesheets/decidim/initiatives/admin.scss +0 -33
  222. data/app/packs/stylesheets/decidim/initiatives/initiatives.scss +0 -64
  223. data/app/packs/stylesheets/decidim/initiatives/popularity_item.scss +0 -76
  224. data/app/packs/stylesheets/decidim/initiatives/statistics.scss +0 -15
  225. data/app/views/decidim/initiatives/create_initiative/_finish_help.html.erb +0 -2
  226. data/app/views/decidim/initiatives/create_initiative/previous_form.html.erb +0 -40
  227. data/app/views/decidim/initiatives/create_initiative/show_similar_initiatives.html.erb +0 -23
  228. data/app/views/decidim/initiatives/initiatives/_author.html.erb +0 -35
  229. data/app/views/decidim/initiatives/initiatives/_count.html.erb +0 -1
  230. data/app/views/decidim/initiatives/initiatives/_filters.html.erb +0 -33
  231. data/app/views/decidim/initiatives/initiatives/_filters_small_view.html.erb +0 -18
  232. data/app/views/decidim/initiatives/initiatives/_index_header.html.erb +0 -44
  233. data/app/views/decidim/initiatives/initiatives/_tags.html.erb +0 -7
  234. data/app/views/decidim/initiatives/versions/index.html.erb +0 -8
  235. data/config/locales/he-IL.yml +0 -1
  236. data/db/seeds/city.jpeg +0 -0
  237. data/db/seeds/city2.jpeg +0 -0
  238. data/decidim-initiatives.gemspec +0 -38
  239. data/lib/decidim/initiatives/initiatives_filter_form_builder.rb +0 -56
  240. data/lib/gem_overrides/origami/date.rb +0 -47
@@ -1,24 +1,15 @@
1
1
  <% if @forced_closed_initiatives %>
2
- <div class="callout warning">
3
- <%= t ".closed_initiatives_warning" %>
4
- </div>
2
+ <%= cell("decidim/announcement", t("decidim.initiatives.initiatives.initiatives.closed_initiatives_warning"), callout_class: "warning") %>
5
3
  <% elsif initiatives.blank? %>
6
- <div class="callout warning">
7
- <%= t ".no_initiatives_warning" %>
8
- </div>
4
+ <%= cell("decidim/announcement", t("decidim.initiatives.initiatives.initiatives.no_initiatives_warning"), callout_class: "warning") %>
9
5
  <% end %>
10
6
 
11
- <div class="collection-sort-controls row small-up-1 medium-up-2 card-grid">
12
- <div class="column">
13
- <%= order_selector available_orders, i18n_scope: "decidim.initiatives.initiatives.orders" %>
14
- </div>
7
+ <h2 class="h5 md:h3 decorator"><%= t("title", scope: "decidim.initiatives.initiatives.count", count: initiatives.total_count) %></h2>
15
8
 
16
- <div class="column">
17
- <%= render partial: "decidim/shared/results_per_page" %>
18
- </div>
19
- </div>
9
+ <%= order_selector available_orders, i18n_scope: "decidim.initiatives.initiatives.orders" %>
20
10
 
21
- <div class="row small-up-1 medium-up-2 card-grid">
11
+ <div class="card__grid-grid">
22
12
  <%= render initiatives %>
23
13
  </div>
14
+
24
15
  <%= decidim_paginate initiatives %>
@@ -1,7 +1,7 @@
1
1
  <div class="row collapse buttons__row">
2
2
  <div class="column collapse">
3
3
  <%= link_to "#comments", class: "button small compact hollow button--nomargin expanded" do %>
4
- <%= icon "comment-square", class: "icon--small", role: "img", "aria-hidden": true %>
4
+ <%= icon "chat-1-line", class: "icon--small", role: "img", "aria-hidden": true %>
5
5
  <%= stats.comments_count %>
6
6
  <%= t(".comments_count.count", count: stats.comments_count) %>
7
7
  <% end %>
@@ -0,0 +1,28 @@
1
+ <% if Decidim::Initiatives.creation_enabled %>
2
+ <% if current_user && available_initiative_types.size > 1 %>
3
+ <%= link_to create_initiative_path(:select_initiative_type), class: "!px-4 title-action__action button button__xl button__secondary w-full" do %>
4
+ <%= t("new_initiative", scope: "decidim.initiatives.initiatives.index_header") %>
5
+ <%= icon "add-fill" %>
6
+ <% end %>
7
+ <% elsif current_user %>
8
+ <% if allowed_to?(:create, :initiative, { initiative_type: available_initiative_types.first }) %>
9
+ <%= link_to create_initiative_path(:select_initiative_type), class: "!px-4 title-action__action button button__xl button__secondary w-full" do %>
10
+ <%= t("new_initiative", scope: "decidim.initiatives.initiatives.index_header") %>
11
+ <%= icon "add-fill" %>
12
+ <% end %>
13
+ <% else %>
14
+ <%= authorized_create_modal_button(available_initiative_types.first, remote: true, class: "!px-4 title-action__action button button__xl button__secondary w-full") do %>
15
+ <%= t("new_initiative", scope: "decidim.initiatives.initiatives.index_header") %>
16
+ <%= icon "add-fill" %>
17
+ <% end %>
18
+ <% end %>
19
+ <% else %>
20
+ <% content_for(:redirect_after_login) { create_initiative_url(:select_initiative_type) } %>
21
+ <button type="button" class="title-action__action button button__xl button__secondary w-full" data-dialog-open="loginModal" aria-controls="loginModal" aria-haspopup="dialog" tabindex="0">
22
+ <%= t("new_initiative", scope: "decidim.initiatives.initiatives.index_header") %>
23
+ <%= icon "add-fill" %>
24
+ </button>
25
+ <% end %>
26
+ <% end %>
27
+
28
+ <%= render partial: "decidim/initiatives/modal" %>
@@ -6,18 +6,14 @@
6
6
  current_initiative.supports_count_for(type_scope.scope),
7
7
  total: type_scope.supports_required,
8
8
  units_name: "decidim.initiatives.initiatives.votes_count.count",
9
- element_id: "initiative-#{current_initiative.id}-votes-count",
10
- subtitle_text: current_initiative.supports_goal_reached? ? t("decidim.initiatives.initiatives.votes_count.most_popular_initiative") : t("decidim.initiatives.initiatives.votes_count.need_more_votes"),
11
- small: false
9
+ element_id: "initiative-#{current_initiative.id}-votes-count"
12
10
  ) %>
13
11
  <% else %>
14
12
  <%= cell(
15
13
  "decidim/progress_bar",
16
14
  current_initiative.supports_count_for(type_scope.scope),
17
15
  total: type_scope.supports_required,
18
- subtitle_text: translated_attribute(type_scope.scope_name),
19
- element_id: "initiative-scope-#{type_scope.id}-#{current_initiative.id}-votes-count",
20
- horizontal: true
16
+ element_id: "initiative-scope-#{type_scope.id}-#{current_initiative.id}-votes-count"
21
17
  ) %>
22
18
  <% end %>
23
19
  <% end %>
@@ -1,26 +1,20 @@
1
1
  <% if initiative.answered? && translated_attribute(initiative.answer).present? %>
2
- <br>
3
- <div class="row column">
4
- <div class="callout success">
5
- <h5><%= t("decidim.initiatives.initiatives.result.answer_title") %>:</h5>
6
- <p>
7
- <% if initiative.answer_url.present? %>
8
- <%= link_to initiative.answer_url, target: "_blank", rel: "noopener noreferrer" do %>
9
- <%= decidim_sanitize_editor translated_attribute initiative.answer %>
10
- <% end %>
11
- <% else %>
12
- <%= decidim_sanitize_editor translated_attribute initiative.answer %>
13
- <% end %>
14
- </p>
15
- </div>
16
- </div>
2
+ <% announcement_body = capture do %>
3
+ <h5><%= t("decidim.initiatives.initiatives.result.answer_title") %>:</h5>
4
+ <p>
5
+ <% if initiative.answer_url.present? %>
6
+ <a href="<%= initiative.answer_url %>" target="_blank">
7
+ <%= decidim_sanitize_editor translated_attribute initiative.answer %>
8
+ </a>
9
+ <% else %>
10
+ <%= decidim_sanitize_editor translated_attribute initiative.answer %>
11
+ <% end %>
12
+ </p>
13
+ <% end %>
14
+
15
+ <%= cell("decidim/announcement", { body: announcement_body }, callout_class: "success") %>
17
16
  <% end %>
18
17
 
19
18
  <% if initiative.rejected? %>
20
- <br>
21
- <div class="row column">
22
- <div class="callout warning">
23
- <h5><%= t(".initiative_rejected_reason") %></h5>
24
- </div>
25
- </div>
19
+ <%= cell("decidim/announcement", t("decidim.initiatives.initiatives.result.initiative_rejected_reason"), callout_class: "warning") %>
26
20
  <% end %>
@@ -1,8 +1,8 @@
1
1
  <% if allowed_to? :send_to_technical_validation, :initiative, initiative: current_initiative %>
2
2
  <%= link_to title,
3
3
  send_to_technical_validation_initiative_path(current_initiative),
4
- class: "button expanded",
5
- data: { confirm: confirm } %>
4
+ class: "button button__xl w-full button__secondary mt-4",
5
+ data: { confirm: } %>
6
6
  <% else %>
7
- <%= link_to title, "#", class: "button expanded disabled" %>
7
+ <%= link_to title, "#", class: "button button__xl w-full button__secondary mt-4 disabled", disabled: true %>
8
8
  <% end %>
@@ -0,0 +1 @@
1
+ <span class="text-sm font-normal block"><%= link_to translated_attribute(resource.type.title), initiatives_path(filter: { with_any_type: [resource.type.id] }) %></span>
@@ -2,16 +2,16 @@
2
2
  <% if steps %>
3
3
  <%= link_to(
4
4
  vote_label,
5
- initiative_initiative_signatures_path(initiative_slug: current_initiative.slug),
6
- class: "button expanded light button--sc"
5
+ initiative_signatures_path(initiative_slug: current_initiative.slug),
6
+ class: "button button__xl w-full button__secondary"
7
7
  ) %>
8
8
  <% else %>
9
9
  <%= button_to(
10
10
  vote_label,
11
- initiative_initiative_signatures_path(initiative_slug: current_initiative.slug),
11
+ initiative_signatures_path(initiative_slug: current_initiative.slug),
12
12
  remote: true,
13
13
  data: { disable: true },
14
- class: "button expanded light button--sc"
14
+ class: "button button__xl w-full button__secondary"
15
15
  ) %>
16
16
  <% end %>
17
17
  <% else %>
@@ -22,19 +22,19 @@
22
22
  method: :delete,
23
23
  remote: true,
24
24
  data: { disable: true },
25
- class: "button expanded light button--sc success"
25
+ class: "button button__xl w-full button__secondary success"
26
26
  ) do %>
27
- <%= icon("check", class: "icon--small") %>
27
+ <%= icon "check-line" %>
28
28
  <%= unvote_label %>
29
29
  <% end %>
30
30
  <% else %>
31
- <button class='button expanded button--sc success light disabled' disabled>
32
- <%= icon("check", class: "icon--small") %>
31
+ <button class='button button__xl w-full button__secondary success light' disabled>
32
+ <%= icon "check-line" %>
33
33
  <%= unvote_label %>
34
34
  </button>
35
35
  <% end %>
36
36
  <% else %>
37
- <%= authorized_vote_modal_button(initiative, remote: true, class: "button expanded light button--sc") do %>
37
+ <%= authorized_vote_modal_button(initiative, remote: true, class: "button button__xl w-full button__secondary") do %>
38
38
  <%= verification_label %>
39
39
  <% end %>
40
40
  <% end %>
@@ -1,14 +1,14 @@
1
1
  <% if initiative.accepts_online_votes? %>
2
2
  <%= render partial: "decidim/initiatives/initiatives/vote_button",
3
3
  locals: {
4
- initiative: initiative,
5
- vote_label: t(".vote"),
6
- unvote_label: t(".already_voted"),
7
- verification_label: t(".verification_required"),
8
- steps: signature_has_steps?
4
+ initiative:,
5
+ vote_label: t("vote", scope: "decidim.initiatives.initiatives.vote_cabin"),
6
+ unvote_label: t("already_voted", scope: "decidim.initiatives.initiatives.vote_cabin"),
7
+ verification_label: t("verification_required", scope: "decidim.initiatives.initiatives.vote_cabin"),
8
+ steps: signature_has_steps?
9
9
  } %>
10
10
  <% else %>
11
- <button class='button expanded light button--sc disabled' disabled>
12
- <%= t(".votes_blocked") %>
11
+ <button class='button button__lg button__secondary w-full' disabled>
12
+ <%= t("votes_blocked", scope: "decidim.initiatives.initiatives.vote_cabin") %>
13
13
  </button>
14
14
  <% end %>
@@ -1,78 +1,73 @@
1
- <% add_decidim_page_title(action_name) %>
1
+ <% add_decidim_page_title(t("title", scope: "decidim.initiatives.edit")) %>
2
2
 
3
- <div class="row columns">
4
- <%= link_to :back, class: "muted-link" do %>
5
- <%= icon "chevron-left", class: "icon--small", role: "img", "aria-hidden": true %>
6
- <%= t("back", scope: "decidim.initiatives.edit") %>
7
- <% end %>
8
- <h2 class="section-heading"><%= t("title", scope: "decidim.initiatives.edit") %></h2>
9
- </div>
3
+ <%= render layout:"layouts/decidim/shared/layout_center" do %>
4
+ <div class="text-center py-10">
5
+ <h1 class="title-decorator inline-block text-left"><%= t("title", scope: "decidim.initiatives.edit") %></h1>
6
+ </div>
7
+
8
+ <%= decidim_form_for @form, html: { class: "form__wrapper edit_initiative" } do |f| %>
9
+ <%= render partial: "form", object: f %>
10
10
 
11
- <div class="row">
12
- <div class="columns large-6 medium-centered">
13
- <div class="card">
14
- <div class="card__content">
15
- <%= decidim_form_for @form, html: { class: "form edit_initiative" } do |f| %>
16
- <%= render partial: "form", object: f %>
17
- <div class="actions">
18
- <%= f.submit t("update", scope: "decidim.initiatives.edit"), class: "button expanded" if allowed_to? :update, :initiative, initiative: current_initiative %>
11
+ <div class="form__wrapper-block flex-col-reverse md:flex-row justify-between">
12
+ <%= link_to :back, class: "button button__sm md:button__lg button__text-secondary" do %>
13
+ <%= icon "arrow-left-line", class: "fill-current" %>
14
+ <%= t("back", scope: "decidim.initiatives.edit") %>
15
+ <% end %>
16
+ <%= f.submit t("update", scope: "decidim.initiatives.edit"), class: "button button__sm md:button__lg button__secondary" if allowed_to? :update, :initiative, initiative: current_initiative %>
19
17
 
20
- <% if allowed_to? :publish, :initiative, initiative: current_initiative %>
21
- <%= link_to t("actions.publish", scope: "decidim.admin"),
22
- publish_initiative_path(current_initiative),
23
- method: :post,
24
- class: "button hollow expanded",
25
- data: { confirm: t("confirm", scope: "decidim.initiatives.edit") } %>
26
- <% end %>
18
+ <% if allowed_to? :publish, :initiative, initiative: current_initiative %>
19
+ <%= link_to t("actions.publish", scope: "decidim.admin"),
20
+ publish_initiative_path(current_initiative),
21
+ method: :post,
22
+ class: "button button__sm md:button__lg button__secondary",
23
+ data: { confirm: t("confirm", scope: "decidim.initiatives.edit") } %>
24
+ <% end %>
27
25
 
28
- <% if allowed_to? :unpublish, :initiative, initiative: current_initiative %>
29
- <%= link_to t("actions.unpublish", scope: "decidim.admin"),
30
- unpublish_initiative_path(current_initiative),
31
- method: :delete,
32
- class: "button alert expanded",
33
- data: { confirm: t("confirm", scope: "decidim.initiatives.edit") } %>
34
- <% end %>
26
+ <% if allowed_to? :unpublish, :initiative, initiative: current_initiative %>
27
+ <%= link_to t("actions.unpublish", scope: "decidim.admin"),
28
+ unpublish_initiative_path(current_initiative),
29
+ method: :delete,
30
+ class: "button button__sm md:button__lg button__secondary",
31
+ data: { confirm: t("confirm", scope: "decidim.initiatives.edit") } %>
32
+ <% end %>
35
33
 
36
- <% if allowed_to? :accept, :initiative, initiative: current_initiative %>
37
- <%= link_to t("accept", scope: "decidim.initiatives.edit"),
38
- accept_initiative_path(current_initiative),
39
- method: :post,
40
- class: "button hollow expanded",
41
- data: { confirm: t("confirm", scope: "decidim.initiatives.edit") } %>
42
- <% end %>
34
+ <% if allowed_to? :accept, :initiative, initiative: current_initiative %>
35
+ <%= link_to t("accept", scope: "decidim.initiatives.edit"),
36
+ accept_initiative_path(current_initiative),
37
+ method: :post,
38
+ class: "button button__sm md:button__lg button__secondary",
39
+ data: { confirm: t("confirm", scope: "decidim.initiatives.edit") } %>
40
+ <% end %>
43
41
 
44
- <% if allowed_to? :reject, :initiative, initiative: current_initiative %>
45
- <%= link_to t("reject", scope: "decidim.initiatives.edit"),
46
- reject_initiative_path(current_initiative),
47
- method: :delete,
48
- class: "button alert expanded",
49
- data: { confirm: t("confirm", scope: "decidim.initiatives.edit") } %>
50
- <% end %>
42
+ <% if allowed_to? :reject, :initiative, initiative: current_initiative %>
43
+ <%= link_to t("reject", scope: "decidim.initiatives.edit"),
44
+ reject_initiative_path(current_initiative),
45
+ method: :delete,
46
+ class: "button button__sm md:button__lg button__secondary",
47
+ data: { confirm: t("confirm", scope: "decidim.initiatives.edit") } %>
48
+ <% end %>
51
49
 
52
- <% if allowed_to? :discard, :initiative, initiative: current_initiative %>
53
- <%= link_to t("discard", scope: "decidim.initiatives.edit"),
54
- discard_initiative_path(current_initiative),
55
- method: :delete,
56
- class: "button alert expanded",
57
- data: { confirm: t("confirm", scope: "decidim.initiatives.edit") } %>
58
- <% end %>
50
+ <% if allowed_to? :discard, :initiative, initiative: current_initiative %>
51
+ <%= link_to t("discard", scope: "decidim.initiatives.edit"),
52
+ discard_initiative_path(current_initiative),
53
+ method: :delete,
54
+ class: "button button__sm md:button__lg button__secondary",
55
+ data: { confirm: t("confirm", scope: "decidim.initiatives.edit") } %>
56
+ <% end %>
59
57
 
60
- <% if allowed_to? :export_votes, :initiative, initiative: current_initiative %>
61
- <%= link_to t("export_votes", scope: "decidim.initiatives.edit"),
62
- export_votes_initiative_path(current_initiative, format: :csv),
63
- class: "button alert expanded",
64
- data: { confirm: t("confirm", scope: "decidim.initiatives.edit") } %>
65
- <% end %>
58
+ <% if allowed_to? :export_votes, :initiative, initiative: current_initiative %>
59
+ <%= link_to t("export_votes", scope: "decidim.initiatives.edit"),
60
+ export_votes_initiative_path(current_initiative, format: :csv),
61
+ class: "button button__sm md:button__lg button__secondary",
62
+ data: { confirm: t("confirm", scope: "decidim.initiatives.edit") } %>
63
+ <% end %>
66
64
 
67
- <% if allowed_to? :export_pdf_signatures, :initiative, initiative: current_initiative %>
68
- <%= link_to t("export_pdf_signatures", scope: "decidim.initiatives.edit"),
69
- export_pdf_signatures_initiative_path(current_initiative, format: :pdf),
70
- class: "button alert expanded",
71
- data: { confirm: t("confirm", scope: "decidim.initiatives.edit") } %>
72
- <% end %>
73
- </div>
74
- <% end %>
75
- </div>
65
+ <% if allowed_to? :export_pdf_signatures, :initiative, initiative: current_initiative %>
66
+ <%= link_to t("export_pdf_signatures", scope: "decidim.initiatives.edit"),
67
+ export_pdf_signatures_initiative_path(current_initiative, format: :pdf),
68
+ class: "button button__sm md:button__lg button__secondary",
69
+ data: { confirm: t("confirm", scope: "decidim.initiatives.edit") } %>
70
+ <% end %>
76
71
  </div>
77
- </div>
78
- </div>
72
+ <% end %>
73
+ <% end %>
@@ -1,3 +1,7 @@
1
+ <% add_decidim_page_title(component_name) %>
2
+ <%= append_javascript_pack_tag "decidim_initiatives" %>
3
+ <%= append_stylesheet_pack_tag "decidim_initiatives", media: "all" %>
4
+
1
5
  <%
2
6
  edit_link(
3
7
  decidim_admin_initiatives.initiatives_path,
@@ -6,24 +10,19 @@ edit_link(
6
10
  )
7
11
  %>
8
12
 
9
- <% provide :meta_title, t("initiatives.index.title", scope: "decidim") %>
13
+ <% content_for :aside do %>
14
+ <h1 class="title-decorator"><%= component_name %></h1>
15
+ <%= render partial: "new_initiative_button" %>
16
+
17
+ <%= render layout: "decidim/shared/filters", locals: { filter_sections: , search_variable: :search_text_cont, skip_to_id: "initiatives" } do %>
18
+ <%= hidden_field_tag :order, order, id: nil, class: "order_filter" %>
19
+ <% end %>
20
+ <% end %>
10
21
 
11
- <%= participatory_space_wrapper do %>
12
- <div class="row columns">
13
- <div class="title-action">
14
- <%= render partial: "index_header" %>
15
- </div>
16
- </div>
22
+ <%= render layout: "layouts/decidim/shared/layout_two_col" do %>
23
+ <%= participatory_space_floating_help %>
17
24
 
18
- <div class="row">
19
- <div class="columns mediumlarge-4 large-3">
20
- <%= render partial: "filters_small_view" %>
21
- <div class="card card--secondary show-for-mediumlarge">
22
- <%= render partial: "filters" %>
23
- </div>
24
- </div>
25
- <div id="initiatives" class="columns mediumlarge-8 large-9">
26
- <%= render partial: "initiatives" %>
27
- </div>
28
- </div>
25
+ <section id="initiatives" class="layout-main__section layout-main__heading">
26
+ <%= render partial: "initiatives" %>
27
+ </section>
29
28
  <% end %>
@@ -1,10 +1,5 @@
1
1
  var $initiatives = $('#initiatives');
2
- var $initiativesCount = $('#initiatives-count');
3
2
  var $orderFilterInput = $('.order_filter');
4
3
 
5
4
  $initiatives.html('<%= j(render partial: "initiatives") %>');
6
- $initiativesCount.html('<%= j(render partial: "count") %>');
7
5
  $orderFilterInput.val('<%= order %>');
8
-
9
- var $dropdownMenu = $('.dropdown.menu', $initiatives);
10
- $dropdownMenu.foundation();