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

Fix and dry

parent c38dfc78
No related branches found
No related tags found
No related merge requests found
......@@ -24,52 +24,37 @@
<% if @block.template.layout == "grid" %>
<div class="organizations grid">
<% @block.template.elements.each do |element| %>
<article class="organization">
<h3>
<% if element.best_url %>
<a href="<%= element.best_url %>" target="_blank">
<% end %>
<%= element.best_name %>
<% if element.best_url%>
</a>
<% end %>
</h3>
<div class="media">
<%= kamifusen_tag element.best_logo, width: 600%>
</div>
</article>
<% end %>
</div>
<% 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 %>">
<h3>
<% if element.best_url %>
<a href="<%= element.best_url %>" target="_blank">
<% end %>
<%= element.best_name %>
<% if element.best_url%>
</a>
<% end %>
</h3>
<% if element.best_logo.attached? %>
<div class="media">
<%= kamifusen_tag element.best_logo, width: 600 %>
</div>
<% end %>
</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>
<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 %>
<% @block.template.elements.each do |element| %>
<article class="organization"
data-latitude="<%= element.organization&.latitude %>"
data-longitude="<%= element.organization&.longitude %>">
<h3>
<% if element.best_url %>
<a href="<%= element.best_url %>" target="_blank">
<% end %>
<%= element.best_name %>
<% if element.best_url%>
</a>
<% end %>
</h3>
<% if element.best_logo %>
<div class="media">
<%= kamifusen_tag element.best_logo, width: 600%>
</div>
<% end %>
</article>
<% end %>
</div>
</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