Skip to content
Snippets Groups Projects
Commit b4fdef75 authored by Arnaud Levy's avatar Arnaud Levy
Browse files

Clean ugly refacto (non working, leaflet always true)

parent 9c624a74
No related branches found
No related tags found
No related merge requests found
<% is_leaflet_needed = true; %>
<% about.blocks.published.ordered.each do |block| %>
<% @block = block %>
<%= render "admin/communication/blocks/templates/#{@block.template_kind}/preview" %>
<% if block.template_kind == "partners" && block.data[:layout] == "map" %>
<% is_leaflet_needed = true; %>
<% end %>
<% end %>
<% if is_leaflet_needed %>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.3/dist/leaflet.css"
integrity="sha256-kLaT2GOSpHechhsozzB+flnD+zUyjE2LlfWPgU04xyI="
crossorigin=""/>
<script src="https://unpkg.com/leaflet@1.9.3/dist/leaflet.js"
integrity="sha256-WBkoXOwTeyKclOHuWtc+i2uENFpDZ9YPdf5Hf+D7ewM="
crossorigin=""></script>
<% end %>
......@@ -41,7 +41,7 @@
</article>
<% end %>
</div>
<% else %>
<% else # Map %>
<div class="map" data-marker-icon="<%= image_path 'map-marker.svg' %>">
<% @block.template.elements.each do |element| %>
<article class="organization" data-latitude="<%= element.organization.latitude %>" data-longitude="<%= element.organization.longitude %>">
......@@ -55,13 +55,19 @@
<% end %>
</h3>
<div class="media">
<%= kamifusen_tag element.best_logo, width: 600%>
<%= kamifusen_tag element.best_logo, width: 600 %>
</div>
</article>
<% end %>
</div>
<link rel="stylesheet"
href="https://unpkg.com/leaflet@1.9.3/dist/leaflet.css"
integrity="sha256-kLaT2GOSpHechhsozzB+flnD+zUyjE2LlfWPgU04xyI="
crossorigin=""/>
<script src="https://unpkg.com/leaflet@1.9.3/dist/leaflet.js"
integrity="sha256-WBkoXOwTeyKclOHuWtc+i2uENFpDZ9YPdf5Hf+D7ewM="
crossorigin=""></script>
<% end %>
</div>
</div>
</section>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment