% require_dependency 'static_maps_url_helper' %>
<%= content_for(:title) do %><%= @visualization.name %><% end %>
<%= content_for(:description) do %><%= @visualization.description.present? ? "#{markdown_html_clean(@visualization.description)} — Map created by #{@name} in CARTO" : "Map created by #{@name} in CARTO" %><% end %>
<%= content_for(:twitter_card) do %><%= Carto::StaticMapsURLHelper.new.url_for_static_map(request, @visualization, 560, 300) %><% end %>
<%= content_for(:facebook_card) do %><%= Carto::StaticMapsURLHelper.new.url_for_static_map(request, @visualization, 1200, 630) %><% end %>
<%= content_for(:body_class) do %> PublicMap <% end %>
<%= content_for(:css) do %>
<%= editor_stylesheet_link_tag 'cartodb', 'common', 'public_map' %>
<% end %>
<%= content_for(:content) do %>
<% if @visualization.is_accesible_by_user?(current_user) %>
<%= render 'admin/shared/public_header' %>
<%# Datasets %>
<%# DISQUS %>
<% if @visualization.user.disqus_shortname.present? %>
<% end %>
<%# Related %>
<% if @more_visualizations && @more_visualizations.count > 0 %>
<% @more_visualizations.each do |vis| %>
-
<% end %>
<%# at most 3 cards per line, visbility is handled by CSS depending on viewport size %>
<% ((3 - @more_visualizations.count + 3) % 3).times.each do %>
-
<% end %>
<% end %>
<% if cartodb_com_hosted? %>
<%= render 'admin/shared/footer', :light => true %>
<% else %>
<%= render 'admin/shared/public_footer', :light => false %>
<% end %>
<% end %>
<% end %>
<%= content_for(:js) do %>
<%= insert_trackjs('embeds', Cartodb.get_config(:trackjs, 'frequency')) %>
<% if @visualization.map.provider == 'googlemaps' %>
<%= insert_google_maps(@visualization.user.google_maps_query_string) %>
<% end %>
<%= editor_javascript_include_tag 'cdb.js', 'templates.js', 'public_map_deps', 'public_map' %>
<% end %>