Skip to content

Commit

Permalink
Merge pull request #1999 from AyuntamientoMadrid/map-image
Browse files Browse the repository at this point in the history
Always use map image from admin site customization images
  • Loading branch information
decabeza authored May 9, 2019
2 parents 17c1e93 + 350b51b commit dfc4f25
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/views/budgets/groups/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
</div>

<div class="medium-5 column show-for-medium text-center">
<%= image_tag "map.jpg" %>
<%= image_tag(image_path_for("map.jpg")) %>
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion app/views/legislation/proposals/_geozones.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
<h2 class="sidebar-title"><%= t("shared.tags_cloud.districts") %></h2>
<br>
<%= link_to map_proposals_path, id: "map", title: t("shared.tags_cloud.districts_list") do %>
<%= image_tag("map.jpg", alt: t("shared.tags_cloud.districts_list")) %>
<%= image_tag(image_path_for("map.jpg", alt: t("shared.tags_cloud.districts_list")) %>
<% end %>
2 changes: 1 addition & 1 deletion app/views/shared/_map.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</div>

<div class="show-for-medium medium-9 column text-center">
<%= image_tag("map.jpg", usemap: "#html_map", alt: "Mapa de distritos de Madrid") %>
<%= image_tag(image_path_for("map.jpg"), usemap: "#html_map", alt: t("map.alt")) %>
</div>

<map name="html_map" id="html_map">
Expand Down
2 changes: 2 additions & 0 deletions config/locales/custom/en/custom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -348,3 +348,5 @@ en:
meta:
title: Change your city with Decide Madrid
description: Decide Madrid is a website where you can make decisions to make Madrid more yours, better. Make your proposals for the City Hall to carry them out.
map:
alt: "Map of Madrid districts"
2 changes: 2 additions & 0 deletions config/locales/custom/es/custom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -348,3 +348,5 @@ es:
meta:
title: Cambia tu ciudad con Decide Madrid
description: Decide Madrid es una web donde puedes tomar decisiones para hacer Madrid más tuyo, mejor. Presenta tus propuestas para que el Ayuntamiento las lleve a cabo.
map:
alt: "Mapa de distritos de Madrid"
16 changes: 15 additions & 1 deletion spec/features/admin/site_customization/images_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
expect(page).to have_css("img[src*='custom_map.jpg']", count: 1)
end

scenario "Image is replaced on front view" do
scenario "Image is replaced on front views" do
budget = create(:budget)
group = create(:budget_group, budget: budget)
visit admin_root_path

within("#side_menu") do
Expand All @@ -56,6 +58,18 @@
within("#map") do
expect(page).to have_css("img[src*='custom_map.jpg']")
end

visit map_proposals_path

within(".show-for-medium") do
expect(page).to have_css("img[src*='custom_map.jpg']")
end

visit budget_group_path(budget, group)

within(".show-for-medium") do
expect(page).to have_css("img[src*='custom_map.jpg']")
end
end

scenario "Upload invalid image" do
Expand Down

0 comments on commit dfc4f25

Please sign in to comment.