metamaps--metamaps/app/views/main/console.html.erb

63 lines
1.3 KiB
Text

<% if @map %>
<div class="focus">
<div class="focusleft">
<p># of Topics: <%= @map.items.count %></p>
<p># of Synapses: <%= @map.synapses.count %></p>
</div>
<div class="focusmiddle">
<h1 class="title"><%= @map.name %></h1>
<div class="desc">
<p><%= @map.desc %></p>
</div>
</div>
<div class="focusright">
<div class="link"><p>Permissions:<%= @map.permission %></p></div>
</div>
</div>
<div class="clearfloat nodemargin"></div>
<div class="maps" id="container">
<div id="center-container">
<div id="infovis"></div>
</div>
</div>
<div class="clearfloat"></div>
<script>
json = <%= @mapjson %>;
if (json.length > 0) {
$(document).ready(function() {
<% if (@map.arranged) %>
initialize("arranged");
<% else %>
initialize("chaotic");
<% end %>
});
}
</script>
<% elsif @items %>
<div class="maps" id="container">
<div id="center-container">
<div id="infovis"></div>
</div>
</div>
<div class="clearfloat"></div>
<% if authenticated? %>
<%= render :partial => 'items/new' %>
<%= render :partial => 'synapses/new' %>
<% end %>
<script>
json = <%= @items %>;
if (json.length > 0) {
$(document).ready(function() {
initialize("chaotic");
});
}
</script>
<% else %>
<h1><br>Shucks, there are no maps.<h1>
<% end %>