diff --git a/app/components/budgets/investments/form_component.html.erb b/app/components/budgets/investments/form_component.html.erb index e065b95cf..20b15c201 100644 --- a/app/components/budgets/investments/form_component.html.erb +++ b/app/components/budgets/investments/form_component.html.erb @@ -55,7 +55,6 @@ map_location: investment.map_location || MapLocation.new, label: t("budgets.investments.form.map_location"), help: t("budgets.investments.form.map_location_instructions"), - remove_marker_label: t("budgets.investments.form.map_remove_marker"), i18n_namespace: "budgets.investments" %> <% end %> diff --git a/app/components/proposals/form_component.html.erb b/app/components/proposals/form_component.html.erb index ace70b75f..88d7a2cf7 100644 --- a/app/components/proposals/form_component.html.erb +++ b/app/components/proposals/form_component.html.erb @@ -61,7 +61,6 @@ map_location: proposal.map_location || MapLocation.new, label: t("proposals.form.map_location"), help: t("proposals.form.map_location_instructions"), - remove_marker_label: t("proposals.form.map_remove_marker"), i18n_namespace: "proposals" %> <% end %> diff --git a/app/components/shared/map_location_component.rb b/app/components/shared/map_location_component.rb index aafdcfd01..334375d08 100644 --- a/app/components/shared/map_location_component.rb +++ b/app/components/shared/map_location_component.rb @@ -1,9 +1,8 @@ class Shared::MapLocationComponent < ApplicationComponent - attr_reader :remove_marker_label, :investments_coordinates, :form + attr_reader :investments_coordinates, :form - def initialize(map_location, remove_marker_label: nil, investments_coordinates: nil, form: nil) + def initialize(map_location, investments_coordinates: nil, form: nil) @map_location = map_location - @remove_marker_label = remove_marker_label @investments_coordinates = investments_coordinates @form = form end @@ -30,6 +29,10 @@ class Shared::MapLocationComponent < ApplicationComponent map_location.zoom.presence || Setting["map.zoom"] end + def remove_marker_label + t("proposals.form.map_remove_marker") + end + def remove_marker_link_id "remove-marker-link-#{dom_id(map_location)}" end diff --git a/app/views/map_locations/_form_fields.html.erb b/app/views/map_locations/_form_fields.html.erb index 072fc82ff..403368b1b 100644 --- a/app/views/map_locations/_form_fields.html.erb +++ b/app/views/map_locations/_form_fields.html.erb @@ -2,7 +2,7 @@

<%= help %>

<%= form.fields_for :map_location, map_location do |m_l_fields| %> - <%= render_map(map_location, remove_marker_label: remove_marker_label, form: m_l_fields) %> + <%= render_map(map_location, form: m_l_fields) %> <%= m_l_fields.hidden_field :latitude %> <%= m_l_fields.hidden_field :longitude %> diff --git a/config/locales/en/budgets.yml b/config/locales/en/budgets.yml index ab3b055d0..63c47bf4a 100644 --- a/config/locales/en/budgets.yml +++ b/config/locales/en/budgets.yml @@ -82,7 +82,6 @@ en: tags_placeholder: "Enter the tags you would like to use, separated by commas (',')" map_location: "Map location" map_location_instructions: "Navigate the map to the location and place the marker." - map_remove_marker: "Remove map marker" index: title: Participatory budgeting unfeasible: Unfeasible investment projects diff --git a/config/locales/es/budgets.yml b/config/locales/es/budgets.yml index 7991b9dd2..53c5a4b35 100644 --- a/config/locales/es/budgets.yml +++ b/config/locales/es/budgets.yml @@ -82,7 +82,6 @@ es: tags_placeholder: "Escribe las etiquetas que desees separadas por coma (',')" map_location: "Ubicación en el mapa" map_location_instructions: "Navega por el mapa hasta la ubicación y coloca el marcador." - map_remove_marker: "Eliminar el marcador" index: title: Presupuestos participativos unfeasible: Proyectos de gasto no viables