decidim-proposals 0.10.1 → 0.11.0.pre1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/app/assets/javascripts/decidim/proposals/add_proposal.js.es6 +3 -3
  4. data/app/assets/javascripts/decidim/proposals/admin/proposals.es6 +6 -7
  5. data/app/assets/javascripts/decidim/proposals/identity_selector_dialog.js.es6 +17 -17
  6. data/app/assets/javascripts/decidim/proposals/utils.js.es6 +2 -2
  7. data/app/commands/decidim/proposals/admin/create_proposal.rb +2 -2
  8. data/app/commands/decidim/proposals/admin/import_proposals.rb +16 -8
  9. data/app/commands/decidim/proposals/create_proposal.rb +6 -6
  10. data/app/commands/decidim/proposals/destroy_proposal.rb +33 -0
  11. data/app/commands/decidim/proposals/update_proposal.rb +4 -4
  12. data/app/controllers/decidim/proposals/admin/application_controller.rb +2 -2
  13. data/app/controllers/decidim/proposals/admin/proposal_answers_controller.rb +1 -1
  14. data/app/controllers/decidim/proposals/admin/proposal_notes_controller.rb +1 -1
  15. data/app/controllers/decidim/proposals/admin/proposals_controller.rb +2 -2
  16. data/app/controllers/decidim/proposals/admin/proposals_imports_controller.rb +4 -4
  17. data/app/controllers/decidim/proposals/application_controller.rb +5 -5
  18. data/app/controllers/decidim/proposals/proposal_endorsements_controller.rb +1 -1
  19. data/app/controllers/decidim/proposals/proposal_votes_controller.rb +1 -1
  20. data/app/controllers/decidim/proposals/proposal_widgets_controller.rb +1 -1
  21. data/app/controllers/decidim/proposals/proposals_controller.rb +52 -24
  22. data/app/events/decidim/proposals/proposal_mentioned_event.rb +19 -0
  23. data/app/forms/decidim/proposals/admin/proposal_form.rb +3 -3
  24. data/app/forms/decidim/proposals/admin/proposals_import_form.rb +9 -9
  25. data/app/forms/decidim/proposals/proposal_form.rb +5 -4
  26. data/app/helpers/decidim/proposals/application_helper.rb +38 -3
  27. data/app/helpers/decidim/proposals/proposal_endorsements_helper.rb +7 -3
  28. data/app/helpers/decidim/proposals/proposal_votes_helper.rb +9 -9
  29. data/app/helpers/decidim/proposals/proposal_wizard_helper.rb +2 -1
  30. data/app/jobs/decidim/proposals/notify_proposals_mentioned_job.rb +28 -0
  31. data/app/jobs/decidim/proposals/settings_change_job.rb +4 -4
  32. data/app/models/decidim/proposals/abilities/admin_ability.rb +4 -4
  33. data/app/models/decidim/proposals/abilities/current_user_ability.rb +12 -12
  34. data/app/models/decidim/proposals/abilities/participatory_process_admin_ability.rb +8 -8
  35. data/app/models/decidim/proposals/abilities/participatory_process_moderator_ability.rb +1 -1
  36. data/app/models/decidim/proposals/proposal.rb +7 -7
  37. data/app/models/decidim/proposals/proposal_endorsement.rb +6 -2
  38. data/app/presenters/decidim/proposals/proposal_presenter.rb +12 -0
  39. data/app/queries/decidim/proposals/filtered_proposals.rb +9 -9
  40. data/app/queries/decidim/proposals/similar_proposals.rb +9 -9
  41. data/app/services/decidim/proposals/proposal_search.rb +1 -1
  42. data/app/types/decidim/proposals/proposal_type.rb +17 -2
  43. data/app/types/decidim/proposals/proposals_type.rb +6 -6
  44. data/app/views/decidim/participatory_processes/participatory_process_groups/_highlighted_proposals.html.erb +1 -1
  45. data/app/views/decidim/participatory_processes/participatory_process_groups/_proposal.html.erb +1 -1
  46. data/app/views/decidim/participatory_spaces/_highlighted_proposals.html.erb +2 -2
  47. data/app/views/decidim/participatory_spaces/_proposal.html.erb +1 -1
  48. data/app/views/decidim/proposals/admin/proposal_answers/edit.html.erb +3 -3
  49. data/app/views/decidim/proposals/admin/proposal_notes/_form.html.erb +2 -2
  50. data/app/views/decidim/proposals/admin/proposal_notes/_proposal_notes.html.erb +3 -3
  51. data/app/views/decidim/proposals/admin/proposal_notes/index.html.erb +1 -1
  52. data/app/views/decidim/proposals/admin/proposals/_bulk-actions.html.erb +2 -2
  53. data/app/views/decidim/proposals/admin/proposals/_form.html.erb +3 -3
  54. data/app/views/decidim/proposals/admin/proposals/_proposal-tr.html.erb +1 -1
  55. data/app/views/decidim/proposals/admin/proposals/index.html.erb +1 -1
  56. data/app/views/decidim/proposals/admin/proposals/new.html.erb +2 -2
  57. data/app/views/decidim/proposals/admin/proposals/update_category.js.erb +3 -3
  58. data/app/views/decidim/proposals/admin/proposals_imports/new.html.erb +3 -3
  59. data/app/views/decidim/proposals/admin/shared/_info_proposal.html.erb +1 -1
  60. data/app/views/decidim/proposals/proposal_endorsements/_identity.html.erb +2 -2
  61. data/app/views/decidim/proposals/proposal_endorsements/identities.html.erb +2 -2
  62. data/app/views/decidim/proposals/proposal_endorsements/update_buttons_and_counters.js.erb +19 -8
  63. data/app/views/decidim/proposals/proposals/_endorsement_button.html.erb +2 -2
  64. data/app/views/decidim/proposals/proposals/_endorsement_identities_cabin.html.erb +3 -3
  65. data/app/views/decidim/proposals/proposals/_endorsements_card_row.html.erb +4 -4
  66. data/app/views/decidim/proposals/proposals/_endorsements_count.html.erb +2 -2
  67. data/app/views/decidim/proposals/proposals/_filters.html.erb +10 -10
  68. data/app/views/decidim/proposals/proposals/_filters_small_view.html.erb +1 -1
  69. data/app/views/decidim/proposals/proposals/_identities_listing.html.erb +30 -0
  70. data/app/views/decidim/proposals/proposals/{_endorsement_xxs.html.erb → _identity_xxs.html.erb} +1 -2
  71. data/app/views/decidim/proposals/proposals/_proposal.html.erb +2 -2
  72. data/app/views/decidim/proposals/proposals/_proposal_badge.html.erb +1 -1
  73. data/app/views/decidim/proposals/proposals/_tags.html.erb +25 -0
  74. data/app/views/decidim/proposals/proposals/_vote_button.html.erb +7 -7
  75. data/app/views/decidim/proposals/proposals/_votes_count.html.erb +6 -5
  76. data/app/views/decidim/proposals/proposals/_voting_rules.html.erb +7 -7
  77. data/app/views/decidim/proposals/proposals/_wizard_header.html.erb +5 -5
  78. data/app/views/decidim/proposals/proposals/compare.html.erb +1 -1
  79. data/app/views/decidim/proposals/proposals/complete.html.erb +70 -0
  80. data/app/views/decidim/proposals/proposals/edit.html.erb +3 -3
  81. data/app/views/decidim/proposals/proposals/edit_draft.html.erb +5 -3
  82. data/app/views/decidim/proposals/proposals/index.html.erb +5 -5
  83. data/app/views/decidim/proposals/proposals/new.html.erb +1 -43
  84. data/app/views/decidim/proposals/proposals/preview.html.erb +1 -1
  85. data/app/views/decidim/proposals/proposals/show.html.erb +16 -23
  86. data/config/locales/ca.yml +69 -55
  87. data/config/locales/en.yml +64 -50
  88. data/config/locales/es.yml +73 -59
  89. data/config/locales/eu.yml +64 -50
  90. data/config/locales/fi.yml +64 -50
  91. data/config/locales/fr.yml +75 -61
  92. data/config/locales/gl.yml +64 -50
  93. data/config/locales/it.yml +64 -50
  94. data/config/locales/nl.yml +153 -139
  95. data/config/locales/pl.yml +64 -50
  96. data/config/locales/pt-BR.yml +64 -50
  97. data/config/locales/pt.yml +64 -50
  98. data/config/locales/ru.yml +0 -9
  99. data/config/locales/sv.yml +64 -50
  100. data/config/locales/uk.yml +2 -16
  101. data/db/migrate/20171212102250_enable_pg_extensions.rb +12 -1
  102. data/db/migrate/20180305133811_rename_features_to_components_at_proposals.rb +11 -0
  103. data/db/migrate/20180413135249_fix_nil_threshold_per_proposal.rb +18 -0
  104. data/lib/decidim/content_parsers/proposal_parser.rb +95 -0
  105. data/lib/decidim/content_renderers/proposal_renderer.rb +33 -0
  106. data/lib/decidim/proposals.rb +9 -1
  107. data/lib/decidim/proposals/commentable_proposal.rb +3 -3
  108. data/lib/decidim/proposals/{feature.rb → component.rb} +39 -38
  109. data/lib/decidim/proposals/engine.rb +21 -6
  110. data/lib/decidim/proposals/proposal_serializer.rb +3 -3
  111. data/lib/decidim/proposals/test/factories.rb +5 -8
  112. data/lib/decidim/proposals/version.rb +1 -1
  113. metadata +32 -23
  114. data/app/views/decidim/proposals/proposals/_endorsements_listing.html.erb +0 -34
@@ -0,0 +1,25 @@
1
+ <figure>
2
+ <figcaption class="text-uppercase">
3
+ <strong>
4
+ <%= t("filed_as", scope: "decidim.proposals.proposals.tags") %>
5
+ </strong>
6
+ </figcaption>
7
+
8
+ <ul>
9
+ <% if resource.category.present? %>
10
+ <li>
11
+ <%= link_to translated_attribute(resource.category.name), resource_locator(resource).index(filter: { category_id: resource.category.id }) %>
12
+ <% if resource.previous_category.present? && action_name == "show" %>
13
+ &nbsp;
14
+ <small class="text-small">
15
+ <%= t("changed_from", scope: "decidim.proposals.proposals.tags", previous_category: "#{resource.previous_category.translated_name}").html_safe %>
16
+ </small>
17
+ <% end %>
18
+ </li>
19
+ <% end %>
20
+
21
+ <% if has_visible_scopes?(resource) %>
22
+ <li><%= link_to translated_attribute(resource.scope.name), resource_locator(resource).index(filter: { scope_id: [resource.scope.id] }) %></li>
23
+ <% end %>
24
+ </ul>
25
+ </figure>
@@ -2,23 +2,23 @@
2
2
  <div id="proposal-<%= proposal.id %>-vote-button">
3
3
  <% if !current_user %>
4
4
  <% if current_settings.votes_blocked? %>
5
- <%= action_authorized_button_to :vote, t('.votes_blocked'), proposal_proposal_vote_path(proposal_id: proposal, from_proposals_list: from_proposals_list), class: "button #{vote_button_classes(from_proposals_list)} disabled", disabled: true %>
5
+ <%= action_authorized_button_to :vote, t(".votes_blocked"), proposal_proposal_vote_path(proposal_id: proposal, from_proposals_list: from_proposals_list), class: "button #{vote_button_classes(from_proposals_list)} disabled", disabled: true %>
6
6
  <% else %>
7
- <%= action_authorized_button_to :vote, t('.vote'), proposal_proposal_vote_path(proposal_id: proposal, from_proposals_list: from_proposals_list), class: "button #{vote_button_classes(from_proposals_list)}", data: { disable: true, "redirect-url": proposal_path(proposal) } %>
7
+ <%= action_authorized_button_to :vote, t(".vote"), proposal_proposal_vote_path(proposal_id: proposal, from_proposals_list: from_proposals_list), class: "button #{vote_button_classes(from_proposals_list)}", data: { disable: true, "redirect-url": proposal_path(proposal) } %>
8
8
  <% end %>
9
9
  <% else %>
10
10
  <% if @voted_proposals ? @voted_proposals.include?(proposal.id) : proposal.voted_by?(current_user) %>
11
- <%= action_authorized_button_to :vote, t('.already_voted'), proposal_proposal_vote_path(proposal_id: proposal, from_proposals_list: from_proposals_list), method: :delete, remote: true, data: { disable: true, original: t('.already_voted'), replace: t('.already_voted_hover'), "redirect-url": proposal_path(proposal) }, class: "button #{vote_button_classes(from_proposals_list)} success", id: "vote_button" %>
11
+ <%= action_authorized_button_to :vote, t(".already_voted"), proposal_proposal_vote_path(proposal_id: proposal, from_proposals_list: from_proposals_list), method: :delete, remote: true, data: { disable: true, original: t(".already_voted"), replace: t(".already_voted_hover"), "redirect-url": proposal_path(proposal) }, class: "button #{vote_button_classes(from_proposals_list)} success", id: "vote_button" %>
12
12
  <% else %>
13
13
  <% if proposal.maximum_votes_reached? && !proposal.can_accumulate_supports_beyond_threshold %>
14
- <%= content_tag :span, t('.maximum_votes_reached'), class: "button #{vote_button_classes(from_proposals_list)} disabled", disabled: true %>
14
+ <%= content_tag :span, t(".maximum_votes_reached"), class: "button #{vote_button_classes(from_proposals_list)} disabled", disabled: true %>
15
15
  <% else %>
16
16
  <% if vote_limit_enabled? && remaining_votes_count_for(current_user) == 0 %>
17
- <%= content_tag :span, t('.no_votes_remaining'), class: "button #{vote_button_classes(from_proposals_list)}", disabled: true %>
17
+ <%= content_tag :span, t(".no_votes_remaining"), class: "button #{vote_button_classes(from_proposals_list)}", disabled: true %>
18
18
  <% elsif current_settings.votes_blocked? %>
19
- <%= content_tag :span, t('.votes_blocked'), class: "button #{vote_button_classes(from_proposals_list)} disabled", disabled: true %>
19
+ <%= content_tag :span, t(".votes_blocked"), class: "button #{vote_button_classes(from_proposals_list)} disabled", disabled: true %>
20
20
  <% else %>
21
- <%= action_authorized_button_to :vote, t('.vote'), proposal_proposal_vote_path(proposal_id: proposal, from_proposals_list: from_proposals_list), remote: true, data: { disable: true, "redirect-url": proposal_path(proposal) }, class: "button #{vote_button_classes(from_proposals_list)}" %>
21
+ <%= action_authorized_button_to :vote, t(".vote"), proposal_proposal_vote_path(proposal_id: proposal, from_proposals_list: from_proposals_list), remote: true, data: { disable: true, "redirect-url": proposal_path(proposal) }, class: "button #{vote_button_classes(from_proposals_list)}" %>
22
22
  <% end %>
23
23
  <% end %>
24
24
  <% end %>
@@ -1,13 +1,13 @@
1
1
  <div id="proposal-<%= proposal.id %>-votes-count" class="card__support__data">
2
2
  <% if !current_settings.votes_hidden? %>
3
3
  <% progress ||= proposal.proposal_votes_count || 0 %>
4
- <% total ||= proposal.maximum_votes || 0 %>
4
+ <% total ||= proposal.maximum_votes || 0 %>
5
5
  <% percent = (progress.to_f/total) * 100 %>
6
6
  <% vertical ||= from_proposals_list %>
7
- <div class="progress__bar<%= (!vertical) ? ' progress__bar--vertical' : '' %>">
7
+ <div class="progress__bar<%= (!vertical) ? " progress__bar--vertical" : "" %>">
8
8
  <div class="progress__bar__title">
9
9
  <span class="progress__bar__number"><%= progress %></span><%= "/#{total}" if total != 0 %>
10
- <span class="progress__bar__text"><%= t('.count', count: proposal.proposal_votes_count) %></span>
10
+ <span class="progress__bar__text"><%= t(".count", count: proposal.proposal_votes_count) %></span>
11
11
  </div>
12
12
  <% if total != 0 %>
13
13
  <div class="progress progress__bar__bar" role="progressbar" tabindex="0" aria-valuenow="<%= percent %>" aria-valuemin="0" aria-valuetext="<%= percent %> percent" aria-valuemax="100">
@@ -16,12 +16,13 @@
16
16
  </div>
17
17
  <div class="progress__bar__subtitle">
18
18
  <% if progress >= total %>
19
- <%= t('.most_popular_proposal') %>
19
+ <%= t(".most_popular_proposal") %>
20
20
  <% else %>
21
- <%= t('.need_more_votes') %>
21
+ <%= t(".need_more_votes") %>
22
22
  <% end %>
23
23
  </div>
24
24
  <% end %>
25
25
  </div>
26
+
26
27
  <% end %>
27
28
  </div>
@@ -3,22 +3,22 @@
3
3
  <div class="callout secondary voting-rules">
4
4
  <div class="row">
5
5
  <div class="columns medium-8 large-9">
6
- <h3 class="heading3"><%= t('.title') %></h3>
6
+ <h3 class="heading3"><%= t(".title") %></h3>
7
7
  <ul>
8
8
  <% if vote_limit_enabled? %>
9
- <li><%= t('.vote_limit.description', limit: feature_settings.vote_limit) %></li>
9
+ <li><%= t(".vote_limit.description", limit: component_settings.vote_limit) %></li>
10
10
  <% end %>
11
11
 
12
12
  <% if proposal_limit_enabled? %>
13
- <li><%= t('.proposal_limit.description', limit: proposal_limit) %></li>
13
+ <li><%= t(".proposal_limit.description", limit: proposal_limit) %></li>
14
14
  <% end %>
15
15
 
16
16
  <% if threshold_per_proposal_enabled? %>
17
- <li><%= t('.threshold_per_proposal.description', limit: threshold_per_proposal) %></li>
17
+ <li><%= t(".threshold_per_proposal.description", limit: threshold_per_proposal) %></li>
18
18
  <% end %>
19
19
 
20
20
  <% if can_accumulate_supports_beyond_threshold? %>
21
- <li><%= t('.can_accumulate_supports_beyond_threshold.description') %></li>
21
+ <li><%= t(".can_accumulate_supports_beyond_threshold.description", limit: threshold_per_proposal) %></li>
22
22
  <% end %>
23
23
  </ul>
24
24
  </div>
@@ -26,9 +26,9 @@
26
26
  <div class="columns medium-4 large-3">
27
27
  <div class="card card--nomargin text-center remaining-votes-counter">
28
28
  <div class="card__content">
29
- <span class="definition-data__title"><%= t('.vote_limit.left', limit: feature_settings.vote_limit) %></span>
29
+ <span class="definition-data__title"><%= t(".vote_limit.left", limit: component_settings.vote_limit) %></span>
30
30
  <%= render partial: "remaining_votes_count" %>
31
- <span class="extra__suport-text"><%= t('.vote_limit.votes') %></span>
31
+ <span class="extra__suport-text"><%= t(".vote_limit.votes") %></span>
32
32
  </div>
33
33
  </div>
34
34
  </div>
@@ -1,10 +1,10 @@
1
- <% if translated_attribute(feature_settings.new_proposal_help_text).present? && @step != :step_3 %>
2
- <%= render partial: "decidim/shared/announcement", locals: { announcement: feature_settings.new_proposal_help_text } %>
3
- <% elsif @step == :step_3 %>
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
4
  <%
5
5
  locals = {
6
6
  callout_class: "warning",
7
- announcement: t("decidim.proposals.proposals.preview.proposal_edit_before_minutes", count: feature_settings.proposal_edit_before_minutes)
7
+ announcement: t("decidim.proposals.proposals.preview.proposal_edit_before_minutes", count: component_settings.proposal_edit_before_minutes)
8
8
  }
9
9
  %>
10
10
  <%= render partial: "decidim/shared/announcement", locals: locals %>
@@ -13,7 +13,7 @@
13
13
  <% if proposal_wizard_step_help_text?(@step) %>
14
14
  <div class="proposal_wizard_help_text">
15
15
  <% callout_step_help_text_class ||= nil %>
16
- <%= render partial: "decidim/shared/announcement", locals: { announcement: feature_settings.try("proposal_wizard_#{@step}_help_text"), callout_class: callout_step_help_text_class } %>
16
+ <%= render partial: "decidim/shared/announcement", locals: { announcement: component_settings.try("proposal_wizard_#{@step}_help_text"), callout_class: callout_step_help_text_class } %>
17
17
  </div>
18
18
  <% end %>
19
19
 
@@ -12,7 +12,7 @@
12
12
  </div>
13
13
  <% end %>
14
14
  <div class="row column text-center">
15
- <%= link_to t(".mine_is_different"), preview_proposal_path(@proposal), class: "button small" %>
15
+ <%= link_to t(".mine_is_different"), complete_proposals_path(proposal: {title: @form.title, body: @form.body}), class: "button small" %>
16
16
  </div>
17
17
  </div>
18
18
  <div class="columns large-3"></div>
@@ -0,0 +1,70 @@
1
+ <div class="row">
2
+ <%= render partial: "wizard_aside" %>
3
+
4
+ <div class="columns large-6">
5
+ <%= render partial: "wizard_header" %>
6
+
7
+ <div class="card">
8
+ <div class="card__content">
9
+ <%= decidim_form_for(@form) do |form| %>
10
+ <div class="field">
11
+ <%= form.text_field :title %>
12
+ </div>
13
+
14
+ <div class="field">
15
+ <%= form.text_area :body, rows: 10 %>
16
+ </div>
17
+
18
+ <% if component_settings.geocoding_enabled? %>
19
+ <div class="field">
20
+ <%= form.check_box :has_address %>
21
+ </div>
22
+ <div class="field" id="address_input">
23
+ <%= form.text_field :address %>
24
+ </div>
25
+ <% end %>
26
+
27
+ <% if @form.categories&.any? %>
28
+ <div class="field">
29
+ <%= form.categories_select :category_id, @form.categories, prompt: t(".select_a_category") %>
30
+ </div>
31
+ <% end %>
32
+
33
+ <% if current_participatory_space.has_subscopes? %>
34
+ <div class="field">
35
+ <%= scopes_picker_field form, :scope_id %>
36
+ </div>
37
+ <% end %>
38
+
39
+ <% if current_user.user_groups.verified.any? %>
40
+ <div class="field">
41
+ <%= user_group_select_field form, :user_group_id %>
42
+ </div>
43
+ <% end %>
44
+
45
+ <% if component_settings.attachments_allowed? %>
46
+ <fieldset>
47
+ <legend><%= t(".attachment_legend") %></legend>
48
+ <%= form.fields_for :attachment, @form.attachment do |form| %>
49
+ <div class="field">
50
+ <%= form.text_field :title %>
51
+ </div>
52
+
53
+ <div class="field">
54
+ <%= form.upload :file, optional: false %>
55
+ </div>
56
+ <% end %>
57
+ </fieldset>
58
+ <% end %>
59
+
60
+ <div class="actions">
61
+ <%= form.submit t(".send"), class: "button expanded mt-s mb-none", data: { disable: true } %>
62
+ </div>
63
+ <% end %>
64
+ </div>
65
+ </div>
66
+ </div>
67
+ <div class="columns large-3"></div>
68
+ </div>
69
+
70
+ <%= javascript_include_tag "decidim/proposals/add_proposal" %>
@@ -9,8 +9,8 @@
9
9
  <div class="row">
10
10
  <div class="columns large-6 medium-centered">
11
11
  <div class="card">
12
- <% if translated_attribute(feature_settings.new_proposal_help_text).present? %>
13
- <%= render partial: "decidim/shared/announcement", locals: { announcement: feature_settings.new_proposal_help_text } %>
12
+ <% if translated_attribute(component_settings.new_proposal_help_text).present? %>
13
+ <%= render partial: "decidim/shared/announcement", locals: { announcement: component_settings.new_proposal_help_text } %>
14
14
  <% end %>
15
15
 
16
16
  <div class="card__content">
@@ -23,7 +23,7 @@
23
23
  <%= form.text_area :body, rows: 10 %>
24
24
  </div>
25
25
 
26
- <% if feature_settings.geocoding_enabled? %>
26
+ <% if component_settings.geocoding_enabled? %>
27
27
  <div class="field">
28
28
  <%= form.check_box :has_address %>
29
29
  </div>
@@ -15,7 +15,7 @@
15
15
  <%= form.text_area :body, rows: 10 %>
16
16
  </div>
17
17
 
18
- <% if feature_settings.geocoding_enabled? %>
18
+ <% if component_settings.geocoding_enabled? %>
19
19
  <div class="field">
20
20
  <%= form.check_box :has_address %>
21
21
  </div>
@@ -42,8 +42,10 @@
42
42
  </div>
43
43
  <% end %>
44
44
 
45
- <div class="actions">
46
- <%= form.submit t(".send"), class: "button expanded", data: { disable: true } %>
45
+ <div class="row column flex-center">
46
+ <%= link_to t(".discard"), destroy_draft_proposal_path(@proposal), method: :delete, data: { confirm: t(".discard_confirmation") } %>
47
+
48
+ <%= form.submit t(".send"), class: "button button--nomargin small", data: { disable: true } %>
47
49
  </div>
48
50
  <% end %>
49
51
  </div>
@@ -1,6 +1,6 @@
1
- <%= render partial: "decidim/shared/feature_announcement" %>
1
+ <%= render partial: "decidim/shared/component_announcement" %>
2
2
 
3
- <% if feature_settings.geocoding_enabled? %>
3
+ <% if component_settings.geocoding_enabled? %>
4
4
  <%= dynamic_map_for proposals_data_for_map(geocoded_proposals) do %>
5
5
  <template id="marker-popup">
6
6
  <div class="map-info__content">
@@ -17,7 +17,7 @@
17
17
  </div>
18
18
  <div class="map-info__button">
19
19
  <a href="${link}" class="button button--sc">
20
- <%= t('.view_proposal') %>
20
+ <%= t(".view_proposal") %>
21
21
  </a>
22
22
  </div>
23
23
  </div>
@@ -49,7 +49,7 @@
49
49
  <div class="row">
50
50
  <div class="columns mediumlarge-4 large-3">
51
51
  <%= render partial: "filters_small_view" %>
52
- <div class="card card--secondary show-for-mediumlarge" >
52
+ <div class="card card--secondary show-for-mediumlarge">
53
53
  <%= render partial: "filters" %>
54
54
  </div>
55
55
  </div>
@@ -59,7 +59,7 @@
59
59
  </div>
60
60
  <div class="row">
61
61
  <div class="text-right">
62
- <%= link_to t('.see_all_withdrawn'), proposals_path('filter[state]' => 'withdrawn') %>
62
+ <%= link_to t(".see_all_withdrawn"), proposals_path("filter[state]" => "withdrawn") %>
63
63
  </div>
64
64
  </div>
65
65
  <%= javascript_include_tag("decidim/filters") %>
@@ -6,7 +6,7 @@
6
6
 
7
7
  <div class="card">
8
8
  <div class="card__content">
9
- <%= decidim_form_for(@form) do |form| %>
9
+ <%= decidim_form_for(@form, url: compare_proposals_path, method: :get) do |form| %>
10
10
  <div class="field">
11
11
  <%= form.text_field :title %>
12
12
  </div>
@@ -15,48 +15,6 @@
15
15
  <%= form.text_area :body, rows: 10 %>
16
16
  </div>
17
17
 
18
- <% if feature_settings.geocoding_enabled? %>
19
- <div class="field">
20
- <%= form.check_box :has_address %>
21
- </div>
22
- <div class="field" id="address_input">
23
- <%= form.text_field :address %>
24
- </div>
25
- <% end %>
26
-
27
- <% if @form.categories&.any? %>
28
- <div class="field">
29
- <%= form.categories_select :category_id, @form.categories, prompt: t(".select_a_category") %>
30
- </div>
31
- <% end %>
32
-
33
- <% if current_participatory_space.has_subscopes? %>
34
- <div class="field">
35
- <%= scopes_picker_field form, :scope_id %>
36
- </div>
37
- <% end %>
38
-
39
- <% if current_user.user_groups.verified.any? %>
40
- <div class="field">
41
- <%= user_group_select_field form, :user_group_id %>
42
- </div>
43
- <% end %>
44
-
45
- <% if feature_settings.attachments_allowed? %>
46
- <fieldset>
47
- <legend><%= t('.attachment_legend') %></legend>
48
- <%= form.fields_for :attachment, @form.attachment do |form| %>
49
- <div class="field">
50
- <%= form.text_field :title %>
51
- </div>
52
-
53
- <div class="field">
54
- <%= form.upload :file, optional: false %>
55
- </div>
56
- <% end %>
57
- </fieldset>
58
- <% end %>
59
-
60
18
  <div class="actions">
61
19
  <%= form.submit t(".send"), class: "button expanded mt-s mb-none", data: { disable: true } %>
62
20
  </div>
@@ -5,7 +5,7 @@
5
5
  <%= render partial: "wizard_header", locals: {callout_help_text_class: "warning"} %>
6
6
  <div class="card">
7
7
  <div class="p-l">
8
- <%= render partial: "proposal_preview", locals: {proposal: @proposal}%>
8
+ <%= render partial: "proposal_preview", locals: {proposal: @proposal} %>
9
9
  <div class="row column flex-center">
10
10
  <%= link_to t(".modify"), edit_draft_proposal_path(@proposal) %>
11
11
 
@@ -7,23 +7,21 @@
7
7
  <%= render partial: "voting_rules" %>
8
8
  <div class="row column view-header">
9
9
  <h2 class="heading2"><%= @proposal.title %></h2>
10
- <div class="author-data">
11
- <%= render partial: "decidim/shared/author_reference", locals: { author: Decidim::Proposals::ProposalPresenter.new(@proposal).author } %>
12
- <div class="author-data__extra">
13
- <button type="button" data-open="<%= current_user.present? ? 'flagModal' : 'loginModal' %>" title="<%= t('.report') %>" aria-controls="<%= current_user.present? ? 'flagModal' : 'loginModal' %>" aria-haspopup="true" tabindex="0">
14
- <%= icon "flag", aria_label: t('.report'), class: 'icon--small' %>
10
+ <%= cell "decidim/author_box", present(@proposal).author, extra: (capture do %>
11
+ <span><%= l @proposal.created_at, format: :decidim_short %></span>
12
+ <button type="button" data-open="<%= current_user.present? ? "flagModal" : "loginModal" %>" title="<%= t(".report") %>" aria-controls="<%= current_user.present? ? "flagModal" : "loginModal" %>" aria-haspopup="true" tabindex="0">
13
+ <%= icon "flag", aria_label: t(".report"), class: "icon--small" %>
15
14
  </button>
16
15
  <% unless @proposal.official? %>
17
16
  <%= link_to_current_or_new_conversation_with(@proposal.author) %>
18
17
  <% end %>
19
- </div>
20
- <% if @proposal.withdrawable_by?(current_user) %>
21
- <%= action_authorized_link_to :withdraw, withdraw_proposal_path(@proposal), method: :put, class: "title-action__action button small hollow", title: t('.withdraw_btn_hint'), data: {confirm: t('.withdraw_confirmation')} do %>
22
- <%= t('.withdraw_proposal') %>
23
- <%= icon "x" %>
24
- <% end %>
18
+ <% if @proposal.withdrawable_by?(current_user) %>
19
+ <%= action_authorized_link_to :withdraw, withdraw_proposal_path(@proposal), method: :put, class: "title-action__action button small hollow", title: t(".withdraw_btn_hint"), data: {confirm: t(".withdraw_confirmation")} do %>
20
+ <%= t(".withdraw_proposal") %>
21
+ <%= icon "x" %>
22
+ <% end %>
25
23
  <% end %>
26
- </div>
24
+ <% end) %>
27
25
  </div>
28
26
  <div class="row">
29
27
  <div class="columns section view-side mediumlarge-4 mediumlarge-push-8 large-3 large-push-9">
@@ -38,14 +36,8 @@
38
36
  <%= render partial: "vote_button", locals: { proposal: @proposal, from_proposals_list: false } %>
39
37
  <% end %>
40
38
  <%= render partial: "endorsements_card_row", locals: { proposal: @proposal } %>
41
- <br/>
42
- <% if current_user %>
43
- <%= render partial: "decidim/shared/follow_button", locals: { followable: @proposal } %>
44
- <% else %>
45
- <p class="mt-s mb-none">
46
- <%= t(".sign_in_or_up", {in: link_to(t(".sign_in"), decidim.new_user_session_path), up: link_to(t(".sign_up"), decidim.new_user_registration_path)}).html_safe %>
47
- </p>
48
- <% end %>
39
+ <br />
40
+ <%= follow_button_for(@proposal) %>
49
41
  </div>
50
42
  </div>
51
43
  <% end %>
@@ -57,10 +49,11 @@
57
49
  <div class="section">
58
50
  <%= render partial: "proposal_badge", locals: { proposal: @proposal } %>
59
51
  <%= simple_format @proposal.body %>
60
- <% if feature_settings.geocoding_enabled? %>
52
+ <% if component_settings.geocoding_enabled? %>
61
53
  <%= render partial: "decidim/shared/static_map", locals: { icon_name: "proposals", geolocalizable: @proposal } %>
62
54
  <% end %>
63
- <%= render partial: "decidim/shared/tags", locals: { resource: @proposal, tags_class_extra: "tags--proposal" } %>
55
+ <%= render partial: "tags", locals: { resource: @proposal } %>
56
+
64
57
  </div>
65
58
  <% if @proposal.answered? && translated_attribute(@proposal.answer).present? %>
66
59
  <% if @proposal.accepted? %>
@@ -95,7 +88,7 @@
95
88
  <%= attachments_for @proposal %>
96
89
 
97
90
  <a name="list-of-endorsements"></a>
98
- <%= render partial: 'endorsements_listing', locals: {proposal: @proposal} %>
91
+ <%= identities_list_xxs(@proposal.endorsements.for_listing) %>
99
92
  <%= comments_for @proposal %>
100
93
 
101
94
  <%= javascript_include_tag "decidim/proposals/social_share" %>