metamaps--metamaps/app/views/maps/show.html.erb
Devin Howard 7c9b6a2205 try to move all rails data into Metamaps.ServerData
Metamaps.Erb and currentPage and currentSection are still not in; should they be?
2016-11-07 14:55:20 -05:00

23 lines
916 B
Plaintext

<%#
# @file
# Code to display a map
# /maps/:id
#%>
<% content_for :title, @map.name + " | Metamaps" %>
<% content_for :mobile_title, @map.name %>
<script>
Metamaps.currentSection = "map";
Metamaps.currentPage = <%= @map.id.to_s %>;
Metamaps.ServerData = Metamaps.ServerData || {}
Metamaps.ServerData.ActiveMap = <%= @map.to_json.html_safe %>;
Metamaps.ServerData.Mappers = <%= @allmappers.to_json.html_safe %>;
Metamaps.ServerData.Collaborators = <%= @allcollaborators.to_json.html_safe %>;
Metamaps.ServerData.Topics = <%= @alltopics.to_json(user: current_user).html_safe %>;
Metamaps.ServerData.Synapses = <%= @allsynapses.to_json.html_safe %>;
Metamaps.ServerData.Mappings = <%= @allmappings.to_json.html_safe %>;
Metamaps.Messages = <%= @allmessages.to_json.html_safe %>;
Metamaps.Stars = <%= @allstars.to_json.html_safe %>;
Metamaps.ServerData.VisualizeType = "ForceDirected";
</script>