decidim-proposals 0.23.5 → 0.24.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/decidim/proposals/add_proposal.js.es6 +4 -1
  3. data/app/assets/javascripts/decidim/proposals/admin/proposals_form.js.es6 +4 -1
  4. data/app/assets/stylesheets/decidim/proposals/_proposals.css.scss +1 -0
  5. data/app/assets/stylesheets/decidim/proposals/proposals/_preview.css.scss +3 -0
  6. data/app/cells/decidim/proposals/collaborative_draft_link_to_proposal_cell.rb +3 -3
  7. data/app/cells/decidim/proposals/collaborative_drafts/reported_content/show.erb +3 -0
  8. data/app/cells/decidim/proposals/collaborative_drafts/reported_content_cell.rb +15 -0
  9. data/app/cells/decidim/proposals/content_blocks/highlighted_proposals/elements.erb +5 -0
  10. data/app/cells/decidim/proposals/content_blocks/highlighted_proposals/heading.erb +1 -0
  11. data/app/cells/decidim/proposals/content_blocks/highlighted_proposals_cell.rb +19 -0
  12. data/app/cells/decidim/proposals/irreversible_action_modal_cell.rb +1 -1
  13. data/app/cells/decidim/proposals/proposal_m_cell.rb +23 -2
  14. data/app/cells/decidim/proposals/proposals_picker_cell.rb +1 -1
  15. data/app/cells/decidim/proposals/reported_content/show.erb +4 -0
  16. data/app/cells/decidim/proposals/reported_content_cell.rb +13 -0
  17. data/app/commands/decidim/proposals/hashtags_methods.rb +1 -1
  18. data/app/commands/decidim/proposals/update_proposal.rb +0 -2
  19. data/app/controllers/decidim/proposals/admin/proposals_controller.rb +6 -4
  20. data/app/controllers/decidim/proposals/collaborative_drafts_controller.rb +1 -30
  21. data/app/controllers/decidim/proposals/proposals_controller.rb +5 -6
  22. data/app/events/decidim/proposals/publish_proposal_event.rb +1 -1
  23. data/app/forms/decidim/proposals/access_to_collaborative_draft_form.rb +1 -3
  24. data/app/forms/decidim/proposals/admin/proposal_base_form.rb +3 -2
  25. data/app/forms/decidim/proposals/proposal_form.rb +15 -5
  26. data/app/forms/decidim/proposals/proposal_wizard_create_step_form.rb +1 -1
  27. data/app/helpers/decidim/proposals/admin/filterable_helper.rb +1 -1
  28. data/app/helpers/decidim/proposals/admin/proposal_rankings_helper.rb +1 -1
  29. data/app/helpers/decidim/proposals/admin/proposals_helper.rb +8 -8
  30. data/app/helpers/decidim/proposals/application_helper.rb +5 -2
  31. data/app/helpers/decidim/proposals/map_helper.rb +31 -8
  32. data/app/helpers/decidim/proposals/proposal_wizard_helper.rb +14 -44
  33. data/app/helpers/decidim/proposals/proposals_helper.rb +3 -6
  34. data/app/models/decidim/proposals/collaborative_draft.rb +10 -0
  35. data/app/models/decidim/proposals/proposal.rb +18 -10
  36. data/app/permissions/decidim/proposals/admin/permissions.rb +2 -2
  37. data/app/permissions/decidim/proposals/permissions.rb +3 -2
  38. data/app/presenters/decidim/proposals/proposal_presenter.rb +4 -4
  39. data/app/queries/decidim/proposals/metrics/proposal_followers_metric_measure.rb +4 -4
  40. data/app/queries/decidim/proposals/metrics/proposal_participants_metric_measure.rb +6 -6
  41. data/app/services/decidim/proposals/collaborative_draft_search.rb +1 -1
  42. data/app/services/decidim/proposals/diff_renderer.rb +7 -11
  43. data/app/services/decidim/proposals/proposal_builder.rb +1 -0
  44. data/app/views/decidim/proposals/admin/proposals/_bulk-actions.html.erb +8 -1
  45. data/app/views/decidim/proposals/admin/proposals/_proposal-tr.html.erb +5 -1
  46. data/app/views/decidim/proposals/admin/proposals_imports/new.html.erb +1 -1
  47. data/app/views/decidim/proposals/collaborative_drafts/_filters_small_view.html.erb +1 -1
  48. data/app/views/decidim/proposals/collaborative_drafts/_wizard_aside.html.erb +2 -7
  49. data/app/views/decidim/proposals/collaborative_drafts/_wizard_header.html.erb +14 -0
  50. data/app/views/decidim/proposals/collaborative_drafts/edit.html.erb +1 -3
  51. data/app/views/decidim/proposals/collaborative_drafts/new.html.erb +5 -13
  52. data/app/views/decidim/proposals/collaborative_drafts/show.html.erb +1 -7
  53. data/app/views/decidim/proposals/proposals/_dynamic_map_instructions.html.erb +3 -0
  54. data/app/views/decidim/proposals/proposals/_edit_form_fields.html.erb +6 -6
  55. data/app/views/decidim/proposals/proposals/_filters.html.erb +34 -32
  56. data/app/views/decidim/proposals/proposals/_filters_small_view.html.erb +1 -1
  57. data/app/views/decidim/proposals/proposals/_wizard_header.html.erb +21 -11
  58. data/app/views/decidim/proposals/proposals/edit.html.erb +1 -3
  59. data/app/views/decidim/proposals/proposals/preview.html.erb +50 -2
  60. data/app/views/decidim/proposals/proposals/show.html.erb +2 -8
  61. data/config/locales/ar.yml +2 -23
  62. data/config/locales/bg.yml +0 -4
  63. data/config/locales/ca.yml +23 -29
  64. data/config/locales/cs.yml +24 -30
  65. data/config/locales/de.yml +23 -29
  66. data/config/locales/el.yml +2 -29
  67. data/config/locales/en.yml +23 -29
  68. data/config/locales/es-MX.yml +23 -29
  69. data/config/locales/es-PY.yml +23 -29
  70. data/config/locales/es.yml +23 -29
  71. data/config/locales/eu.yml +2 -23
  72. data/config/locales/fi-plain.yml +22 -28
  73. data/config/locales/fi.yml +22 -28
  74. data/config/locales/fr-CA.yml +19 -29
  75. data/config/locales/fr.yml +19 -29
  76. data/config/locales/gl.yml +17 -25
  77. data/config/locales/hu.yml +2 -23
  78. data/config/locales/id-ID.yml +2 -23
  79. data/config/locales/is-IS.yml +0 -8
  80. data/config/locales/it.yml +4 -29
  81. data/config/locales/ja.yml +2 -29
  82. data/config/locales/lv.yml +2 -22
  83. data/config/locales/nl.yml +17 -29
  84. data/config/locales/no.yml +2 -23
  85. data/config/locales/pl.yml +22 -28
  86. data/config/locales/pt-BR.yml +2 -22
  87. data/config/locales/pt.yml +2 -29
  88. data/config/locales/ro-RO.yml +13 -29
  89. data/config/locales/ru.yml +0 -8
  90. data/config/locales/sk.yml +5 -23
  91. data/config/locales/sv.yml +23 -28
  92. data/config/locales/tr-TR.yml +17 -29
  93. data/config/locales/uk.yml +0 -8
  94. data/config/locales/zh-CN.yml +2 -29
  95. data/db/migrate/20210310102839_add_followable_counter_cache_to_proposals.rb +16 -0
  96. data/db/migrate/20210310120812_add_followable_counter_cache_to_collaborative_drafts.rb +16 -0
  97. data/db/migrate/20210318082934_fix_counters_for_copied_proposals.rb +9 -7
  98. data/{app/types/decidim/proposals → lib/decidim/api}/proposal_input_filter.rb +0 -0
  99. data/{app/types/decidim/proposals → lib/decidim/api}/proposal_input_sort.rb +3 -5
  100. data/lib/decidim/api/proposal_type.rb +56 -0
  101. data/lib/decidim/api/proposals_type.rb +43 -0
  102. data/lib/decidim/content_renderers/proposal_renderer.rb +1 -1
  103. data/lib/decidim/proposals.rb +2 -0
  104. data/lib/decidim/proposals/api.rb +10 -0
  105. data/lib/decidim/proposals/component.rb +30 -19
  106. data/lib/decidim/proposals/engine.rb +6 -27
  107. data/lib/decidim/proposals/proposal_creator.rb +98 -0
  108. data/lib/decidim/proposals/test/factories.rb +22 -8
  109. data/lib/decidim/proposals/version.rb +1 -1
  110. metadata +49 -35
  111. data/app/commands/decidim/proposals/create_proposal_export.rb +0 -37
  112. data/app/helpers/decidim/proposals/proposal_endorsements_helper.rb +0 -0
  113. data/app/queries/decidim/proposals/similar_collaborative_drafts.rb +0 -52
  114. data/app/types/decidim/proposals/proposal_type.rb +0 -70
  115. data/app/types/decidim/proposals/proposals_type.rb +0 -41
  116. data/app/views/decidim/participatory_processes/participatory_process_groups/_highlighted_proposals.html.erb +0 -13
  117. data/app/views/decidim/proposals/collaborative_drafts/compare.html.erb +0 -21
  118. data/app/views/decidim/proposals/collaborative_drafts/complete.html.erb +0 -24
  119. data/app/views/decidim/proposals/proposals/_proposal_preview.html.erb +0 -1
@@ -19,9 +19,9 @@ module Decidim
19
19
  cumulative_users |= retrieve_proposals.pluck("decidim_coauthorships.decidim_author_id") # To avoid ambiguosity must be called this way
20
20
 
21
21
  quantity_users = []
22
- quantity_users |= retrieve_votes(true).pluck(:decidim_author_id)
23
- quantity_users |= retrieve_endorsements(true).pluck(:decidim_author_id)
24
- quantity_users |= retrieve_proposals(true).pluck("decidim_coauthorships.decidim_author_id") # To avoid ambiguosity must be called this way
22
+ quantity_users |= retrieve_votes(from_start: true).pluck(:decidim_author_id)
23
+ quantity_users |= retrieve_endorsements(from_start: true).pluck(:decidim_author_id)
24
+ quantity_users |= retrieve_proposals(from_start: true).pluck("decidim_coauthorships.decidim_author_id") # To avoid ambiguosity must be called this way
25
25
 
26
26
  {
27
27
  cumulative_users: cumulative_users.uniq,
@@ -31,7 +31,7 @@ module Decidim
31
31
 
32
32
  private
33
33
 
34
- def retrieve_proposals(from_start = false)
34
+ def retrieve_proposals(from_start: false)
35
35
  @proposals ||= Decidim::Proposals::Proposal.where(component: @resource).joins(:coauthorships)
36
36
  .includes(:votes, :endorsements)
37
37
  .where(decidim_coauthorships: {
@@ -49,7 +49,7 @@ module Decidim
49
49
  @proposals
50
50
  end
51
51
 
52
- def retrieve_votes(from_start = false)
52
+ def retrieve_votes(from_start: false)
53
53
  @votes ||= Decidim::Proposals::ProposalVote.joins(:proposal).where(proposal: retrieve_proposals).joins(:author)
54
54
  .where("decidim_proposals_proposal_votes.created_at <= ?", end_time)
55
55
 
@@ -58,7 +58,7 @@ module Decidim
58
58
  @votes
59
59
  end
60
60
 
61
- def retrieve_endorsements(from_start = false)
61
+ def retrieve_endorsements(from_start: false)
62
62
  @endorsements ||= Decidim::Endorsement.joins("INNER JOIN decidim_proposals_proposals proposals ON resource_id = proposals.id")
63
63
  .where(resource: retrieve_proposals)
64
64
  .where("decidim_endorsements.created_at <= ?", end_time)
@@ -21,7 +21,7 @@ module Decidim
21
21
  # translated.
22
22
  def search_search_text
23
23
  query
24
- .where("title ILIKE ?", "%#{search_text}%")
24
+ .where("title::text ILIKE ?", "%#{search_text}%")
25
25
  .or(query.where("body ILIKE ?", "%#{search_text}%"))
26
26
  end
27
27
 
@@ -42,15 +42,7 @@ module Decidim
42
42
  # Returns and Array of two Strings.
43
43
  def parse_values(attribute, values)
44
44
  values = [amended_previous_value(attribute), values[1]] if proposal&.emendation?
45
- if attribute == :body
46
- values = values.map do |value|
47
- if value.is_a?(Hash)
48
- value.values.map { |subvalue| normalize_line_endings(subvalue) }
49
- else
50
- normalize_line_endings(value)
51
- end
52
- end
53
- end
45
+ values = values.map { |value| normalize_line_endings(value) } if attribute == :body
54
46
  values
55
47
  end
56
48
 
@@ -66,8 +58,12 @@ module Decidim
66
58
  end
67
59
 
68
60
  # Returns a String with the newline escape sequences normalized.
69
- def normalize_line_endings(string)
70
- Decidim::ContentParsers::NewlineParser.new(string, context: {}).rewrite
61
+ def normalize_line_endings(value)
62
+ if value.is_a?(Hash)
63
+ value.values.map { |subvalue| normalize_line_endings(subvalue) }
64
+ else
65
+ Decidim::ContentParsers::NewlineParser.new(value, context: {}).rewrite
66
+ end
71
67
  end
72
68
 
73
69
  def proposal
@@ -70,6 +70,7 @@ module Decidim
70
70
  "reference",
71
71
  "comments_count",
72
72
  "endorsements_count",
73
+ "follows_count",
73
74
  "proposal_notes_count",
74
75
  "proposal_votes_count"
75
76
  ).merge(
@@ -5,12 +5,19 @@
5
5
  <% if component_settings.participatory_texts_enabled? %>
6
6
  <%= link_to t("actions.participatory_texts", scope: "decidim.proposals"), participatory_texts_path, id: "participatory_texts", class: "button tiny button--simple" %>
7
7
  <% end %>
8
- <%= link_to t("actions.import", scope: "decidim.proposals", name: t("models.proposal.name", scope: "decidim.proposals.admin")), new_proposals_import_path, class: "button tiny button--simple" if allowed_to? :import, :proposals %>
9
8
 
10
9
  <% if allowed_to? :export, :proposals %>
11
10
  <%= export_dropdown %>
12
11
  <% end %>
13
12
 
13
+ <% if allowed_to? :import, :proposals %>
14
+ <%= import_dropdown do %>
15
+ <% content_tag :li do %>
16
+ <% link_to t("actions.import", scope: "decidim.proposals", name: t("models.proposal.name", scope: "decidim.proposals.admin")), new_proposals_import_path %>
17
+ <% end %>
18
+ <% end %>
19
+ <% end %>
20
+
14
21
  <% if allowed_to? :create, :proposal %>
15
22
  <%= link_to t("actions.new", scope: "decidim.proposals"), new_proposal_path, class: "button tiny button--simple" %>
16
23
  <% end %>
@@ -16,9 +16,11 @@
16
16
  <%= translated_attribute proposal.category.name %>
17
17
  <% end %>
18
18
  </td>
19
+
19
20
  <%= td_resource_scope_for(proposal.scope) %>
21
+
20
22
  <td>
21
- <strong class="<%= proposal_state_css_class proposal.state %>">
23
+ <strong class="<%= proposal_state_css_class proposal %>">
22
24
  <%= t("decidim/amendment", scope: "activerecord.models", count: 1) if proposal.emendation? %>
23
25
  <%= proposal_complete_state proposal %>
24
26
  </strong>
@@ -61,6 +63,8 @@
61
63
  <td class="table-list__actions">
62
64
  <% if allowed_to? :edit, :proposal, proposal: proposal %>
63
65
  <%= icon_link_to "pencil", edit_proposal_path(proposal), t("actions.edit_proposal", scope: "decidim.proposals"), class: "action-icon--edit-proposal" %>
66
+ <% else %>
67
+ <span class="action-space icon"></span>
64
68
  <% end %>
65
69
 
66
70
  <%= icon_with_link_to_proposal(proposal) %>
@@ -2,7 +2,7 @@
2
2
  <% if @form.origin_components.any? %>
3
3
  <div class="card">
4
4
  <div class="card-divider">
5
- <h2 class="card-title"><%= title %></h2>
5
+ <h2 class="card-title"><%= t(".title") %></h2>
6
6
  </div>
7
7
 
8
8
  <div class="card-section">
@@ -13,6 +13,6 @@
13
13
  </button>
14
14
  </div>
15
15
  <div class="filters">
16
- <%= render partial: "filters" %>
16
+ <%= render partial: "filters", locals: { type: :small } %>
17
17
  </div>
18
18
  </div>
@@ -2,17 +2,12 @@
2
2
  <div class="m-bottom">
3
3
  <%= link_to :back do %>
4
4
  <%= icon "chevron-left", class: "icon--small", role: "img", "aria-hidden": true %>
5
- <%= wizard_aside_back_text("collaborative_draft") %>
5
+ <%= t("back_from_collaborative_draft", scope: "decidim.proposals.collaborative_drafts.wizard_aside").html_safe %>
6
6
  <% end %>
7
7
  </div>
8
8
  <div class="section">
9
9
  <p>
10
- <%= wizard_aside_info_text %>
10
+ <%= t("info", scope: "decidim.proposals.collaborative_drafts.wizard_aside").html_safe %>
11
11
  </p>
12
12
  </div>
13
- <div class="show-for-large">
14
- <div><%= proposal_wizard_steps_title %></div>
15
- <div><%= proposal_wizard_current_step_of(@step) %></div>
16
- <%= proposal_wizard_stepper(@step) %>
17
- </div>
18
13
  </div>
@@ -0,0 +1,14 @@
1
+ <% if translated_attribute(component_settings.new_proposal_help_text).present? %>
2
+ <%= cell("decidim/announcement", component_settings.new_proposal_help_text) %>
3
+ <% end %>
4
+
5
+ <% if proposal_wizard_step_help_text?(@step) %>
6
+ <div class="proposal_wizard_help_text">
7
+ <% callout_step_help_text_class ||= nil %>
8
+ <%= cell("decidim/announcement", component_settings.try("proposal_wizard_#{@step}_help_text"), callout_class: callout_step_help_text_class) %>
9
+ </div>
10
+ <% end %>
11
+
12
+ <h2 class="section-heading">
13
+ <%= t(".title") %>
14
+ </h2>
@@ -13,9 +13,7 @@
13
13
  <div class="row">
14
14
  <div class="columns large-6 medium-centered">
15
15
  <div class="card">
16
- <% if translated_attribute(component_settings.new_proposal_help_text).present? %>
17
- <%= render partial: "decidim/shared/announcement", locals: { announcement: component_settings.new_proposal_help_text } %>
18
- <% end %>
16
+ <%= cell("decidim/announcement", component_settings.new_proposal_help_text) %>
19
17
 
20
18
  <div class="card__content">
21
19
  <%= decidim_form_for(@form) do |form| %>
@@ -1,26 +1,18 @@
1
- <% add_decidim_page_title(proposal_wizard_step_title(action_name)) %>
1
+ <% add_decidim_page_title(t("decidim.proposals.collaborative_drafts.wizard_header.title")) %>
2
2
 
3
3
  <div class="row">
4
4
  <%= render partial: "wizard_aside" %>
5
5
 
6
6
  <div class="columns large-6">
7
- <%= render partial: "decidim/proposals/proposals/wizard_header" %>
7
+ <%= render partial: "wizard_header" %>
8
8
 
9
9
  <div class="card">
10
10
  <div class="card__content">
11
- <%= decidim_form_for(@form, url: compare_collaborative_drafts_path, method: :get) do |form| %>
12
- <%= form_required_explanation %>
13
-
14
- <div class="field">
15
- <%= form.text_field :title %>
16
- </div>
17
-
18
- <div class="field">
19
- <%= form.text_area :body, rows: 10 %>
20
- </div>
11
+ <%= decidim_form_for(@form) do |form| %>
12
+ <%= render partial: "edit_form_fields", locals: { form: form } %>
21
13
 
22
14
  <div class="actions">
23
- <%= form.submit t("decidim.proposals.collaborative_drafts.new.send"), class: "button expanded mt-s mb-none", data: { disable: true } %>
15
+ <%= form.submit t(".send"), class: "button expanded mt-s mb-none", data: { disable: true } %>
24
16
  </div>
25
17
  <% end %>
26
18
  </div>
@@ -125,10 +125,4 @@
125
125
  <%= attachments_for @collaborative_draft %>
126
126
  <%= comments_for @collaborative_draft %>
127
127
 
128
- <%=
129
- render partial: "decidim/shared/flag_modal", locals: {
130
- reportable: @collaborative_draft,
131
- form: @report_form,
132
- url: decidim.report_path(sgid: @collaborative_draft.to_sgid.to_s)
133
- }
134
- %>
128
+ <%= cell("decidim/flag_modal", @collaborative_draft) %>
@@ -0,0 +1,3 @@
1
+ <div class="column dynamic-map-instructions">
2
+ <%== t(".instructions") %>
3
+ </div>
@@ -25,7 +25,7 @@
25
25
  <div class="field">
26
26
  <%= form.label :suggested_hashtags, nil, for: nil %>
27
27
  <div class="checkboxes hashtags">
28
- <%= form.collection_check_boxes :suggested_hashtags, @form.component_suggested_hashtags.map {|hashtag| [hashtag.downcase, "##{hashtag}"]}, :first, :last do |option|
28
+ <%= form.collection_check_boxes :suggested_hashtags, @form.component_suggested_hashtags.map { |hashtag| [hashtag.downcase, "##{hashtag}"] }, :first, :last do |option|
29
29
  option.label { option.check_box(checked: @form.suggested_hashtag_checked?(option.value)) + option.text }
30
30
  end %>
31
31
  </div>
@@ -38,7 +38,7 @@
38
38
  </div>
39
39
 
40
40
  <div class="field" id="address_input">
41
- <%= form.geocoding_field :address %>
41
+ <%= form.geocoding_field :address, placeholder: t("decidim.proposals.proposals.placeholder.address") %>
42
42
  </div>
43
43
  <% end %>
44
44
 
@@ -61,12 +61,12 @@
61
61
  <% end %>
62
62
 
63
63
  <% if component_settings.attachments_allowed? && @proposal %>
64
- <fieldset>
64
+ <fieldset class="gallery__container">
65
65
  <legend><%= t("gallery_legend", scope: "decidim.proposals.proposals.edit") %></legend>
66
66
 
67
67
  <% if @form.photos.any? %>
68
68
  <% @form.photos.each do |photo| %>
69
- <div class="callout gallery__item" data-closable>
69
+ <div class="callout gallery__item" id="attachment_<%= photo.id %>" data-closable>
70
70
  <%= image_tag photo.thumbnail_url, class: "thumbnail", alt: photo.file.file.filename %>
71
71
  <%= form.hidden_field :photos, multiple: true, value: photo.id, id: "photo-#{photo.id}" %>
72
72
  <button class="close-button"
@@ -85,12 +85,12 @@
85
85
  </div>
86
86
  </fieldset>
87
87
 
88
- <fieldset>
88
+ <fieldset class="gallery__container">
89
89
  <legend><%= t("attachment_legend", scope: "decidim.proposals.proposals.edit") %></legend>
90
90
 
91
91
  <% if @form.documents.any? %>
92
92
  <% @form.documents.each do |document| %>
93
- <div class="callout" data-closable>
93
+ <div class="callout" id="attachment_<%= document.id %>" data-closable>
94
94
  <%= link_to translated_attribute(document.title), document.url %>
95
95
  <small><%= document.file_type %> <%= number_to_human_size(document.file_size) %></small>
96
96
  <%= form.hidden_field :documents, multiple: true, value: document.id, id: "document-#{document.id}" %>
@@ -1,46 +1,48 @@
1
1
  <%= render partial: "decidim/shared/filter_form_help", locals: { skip_to_id: "proposals" } %>
2
2
 
3
- <%= filter_form_for filter do |form| %>
4
- <div class="filters__section">
5
- <div class="filters__search">
6
- <div class="input-group">
7
- <%= form.search_field :search_text, label: false, class: "input-group-field", placeholder: t(".search"), title: t(".search"), data: { disable_dynamic_change: true } %>
8
- <div class="input-group-button">
9
- <button type="submit" class="button" aria-controls="proposals">
10
- <%= icon "magnifying-glass", aria_label: t(".search"), role: "img" %>
11
- </button>
3
+ <% cache filter_cache_hash(filter, defined?(type) ? type : nil) do %>
4
+ <%= filter_form_for filter do |form| %>
5
+ <div class="filters__section">
6
+ <div class="filters__search">
7
+ <div class="input-group">
8
+ <%= form.search_field :search_text, label: false, class: "input-group-field", placeholder: t(".search"), title: t(".search"), data: { disable_dynamic_change: true } %>
9
+ <div class="input-group-button">
10
+ <button type="submit" class="button" aria-controls="proposals">
11
+ <%= icon "magnifying-glass", aria_label: t(".search"), role: "img" %>
12
+ </button>
13
+ </div>
12
14
  </div>
13
15
  </div>
14
16
  </div>
15
- </div>
16
17
 
17
- <% if component_settings.proposal_answering_enabled && current_settings.proposal_answering_enabled %>
18
- <%= form.check_boxes_tree :state, filter_proposals_state_values, legend_title: t(".state"), "aria-controls": "proposals" %>
19
- <% end %>
18
+ <% if component_settings.proposal_answering_enabled && current_settings.proposal_answering_enabled %>
19
+ <%= form.check_boxes_tree :state, filter_proposals_state_values, legend_title: t(".state"), "aria-controls": "proposals" %>
20
+ <% end %>
20
21
 
21
- <% if current_component.has_subscopes? %>
22
- <%= form.check_boxes_tree :scope_id, filter_scopes_values, legend_title: t(".scope"), "aria-controls": "proposals" %>
23
- <% end %>
22
+ <% if current_component.has_subscopes? %>
23
+ <%= form.check_boxes_tree :scope_id, filter_scopes_values, legend_title: t(".scope"), "aria-controls": "proposals" %>
24
+ <% end %>
24
25
 
25
- <% if current_component.categories.any? %>
26
- <%= form.check_boxes_tree :category_id, filter_categories_values, legend_title: t(".category"), "aria-controls": "proposals" %>
27
- <% end %>
26
+ <% if current_component.categories.any? %>
27
+ <%= form.check_boxes_tree :category_id, filter_categories_values, legend_title: t(".category"), "aria-controls": "proposals" %>
28
+ <% end %>
28
29
 
29
- <% if component_settings.official_proposals_enabled %>
30
- <%= form.check_boxes_tree :origin, filter_origin_values, legend_title: t(".origin"), "aria-controls": "proposals" %>
31
- <% end %>
30
+ <% if component_settings.official_proposals_enabled %>
31
+ <%= form.check_boxes_tree :origin, filter_origin_values, legend_title: t(".origin"), "aria-controls": "proposals" %>
32
+ <% end %>
32
33
 
33
- <% if current_user %>
34
- <%= form.collection_radio_buttons :activity, activity_filter_values, :first, :last, { legend_title: t(".activity") }, "aria-controls": "proposals" %>
35
- <% end %>
34
+ <% if current_user %>
35
+ <%= form.collection_radio_buttons :activity, activity_filter_values, :first, :last, { legend_title: t(".activity") }, "aria-controls": "proposals" %>
36
+ <% end %>
36
37
 
37
- <% if @proposals.only_emendations.any? %>
38
- <%= form.collection_radio_buttons :type, filter_type_values, :first, :last, { legend_title: t(".amendment_type") }, "aria-controls": "proposals" %>
39
- <% end %>
38
+ <% if @proposals.only_emendations.any? %>
39
+ <%= form.collection_radio_buttons :type, filter_type_values, :first, :last, { legend_title: t(".amendment_type") }, "aria-controls": "proposals" %>
40
+ <% end %>
40
41
 
41
- <% if linked_classes_for(Decidim::Proposals::Proposal).any? %>
42
- <%= form.collection_radio_buttons :related_to, linked_classes_filter_values_for(Decidim::Proposals::Proposal), :first, :last, { legend_title: t(".related_to") }, "aria-controls": "proposals" %>
43
- <% end %>
42
+ <% if linked_classes_for(Decidim::Proposals::Proposal).any? %>
43
+ <%= form.collection_radio_buttons :related_to, linked_classes_filter_values_for(Decidim::Proposals::Proposal), :first, :last, { legend_title: t(".related_to") }, "aria-controls": "proposals" %>
44
+ <% end %>
44
45
 
45
- <%= hidden_field_tag :order, order, id: nil, class: "order_filter" %>
46
+ <%= hidden_field_tag :order, order, id: nil, class: "order_filter" %>
47
+ <% end %>
46
48
  <% end %>
@@ -13,6 +13,6 @@
13
13
  </button>
14
14
  </div>
15
15
  <div class="filters">
16
- <%= render partial: "filters" %>
16
+ <%= render partial: "filters", locals: { type: :small } %>
17
17
  </div>
18
18
  </div>
@@ -1,19 +1,29 @@
1
- <% if translated_attribute(component_settings.new_proposal_help_text).present? && @step != :step_4 %>
2
- <%= render partial: "decidim/shared/announcement", locals: { announcement: component_settings.new_proposal_help_text } %>
3
- <% elsif @step == :step_4 %>
4
- <%
5
- locals = {
6
- callout_class: "warning",
7
- announcement: t("decidim.proposals.proposals.preview.proposal_edit_before_minutes", count: component_settings.proposal_edit_before_minutes)
8
- }
9
- %>
10
- <%= render partial: "decidim/shared/announcement", locals: locals %>
1
+ <% if @step == :step_4 %>
2
+ <% body_messages = [t("decidim.proposals.proposals.preview.announcement_body")]
3
+ if component_settings.proposal_edit_time == "limited"
4
+ body_messages << t("decidim.proposals.proposals.preview.proposal_edit_before_minutes", count: component_settings.proposal_edit_before_minutes)
5
+ end %>
6
+
7
+ <%= cell(
8
+ "decidim/announcement",
9
+ {
10
+ title: t("decidim.proposals.proposals.preview.announcement_title"),
11
+ body: body_messages
12
+ },
13
+ callout_class: "warning"
14
+ ) %>
15
+ <% else %>
16
+ <%= cell("decidim/announcement", component_settings.new_proposal_help_text) %>
11
17
  <% end %>
12
18
 
13
19
  <% if proposal_wizard_step_help_text?(@step) %>
14
20
  <div class="proposal_wizard_help_text">
15
21
  <% callout_step_help_text_class ||= nil %>
16
- <%= render partial: "decidim/shared/announcement", locals: { announcement: component_settings.try("proposal_wizard_#{@step}_help_text"), callout_class: callout_step_help_text_class } %>
22
+ <%= cell(
23
+ "decidim/announcement",
24
+ component_settings.try("proposal_wizard_#{@step}_help_text"),
25
+ callout_class: callout_step_help_text_class
26
+ ) %>
17
27
  </div>
18
28
  <% end %>
19
29
 
@@ -13,9 +13,7 @@
13
13
  <div class="row">
14
14
  <div class="columns large-6 medium-centered">
15
15
  <div class="card">
16
- <% if translated_attribute(component_settings.new_proposal_help_text).present? %>
17
- <%= render partial: "decidim/shared/announcement", locals: { announcement: component_settings.new_proposal_help_text } %>
18
- <% end %>
16
+ <%= cell("decidim/announcement", translated_attribute(component_settings.new_proposal_help_text)) %>
19
17
 
20
18
  <div class="card__content">
21
19
  <%= decidim_form_for(@form) do |form| %>