decidim-initiatives 0.27.4 → 0.28.0.rc5

Sign up to get free protection for your applications and to get access to all the features.
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 +1 -1
  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 +12 -12
  59. data/app/events/decidim/initiatives/create_initiative_event.rb +6 -6
  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 +1 -1
  63. data/app/events/decidim/initiatives/milestone_completed_event.rb +1 -1
  64. data/app/events/decidim/initiatives/revoke_membership_request_event.rb +12 -12
  65. data/app/events/decidim/initiatives/spawn_committee_request_event.rb +12 -12
  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 +4 -61
  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 +17 -20
  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 +59 -31
  83. data/app/packs/stylesheets/initiatives.scss +171 -0
  84. data/app/permissions/decidim/initiatives/permissions.rb +3 -3
  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 -70
  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 +14 -5
  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/environment.rb +3 -0
  159. data/config/initializers/wicked_pdf.rb +1 -1
  160. data/config/locales/ar.yml +1 -92
  161. data/config/locales/ca.yml +65 -104
  162. data/config/locales/cs.yml +70 -109
  163. data/config/locales/de.yml +71 -110
  164. data/config/locales/el.yml +1 -97
  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 +65 -104
  169. data/config/locales/eu.yml +171 -161
  170. data/config/locales/fi-plain.yml +67 -106
  171. data/config/locales/fi.yml +67 -106
  172. data/config/locales/fr-CA.yml +72 -106
  173. data/config/locales/fr.yml +70 -104
  174. data/config/locales/ga-IE.yml +0 -35
  175. data/config/locales/gl.yml +1 -87
  176. data/config/locales/hu.yml +25 -107
  177. data/config/locales/id-ID.yml +1 -88
  178. data/config/locales/is-IS.yml +1 -57
  179. data/config/locales/it.yml +6 -111
  180. data/config/locales/ja.yml +63 -109
  181. data/config/locales/lb.yml +6 -73
  182. data/config/locales/lt.yml +72 -101
  183. data/config/locales/lv.yml +1 -98
  184. data/config/locales/nl.yml +6 -103
  185. data/config/locales/no.yml +6 -114
  186. data/config/locales/pl.yml +11 -111
  187. data/config/locales/pt-BR.yml +21 -116
  188. data/config/locales/pt.yml +6 -111
  189. data/config/locales/ro-RO.yml +13 -108
  190. data/config/locales/ru.yml +1 -65
  191. data/config/locales/sk.yml +1 -84
  192. data/config/locales/sl.yml +3 -5
  193. data/config/locales/sq-AL.yml +1 -0
  194. data/config/locales/sv.yml +20 -107
  195. data/config/locales/th-TH.yml +1 -0
  196. data/config/locales/tr-TR.yml +9 -111
  197. data/config/locales/uk.yml +1 -65
  198. data/config/locales/zh-CN.yml +6 -102
  199. data/config/locales/zh-TW.yml +31 -97
  200. data/db/migrate/20171017091734_add_scopes_for_all_initiative_types.rb +1 -1
  201. data/db/migrate/20171017095143_update_initiative_scoped_type.rb +1 -1
  202. data/db/migrate/20191002082220_move_signature_type_to_initative_type.rb +1 -1
  203. data/lib/decidim/api/initiative_committee_member_type.rb +2 -2
  204. data/lib/decidim/initiatives/admin_engine.rb +13 -93
  205. data/lib/decidim/initiatives/content_blocks/registry_manager.rb +22 -0
  206. data/lib/decidim/initiatives/engine.rb +45 -23
  207. data/lib/decidim/initiatives/menu.rb +150 -0
  208. data/lib/decidim/initiatives/participatory_space.rb +6 -91
  209. data/lib/decidim/initiatives/query_extensions.rb +5 -5
  210. data/lib/decidim/initiatives/seeds.rb +95 -0
  211. data/lib/decidim/initiatives/test/factories.rb +25 -7
  212. data/lib/decidim/initiatives/version.rb +1 -1
  213. data/lib/decidim/initiatives.rb +1 -1
  214. data/lib/tasks/decidim_initiatives.rake +2 -2
  215. data/lib/tasks/initiatives/upgrade/decidim_initiatives_upgrade_tasks.rake +1 -1
  216. metadata +49 -75
  217. data/app/cells/decidim/initiatives/content_blocks/highlighted_initiatives/show.erb +0 -28
  218. data/app/cells/decidim/initiatives/initiative_m/author.erb +0 -10
  219. data/app/cells/decidim/initiatives/initiative_m/footer.erb +0 -28
  220. data/app/cells/decidim/initiatives/initiative_m/tags.erb +0 -9
  221. data/app/cells/decidim/initiatives/initiative_m_cell.rb +0 -77
  222. data/app/controllers/decidim/initiatives/widgets_controller.rb +0 -30
  223. data/app/packs/stylesheets/decidim/initiatives/admin.scss +0 -33
  224. data/app/packs/stylesheets/decidim/initiatives/initiatives.scss +0 -64
  225. data/app/packs/stylesheets/decidim/initiatives/popularity_item.scss +0 -76
  226. data/app/packs/stylesheets/decidim/initiatives/statistics.scss +0 -15
  227. data/app/views/decidim/initiatives/create_initiative/_finish_help.html.erb +0 -2
  228. data/app/views/decidim/initiatives/create_initiative/previous_form.html.erb +0 -40
  229. data/app/views/decidim/initiatives/create_initiative/show_similar_initiatives.html.erb +0 -23
  230. data/app/views/decidim/initiatives/initiatives/_author.html.erb +0 -35
  231. data/app/views/decidim/initiatives/initiatives/_count.html.erb +0 -1
  232. data/app/views/decidim/initiatives/initiatives/_filters.html.erb +0 -33
  233. data/app/views/decidim/initiatives/initiatives/_filters_small_view.html.erb +0 -18
  234. data/app/views/decidim/initiatives/initiatives/_index_header.html.erb +0 -44
  235. data/app/views/decidim/initiatives/initiatives/_tags.html.erb +0 -7
  236. data/app/views/decidim/initiatives/versions/index.html.erb +0 -8
  237. data/db/seeds/city.jpeg +0 -0
  238. data/db/seeds/city2.jpeg +0 -0
  239. data/lib/decidim/initiatives/initiatives_filter_form_builder.rb +0 -56
  240. data/lib/gem_overrides/origami/date.rb +0 -47
@@ -1,53 +1,39 @@
1
+ <% add_decidim_page_title(t("new", scope: "decidim.initiatives.create_initiative.select_initiative_type")) %>
1
2
  <% default_type = available_initiative_types.first %>
2
- <% content_for :back_link do %>
3
- <%= link_to initiatives_path do %>
4
- <%= icon "chevron-left", class: "icon--small", role: "img", "aria-hidden": true %>
5
- <%= t(".back") %>
6
- <% end %>
3
+ <% announcement_body = capture do %>
4
+ <%= t("select_initiative_type_help", scope: "decidim.initiatives.create_initiative.select_initiative_type") %>
5
+ <%= link_to t("more_information", scope: "decidim.initiatives.create_initiative.select_initiative_type"), decidim.page_path("initiatives"), target: "_blank", class: "button button__sm button__text-secondary block text-left" %>
7
6
  <% end %>
8
7
 
9
- <div class="row column">
10
- <div class="callout secondary">
11
- <%= t ".select_initiative_type_help" %>
12
- <%= link_to t(".more_information"), decidim.page_path("initiatives"), target: "_blank" %>.
13
- </div>
14
- </div>
15
- <br>
16
- <div class="row column">
17
- <div class="main-container">
18
- <div class="row collapse main-container--side-panel">
19
- <div class="columns medium-4 large-3">
20
- <div class="side-panel">
21
- <ul class="tabs vertical side-panel__tabs" id="initiatives-tabs" data-tabs>
22
- <% initiative_types_each do |type| %>
23
- <li class="tabs-title <%= "is-active" if type == default_type %>">
24
- <%= link_to "#initiativeType#{type.id}" do %>
25
- <%= t(".choose_html", title: translated_attribute(type.title)) %>
26
- <% end %>
27
- </li>
28
- <% end %>
29
- </ul>
30
- </div>
31
- </div>
32
- <div class="columns medium-8 large-9">
33
- <div class="main-container__content">
34
- <div class="tabs-content vertical" data-tabs-content="initiatives-tabs">
35
- <% initiative_types_each do |type| %>
36
- <div class="tabs-panel <%= "is-active" if type == default_type %>" id="<%= "initiativeType#{type.id}" %>">
37
- <h2 class="section-heading"><%= translated_attribute(type.title) %></h2>
38
- <div>
39
- <%= raw translated_attribute type.description %>
40
- </div>
41
- <br>
42
- <%= decidim_form_for(@form, url: next_wizard_path, method: :put, html: { id: "new_initiative_#{type.id}", class: "form select-initiative_type-form" }) do |f| %>
43
- <%= f.hidden_field :type_id, value: type.id, id: "initiative_type_id_#{ type.id }" %>
44
- <%= f.submit t(".select"), class: "button" %>
45
- <% end %>
46
- </div>
47
- <% end %>
8
+ <%= cell("decidim/announcement", { body: announcement_body }, callout_class: "secondary") %>
9
+
10
+ <div class="initiatives__selection">
11
+ <% initiative_types_each do |type| %>
12
+ <% if allowed_to?(:create, :initiative, { initiative_type: type }) %>
13
+ <%= decidim_form_for(@form, url: select_initiative_type_create_initiative_index_path, method: :put, html: { id: "new_initiative_#{type.id}", class: "form-defaults " }) do |f| %>
14
+ <%= f.hidden_field :type_id, value: type.id, id: "initiative_type_id_#{type.id}" %>
15
+ <button class="card__highlight w-full">
16
+ <%= icon "lightbulb-flash-line", class: "verification__icon " %>
17
+ <div class="initiatives__selection__text">
18
+ <h2 class="h5 text-secondary"><%= translated_attribute(type.title) %></h2>
19
+ <span><%= raw translated_attribute type.description %></span>
48
20
  </div>
21
+ <%= icon "arrow-right-s-line", class: "fill-secondary initiatives__selection__icon" %>
22
+ </button>
23
+ <% end %>
24
+ <% else %>
25
+ <div class="card__highlight card__highlight-authorized">
26
+ <%= icon "lightbulb-flash-line", class: "verification__icon " %>
27
+ <div class="initiatives__selection__text">
28
+ <h2 class="h5 text-secondary"><%= translated_attribute(type.title) %></h2>
29
+ <span><%= raw translated_attribute type.description %></span>
30
+ <%= authorized_create_modal_button(type, remote: true, class: "button button__sm button__secondary") do %>
31
+ <%= t("verification_required", scope: "decidim.initiatives.create_initiative.select_initiative_type") %>
32
+ <% end %>
49
33
  </div>
50
34
  </div>
51
- </div>
52
- </div>
35
+ <% end %>
36
+ <% end %>
53
37
  </div>
38
+
39
+ <%= render partial: "decidim/initiatives/modal" %>
@@ -1,19 +1,15 @@
1
- <div class="hide-for-large m-bottom">
2
- <span class="text-small">
3
- <%= t("step", scope: "layouts.decidim.initiative_signature_creation_header", current: (wizard_steps.index(step) + 1), total: wizard_steps.length) %>
4
- (<a data-toggle="steps"><%= t("see_steps", scope: "layouts.decidim.initiative_signature_creation_header") %></a>)
5
- </span>
6
- <ol id="steps" class="wizard__steps steps-toggle is-hidden" data-toggler=".is-hidden">
7
- <% wizard_steps.each do |wizard_step| %>
8
- <% if step == wizard_step %>
9
- <li class="step--active">
10
- <%= t(wizard_step, scope: "layouts.decidim.initiative_signature_creation_header") %>
11
- </li>
12
- <% else %>
13
- <li>
14
- <%= t(wizard_step, scope: "layouts.decidim.initiative_signature_creation_header") %>
15
- </li>
16
- <% end %>
17
- <% end %>
18
- </ol>
19
- </div>
1
+ <% scope = "layouts.decidim.initiative_signature_creation_header" %>
2
+ <ol id="wizard-steps" class="wizard-steps">
3
+ <% options = { data: { active: false }, aria: { current: "step" } } %>
4
+
5
+ <% if fill_personal_data_step? %>
6
+ <%= content_tag :li, t("fill_personal_data", scope: ),
7
+ %w(fill_personal_data update_fill_personal_data).include?(action_name) ? options : {} %>
8
+ <% end %>
9
+ <% if sms_step? %>
10
+ <%= content_tag :li, t("sms_phone_number", scope: ),
11
+ %w(sms_phone_number update_sms_phone_number).include?(action_name) ? options : {} %>
12
+ <%= content_tag :li, t("sms_code", scope: ), %w(sms_code update_sms_code).include?(action_name) ? options : {} %>
13
+ <% end %>
14
+ <%= content_tag :li, t("finish", scope: ), action_name == "finish" ? options : {} %>
15
+ </ol>
@@ -1,43 +1,32 @@
1
- <div class="callout secondary mb-sm">
2
- <p>
3
- <%= t ".help" %>
4
- </p>
5
- </div>
6
- <h2 class="section-heading"><%= t(step, scope: "layouts.decidim.initiative_signature_creation_header") %></h2>
1
+ <%= cell("decidim/announcement", t("decidim.initiatives.initiative_signatures.fill_personal_data.help"), callout_class: "secondary") %>
7
2
 
8
- <%= render partial: "wizard_steps" %>
3
+ <%= decidim_form_for(@form, url: fill_personal_data_initiative_signatures_path, method: :put) do |f| %>
4
+ <%= form_required_explanation %>
5
+ <div>
6
+ <div class="form__wrapper">
7
+ <%= f.text_field :name_and_surname, autofocus: true, required: true %>
8
+ </div>
9
9
 
10
- <div class="card">
11
- <div class="card__content">
12
- <%= decidim_form_for(@form, url: next_wizard_path, method: :put, html: { class: "form user_personal_data_signature_form" }) do |f| %>
13
- <%= form_required_explanation %>
14
- <div>
15
- <div class="field">
16
- <%= f.text_field :name_and_surname, autofocus: true, required: true %>
17
- </div>
10
+ <div class="form__wrapper">
11
+ <%= f.text_field :document_number, required: true %>
12
+ </div>
18
13
 
19
- <div class="field">
20
- <%= f.text_field :document_number, required: true %>
21
- </div>
14
+ <div class="form__wrapper">
15
+ <%= f.date_field :date_of_birth, min: 120.years.ago.to_date, max: 16.years.ago.to_date, value: 35.years.ago.to_date %>
16
+ </div>
22
17
 
23
- <div class="field date">
24
- <%= f.date_select :date_of_birth, start_year: 1900, end_year: 16.years.ago.year, default: 35.years.ago, prompt: { day: t(".date_select.day"), month: t(".date_select.month"), year: t(".date_select.year") } %>
25
- </div>
18
+ <div class="form__wrapper">
19
+ <%= f.text_field :postal_code, required: true %>
20
+ </div>
26
21
 
27
- <div class="field">
28
- <%= f.text_field :postal_code, required: true %>
29
- </div>
30
-
31
- <div class="pb-s">
32
- <small class="text-small">
33
- <%= strip_tags(translated_attribute(extra_data_legal_information)) %>
34
- </small>
35
- </div>
36
- </div>
22
+ <div class="pb-s">
23
+ <small>
24
+ <%= strip_tags(translated_attribute(extra_data_legal_information)) %>
25
+ </small>
26
+ </div>
27
+ </div>
37
28
 
38
- <div class="actions">
39
- <%= f.submit t(".continue"), class: "button expanded" %>
40
- </div>
41
- <% end %>
29
+ <div class="form__wrapper-block">
30
+ <%= f.submit t(".continue"), class: "button button__sm md:button__lg button__secondary" %>
42
31
  </div>
43
- </div>
32
+ <% end %>
@@ -1,17 +1,6 @@
1
- <div class="callout secondary mb-sm">
2
- <p>
3
- <%= t("create.success_html",
4
- scope: "decidim.initiatives.initiative_votes",
5
- title: translated_attribute(current_initiative.title)) %>
6
- </p>
7
- </div>
8
- <h2 class="section-heading"><%= t("finished", scope: "layouts.decidim.initiative_signature_creation_header") %></h2>
1
+ <%= cell("decidim/announcement", t("decidim.initiatives.initiative_votes.create.success_html", title: translated_attribute(current_initiative.title)), callout_class: "secondary") %>
9
2
 
10
- <%= render partial: "wizard_steps" %>
11
-
12
- <div class="card">
13
- <br>
14
- <div class="column actions">
15
- <%= link_to t(".back_to_initiative"), initiative_path(current_initiative), class: "button white-button expanded" %>
16
- </div>
17
- </div>
3
+ <%= link_to initiative_path(current_initiative), class: "button button__sm md:button__lg button__text-secondary" do %>
4
+ <%= icon "arrow-left-line" %>
5
+ <%= t(".back_to_initiative") %>
6
+ <% end %>
@@ -1,22 +1,11 @@
1
- <div class="callout secondary mb-sm">
2
- <p>
3
- <%= t ".help" %>
4
- </p>
5
- </div>
6
- <h2 class="section-heading"><%= t(step, scope: "layouts.decidim.initiative_signature_creation_header") %></h2>
1
+ <%= cell("decidim/announcement", t("decidim.initiatives.initiative_signatures.sms_code.help"), callout_class: "secondary") %>
7
2
 
8
- <%= render partial: "wizard_steps" %>
9
-
10
- <div class="card">
11
- <div class="card__content">
12
- <%= decidim_form_for(@form, url: next_wizard_path, method: :put, html: { class: "form sms_code" }) do |f| %>
13
- <div class="field">
14
- <%= f.text_field :verification_code %>
15
- </div>
3
+ <%= decidim_form_for(@form, url: sms_code_initiative_signatures_path, method: :put) do |f| %>
4
+ <div class="form__wrapper">
5
+ <%= f.text_field :verification_code %>
6
+ </div>
16
7
 
17
- <div class="actions">
18
- <%= f.submit t(".continue"), class: "button expanded" %>
19
- </div>
20
- <% end %>
8
+ <div class="form__wrapper-block">
9
+ <%= f.submit t(".continue"), class: "button button__sm md:button__lg button__secondary" %>
21
10
  </div>
22
- </div>
11
+ <% end %>
@@ -1,22 +1,10 @@
1
- <div class="callout secondary mb-sm">
2
- <p>
3
- <%= t ".help" %>
4
- </p>
5
- </div>
6
- <h2 class="section-heading"><%= t(step, scope: "layouts.decidim.initiative_signature_creation_header") %></h2>
7
-
8
- <%= render partial: "wizard_steps" %>
9
-
10
- <div class="card">
11
- <div class="card__content">
12
- <%= decidim_form_for(@form, url: next_wizard_path, method: :put, html: { class: "form mobile_phone_number" }) do |f| %>
13
- <div class="field">
14
- <%= f.text_field :mobile_phone_number %>
15
- </div>
1
+ <%= cell("decidim/announcement", t("decidim.initiatives.initiative_signatures.sms_phone_number.help"), callout_class: "secondary") %>
2
+ <%= decidim_form_for(@form, url: sms_phone_number_initiative_signatures_path, method: :put) do |f| %>
3
+ <div class="form__wrapper">
4
+ <%= f.text_field :mobile_phone_number %>
5
+ </div>
16
6
 
17
- <div class="actions">
18
- <%= f.submit t(".continue"), class: "button expanded" %>
19
- </div>
20
- <% end %>
7
+ <div class="form__wrapper-block">
8
+ <%= f.submit t(".continue"), class: "button button__sm md:button__lg button__secondary" %>
21
9
  </div>
22
- </div>
10
+ <% end %>
@@ -1,73 +1,55 @@
1
- <fieldset>
2
- <legend><%= t ".title" %></legend>
1
+ <div class="block">
2
+ <span class="font-semibold text-xl"><%= t ".link" %></span>
3
+ <span class="help-text mb-2">
4
+ <%= t ".invite_to_committee_help" %>
5
+ </span>
3
6
 
4
- <div class="card-section">
5
- <div class="row column">
6
- <%= t ".invite_to_committee_help" %>
7
- </div>
8
-
9
- <div class="row column">
10
- <div class="card card--list">
11
- <div class="card--list__item">
12
- <div class="card--list__text">
13
- <div>
14
- <h6 class="card--list__heading heading6 lowercase" id="committee_link">
15
- <%= decidim_initiatives.new_initiative_committee_request_url(current_initiative) %>
16
- </h6>
17
- </div>
18
- </div>
19
- <div class="card--list__data">
20
- <%= icon_link_to "clipboard", "#", t(".invite_to_committee_help"), class: "card--list__data__icon invite-users-link" %>
21
- </div>
22
- </div>
23
- </div>
7
+ <div class="initiative__form__committee">
8
+ <span>
9
+ <%= decidim_initiatives.new_initiative_committee_request_url(current_initiative) %>
10
+ </span>
11
+ <div class="ml-auto fill-secondary inline-block">
12
+ <button type="button" class="button button__sm button__text-secondary" data-clipboard-copy="#urlShareLink-committee">
13
+ <%= render_committee_tooltip %>
14
+ <span class="sr-only"><%= t("decidim.shared.share_modal.copy_share_link") %></span>
15
+ </button>
16
+ <input id="urlShareLink-committee" type="text" class="!hidden" value="<%= decidim_initiatives.new_initiative_committee_request_url(current_initiative) %>" readonly>
24
17
  </div>
25
18
  </div>
26
- <div class="card-section">
27
- <div class="table-scroll">
28
- <table class="table-list">
29
- <thead>
30
- <tr>
31
- <th><%= t ".title" %></th>
32
- <th></th>
33
- </tr>
34
- </thead>
35
- <tbody>
36
- <% if current_initiative.committee_members.empty? %>
37
- <tr>
38
- <td><%= t ".no_members_yet" %></td>
39
- <td></td>
40
- </tr>
41
- <% end %>
42
-
43
- <% current_initiative.committee_members.each do |request| %>
44
- <tr data-id="<%= request.id %>">
45
- <td>
46
- <%= link_to request.user.name, "mailto:#{request.user.email}" %>
47
- </td>
48
- <td class="table-list__actions">
49
- <% if allowed_to? :approve, :initiative_committee_member, initiative: current_initiative, request: request %>
50
- <%= icon_link_to "check",
51
- approve_initiative_committee_request_path(current_initiative, request),
52
- t(".approve"),
53
- class: "action-icon--check" %>
19
+ </div>
20
+ <div class="block">
21
+ <span class="font-semibold text-xl mb-4 block"><%= t ".title" %></span>
22
+ <% if current_initiative.committee_members.empty? %>
23
+ <%= t ".no_members_yet" %>
24
+ <% end %>
25
+ <% current_initiative.committee_members.each do |request| %>
26
+ <div class="author mb-6" data-id="<%= request.id %>">
27
+ <div class="profile__group__list">
28
+ <%= card_for request.user %>
29
+ <% if allowed_to? :approve, :initiative_committee_member, initiative: current_initiative, request: request %>
30
+ <%= link_to(
31
+ approve_initiative_committee_request_path(current_initiative, request),
32
+ data: { confirm: t(".confirm_approve") },
33
+ class: "button button__sm button__transparent-secondary"
34
+ ) do %>
35
+ <span><%= t(".approve") %></span>
36
+ <%= icon "check-line" %>
54
37
  <% end %>
55
-
56
- <% if allowed_to? :revoke, :initiative_committee_member, initiative: current_initiative, request: request %>
57
- <%= icon_link_to "circle-x",
58
- revoke_initiative_committee_request_path(current_initiative, request),
59
- t(".revoke"),
60
- class: "action-icon--remove",
61
- method: :delete,
62
- data: { confirm: t(".confirm_revoke") } %>
38
+ <% end %>
39
+ <% if allowed_to? :revoke, :initiative_committee_member, initiative: current_initiative, request: request %>
40
+ <%= link_to(
41
+ revoke_initiative_committee_request_path(current_initiative, request),
42
+ method: :delete,
43
+ data: { confirm: t(".confirm_revoke") },
44
+ class: "button button__sm button__transparent-secondary"
45
+ ) do %>
46
+ <span><%= t(".revoke") %></span>
47
+ <%= icon "forbid-line" %>
63
48
  <% end %>
64
- </td>
65
- </tr>
66
- <% end %>
67
- </tbody>
68
- </table>
49
+ <% end %>
50
+ </div>
69
51
  </div>
70
- </div>
71
- </fieldset>
52
+ <% end %>
53
+ </div>
72
54
 
73
- <%= javascript_pack_tag "decidim_initiatives_admin" %>
55
+ <%= append_javascript_pack_tag "decidim_initiatives_admin" %>
@@ -1,120 +1,74 @@
1
1
  <%= form_required_explanation %>
2
2
 
3
3
  <% unless single_initiative_type? %>
4
- <div class="field">
5
- <%= form.select :type_id,
6
- initiative_type_options,
7
- {},
8
- {
9
- disabled: !@form.signature_type_updatable?,
10
- "data-scope-selector": "initiative_decidim_scope_id",
11
- "data-scope-id": form.object.scope_id.to_s,
12
- "data-scope-search-url": decidim_initiatives.initiative_type_scopes_search_url,
13
- "data-signature-types-selector": "initiative_signature_type",
14
- "data-signature-type": current_initiative.signature_type,
15
- "data-signature-types-search-url": decidim_initiatives.initiative_type_signature_types_search_url
16
- } %>
17
- </div>
4
+ <%= form.select :type_id,
5
+ initiative_type_options,
6
+ {},
7
+ {
8
+ disabled: !@form.signature_type_updatable?,
9
+ "data-scope-selector": "initiative_decidim_scope_id",
10
+ "data-scope-id": form.object.scope_id.to_s,
11
+ "data-scope-search-url": decidim_initiatives.initiative_type_scopes_search_url,
12
+ "data-signature-types-selector": "initiative_signature_type",
13
+ "data-signature-type": current_initiative.signature_type,
14
+ "data-signature-types-search-url": decidim_initiatives.initiative_type_signature_types_search_url
15
+ } %>
18
16
  <% end %>
19
17
 
20
- <div class="field">
21
- <%= form.text_field :title, autofocus: true, disabled: !allowed_to?(:update, :initiative, initiative: current_initiative), value: translated_attribute(@form.title) %>
22
- </div>
18
+ <%= form.text_field :title, autofocus: true, disabled: !allowed_to?(:update, :initiative, initiative: current_initiative), value: translated_attribute(@form.title) %>
23
19
 
24
- <div class="field">
25
- <%= text_editor_for(form, :description, toolbar: :content, lines: 8, disabled: !allowed_to?(:update, :initiative, initiative: current_initiative), value: translated_attribute(@form.description)) %>
26
- </div>
20
+ <%= text_editor_for(form, :description, toolbar: :content, lines: 8, disabled: !allowed_to?(:update, :initiative, initiative: current_initiative), value: translated_attribute(@form.description)) %>
27
21
 
28
- <div class="field">
29
- <%= form.text_field :hashtag, disabled: !allowed_to?(:update, :initiative, initiative: current_initiative) %>
30
- </div>
22
+ <%= form.text_field :hashtag, disabled: !allowed_to?(:update, :initiative, initiative: current_initiative) %>
31
23
 
32
- <% signature_type_options = signature_type_options(form.object) %>
33
- <% if signature_type_options.length == 1 %>
34
- <%= form.hidden_field :signature_type %>
35
- <% else %>
36
- <div class="field">
37
- <%= form.select :signature_type, signature_type_options, {}, { disabled: !@form.signature_type_updatable? } %>
38
- </div>
24
+ <% if @form.state_updatable? %>
25
+ <%= form.select :state, Decidim::Initiative.states.keys.map { |state| [I18n.t(state, scope: "decidim.initiatives.admin_states"), state] }, {} %>
39
26
  <% end %>
40
27
 
28
+ <%= form.select :scope_id, @form.available_scopes.map { |scope| [translated_attribute(scope.scope_name), scope.scope&.id] }, {}, { disabled: !@form.state_updatable? } %>
29
+
41
30
  <% if can_edit_custom_signature_end_date?(current_initiative) %>
42
- <div class="row column">
43
- <%= form.date_field :signature_end_date, disabled: !allowed_to?(:update, :initiative, initiative: current_initiative) %>
44
- </div>
31
+ <%= form.date_field :signature_end_date, disabled: !allowed_to?(:update, :initiative, initiative: current_initiative) %>
45
32
  <% end %>
46
33
 
47
- <div class="field">
48
- <%= form.select :scope_id,
49
- @form.available_scopes.map { |scope| [translated_attribute(scope.scope_name), scope&.scope&.id] },
50
- { disabled: !@form.state_updatable? } %>
51
- </div>
52
-
53
34
  <% if current_initiative.area_enabled? %>
54
- <div class="field">
55
- <%= form.areas_select :area_id,
56
- areas_for_select(current_organization),
57
- {
58
- selected: current_initiative.decidim_area_id,
59
- include_blank: current_initiative.decidim_area_id.blank? || current_initiative.created?
60
- },
61
- disabled: !@form.area_updatable? %>
62
- </div>
35
+ <%= form.areas_select :area_id,
36
+ areas_for_select(current_organization),
37
+ {
38
+ selected: current_initiative.decidim_area_id,
39
+ include_blank: current_initiative.decidim_area_id.blank? || current_initiative.created?
40
+ },
41
+ disabled: !@form.area_updatable? %>
63
42
  <% end %>
64
43
 
65
- <div class="field">
66
- <%= form.select :state,
67
- Decidim::Initiative.states.keys.map { |state| [I18n.t(state, scope: "decidim.initiatives.admin_states"), state] },
68
- {},
69
- { disabled: !@form.state_updatable? } %>
70
- </div>
44
+ <% signature_type_options = signature_type_options(form.object) %>
45
+ <% if signature_type_options.length == 1 %>
46
+ <%= form.hidden_field :signature_type %>
47
+ <% else %>
48
+ <%= form.select :signature_type, [], {}, { disabled: !@form.signature_type_updatable? } %>
49
+ <% end %>
71
50
 
72
51
  <% if current_initiative.type.attachments_enabled? %>
73
- <fieldset class="attachments_container">
74
- <legend><%= t("attachment_legend", scope: "decidim.initiatives.form") %></legend>
75
-
76
- <% if @form.photos.any? %>
77
- <% @form.photos.each do |photo| %>
78
- <div class="callout gallery__item" data-closable>
79
- <%= image_tag photo.thumbnail_url, class: "thumbnail", alt: photo.file.filename %>
80
- <%= form.hidden_field :photos, multiple: true, value: photo.id, id: "photo-#{photo.id}" %>
81
- <button class="close-button"
82
- aria-label="<%= t("delete_attachment", scope: "decidim.initiatives.form") %>"
83
- title="<%= t("delete_attachment", scope: "decidim.initiatives.form") %>"
84
- type="button"
85
- data-close>
86
- <span aria-hidden="true">&times;</span>
87
- </button>
88
- </div>
89
- <% end %>
90
- <% end %>
52
+ <%= form.attachment :documents,
53
+ multiple: true,
54
+ label: t("decidim.initiatives.form.add_documents"),
55
+ button_label: t("decidim.initiatives.form.add_documents"),
56
+ button_class: "button button__lg button__transparent-secondary w-full",
57
+ button_edit_label: t("decidim.initiatives.form.edit_documents"),
58
+ help_text: t("decidim.initiatives.form.attachment_legend") %>
91
59
 
92
- <% if @form.documents.any? %>
93
- <% @form.documents.each do |document| %>
94
- <div class="callout" data-closable>
95
- <%= link_to translated_attribute(document.title), document.url %>
96
- <small><%= document.file_type %> <%= number_to_human_size(document.file_size) %></small>
97
- <%= form.hidden_field :documents, multiple: true, value: document.id, id: "document-#{document.id}" %>
98
- <button class="close-button"
99
- aria-label="<%= t("delete_attachment", scope: "decidim.initiatives.form") %>"
100
- title="<%= t("delete_attachment", scope: "decidim.initiatives.form") %>"
101
- type="button" data-close>
102
- <span aria-hidden="true">&times;</span>
103
- </button>
104
- </div>
105
- <% end %>
106
- <% end %>
107
-
108
- <div class="row column">
109
- <%= form.file_field :add_documents, multiple: true, label: t("add_attachments", scope: "decidim.initiatives.form") %>
110
- </div>
111
- </fieldset>
60
+ <%= form.attachment :photos,
61
+ multiple: true,
62
+ label: t("decidim.initiatives.form.add_image"),
63
+ button_label: t("decidim.initiatives.form.add_image"),
64
+ button_class: "button button__lg button__transparent-secondary w-full",
65
+ button_edit_label: t("decidim.initiatives.form.edit_image"),
66
+ help_text: t("decidim.initiatives.form.image_legend") %>
112
67
  <% end %>
113
68
 
114
69
  <% if current_initiative.type.promoting_committee_enabled? %>
115
70
  <%= render partial: "committee_members" %>
116
71
  <% end %>
117
72
 
118
- <% content_for :js_content do %>
119
- <%= javascript_pack_tag "decidim_initiatives" %>
120
- <% end %>
73
+ <%= append_javascript_pack_tag "decidim_initiatives" %>
74
+ <%= append_stylesheet_pack_tag "decidim_initiatives", media: "all" %>
@@ -1,5 +1,3 @@
1
- <% if initiative.rejected? || initiative.accepted? %>
2
- <span class="<%= state_badge_css_class(initiative) %> label initiative-status">
3
- <%= humanize_state initiative %>
4
- </span>
5
- <% end %>
1
+ <span class="<%= metadata_badge_css_class(initiative.state) %> label initiative-status rounded px-2">
2
+ <%= t(initiative.state, scope: "decidim.initiatives.show.badge_name") %>
3
+ </span>
@@ -0,0 +1,13 @@
1
+ <section style="background-image:url('<%= hero_background_path(current_initiative) %>');">
2
+ <div class="initiative__hero">
3
+ <div class="initiative__hero-text">
4
+ <h1 class="h1 text-5xl">
5
+ <%= translated_attribute(current_participatory_space.title) %>
6
+ </h1>
7
+ <p class="initiative__hero-slogan">
8
+ <%= render partial: "tags_type", locals: { resource: current_initiative } %>
9
+ </p>
10
+ <%= render partial: "layouts/decidim/initiative_header_steps", locals: { initiative: current_participatory_space } %>
11
+ </div>
12
+ </div>
13
+ </section>