decidim-meetings 0.27.9 → 0.28.0.rc4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (251) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/meetings/attending_organizations_list_cell.rb +32 -0
  3. data/app/cells/decidim/meetings/cancel_registration_meeting_button/cancelation_modal.erb +21 -0
  4. data/app/cells/decidim/meetings/cancel_registration_meeting_button/show.erb +10 -13
  5. data/app/cells/decidim/meetings/cancel_registration_meeting_button_cell.rb +2 -2
  6. data/app/cells/decidim/meetings/content_blocks/highlighted_meetings_cell.rb +8 -18
  7. data/app/cells/decidim/meetings/dates_and_map/show.erb +25 -0
  8. data/app/cells/decidim/meetings/dates_and_map/static_map.erb +1 -0
  9. data/app/cells/decidim/meetings/dates_and_map_cell.rb +35 -0
  10. data/app/cells/decidim/meetings/highlighted_meetings_for_component/show.erb +32 -30
  11. data/app/cells/decidim/meetings/highlighted_meetings_for_component_cell.rb +76 -16
  12. data/app/cells/decidim/meetings/join_meeting_button/registration_modal.erb +25 -0
  13. data/app/cells/decidim/meetings/join_meeting_button/remaining_slots.erb +4 -0
  14. data/app/cells/decidim/meetings/join_meeting_button/show.erb +6 -4
  15. data/app/cells/decidim/meetings/join_meeting_button_cell.rb +3 -7
  16. data/app/cells/decidim/meetings/meeting_activity_cell.rb +1 -12
  17. data/app/cells/decidim/meetings/meeting_card_metadata_cell.rb +64 -0
  18. data/app/cells/decidim/meetings/meeting_cell.rb +2 -6
  19. data/app/cells/decidim/meetings/meeting_l/image.erb +5 -0
  20. data/app/cells/decidim/meetings/meeting_l_cell.rb +33 -0
  21. data/app/cells/decidim/meetings/meeting_month/show.erb +33 -0
  22. data/app/cells/decidim/meetings/meeting_month_cell.rb +72 -0
  23. data/app/cells/decidim/meetings/meeting_s_cell.rb +5 -37
  24. data/app/cells/decidim/meetings/meetings_map/show.erb +9 -24
  25. data/app/cells/decidim/meetings/meetings_map_cell.rb +1 -1
  26. data/app/cells/decidim/meetings/online_meeting_cell.rb +1 -0
  27. data/app/cells/decidim/meetings/online_meeting_link/show.erb +18 -41
  28. data/app/cells/decidim/meetings/public_participants_list/show.erb +4 -15
  29. data/app/commands/decidim/meetings/admin/copy_meeting.rb +1 -1
  30. data/app/commands/decidim/meetings/admin/create_meeting.rb +1 -1
  31. data/app/commands/decidim/meetings/admin/invite_user_to_join_meeting.rb +5 -5
  32. data/app/commands/decidim/meetings/admin/publish_meeting.rb +1 -1
  33. data/app/commands/decidim/meetings/admin/unpublish_meeting.rb +1 -1
  34. data/app/commands/decidim/meetings/create_meeting.rb +14 -3
  35. data/app/commands/decidim/meetings/decline_invitation.rb +1 -1
  36. data/app/commands/decidim/meetings/join_meeting.rb +5 -5
  37. data/app/commands/decidim/meetings/update_meeting.rb +13 -3
  38. data/app/controllers/concerns/decidim/meetings/component_filterable.rb +4 -4
  39. data/app/controllers/decidim/meetings/admin/agenda_controller.rb +6 -6
  40. data/app/controllers/decidim/meetings/admin/invites_controller.rb +3 -3
  41. data/app/controllers/decidim/meetings/admin/meeting_closes_controller.rb +2 -4
  42. data/app/controllers/decidim/meetings/admin/meeting_copies_controller.rb +3 -3
  43. data/app/controllers/decidim/meetings/admin/meetings_controller.rb +7 -7
  44. data/app/controllers/decidim/meetings/admin/meetings_poll_controller.rb +4 -4
  45. data/app/controllers/decidim/meetings/admin/registrations_controller.rb +6 -6
  46. data/app/controllers/decidim/meetings/application_controller.rb +11 -0
  47. data/app/controllers/decidim/meetings/calendars_controller.rb +0 -1
  48. data/app/controllers/decidim/meetings/directory/application_controller.rb +12 -0
  49. data/app/controllers/decidim/meetings/directory/meetings_controller.rb +5 -30
  50. data/app/controllers/decidim/meetings/live_events_controller.rb +1 -0
  51. data/app/controllers/decidim/meetings/meeting_closes_controller.rb +2 -3
  52. data/app/controllers/decidim/meetings/meetings_controller.rb +75 -7
  53. data/app/controllers/decidim/meetings/polls/answers_controller.rb +2 -2
  54. data/app/controllers/decidim/meetings/polls/questions_controller.rb +1 -1
  55. data/app/controllers/decidim/meetings/registrations_controller.rb +5 -5
  56. data/app/events/decidim/meetings/close_meeting_event.rb +1 -1
  57. data/app/events/decidim/meetings/meeting_event.rb +1 -1
  58. data/app/events/decidim/meetings/meeting_registration_notification_event.rb +3 -3
  59. data/app/events/decidim/meetings/meeting_registrations_enabled_event.rb +1 -1
  60. data/app/events/decidim/meetings/meeting_registrations_over_percentage_event.rb +1 -1
  61. data/app/events/decidim/meetings/registration_code_validated_event.rb +1 -1
  62. data/app/forms/decidim/meetings/admin/meeting_form.rb +5 -1
  63. data/app/forms/decidim/meetings/admin/meeting_registrations_form.rb +2 -2
  64. data/app/forms/decidim/meetings/admin/validate_registration_code_form.rb +1 -1
  65. data/app/forms/decidim/meetings/base_meeting_form.rb +1 -1
  66. data/app/forms/decidim/meetings/meeting_form.rb +3 -3
  67. data/app/helpers/decidim/meetings/admin/application_helper.rb +1 -0
  68. data/app/helpers/decidim/meetings/application_helper.rb +18 -25
  69. data/app/helpers/decidim/meetings/directory/application_helper.rb +11 -59
  70. data/app/helpers/decidim/meetings/map_helper.rb +2 -9
  71. data/app/helpers/decidim/meetings/meetings_helper.rb +6 -5
  72. data/app/jobs/decidim/meetings/hide_all_created_by_author_job.rb +13 -0
  73. data/app/mailers/decidim/meetings/admin/invite_join_meeting_mailer.rb +1 -1
  74. data/app/mailers/decidim/meetings/registration_mailer.rb +1 -1
  75. data/app/models/decidim/meetings/meeting.rb +11 -32
  76. data/app/models/decidim/meetings/question.rb +1 -1
  77. data/app/packs/entrypoints/decidim_meetings.js +3 -0
  78. data/app/packs/images/decidim/gamification/badges/decidim_gamification_badges_attended_meetings.svg +42 -1
  79. data/app/packs/src/decidim/meetings/admin/agendas.js +3 -4
  80. data/app/packs/src/decidim/meetings/admin/registrations_form.js +12 -4
  81. data/app/packs/src/decidim/meetings/meetings_form.js +1 -1
  82. data/app/packs/src/decidim/meetings/poll.component.js +1 -28
  83. data/app/packs/stylesheets/decidim/meetings/_calendar.scss +47 -0
  84. data/app/packs/stylesheets/decidim/meetings/_item.scss +177 -0
  85. data/app/packs/stylesheets/decidim/meetings/_list.scss +58 -0
  86. data/app/packs/stylesheets/decidim/meetings/_live_event.scss +128 -0
  87. data/app/packs/stylesheets/decidim/meetings/meetings.scss +4 -0
  88. data/app/permissions/decidim/meetings/permissions.rb +15 -12
  89. data/app/presenters/decidim/meetings/admin_log/invite_presenter.rb +2 -2
  90. data/app/presenters/decidim/meetings/admin_log/meeting_presenter.rb +6 -2
  91. data/app/presenters/decidim/meetings/admin_log/questionnaire_presenter.rb +2 -2
  92. data/app/presenters/decidim/meetings/admin_log/value_types/meeting_title_description_presenter.rb +1 -1
  93. data/app/presenters/decidim/meetings/log/resource_presenter.rb +18 -0
  94. data/app/presenters/decidim/meetings/meeting_presenter.rb +8 -2
  95. data/app/services/decidim/meetings/calendar/component_calendar.rb +1 -1
  96. data/app/services/decidim/meetings/close_meeting_reminder_generator.rb +7 -13
  97. data/app/services/decidim/meetings/meeting_iframe_embedder.rb +1 -1
  98. data/app/views/decidim/meetings/_calendar_modal.html.erb +19 -21
  99. data/app/views/decidim/meetings/admin/agenda/_agenda_item.html.erb +12 -12
  100. data/app/views/decidim/meetings/admin/agenda/_agenda_item_child.html.erb +8 -8
  101. data/app/views/decidim/meetings/admin/agenda/_agenda_item_child_template.html.erb +1 -1
  102. data/app/views/decidim/meetings/admin/agenda/_agenda_item_fields.html.erb +3 -3
  103. data/app/views/decidim/meetings/admin/agenda/_form.html.erb +54 -50
  104. data/app/views/decidim/meetings/admin/agenda/edit.html.erb +18 -6
  105. data/app/views/decidim/meetings/admin/agenda/new.html.erb +17 -5
  106. data/app/views/decidim/meetings/admin/invite_join_meeting_mailer/invite.html.erb +11 -2
  107. data/app/views/decidim/meetings/admin/invites/_form.html.erb +38 -28
  108. data/app/views/decidim/meetings/admin/invites/index.html.erb +77 -81
  109. data/app/views/decidim/meetings/admin/meeting_closes/_form.html.erb +26 -28
  110. data/app/views/decidim/meetings/admin/meeting_closes/edit.html.erb +17 -5
  111. data/app/views/decidim/meetings/admin/meeting_copies/new.html.erb +17 -6
  112. data/app/views/decidim/meetings/admin/meetings/_form.html.erb +76 -83
  113. data/app/views/decidim/meetings/admin/meetings/_service.html.erb +14 -10
  114. data/app/views/decidim/meetings/admin/meetings/_services.html.erb +9 -5
  115. data/app/views/decidim/meetings/admin/meetings/edit.html.erb +17 -7
  116. data/app/views/decidim/meetings/admin/meetings/index.html.erb +133 -129
  117. data/app/views/decidim/meetings/admin/meetings/new.html.erb +16 -6
  118. data/app/views/decidim/meetings/admin/poll/_answer_option.html.erb +1 -1
  119. data/app/views/decidim/meetings/admin/poll/_answer_option_template.html.erb +1 -1
  120. data/app/views/decidim/meetings/admin/poll/_form.html.erb +17 -32
  121. data/app/views/decidim/meetings/admin/poll/_question.html.erb +81 -75
  122. data/app/views/decidim/meetings/admin/poll/edit.html.erb +28 -8
  123. data/app/views/decidim/meetings/admin/registrations/_form.html.erb +32 -55
  124. data/app/views/decidim/meetings/admin/registrations/edit.html.erb +59 -26
  125. data/app/views/decidim/meetings/directory/meetings/index.html.erb +15 -20
  126. data/app/views/decidim/meetings/directory/meetings/index.js.erb +1 -23
  127. data/app/views/decidim/meetings/layouts/_aside_block.html.erb +8 -0
  128. data/app/views/decidim/meetings/layouts/live_event.html.erb +20 -19
  129. data/app/views/decidim/meetings/live_events/show.html.erb +4 -5
  130. data/app/views/decidim/meetings/meeting_closes/_form.html.erb +3 -10
  131. data/app/views/decidim/meetings/meeting_closes/edit.html.erb +17 -21
  132. data/app/views/decidim/meetings/meetings/_actions.html.erb +6 -0
  133. data/app/views/decidim/meetings/meetings/_add_to_calendar_modal.html.erb +17 -0
  134. data/app/views/decidim/meetings/meetings/_form.html.erb +26 -34
  135. data/app/views/decidim/meetings/meetings/_linked_meetings.html.erb +3 -22
  136. data/app/views/decidim/meetings/meetings/_meeting.html.erb +74 -0
  137. data/app/views/decidim/meetings/meetings/_meeting_agenda.html.erb +28 -26
  138. data/app/views/decidim/meetings/meetings/_meeting_aside.html.erb +98 -0
  139. data/app/views/decidim/meetings/meetings/_meeting_minutes.html.erb +23 -36
  140. data/app/views/decidim/meetings/meetings/edit.html.erb +17 -21
  141. data/app/views/decidim/meetings/meetings/index.html.erb +15 -33
  142. data/app/views/decidim/meetings/meetings/index.js.erb +1 -23
  143. data/app/views/decidim/meetings/meetings/new.html.erb +17 -21
  144. data/app/views/decidim/meetings/meetings/show.html.erb +8 -167
  145. data/app/views/decidim/meetings/polls/answers/_multiple_option.html.erb +9 -13
  146. data/app/views/decidim/meetings/polls/answers/_single_option.html.erb +4 -4
  147. data/app/views/decidim/meetings/polls/answers/create.js.erb +1 -1
  148. data/app/views/decidim/meetings/polls/questions/_index.html.erb +1 -1
  149. data/app/views/decidim/meetings/polls/questions/_index_admin.html.erb +5 -5
  150. data/app/views/decidim/meetings/polls/questions/_published_question.html.erb +9 -11
  151. data/app/views/decidim/meetings/polls/questions/_question.html.erb +3 -3
  152. data/app/views/decidim/meetings/polls/questions/index_admin.js.erb +1 -1
  153. data/app/views/decidim/meetings/shared/_filters.html.erb +20 -0
  154. data/app/views/decidim/meetings/shared/_index.html.erb +24 -0
  155. data/app/views/decidim/meetings/shared/_index.js.erb +16 -0
  156. data/app/views/decidim/meetings/shared/_meetings.html.erb +33 -0
  157. data/app/views/decidim/meetings/shared/_meetings_aside.html.erb +18 -0
  158. data/app/views/decidim/meetings/versions/show.html.erb +14 -4
  159. data/app/views/decidim/participatory_spaces/_conference_venues.html.erb +13 -15
  160. data/config/assets.rb +0 -2
  161. data/config/locales/ar.yml +6 -94
  162. data/config/locales/bg.yml +0 -673
  163. data/config/locales/ca.yml +52 -75
  164. data/config/locales/cs.yml +48 -71
  165. data/config/locales/de.yml +53 -76
  166. data/config/locales/el.yml +48 -51
  167. data/config/locales/en.yml +51 -74
  168. data/config/locales/es-MX.yml +50 -73
  169. data/config/locales/es-PY.yml +48 -71
  170. data/config/locales/es.yml +53 -76
  171. data/config/locales/eu.yml +53 -76
  172. data/config/locales/fi-plain.yml +46 -69
  173. data/config/locales/fi.yml +44 -67
  174. data/config/locales/fr-CA.yml +43 -69
  175. data/config/locales/fr.yml +48 -71
  176. data/config/locales/ga-IE.yml +2 -16
  177. data/config/locales/gl.yml +5 -63
  178. data/config/locales/hu.yml +6 -92
  179. data/config/locales/id-ID.yml +4 -60
  180. data/config/locales/is-IS.yml +1 -22
  181. data/config/locales/it.yml +6 -86
  182. data/config/locales/ja.yml +45 -74
  183. data/config/locales/lb.yml +6 -67
  184. data/config/locales/lt.yml +42 -65
  185. data/config/locales/lv.yml +4 -61
  186. data/config/locales/nl.yml +4 -92
  187. data/config/locales/no.yml +4 -80
  188. data/config/locales/pl.yml +2 -199
  189. data/config/locales/pt-BR.yml +4 -200
  190. data/config/locales/pt.yml +5 -85
  191. data/config/locales/ro-RO.yml +11 -81
  192. data/config/locales/ru.yml +5 -60
  193. data/config/locales/sk.yml +4 -61
  194. data/config/locales/sl.yml +0 -3
  195. data/config/locales/sr-CS.yml +0 -6
  196. data/config/locales/sv.yml +14 -94
  197. data/config/locales/tr-TR.yml +5 -78
  198. data/config/locales/uk.yml +5 -53
  199. data/config/locales/zh-CN.yml +3 -70
  200. data/config/locales/zh-TW.yml +24 -51
  201. data/db/migrate/20201016065302_fix_meetings_registration_terms.rb +1 -1
  202. data/db/migrate/20230427105701_change_types_and_registration_types_on_meetings.rb +49 -0
  203. data/lib/decidim/meetings/admin_engine.rb +2 -2
  204. data/lib/decidim/meetings/component.rb +4 -216
  205. data/lib/decidim/meetings/content_blocks/registry_manager.rb +17 -0
  206. data/lib/decidim/meetings/directory_engine.rb +4 -6
  207. data/lib/decidim/meetings/engine.rb +62 -27
  208. data/lib/decidim/meetings/meeting_serializer.rb +3 -3
  209. data/lib/decidim/meetings/seeds.rb +188 -0
  210. data/lib/decidim/meetings/test/factories.rb +124 -54
  211. data/lib/decidim/meetings/test/notifications_handling.rb +3 -3
  212. data/lib/decidim/meetings/test/translated_event.rb +1 -1
  213. data/lib/decidim/meetings/version.rb +1 -1
  214. metadata +58 -58
  215. data/app/cells/decidim/meetings/content_blocks/highlighted_meetings/elements.erb +0 -16
  216. data/app/cells/decidim/meetings/content_blocks/highlighted_meetings/heading.erb +0 -1
  217. data/app/cells/decidim/meetings/content_blocks/upcoming_meetings/show.erb +0 -26
  218. data/app/cells/decidim/meetings/content_blocks/upcoming_meetings_cell.rb +0 -63
  219. data/app/cells/decidim/meetings/join_meeting_button/registration_confirm.erb +0 -31
  220. data/app/cells/decidim/meetings/meeting_highlighted_list_item/show.erb +0 -21
  221. data/app/cells/decidim/meetings/meeting_highlighted_list_item_cell.rb +0 -10
  222. data/app/cells/decidim/meetings/meeting_list_item/show.erb +0 -14
  223. data/app/cells/decidim/meetings/meeting_list_item_cell.rb +0 -44
  224. data/app/cells/decidim/meetings/meeting_m/address.erb +0 -5
  225. data/app/cells/decidim/meetings/meeting_m/data.erb +0 -2
  226. data/app/cells/decidim/meetings/meeting_m/date.erb +0 -8
  227. data/app/cells/decidim/meetings/meeting_m/footer.erb +0 -9
  228. data/app/cells/decidim/meetings/meeting_m/multiple_dates.erb +0 -17
  229. data/app/cells/decidim/meetings/meeting_m/single_date.erb +0 -9
  230. data/app/cells/decidim/meetings/meeting_m/tags.erb +0 -1
  231. data/app/cells/decidim/meetings/meeting_m_cell.rb +0 -121
  232. data/app/cells/decidim/meetings/meeting_s/show.erb +0 -27
  233. data/app/controllers/concerns/decidim/meetings/filterable.rb +0 -27
  234. data/app/controllers/decidim/meetings/widgets_controller.rb +0 -30
  235. data/app/packs/stylesheets/decidim/meetings/_header.scss +0 -52
  236. data/app/packs/stylesheets/decidim/meetings/_main.scss +0 -178
  237. data/app/packs/stylesheets/decidim/meetings/_meetings.scss +0 -2
  238. data/app/queries/decidim/meetings/admin/invites.rb +0 -60
  239. data/app/views/decidim/meetings/admin/meeting_closes/proposals_picker.html.erb +0 -1
  240. data/app/views/decidim/meetings/directory/meetings/_filters.html.erb +0 -34
  241. data/app/views/decidim/meetings/directory/meetings/_meetings.html.erb +0 -26
  242. data/app/views/decidim/meetings/meeting_closes/proposals_picker.html.erb +0 -1
  243. data/app/views/decidim/meetings/meetings/_calendar_modal.html.erb +0 -26
  244. data/app/views/decidim/meetings/meetings/_filters.html.erb +0 -40
  245. data/app/views/decidim/meetings/meetings/_filters_small_view.html.erb +0 -18
  246. data/app/views/decidim/meetings/meetings/_meetings.html.erb +0 -48
  247. data/app/views/decidim/meetings/versions/index.html.erb +0 -8
  248. data/app/views/decidim/participatory_spaces/_upcoming_meeting_for_card.html.erb +0 -4
  249. data/config/locales/he-IL.yml +0 -1
  250. data/decidim-meetings.gemspec +0 -36
  251. data/lib/decidim/meetings/seeds/city.jpeg +0 -0
@@ -1,160 +1,164 @@
1
1
  <% add_decidim_page_title(t(".title")) %>
2
2
  <div class="card">
3
- <div class="card-divider">
4
- <h2 class="card-title">
3
+ <div class="item_show__header">
4
+ <h2 class="item_show__header-title">
5
5
  <%= t(".title") %>
6
- <div class="button--title">
7
- <%= link_to t("actions.new", scope: "decidim.meetings", name: t("models.meeting.name", scope: "decidim.meetings.admin")), new_meeting_path, class: "button tiny button--simple" if allowed_to? :create, :meeting %>
8
- <%= export_dropdown %>
9
- </div>
6
+ <%= export_dropdowns(query) %>
7
+ <%= link_to t("actions.new_meeting", scope: "decidim.meetings"), new_meeting_path, class: "button button__sm button__secondary" if allowed_to? :create, :meeting %>
8
+ <%= render partial: "decidim/admin/components/resource_action" %>
10
9
  </h2>
11
10
  </div>
12
11
 
13
12
  <%= admin_filter_selector(:meetings) %>
14
- <div class="card-section">
15
- <div class="table-scroll">
16
- <table class="table-list">
17
- <thead>
18
- <tr>
19
- <th>
20
- <%= sort_link(query, :id, t("models.meeting.fields.id", scope: "decidim.meetings"), default_order: :desc ) %>
21
- </th>
22
- <th>
23
- <%= sort_link(query, :translated_title, t("models.meeting.fields.title", scope: "decidim.meetings"), default_order: :desc ) %>
24
- </th>
25
- <th>
26
- <%= sort_link(query, :start_time, t("models.meeting.fields.start_time", scope: "decidim.meetings"), default_order: :desc ) %>
27
- </th>
28
- <th>
29
- <%= sort_link(query, :end_time, t("models.meeting.fields.end_time", scope: "decidim.meetings"), default_order: :desc ) %>
30
- </th>
13
+ <div class="table-scroll">
14
+ <table class="table-list">
15
+ <thead>
16
+ <tr>
17
+ <th>
18
+ <%= sort_link(query, :id, t("models.meeting.fields.id", scope: "decidim.meetings"), default_order: :desc ) %>
19
+ </th>
20
+ <th>
21
+ <%= sort_link(query, :translated_title, t("models.meeting.fields.title", scope: "decidim.meetings"), default_order: :desc ) %>
22
+ </th>
23
+ <th>
24
+ <%= sort_link(query, :start_time, t("models.meeting.fields.start_time", scope: "decidim.meetings"), default_order: :desc ) %>
25
+ </th>
26
+ <th>
27
+ <%= sort_link(query, :end_time, t("models.meeting.fields.end_time", scope: "decidim.meetings"), default_order: :desc ) %>
28
+ </th>
29
+ <th>
30
+ <%= sort_link(query, :closed, t("models.meeting.fields.closed", scope: "decidim.meetings"), default_order: :desc ) %>
31
+ </th>
32
+ <% if maps_enabled? && Decidim::Map.available?(:static, :geocoding) %>
33
+ <th><%= t("models.meeting.fields.map", scope: "decidim.meetings") %></th>
34
+ <% end %>
35
+ <% if resource_with_scopes_enabled? %>
31
36
  <th>
32
- <%= sort_link(query, :closed, t("models.meeting.fields.closed", scope: "decidim.meetings"), default_order: :desc ) %>
37
+ <%= sort_link(query, :scope_name, t("models.proposal.fields.scope", scope: "decidim.proposals") ) %>
33
38
  </th>
34
- <% if maps_enabled? && Decidim::Map.available?(:static, :geocoding) %>
35
- <th><%= t("models.meeting.fields.map", scope: "decidim.meetings") %></th>
36
- <% end %>
37
- <% if resource_with_scopes_enabled? %>
38
- <th>
39
- <%= sort_link(query, :scope_name, t("models.proposal.fields.scope", scope: "decidim.proposals") ) %>
40
- </th>
41
- <% end %>
42
- <th class="actions"><%= t("actions.title", scope: "decidim.meetings") %></th>
43
- </tr>
44
- </thead>
45
- <tbody>
46
- <% meetings.each do |meeting| %>
47
- <tr data-id="<%= meeting.id %>">
48
- <td>
49
- <%= meeting.id %><br>
50
- </td>
51
- <td>
39
+ <% end %>
40
+ <th class="actions"><%= t("actions.title", scope: "decidim.meetings") %></th>
41
+ </tr>
42
+ </thead>
43
+ <tbody>
44
+ <% meetings.each do |meeting| %>
45
+ <tr data-id="<%= meeting.id %>">
46
+ <td>
47
+ <%= meeting.id %><br>
48
+ </td>
49
+ <td>
50
+ <% if allowed_to? :update, :meeting, meeting: meeting %>
51
+ <%= link_to present(meeting).title(html_escape: true), edit_meeting_path(meeting) %>
52
+ <% else %>
52
53
  <%= present(meeting).title(html_escape: true) %><br>
53
- </td>
54
- <td>
55
- <% if meeting.start_time %>
56
- <%= l meeting.start_time, format: :long %>
57
- <% end %>
58
- </td>
59
- <td>
60
- <% if meeting.end_time %>
61
- <%= l meeting.end_time, format: :long %>
62
- <% end %>
63
- </td>
54
+ <% end %>
55
+ </td>
56
+ <td>
57
+ <% if meeting.start_time %>
58
+ <%= l meeting.start_time, format: :long %>
59
+ <% end %>
60
+ </td>
61
+ <td>
62
+ <% if meeting.end_time %>
63
+ <%= l meeting.end_time, format: :long %>
64
+ <% end %>
65
+ </td>
66
+ <td>
67
+ <%= humanize_boolean meeting.closed? %>
68
+ </td>
69
+ <% if maps_enabled? && Decidim::Map.available?(:static, :geocoding) %>
64
70
  <td>
65
- <%= humanize_boolean meeting.closed? %>
71
+ <%= static_map_link(meeting, {}, { class: "static-map__admin" }) unless meeting.online? %>
66
72
  </td>
67
- <% if maps_enabled? && Decidim::Map.available?(:static, :geocoding) %>
68
- <td>
69
- <%= static_map_link(meeting) %>
70
- </td>
73
+ <% end %>
74
+ <%= td_resource_scope_for(meeting.scope) %>
75
+ <td class="table-list__actions">
76
+ <% if allowed_to? :update, :meeting, meeting: meeting %>
77
+ <%= icon_link_to "pencil-line", edit_meeting_path(meeting), t("actions.edit", scope: "decidim.meetings"), class: "action-icon--edit" %>
78
+ <% else %>
79
+ <span class="action-space icon"></span>
71
80
  <% end %>
72
- <%= td_resource_scope_for(meeting.scope) %>
73
- <td class="table-list__actions">
74
- <% if allowed_to? :update, :meeting, meeting: meeting %>
75
- <% if meeting.published? %>
76
- <%= icon_link_to "x", unpublish_meeting_path(meeting), t("actions.unpublish", scope: "decidim.admin"), method: :put, class: "action-icon--unpublish", data: { confirm: t("actions.unpublish", scope: "decidim.admin") } %>
77
- <% else %>
78
- <%= icon_link_to "check", publish_meeting_path(meeting), t("actions.publish", scope: "decidim.admin"), method: :put, class: "action-icon--publish" %>
79
- <% end %>
80
- <% else %>
81
- <span class="action-space icon"></span>
82
- <% end %>
83
81
 
84
- <%= icon_link_to "eye", resource_locator(meeting).path, t("actions.preview", scope: "decidim.meetings"), class: "action-icon--preview", target: :blank %>
82
+ <% if allowed_to? :copy, :meeting, meeting: meeting %>
83
+ <%= icon_link_to "file-copy-line", new_meeting_copy_path(meeting), t("actions.duplicate", scope: "decidim.admin"), class: "action-icon--copy" %>
84
+ <% else %>
85
+ <span class="action-space icon"></span>
86
+ <% end %>
85
87
 
86
- <% if allowed_to? :copy, :meeting, meeting: meeting %>
87
- <%= icon_link_to "clipboard", new_meeting_copy_path(meeting), t("actions.duplicate", scope: "decidim.admin"), class: "action-icon--copy" %>
88
- <% else %>
89
- <span class="action-space icon"></span>
90
- <% end %>
88
+ <% if allowed_to? :update, :meeting, meeting: meeting %>
89
+ <%= icon_link_to "folder-line", meeting_attachment_collections_path(meeting), t("actions.attachment_collections", scope: "decidim.meetings"), class: "action-icon--attachment_collections" %>
90
+ <% else %>
91
+ <span class="action-space icon"></span>
92
+ <% end %>
91
93
 
92
- <% if allowed_to? :update, :meeting, meeting: meeting %>
93
- <% if meeting.registration_disabled? %>
94
- <%= icon "people", class: "action-icon action-icon--disabled", role: "img", aria_label: t("actions.registrations", scope: "decidim.meetings") %>
95
- <% else %>
96
- <%= icon_link_to "people", meeting.on_this_platform? ? edit_meeting_registrations_path(meeting) : meeting.registration_url, t("actions.registrations", scope: "decidim.meetings"), class: "action-icon--registrations" %>
97
- <% end %>
98
- <% end %>
94
+ <% if allowed_to? :update, :meeting, meeting: meeting %>
95
+ <%= icon_link_to "attachment-line", meeting_attachments_path(meeting), t("actions.attachments", scope: "decidim.meetings"), class: "action-icon--attachments" %>
96
+ <% else %>
97
+ <span class="action-space icon"></span>
98
+ <% end %>
99
99
 
100
- <% if allowed_to? :update, :meeting, meeting: meeting %>
101
- <%= icon_link_to "pencil", edit_meeting_path(meeting), t("actions.edit", scope: "decidim.meetings"), class: "action-icon--edit" %>
102
- <%= icon_link_to "calendar", meeting.agenda.present? ? edit_meeting_agenda_path(meeting, meeting.agenda) : new_meeting_agenda_path(meeting), t("actions.agenda", scope: "decidim.meetings"), class: "action-icon--agenda" %>
103
- <%= icon_link_to "list", edit_meeting_poll_path(meeting), t("actions.manage_poll", scope: "decidim.meetings"), class: "action-icon--manage-poll-questionnaire" %>
100
+ <% if allowed_to? :update, :meeting, meeting: meeting %>
101
+ <% if meeting.registration_disabled? %>
102
+ <%= icon "group-line", class: "action-icon action-icon--disabled", role: "img", aria_label: t("actions.registrations", scope: "decidim.meetings") %>
104
103
  <% else %>
105
- <span class="action-space icon"></span>
106
- <span class="action-space icon"></span>
107
- <span class="action-space icon"></span>
104
+ <%= icon_link_to "group-line", meeting.on_this_platform? ? edit_meeting_registrations_path(meeting) : meeting.registration_url, t("actions.registrations", scope: "decidim.meetings"), class: "action-icon--registrations" %>
108
105
  <% end %>
106
+ <% end %>
109
107
 
110
- <% if allowed_to? :close, :meeting, meeting: meeting %>
111
- <%= icon_link_to "lock-locked", edit_meeting_meeting_close_path(meeting_id: meeting.id, id: meeting.id), t("actions.close", scope: "decidim.meetings"), class: "action-icon--close" %>
112
- <% else %>
113
- <span class="action-space icon"></span>
114
- <% end %>
108
+ <% if allowed_to? :update, :meeting, meeting: meeting %>
109
+ <%= icon_link_to "calendar-line", meeting.agenda.present? ? edit_meeting_agenda_path(meeting, meeting.agenda) : new_meeting_agenda_path(meeting), t("actions.agenda", scope: "decidim.meetings"), class: "action-icon--agenda" %>
110
+ <%= icon_link_to "list-check", edit_meeting_poll_path(meeting), t("actions.manage_poll", scope: "decidim.meetings"), class: "action-icon--manage-poll-questionnaire" %>
111
+ <% else %>
112
+ <span class="action-space icon"></span>
113
+ <% end %>
115
114
 
116
- <% if allowed_to? :update, :meeting, meeting: meeting %>
117
- <%= icon_link_to "folder", meeting_attachment_collections_path(meeting), t("actions.attachment_collections", scope: "decidim.meetings"), class: "action-icon--attachment_collections" %>
118
- <% else %>
119
- <span class="action-space icon"></span>
120
- <% end %>
115
+ <% if allowed_to? :close, :meeting, meeting: meeting %>
116
+ <%= icon_link_to "lock-line" , edit_meeting_meeting_close_path(meeting_id: meeting.id, id: meeting.id), t("actions.close", scope: "decidim.meetings"), class: "action-icon--close" %>
117
+ <% else %>
118
+ <span class="action-space icon"></span>
119
+ <% end %>
121
120
 
122
- <% if allowed_to? :update, :meeting, meeting: meeting %>
123
- <%= icon_link_to "paperclip", meeting_attachments_path(meeting), t("actions.attachments", scope: "decidim.meetings"), class: "action-icon--attachments" %>
121
+ <% if allowed_to? :update, :meeting, meeting: meeting %>
122
+ <% if meeting.published? %>
123
+ <%= icon_link_to "close-circle-line", unpublish_meeting_path(meeting), t("actions.unpublish", scope: "decidim.admin"), method: :put, class: "action-icon--unpublish", data: { confirm: t("actions.unpublish", scope: "decidim.admin") } %>
124
124
  <% else %>
125
- <span class="action-space icon"></span>
125
+ <%= icon_link_to "check-line", publish_meeting_path(meeting), t("actions.publish", scope: "decidim.admin"), method: :put, class: "action-icon--publish" %>
126
126
  <% end %>
127
+ <% else %>
128
+ <span class="action-space icon"></span>
129
+ <% end %>
127
130
 
128
- <%= resource_permissions_link(meeting) %>
131
+ <%= icon_link_to "eye-line", resource_locator(meeting).path, t("actions.preview", scope: "decidim.meetings"), class: "action-icon--preview", target: :blank, data: { "external-link": false } %>
129
132
 
130
- <% if allowed_to? :destroy, :meeting, meeting: meeting %>
131
- <% if present(meeting).authored_proposals.empty? %>
132
- <%= icon_link_to "circle-x", meeting_path(meeting), t("actions.destroy", scope: "decidim.meetings"), method: :delete, class: "action-icon--remove", data: { confirm: t("actions.confirm_destroy", scope: "decidim.meetings") } %>
133
- <% else %>
134
- <%=
135
- content_tag(:button,
136
- class: ["action-icon", "action-icon--remove", "destroy-meeting-alert"],
137
- "data-invalid-destroy-message" => t("actions.invalid_destroy.proposals_count", count: present(meeting).authored_proposals.size, scope: "decidim.meetings"),
138
- "data-proposal-titles" => present(meeting).formatted_proposals_titles) do
139
- content_tag(:span,
140
- data: { tooltip: true, disable_hover: false, click_open: false },
141
- title: t("actions.destroy", scope: "decidim.meetings")) do
142
- icon("circle-x")
143
- end
144
- end
145
- %>
146
- <% end %>
133
+ <%= resource_permissions_link(meeting) %>
134
+
135
+ <% if allowed_to? :destroy, :meeting, meeting: meeting %>
136
+ <% if present(meeting).authored_proposals.empty? %>
137
+ <%= icon_link_to "delete-bin-line", meeting_path(meeting), t("actions.destroy", scope: "decidim.meetings"), method: :delete, class: "action-icon--remove", data: { confirm: t("actions.confirm_destroy", scope: "decidim.meetings") } %>
147
138
  <% else %>
148
- <span class="action-space icon"></span>
139
+ <%=
140
+ content_tag(:button,
141
+ class: ["action-icon", "action-icon--remove", "destroy-meeting-alert"],
142
+ "data-invalid-destroy-message" => t("actions.invalid_destroy.proposals_count", count: present(meeting).authored_proposals.size, scope: "decidim.meetings"),
143
+ "data-proposal-titles" => present(meeting).formatted_proposals_titles) do
144
+ content_tag(:span,
145
+ data: { tooltip: true, disable_hover: false, click_open: false },
146
+ title: t("actions.destroy", scope: "decidim.meetings")) do
147
+ icon("delete-bin-line")
148
+ end
149
+ end
150
+ %>
149
151
  <% end %>
150
- </td>
151
- </tr>
152
- <% end %>
153
- </tbody>
154
- </table>
155
- <%= paginate meetings, theme: "decidim" %>
156
- </div>
152
+ <% else %>
153
+ <span class="action-space icon"></span>
154
+ <% end %>
155
+ </td>
156
+ </tr>
157
+ <% end %>
158
+ </tbody>
159
+ </table>
157
160
  </div>
158
161
  </div>
159
162
 
160
- <%= javascript_pack_tag "decidim_meetings_admin" %>
163
+ <%= decidim_paginate meetings %>
164
+ <%= append_javascript_pack_tag "decidim_meetings_admin" %>
@@ -1,8 +1,18 @@
1
1
  <% add_decidim_page_title(t(".title")) %>
2
- <%= decidim_form_for(@form, html: { class: "form meetings_form new_meeting" }) do |f| %>
3
- <%= render partial: "form", object: f, locals: { title: t(".title") } %>
4
-
5
- <div class="button--double form-general-submit">
6
- <%= f.submit t(".create") %>
2
+ <div class="item_show__header">
3
+ <h2 class="item_show__header-title">
4
+ <%= t(".title") %>
5
+ </h2>
6
+ </div>
7
+ <div class="item__edit item__edit-1col">
8
+ <div class="item__edit-form">
9
+ <%= decidim_form_for(@form, html: { class: "form-defaults form meetings_form new_meeting" }) do |f| %>
10
+ <%= render partial: "form", object: f %>
11
+ <div class="item__edit-sticky">
12
+ <div class="item__edit-sticky-container">
13
+ <%= f.submit t(".create"), class: "button button__sm button__secondary" %>
14
+ </div>
15
+ </div>
16
+ <% end %>
7
17
  </div>
8
- <% end %>
18
+ </div>
@@ -5,7 +5,7 @@
5
5
  <h2 class="card-title">
6
6
  <span><%= t("answer_option", scope: "decidim.forms.admin.questionnaires.answer_option") %></span>
7
7
  <% if editable %>
8
- <button class="button small alert hollow remove-answer-option button--title">
8
+ <button class="button button__sm button__secondary small alert hollow remove-answer-option button--title">
9
9
  <%= t("remove", scope: "decidim.forms.admin.questionnaires.answer_option") %>
10
10
  </button>
11
11
  <% end %>
@@ -2,6 +2,6 @@
2
2
 
3
3
  <script type="text/template" class="decidim-answer-option-template decidim-template" id="<%= template_id %>">
4
4
  <%= fields_for "questionnaire[questions][#{question.to_param}][answer_options][]", blank_answer_option do |answer_option_form| %>
5
- <%= render "decidim/meetings/admin/poll/answer_option", form: answer_option_form, question: question, editable: editable %>
5
+ <%= render "decidim/meetings/admin/poll/answer_option", form: answer_option_form, question:, editable: %>
6
6
  <% end %>
7
7
  </script>
@@ -1,63 +1,48 @@
1
- <div class="card">
2
- <div class="card-divider">
3
- <h2 class="card-title">
4
- <%= edit_questionnaire_title %>
5
- <% if questionnaire.answers.any? %>
6
- <div class="button--title">
7
- <%= export_dropdown(current_component, questionnaire.id) if allowed_to?(:export_answers, :questionnaire) %>
8
- </div>
9
- <% else %>
10
- <button class="button tiny button--title" disabled><%= t("empty", scope: "decidim.forms.admin.questionnaires.answers") %></button>
11
- <% end %>
12
- </h2>
13
- </div>
14
- </div>
15
-
16
1
  <div class="questionnaire-questions">
17
2
  <div class="row column text-center">
18
- <button type="button" class="button collapse-all"><%= t("collapse", scope: "decidim.forms.admin.questionnaires.form") %></button>
19
- <button type="button" class="button expand-all"><%= t("expand", scope: "decidim.forms.admin.questionnaires.form") %></button>
3
+ <button type="button" class="button button__sm button__secondary collapse-all"><%= t("collapse", scope: "decidim.forms.admin.questionnaires.form") %></button>
4
+ <button type="button" class="button button__sm button__secondary expand-all"><%= t("expand", scope: "decidim.forms.admin.questionnaires.form") %></button>
20
5
  </div>
21
6
 
22
7
  <% if questionnaire.questions_editable? %>
23
8
  <%= fields_for "questionnaire[questions][#{blank_question.to_param}]", blank_question do |question_form| %>
24
9
  <script type="text/template" class="decidim-question-template decidim-template" id="question-template">
25
10
  <%= render "decidim/meetings/admin/poll/question",
26
- form: question_form,
27
- id: tabs_id_for_question(blank_question),
28
- editable: questionnaire.questions_editable?,
29
- answer_option_template_selector: "#answer-option-template-dummy" %>
11
+ form: question_form,
12
+ id: tabs_id_for_question(blank_question),
13
+ editable: questionnaire.questions_editable?,
14
+ answer_option_template_selector: "#answer-option-template-dummy" %>
30
15
  </script>
31
16
  <%= render "decidim/meetings/admin/poll/answer_option_template", form: question_form, editable: questionnaire.questions_editable?, template_id: "answer-option-template-dummy" %>
32
17
  <% end %>
33
18
  <% else %>
34
- <div class="callout warning">
35
- <%= t("already_answered_warning", scope: "decidim.forms.admin.questionnaires.form") %>
36
- </div>
19
+ <%= cell("decidim/announcement", t("already_answered_warning", scope: "decidim.forms.admin.questionnaires.form"), callout_class: "warning" ) %>
37
20
  <% end %>
38
21
 
39
- <div class="questionnaire-questions-list">
22
+ <div class="questionnaire-questions-list flex flex-col py-6 gap-6 last:pb-0">
40
23
  <% @form.questions.each_with_index do |question, index| %>
41
24
  <%= fields_for "questionnaire[questions][]", question do |question_form| %>
42
25
  <%= render "decidim/meetings/admin/poll/question",
43
- form: question_form,
44
- id: tabs_id_for_question(question),
45
- editable: questionnaire.questions_editable?,
46
- answer_option_template_selector: "#answer-option-template-#{index}" %>
26
+ form: question_form,
27
+ id: tabs_id_for_question(question),
28
+ editable: questionnaire.questions_editable?,
29
+ answer_option_template_selector: "#answer-option-template-#{index}" %>
47
30
  <%= render "decidim/meetings/admin/poll/answer_option_template", form: question_form, editable: questionnaire.questions_editable?, template_id: "answer-option-template-#{index}" %>
48
31
  <% end %>
49
32
  <% end %>
50
33
  </div>
51
34
 
52
35
  <% if questionnaire.questions_editable? %>
53
- <button class="button add-question"><%= t("add_question", scope: "decidim.forms.admin.questionnaires.form") %></button>
36
+ <button class="button button__sm button__secondary add-question"><%= t("add_question", scope: "decidim.forms.admin.questionnaires.form") %></button>
54
37
  <% end %>
55
38
  </div>
56
39
 
57
- <%= javascript_pack_tag "decidim_forms_admin", defer: false %>
40
+ <%= append_javascript_pack_tag "decidim_forms_admin" %>
58
41
 
59
42
  <% if questionnaire.questions_editable? %>
60
43
  <script>
61
- window.Decidim.createEditableForm()
44
+ document.addEventListener("DOMContentLoaded", function () {
45
+ window.Decidim.createEditableForm()
46
+ })
62
47
  </script>
63
48
  <% end %>
@@ -1,96 +1,102 @@
1
1
  <% question = form.object %>
2
2
  <% is_expanded = question.errors.any? %>
3
-
4
3
  <div class="card questionnaire-question" id="<%= id %>-field">
5
- <div class="card-divider question-divider">
6
- <h2 class="card-title">
7
- <span>
8
- <% if editable %>
9
- <%== icon("move") %>
10
- <% end %>
11
- <%= dynamic_title(translated_attribute(question.body), class: "question-title-statement", max_length: 50, omission: "...", placeholder: t("question", scope: "decidim.forms.admin.questionnaires.question")) %>
12
- </span>
13
-
14
- <button type="button" class="button small secondary button--title question--collapse" data-toggle="<%= id %>-question-card button--collapse-question-<%= id %> button--expand-question-<%= id %>">
15
- <span id="button--collapse-question-<%= id %>" data-toggler=".hide" class="icon-collapse <%= "hide" unless is_expanded %>">
16
- <%== icon("caret-top", aria_label: t("collapse", scope: "decidim.forms.admin.questionnaires.question"), role: "img") %>
4
+ <div class="form__wrapper" data-component="accordion">
5
+ <div class="card-divider question-divider">
6
+ <h2 class="card-title">
7
+ <span>
8
+ <% if editable %>
9
+ <%== icon("drag-move-2-fill") %>
10
+ <% end %>
11
+ <%= dynamic_title(translated_attribute(question.body), class: "question-title-statement", max_length: 50, omission: "...", placeholder: t("question", scope: "decidim.forms.admin.questionnaires.question")) %>
17
12
  </span>
18
13
 
19
- <span id="button--expand-question-<%= id %>" data-toggler=".hide" class="icon-expand <%= "hide" if is_expanded %>">
20
- <%== icon("caret-bottom", aria_label: t("expand", scope: "decidim.forms.admin.questionnaires.question"), role: "img") %>
21
- </span>
22
- </button>
14
+ <span class="ml-auto flex flex-row-reverse items-center gap-2">
15
+ <button id="<%= id %>-button" type="button" class="question--collapse <%= "question-error" if is_expanded %>" data-controls="panel-<%= id %>-question-card">
16
+ <span class="icon-collapse">
17
+ <%== icon "arrow-up-s-line", aria_label: t("collapse", scope: "decidim.forms.admin.questionnaires.question"), role: "img" %>
18
+ </span>
23
19
 
24
- <% if editable %>
25
- <button class="button small alert hollow move-up-question button--title">
26
- <%== "#{icon("arrow-top")} #{t("up", scope: "decidim.forms.admin.questionnaires.question")}" %>
27
- </button>
20
+ <span class="icon-expand">
21
+ <%== icon "arrow-down-s-line", aria_label: t("expand", scope: "decidim.forms.admin.questionnaires.question"), role: "img" %>
22
+ </span>
23
+ </button>
28
24
 
29
- <button class="button small alert hollow move-down-question button--title">
30
- <%== "#{icon("arrow-bottom")} #{t("down", scope: "decidim.forms.admin.questionnaires.question")}" %>
31
- </button>
25
+ <% if editable %>
26
+ <button class="button button__sm button__transparent-secondary small alert hollow move-up-question button--title">
27
+ <%= icon "arrow-up-line" %>
28
+ <span><%= t("up", scope: "decidim.forms.admin.questionnaires.question") %></span>
29
+ </button>
32
30
 
33
- <button class="button small alert hollow remove-question button--title">
34
- <%= t("remove", scope: "decidim.forms.admin.questionnaires.question") %>
35
- </button>
36
- <% end %>
37
- </h2>
38
- </div>
31
+ <button class="button button__sm button__transparent-secondary small alert hollow move-down-question button--title">
32
+ <%= icon "arrow-down-line" %>
33
+ <span><%= t("down", scope: "decidim.forms.admin.questionnaires.question") %></span>
34
+ </button>
39
35
 
40
- <div class="card-section collapsible <%= "hide" unless is_expanded %>" data-toggler=".hide" id="<%= id %>-question-card">
41
- <div class="row column">
42
- <%=
43
- form.translated(
44
- :text_field,
45
- :body,
46
- tabs_id: id,
47
- label: t("statement", scope: "decidim.forms.admin.questionnaires.question"),
48
- disabled: !editable
49
- )
50
- %>
36
+ <button class="button button__sm button__transparent-secondary small alert hollow remove-question button--title">
37
+ <%= t("remove", scope: "decidim.forms.admin.questionnaires.question") %>
38
+ </button>
39
+ <% end %>
40
+ </span>
41
+ </h2>
51
42
  </div>
52
43
 
53
- <div class="row column">
54
- <%=
55
- form.select(
56
- :question_type,
57
- options_from_collection_for_select(question_types, :first, :last, question.question_type),
58
- {},
59
- disabled: !editable
60
- )
61
- %>
62
- </div>
44
+ <div id="panel-<%= id %>-question-card" class="panel-question-card card-section collapsible <%= "panel-error" if is_expanded %>">
45
+ <div class="row column">
46
+ <%=
47
+ form.translated(
48
+ :text_field,
49
+ :body,
50
+ tabs_id: id,
51
+ label: t("statement", scope: "decidim.forms.admin.questionnaires.question"),
52
+ disabled: !editable
53
+ )
54
+ %>
55
+ </div>
63
56
 
64
- <% if question.persisted? %>
65
- <%= form.hidden_field :id, disabled: !editable %>
66
- <% end %>
57
+ <div class="row column">
58
+ <%=
59
+ form.select(
60
+ :question_type,
61
+ options_from_collection_for_select(question_types, :first, :last, question.question_type),
62
+ {},
63
+ disabled: !editable
64
+ )
65
+ %>
66
+ </div>
67
+
68
+ <% if question.persisted? %>
69
+ <%= form.hidden_field :id, disabled: !editable %>
70
+ <% end %>
67
71
 
68
- <%= form.hidden_field :position, value: question.position || 0, disabled: !editable %>
69
- <%= form.hidden_field :deleted, disabled: !editable %>
72
+ <%= form.hidden_field :position, value: question.position || 0, disabled: !editable %>
73
+ <%= form.hidden_field :deleted, disabled: !editable %>
70
74
 
71
- <div class="questionnaire-question-answer-options" data-template="<%= answer_option_template_selector %>">
72
- <div class="questionnaire-question-answer-options-list">
73
- <% question.answer_options.each do |answer_option| %>
74
- <%= fields_for "questionnaire[questions][#{question.to_param}][answer_options][]", answer_option do |answer_option_form| %>
75
- <%= render "decidim/meetings/admin/poll/answer_option", form: answer_option_form, question: question, editable: editable %>
75
+ <div class="questionnaire-question-answer-options" data-template="<%= answer_option_template_selector %>">
76
+ <div class="questionnaire-question-answer-options-list">
77
+ <% question.answer_options.each do |answer_option| %>
78
+ <%= fields_for "questionnaire[questions][#{question.to_param}][answer_options][]", answer_option do |answer_option_form| %>
79
+ <%= render "decidim/meetings/admin/poll/answer_option", form: answer_option_form, question:, editable: %>
80
+ <% end %>
76
81
  <% end %>
82
+ </div>
83
+ <% if editable %>
84
+ <div class="row column">
85
+ <button type="button" class="button button__sm button__secondary add-answer-option"><%= t("add_answer_option", scope: "decidim.forms.admin.questionnaires.question") %></button>
86
+ </div>
77
87
  <% end %>
78
88
  </div>
79
89
 
80
- <% if editable %>
81
- <button class="button add-answer-option"><%= t("add_answer_option", scope: "decidim.forms.admin.questionnaires.question") %></button>
82
- <% end %>
83
- </div>
84
-
85
- <div class="row column questionnaire-question-max-choices">
86
- <%=
87
- form.select(
88
- :max_choices,
89
- (2..question.number_of_options),
90
- { include_blank: t("any", scope: "decidim.forms.admin.questionnaires.question") },
91
- disabled: !editable
92
- )
93
- %>
90
+ <div class="row column questionnaire-question-max-choices">
91
+ <%=
92
+ form.select(
93
+ :max_choices,
94
+ (2..question.number_of_options),
95
+ { include_blank: t("any", scope: "decidim.forms.admin.questionnaires.question") },
96
+ disabled: !editable
97
+ )
98
+ %>
99
+ </div>
94
100
  </div>
95
101
  </div>
96
102
  </div>