Skip to content

Commit

Permalink
fix: Remove caching from the geocoding elements to avoid map not relo…
Browse files Browse the repository at this point in the history
…ading when refreshing (#638)
  • Loading branch information
AyakorK authored Nov 27, 2024
1 parent 1fe41e8 commit e2fc405
Showing 1 changed file with 18 additions and 20 deletions.
38 changes: 18 additions & 20 deletions app/views/decidim/proposals/proposals/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,30 +1,28 @@
<%= render partial: "decidim/shared/component_announcement" %>

<% if component_settings.geocoding_enabled? %>
<% cache @all_geocoded_proposals do %>
<%= dynamic_map_for proposals_data_for_map(@all_geocoded_proposals) do %>
<template id="marker-popup">
<div class="map-info__content">
<h3>${title}</h3>
<div id="bodyContent">
<p>{{html body}}</p>
<div class="map__date-address">
<div class="address card__extra">
<div class="address__icon">{{html icon}}</div>
<div class="address__details">
<span>${address}</span><br>
</div>
<%= dynamic_map_for proposals_data_for_map(@all_geocoded_proposals) do %>
<template id="marker-popup">
<div class="map-info__content">
<h3>${title}</h3>
<div id="bodyContent">
<p>{{html body}}</p>
<div class="map__date-address">
<div class="address card__extra">
<div class="address__icon">{{html icon}}</div>
<div class="address__details">
<span>${address}</span><br>
</div>
</div>
<div class="map-info__button">
<a href="${link}" class="button button--sc">
<%= t(".view_proposal") %>
</a>
</div>
</div>
<div class="map-info__button">
<a href="${link}" class="button button--sc">
<%= t(".view_proposal") %>
</a>
</div>
</div>
</template>
<% end %>
</div>
</template>
<% end %>
<% end %>
<%= render partial: "voting_rules" %>
Expand Down

0 comments on commit e2fc405

Please sign in to comment.