decidim-reporting_proposals 0.4.2 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/lint.yml +2 -2
  3. data/.github/workflows/test_integration.yml +2 -2
  4. data/.github/workflows/test_unit.yml +2 -2
  5. data/.rubocop-disabled.yml +11 -0
  6. data/.rubocop.yml +1 -0
  7. data/.rubocop_rails.yml +3 -0
  8. data/.rubocop_ruby.yml +24 -10
  9. data/.ruby-version +1 -1
  10. data/.simplecov +2 -2
  11. data/Gemfile.lock +257 -235
  12. data/README.md +2 -2
  13. data/Rakefile +2 -0
  14. data/app/commands/concerns/decidim/reporting_proposals/gallery_methods_override.rb +18 -0
  15. data/app/commands/decidim/reporting_proposals/admin/update_proposal_note.rb +1 -1
  16. data/app/commands/decidim/reporting_proposals/create_reporting_proposal.rb +2 -0
  17. data/app/commands/decidim/templates/admin/copy_proposal_answer_template.rb +1 -1
  18. data/app/commands/decidim/templates/admin/create_proposal_answer_template.rb +1 -1
  19. data/app/commands/decidim/templates/admin/update_proposal_answer_template.rb +1 -1
  20. data/app/controllers/concerns/decidim/reporting_proposals/admin/needs_header_snippets.rb +5 -7
  21. data/app/controllers/concerns/decidim/reporting_proposals/needs_proposal_extra_validations_snippets.rb +1 -1
  22. data/app/controllers/concerns/decidim/reporting_proposals/proposals_controller_override.rb +5 -5
  23. data/app/controllers/decidim/templates/admin/proposal_answer_templates_controller.rb +3 -5
  24. data/app/forms/concerns/decidim/reporting_proposals/form_builder_override.rb +9 -8
  25. data/app/forms/concerns/decidim/reporting_proposals/map_builder_override.rb +6 -4
  26. data/app/helpers/concerns/decidim/reporting_proposals/proposal_wizard_helper_override.rb +4 -4
  27. data/app/overrides/decidim/proposals/admin/proposal_answers/_form/add_template_chooser.html.erb.deface +1 -1
  28. data/app/overrides/decidim/proposals/admin/proposals/_proposal-tr/add_valuators_name.html.erb.deface +3 -3
  29. data/app/overrides/decidim/proposals/admin/proposals/show/add_send_email_btn.html.erb.deface +1 -1
  30. data/app/overrides/decidim/proposals/admin/proposals/show/add_valuators_form.html.erb.deface +1 -1
  31. data/app/overrides/decidim/proposals/admin/proposals/show/remove_photos.html.erb.deface +0 -1
  32. data/app/overrides/decidim/proposals/proposals/_edit_form_fields/replace_add_photos.html.erb.deface +37 -0
  33. data/app/overrides/decidim/proposals/proposals/_proposal_similar/add_distance_badge.html.erb.deface +1 -1
  34. data/app/overrides/decidim/proposals/proposals/_wizard_header/replace_title.html.erb.deface +9 -9
  35. data/app/overrides/decidim/proposals/proposals/edit/add_css.html.erb.deface +5 -0
  36. data/app/overrides/decidim/proposals/proposals/edit/replace_javascript.html.erb.deface +0 -1
  37. data/app/overrides/decidim/proposals/proposals/edit_draft/add_css.html.erb.deface +5 -0
  38. data/app/overrides/decidim/proposals/proposals/new/add_css.html.erb.deface +5 -0
  39. data/app/overrides/decidim/proposals/proposals/new/replace_javascript.html.erb.deface +0 -1
  40. data/app/overrides/decidim/reported_mailer/report/add_link_to_admin.html.erb.deface +1 -1
  41. data/app/overrides/layouts/decidim/_process_header_steps/always_show_new_proposals.html.erb.deface +1 -1
  42. data/app/packs/stylesheets/decidim/reporting_proposals/geocoding_addons.scss +8 -8
  43. data/app/packs/stylesheets/decidim/reporting_proposals/list_component_admin.scss +5 -5
  44. data/app/packs/stylesheets/decidim/reporting_proposals/manage_component_admin.scss +10 -10
  45. data/app/packs/stylesheets/decidim/reporting_proposals/proposals/add_proposal.scss +3 -3
  46. data/app/packs/stylesheets/decidim/reporting_proposals/user_camera_inputs.scss +5 -5
  47. data/app/queries/decidim/reporting_proposals/nearby_proposals.rb +1 -1
  48. data/app/validators/concerns/decidim/reporting_proposals/component_validator_override.rb +2 -2
  49. data/app/views/decidim/proposals/proposals/index.js.erb +1 -1
  50. data/app/views/decidim/reporting_proposals/proposals/_reporting_proposal_fields.html.erb +9 -21
  51. data/babel.config.json +25 -0
  52. data/config/locales/en.yml +2 -0
  53. data/db/migrate/20230404103706_add_target_and_field_values_to_decidim_templates_templates.rb +2 -6
  54. data/decidim-reporting_proposals.gemspec +2 -1
  55. data/lib/decidim/reporting_proposals/component.rb +0 -9
  56. data/lib/decidim/reporting_proposals/engine.rb +27 -3
  57. data/lib/decidim/reporting_proposals/version.rb +3 -3
  58. data/package-lock.json +161 -142
  59. data/package.json +4 -163
  60. metadata +56 -48
data/README.md CHANGED
@@ -25,12 +25,12 @@ Or, if you want to stay up to date with the latest changes use this line instead
25
25
  gem 'decidim-reporting_proposals', git: "https://github.com/openpoke/decidim-module-reporting_proposals"
26
26
  ```
27
27
 
28
- And then execute:
28
+ And then execute (do also this on upgrades):
29
29
 
30
30
  ```
31
31
  bundle
32
- And then execute:
33
32
  bundle exec rails decidim_reporting_proposals:install:migrations
33
+ bin/rails db:migrate
34
34
  ```
35
35
 
36
36
  > **IMPORTANT:**
data/Rakefile CHANGED
@@ -3,6 +3,8 @@
3
3
  require "decidim/dev/common_rake"
4
4
 
5
5
  def install_module(path)
6
+ # maintain until https://github.com/decidim/decidim/commit/51b81b37004708ab72e70993fef4634eef18ee6c is in the decidim version used
7
+ FileUtils.cp("babel.config.json", "#{path}/babel.config.json")
6
8
  Dir.chdir(path) do
7
9
  system("bundle exec rake decidim_reporting_proposals:install:migrations")
8
10
  system("bundle exec rake db:migrate")
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module ReportingProposals
5
+ module GalleryMethodsOverride
6
+ extend ActiveSupport::Concern
7
+
8
+ # this method cannot process direct uploads in gallery_methods.rb so we override it here with the fix
9
+ included do
10
+ def photos_content_type(photo)
11
+ return blob(photos_signed_id(photo)).content_type if photo.is_a?(Hash)
12
+
13
+ photo.content_type
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -4,7 +4,7 @@ module Decidim
4
4
  module ReportingProposals
5
5
  module Admin
6
6
  # A command with all the business logic when a user updates a proposal note.
7
- class UpdateProposalNote < Rectify::Command
7
+ class UpdateProposalNote < Decidim::Command
8
8
  # Public: Initializes the command.
9
9
  #
10
10
  # form - A form object with the params.
@@ -35,6 +35,8 @@ module Decidim
35
35
  broadcast(:ok, proposal)
36
36
  end
37
37
 
38
+ private
39
+
38
40
  def create_reporting_proposal
39
41
  PaperTrail.request(enabled: false) do
40
42
  @proposal = Decidim.traceability.perform_action!(
@@ -4,7 +4,7 @@ module Decidim
4
4
  module Templates
5
5
  # A command with all the business logic when duplicating a proposal's answer template
6
6
  module Admin
7
- class CopyProposalAnswerTemplate < Rectify::Command
7
+ class CopyProposalAnswerTemplate < Decidim::Command
8
8
  def initialize(template)
9
9
  @template = template
10
10
  end
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  module Templates
5
5
  module Admin
6
- class CreateProposalAnswerTemplate < Rectify::Command
6
+ class CreateProposalAnswerTemplate < Decidim::Command
7
7
  # Initializes the command.
8
8
  #
9
9
  # form - The source for this ProposalAnswerTemplate.
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  module Templates
5
5
  module Admin
6
- class UpdateProposalAnswerTemplate < Rectify::Command
6
+ class UpdateProposalAnswerTemplate < Decidim::Command
7
7
  # Initializes the command.
8
8
  #
9
9
  # template - The Template to update.
@@ -36,13 +36,11 @@ module Decidim
36
36
  end
37
37
 
38
38
  def current_component
39
- @current_component ||= begin
40
- if defined?(query_scope) && query_scope.respond_to?(:find)
41
- query_scope.find_by(id: params[:id])
42
- elsif params.has_key?(:component_id)
43
- Decidim::Component.find_by(id: params[:component_id])
44
- end
45
- end
39
+ @current_component ||= if defined?(query_scope) && query_scope.respond_to?(:find)
40
+ query_scope.find_by(id: params[:id])
41
+ elsif params.has_key?(:component_id)
42
+ Decidim::Component.find_by(id: params[:component_id])
43
+ end
46
44
  end
47
45
  end
48
46
  end
@@ -16,7 +16,7 @@ module Decidim
16
16
  unless @snippets.any?(:reporting_proposals_js_validations)
17
17
  @snippets.add(:reporting_proposals_js_validations, ActionController::Base.helpers.javascript_pack_tag("decidim_reporting_proposals_js_validations"))
18
18
  @snippets.add(:reporting_proposals_js_validations, rules_tag)
19
- @snippets.add(:head, @snippets.for(:reporting_proposals_js_validations))
19
+ @snippets.add(:foot, @snippets.for(:reporting_proposals_js_validations))
20
20
  end
21
21
  @snippets
22
22
  end
@@ -12,7 +12,7 @@ module Decidim
12
12
 
13
13
  def new
14
14
  enforce_permission_to :create, :proposal
15
- @step = :step_1
15
+ @step = Proposals::ProposalsController::STEP1
16
16
  if proposal_draft.present?
17
17
  redirect_to edit_draft_proposal_path(proposal_draft, component_id: proposal_draft.component.id, question_slug: proposal_draft.component.participatory_space.slug)
18
18
  else
@@ -22,7 +22,7 @@ module Decidim
22
22
 
23
23
  def create
24
24
  enforce_permission_to :create, :proposal
25
- @step = :step_1
25
+ @step = Proposals::ProposalsController::STEP1
26
26
  @form = form(new_proposal_form).from_params(proposal_creation_params)
27
27
 
28
28
  create_proposal_command.call(@form, current_user) do
@@ -42,7 +42,7 @@ module Decidim
42
42
  # change comparison class if geocoding comparison is enabled
43
43
  def compare
44
44
  enforce_permission_to :edit, :proposal, proposal: @proposal
45
- @step = :step_2
45
+ @step = Proposals::ProposalsController::STEP2
46
46
  klass = if geocoding_comparison?
47
47
  Decidim::ReportingProposals::NearbyProposals
48
48
  else
@@ -61,7 +61,7 @@ module Decidim
61
61
  # disable this step for reporting proposals
62
62
  def complete
63
63
  enforce_permission_to :edit, :proposal, proposal: @proposal
64
- @step = :step_3
64
+ @step = Proposals::ProposalsController::STEP3
65
65
 
66
66
  @form = form_proposal_model
67
67
 
@@ -71,7 +71,7 @@ module Decidim
71
71
  end
72
72
 
73
73
  def edit_draft
74
- @step = reporting_proposal? ? :step_1 : :step_3
74
+ @step = reporting_proposal? ? Proposals::ProposalsController::STEP1 : Proposals::ProposalsController::STEP3
75
75
  enforce_permission_to :edit, :proposal, proposal: @proposal
76
76
  end
77
77
 
@@ -123,15 +123,13 @@ module Decidim
123
123
  private
124
124
 
125
125
  def populate_template_interpolations(proposal)
126
- template.description.map do |row|
127
- language = row.first
128
- value = row.last
126
+ template.description do |language, value|
129
127
  value.gsub!("%{organization}", proposal.organization.name)
130
128
  value.gsub!("%{name}", proposal.creator_author.name)
131
129
  value.gsub!("%{admin}", current_user.name)
132
130
 
133
131
  [language, value]
134
- end.to_h
132
+ end
135
133
  end
136
134
 
137
135
  def proposal
@@ -156,7 +154,7 @@ module Decidim
156
154
  @avaliablity_options["components-#{component.id}"] = formated_name(component)
157
155
  end
158
156
  global_scope = { "organizations-#{current_organization.id}" => t("global_scope", scope: "decidim.templates.admin.proposal_answer_templates.index") }
159
- @avaliablity_options = global_scope.merge(Hash[@avaliablity_options.sort_by { |_, val| val }])
157
+ @avaliablity_options = global_scope.merge(@avaliablity_options.sort_by { |_, val| val }.to_h)
160
158
  end
161
159
 
162
160
  def formated_name(component)
@@ -10,21 +10,22 @@ module Decidim
10
10
  delegate :asset_pack_path, to: :@template
11
11
 
12
12
  included do
13
- def file_field(object_name, method, options = {})
14
- return super(object_name, method, options) unless use_camera_button?(object_name)
13
+ def file_field(object_name, options = {})
14
+ return super(object_name, options) unless use_camera_button?(object_name)
15
15
 
16
- unless @template.snippets.any?(:reporting_proposals_camera_addons)
17
- @template.snippets.add(:reporting_proposals_camera_addons, @template.javascript_pack_tag("decidim_reporting_proposals_camera"))
18
- @template.snippets.add(:reporting_proposals_camera_addons, @template.stylesheet_pack_tag("decidim_reporting_proposals_camera"))
16
+ unless @template.snippets.any?(:reporting_proposals_camera_scripts) || @template.snippets.any?(:reporting_proposals_camera_styles)
17
+ @template.snippets.add(:reporting_proposals_camera_scripts, @template.javascript_pack_tag("decidim_reporting_proposals_camera"))
18
+ @template.snippets.add(:reporting_proposals_camera_styles, @template.stylesheet_pack_tag("decidim_reporting_proposals_camera"))
19
19
 
20
20
  # This will display the snippets in the <head> part of the page.
21
- @template.snippets.add(:head, @template.snippets.for(:reporting_proposals_camera_addons))
21
+ @template.snippets.add(:head, @template.snippets.for(:reporting_proposals_camera_styles))
22
+ @template.snippets.add(:foot, @template.snippets.for(:reporting_proposals_camera_scripts))
22
23
  end
23
24
 
24
25
  content_tag(:div, class: "input-group") do
25
- super(object_name, method, options) +
26
+ super(object_name, options) +
26
27
  content_tag(:div, class: "input-group-button") do
27
- content_tag(:button, class: "button secondary user-device-camera", type: "button", data: { input: "#{object_name}_#{method}" }) do
28
+ content_tag(:button, class: "button secondary user-device-camera", type: "button", data: { input: object_name }) do
28
29
  icon("camera-slr", role: "img", "aria-hidden": true) + " #{I18n.t("use_my_camera", scope: "decidim.reporting_proposals.forms")}"
29
30
  end
30
31
  end
@@ -15,12 +15,14 @@ module Decidim
15
15
  def geocoding_field(object_name, method, options = {})
16
16
  return original_geocoding_field(object_name, method, options) unless show_my_location_button?
17
17
 
18
- unless template.snippets.any?(:reporting_proposals_geocoding_addons)
19
- template.snippets.add(:reporting_proposals_geocoding_addons, template.javascript_pack_tag("decidim_reporting_proposals_geocoding"))
20
- template.snippets.add(:reporting_proposals_geocoding_addons, template.stylesheet_pack_tag("decidim_reporting_proposals_geocoding"))
18
+ unless template.snippets.any?(:reporting_proposals_geocoding_scripts) || template.snippets.any?(:reporting_proposals_geocoding_styles)
19
+ template.snippets.add(:reporting_proposals_geocoding_scripts, template.javascript_pack_tag("decidim_reporting_proposals_geocoding"))
20
+ template.snippets.add(:reporting_proposals_geocoding_styles, template.stylesheet_pack_tag("decidim_reporting_proposals_geocoding"))
21
21
 
22
22
  # This will display the snippets in the <head> part of the page.
23
- template.snippets.add(:head, template.snippets.for(:reporting_proposals_geocoding_addons))
23
+ template.snippets.add(:head, template.snippets.for(:reporting_proposals_geocoding_styles))
24
+ # This will display the snippets in the bottom part of the page.
25
+ template.snippets.add(:foot, template.snippets.for(:reporting_proposals_geocoding_scripts))
24
26
  end
25
27
 
26
28
  options[:autocomplete] ||= "off"
@@ -9,11 +9,11 @@ module Decidim
9
9
  included do
10
10
  def proposal_wizard_stepper(current_step)
11
11
  steps = %(
12
- #{proposal_wizard_stepper_step(:step_1, current_step)}
13
- #{proposal_wizard_stepper_step(:step_2, current_step)}
12
+ #{proposal_wizard_stepper_step(Proposals::ProposalsController::STEP1, current_step)}
13
+ #{proposal_wizard_stepper_step(Proposals::ProposalsController::STEP2, current_step)}
14
14
  )
15
- steps = %(#{steps} #{proposal_wizard_stepper_step(:step_3, current_step)}) unless reporting_proposals_component?
16
- steps = %(#{steps} #{proposal_wizard_stepper_step(:step_4, current_step)})
15
+ steps = %(#{steps} #{proposal_wizard_stepper_step(Proposals::ProposalsController::STEP3, current_step)}) unless reporting_proposals_component?
16
+ steps = %(#{steps} #{proposal_wizard_stepper_step(Proposals::ProposalsController::STEP4, current_step)})
17
17
 
18
18
  content_tag :ol, class: "wizard__steps" do
19
19
  steps.html_safe
@@ -2,4 +2,4 @@
2
2
 
3
3
  <% if defined?(Decidim::Templates) %>
4
4
  <%= render "decidim/templates/admin/proposal_answer_templates/template_chooser", form: f %>
5
- <% end %>
5
+ <% end %>
@@ -4,6 +4,6 @@
4
4
  <% if count.zero? %>
5
5
  0
6
6
  <% else %>
7
- <%= proposal.valuation_assignments.first&.valuator_role&.user&.name %>
8
- <%= "(+#{(count - 1)})" if count > 1 %>
9
- <% end %>
7
+ <%= proposal.valuation_assignments.first&.valuator_role&.user&.name %>
8
+ <%= "(+#{(count - 1)})" if count > 1 %>
9
+ <% end %>
@@ -1,3 +1,3 @@
1
1
  <!-- insert_after "erb[loud]:contains('current_or_new_conversation_path_with(presented_author)')" -->
2
2
 
3
- <%= render partial: "decidim/proposals/admin/proposals/send_email_button", locals: { presented_author: presented_author }%>
3
+ <%= render partial: "decidim/proposals/admin/proposals/send_email_button", locals: { presented_author: presented_author } %>
@@ -15,5 +15,5 @@
15
15
  id: "js-submit-assign-proposal-to-valuator",
16
16
  class: "button small button--simple float-left") %>
17
17
  <% end %>
18
- </div>
18
+ </div>
19
19
  <% end %>
@@ -1,4 +1,3 @@
1
1
  <!-- replace "erb[silent]:contains('if proposal.photos.any?')" -->
2
2
 
3
3
  <% if nil %>
4
-
@@ -0,0 +1,37 @@
1
+ <!-- replace '.gallery__container.photos_container' -->
2
+
3
+ <% if Decidim::ReportingProposals.use_camera_button.include?(current_component.manifest_name.to_sym) %>
4
+ <fieldset class="gallery__container photos_container">
5
+ <% if @form.photos.any? %>
6
+ <% @form.photos.each do |photo| %>
7
+ <div class="callout gallery__item" id="attachment_<%= photo.id %>" data-closable>
8
+ <%= image_tag photo.thumbnail_url, class: "thumbnail", alt: photo.file.filename %>
9
+ <%= form.hidden_field :photos, multiple: true, value: photo.id, id: "photo-#{photo.id}" %>
10
+ <button class="close-button"
11
+ aria-label="<%= t("delete_image", scope: "decidim.reporting_proposals.proposals.edit") %>"
12
+ title="<%= t("delete_image", scope: "decidim.reporting_proposals.proposals.edit") %>"
13
+ type="button"
14
+ data-close>
15
+ <span aria-hidden="true">&times;</span>
16
+ </button>
17
+ </div>
18
+ <% end %>
19
+ <% end %>
20
+ <div class="field row column">
21
+ <%= form.file_field :add_photos, multiple: false, label: t("image", scope: "decidim.reporting_proposals.proposals.form") %>
22
+ </div>
23
+ </fieldset>
24
+ <% else %>
25
+ <fieldset class="gallery__container photos_container">
26
+ <legend><%= t("gallery_legend", scope: "decidim.proposals.proposals.edit") %></legend>
27
+ <div class="row column">
28
+ <%= form.attachment :photos,
29
+ multiple: false,
30
+ label: t("decidim.proposals.proposals.edit.add_image"),
31
+ button_label: t("decidim.proposals.proposals.edit.add_image"),
32
+ button_edit_label: t("decidim.proposals.proposals.edit.edit_image"),
33
+ help_i18n_scope: "decidim.forms.file_help.image",
34
+ extension_allowlist: Decidim::OrganizationSettings.for(current_organization).upload_allowed_file_extensions_image %>
35
+ </div>
36
+ </fieldset>
37
+ <% end %>
@@ -1,5 +1,5 @@
1
1
  <!-- insert_before ".card__header" -->
2
2
 
3
3
  <% if geocoding_comparison? %>
4
- <span class="label secondary float-right"><%= icon("location") %> <%= t("away", scope: "decidim.reporting_proposals.proposals.compare.geocoding", meters: distance(1000 * @proposal.distance_from([proposal.latitude, proposal.longitude], :km))) %></span>
4
+ <span class="label secondary float-right"><%= icon("location") %> <%= t("away", scope: "decidim.reporting_proposals.proposals.compare.geocoding", meters: distance(1000 * @proposal.distance_from([proposal.latitude, proposal.longitude], :km))) %></span>
5
5
  <% end %>
@@ -1,14 +1,14 @@
1
1
  <!-- replace ".section-heading" -->
2
2
 
3
3
  <% if geocoding_comparison? && action_name == "compare" %>
4
- <h2 class="section-heading">
5
- <%= t("title", scope: "decidim.reporting_proposals.proposals.compare.geocoding") %>
6
- <%= "(#{@similar_proposals.count})" if @similar_proposals.present? %>
7
- </h2>
8
- <p><%= t("description", scope: "decidim.reporting_proposals.proposals.compare.geocoding", meters: distance) %></p>
4
+ <h2 class="section-heading">
5
+ <%= t("title", scope: "decidim.reporting_proposals.proposals.compare.geocoding") %>
6
+ <%= "(#{@similar_proposals.count})" if @similar_proposals.present? %>
7
+ </h2>
8
+ <p><%= t("description", scope: "decidim.reporting_proposals.proposals.compare.geocoding", meters: distance) %></p>
9
9
  <% else %>
10
- <h2 class="section-heading">
11
- <%= proposal_wizard_step_title action_name %>
12
- <%= "(#{@similar_proposals.count})" if @similar_proposals.present? %>
13
- </h2>
10
+ <h2 class="section-heading">
11
+ <%= proposal_wizard_step_title action_name %>
12
+ <%= "(#{@similar_proposals.count})" if @similar_proposals.present? %>
13
+ </h2>
14
14
  <% end %>
@@ -0,0 +1,5 @@
1
+ <!-- insert_before "erb[silent]:contains(':js_content')" -->
2
+
3
+ <% if reporting_proposal? %>
4
+ <%= stylesheet_pack_tag "decidim_reporting_proposals" %>
5
+ <% end %>
@@ -2,7 +2,6 @@
2
2
 
3
3
  <% if reporting_proposal? %>
4
4
  <%= javascript_pack_tag "decidim_reporting_proposals" %>
5
- <%= stylesheet_pack_tag "decidim_reporting_proposals" %>
6
5
  <% else %>
7
6
  <%= javascript_pack_tag "decidim_proposals" %>
8
7
  <% end %>
@@ -0,0 +1,5 @@
1
+ <!-- insert_before "erb[silent]:contains(':js_content')" -->
2
+
3
+ <% if reporting_proposal? %>
4
+ <%= stylesheet_pack_tag "decidim_reporting_proposals" %>
5
+ <% end %>
@@ -0,0 +1,5 @@
1
+ <!-- insert_before "erb[silent]:contains(':js_content')" -->
2
+
3
+ <% if reporting_proposal? %>
4
+ <%= stylesheet_pack_tag "decidim_reporting_proposals" %>
5
+ <% end %>
@@ -2,7 +2,6 @@
2
2
 
3
3
  <% if reporting_proposal? %>
4
4
  <%= javascript_pack_tag "decidim_reporting_proposals" %>
5
- <%= stylesheet_pack_tag "decidim_reporting_proposals" %>
6
5
  <% else %>
7
6
  <%= javascript_pack_tag "decidim_proposals" %>
8
7
  <% end %>
@@ -2,4 +2,4 @@
2
2
 
3
3
  <% if resource_admin_url.present? %>
4
4
  <p><%= link_to t("admin_resource", scope: "decidim.reported_mailer.report"), resource_admin_url, target: "_blank" %></p>
5
- <% end %>
5
+ <% end %>
@@ -1,3 +1,3 @@
1
1
  <!-- replace "erb[loud]:contains('button small button--sc show-for-medium')" -->
2
2
 
3
- <%= link_to(cta_text, step_cta_url(participatory_process), class: "button small button--sc") %>
3
+ <%= link_to(cta_text, step_cta_url(participatory_process), class: "button small button--sc") %>
@@ -1,20 +1,20 @@
1
- .input-group.has-tribute {
1
+ .input-group.has-tribute{
2
2
  position: relative;
3
3
 
4
- .tribute-container {
4
+ .tribute-container{
5
5
  margin-top: 2.3rem;
6
6
  }
7
7
  }
8
8
 
9
- .user-device-location {
10
- button {
9
+ .user-device-location{
10
+ button{
11
11
  max-height: 3rem;
12
12
 
13
- &.loading-spinner {
13
+ &.loading-spinner{
14
14
  position: relative;
15
15
  margin: 0 !important;
16
16
 
17
- &::before {
17
+ &::before{
18
18
  position: absolute;
19
19
  top: 6px;
20
20
  left: 12px;
@@ -22,12 +22,12 @@
22
22
  }
23
23
  }
24
24
 
25
- @media only screen and (max-width: 596px) {
25
+ @media only screen and (max-width: 596px){
26
26
  display: block !important;
27
27
  margin-top: 1rem;
28
28
  margin-bottom: -.5rem;
29
29
 
30
- button {
30
+ button{
31
31
  border-radius: 4px !important;
32
32
  }
33
33
  }
@@ -1,26 +1,26 @@
1
- .table__title-block {
1
+ .table__title-block{
2
2
  display: flex;
3
3
  align-items: flex-start;
4
4
  }
5
5
 
6
- .table__title-icon {
6
+ .table__title-icon{
7
7
  width: 20px;
8
8
  padding: 3px;
9
9
  margin-right: 5px;
10
10
  float: left;
11
11
  }
12
12
 
13
- .table__list-title {
13
+ .table__list-title{
14
14
  display: flex;
15
15
  flex-direction: column;
16
16
  align-items: start;
17
17
  }
18
18
 
19
- .table__list-title a {
19
+ .table__list-title a{
20
20
  text-align: start;
21
21
  }
22
22
 
23
- .help-text-overdue {
23
+ .help-text-overdue{
24
24
  font-style: italic;
25
25
  font-size: .8125rem;
26
26
  text-align: start;
@@ -1,11 +1,11 @@
1
1
  .global-settings,
2
- .step-settings {
3
- .readonly_container {
2
+ .step-settings{
3
+ .readonly_container{
4
4
  display: none;
5
5
  }
6
6
  }
7
7
 
8
- .proposal-photo.gallery__item {
8
+ .proposal-photo.gallery__item{
9
9
  position: relative;
10
10
  margin: 0 0 1rem;
11
11
  border: 1px solid rgba(0, 0, 0, .2);
@@ -14,11 +14,11 @@
14
14
  color: #202734;
15
15
  }
16
16
 
17
- .proposal-photo .thumbnail {
17
+ .proposal-photo .thumbnail{
18
18
  margin-bottom: 0;
19
19
  }
20
20
 
21
- .delete-proposal__button {
21
+ .delete-proposal__button{
22
22
  position: absolute;
23
23
  right: 0;
24
24
  top: 7px;
@@ -33,28 +33,28 @@
33
33
  //Variables
34
34
 
35
35
  /* Card address */
36
- .address {
36
+ .address{
37
37
  display: flex;
38
38
  padding: 1rem;
39
39
  }
40
40
 
41
- .address--alone {
41
+ .address--alone{
42
42
  flex-grow: 1;
43
43
  }
44
44
 
45
- .address__info {
45
+ .address__info{
46
46
  display: flex;
47
47
  flex-grow: 1;
48
48
  }
49
49
 
50
- .address__icon {
50
+ .address__icon{
51
51
  float: left;
52
52
  display: flex;
53
53
  align-self: center;
54
54
  fill: var(--primary);
55
55
  }
56
56
 
57
- .address__details {
57
+ .address__details{
58
58
  float: left;
59
59
  max-width: 100%; //IE10 bug fix
60
60
  padding-left: .5em;
@@ -1,9 +1,9 @@
1
- .has_no_address {
1
+ .has_no_address{
2
2
  text-align: right;
3
3
  }
4
4
 
5
- .editor {
6
- .form-error {
5
+ .editor{
6
+ .form-error{
7
7
  margin: -1rem 0 1rem;
8
8
  font-size: .75rem;
9
9
  font-weight: 600;
@@ -1,19 +1,19 @@
1
- button.user-device-camera {
1
+ button.user-device-camera{
2
2
  border-radius: 4px !important;
3
3
  max-height: 3rem;
4
4
  }
5
5
 
6
- .has_no_image {
6
+ .has_no_image{
7
7
  margin-top: -1rem;
8
8
  text-align: right;
9
9
  }
10
10
 
11
- @media only screen and (max-width: 596px) {
12
- .gallery__container .input-group .input-group-button {
11
+ @media only screen and (max-width: 596px){
12
+ .gallery__container .input-group .input-group-button{
13
13
  display: block;
14
14
  }
15
15
 
16
- .has_no_image {
16
+ .has_no_image{
17
17
  margin-top: -.5rem;
18
18
  }
19
19
  }
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  module ReportingProposals
5
5
  # Class used to retrieve similar proposals.
6
- class NearbyProposals < Rectify::Query
6
+ class NearbyProposals < Decidim::Query
7
7
  # Syntactic sugar to initialize the class and return the queried objects.
8
8
  #
9
9
  # components - Decidim::CurrentComponent
@@ -11,13 +11,13 @@ module Decidim
11
11
  # over all the validators.
12
12
  def validate_each(record, attribute, component)
13
13
  unless component
14
- record.errors[attribute] << :blank
14
+ record.errors.add(attribute, :blank)
15
15
  return
16
16
  end
17
17
  manifests = [options[:manifest].to_s]
18
18
  manifests << "reporting_proposals" if manifests.first == "proposals"
19
19
 
20
- record.errors[attribute] << :invalid unless component.manifest_name.to_s.in?(manifests)
20
+ record.errors.add(attribute, :invalid) unless component.manifest_name.to_s.in?(manifests)
21
21
  end
22
22
  end
23
23
  end