49 lines
2.4 KiB
Text
49 lines
2.4 KiB
Text
<%#
|
|
# @file
|
|
# Shows a map as a card.
|
|
# Any list of maps uses this rendering.
|
|
#%>
|
|
<%= div_for map do %>
|
|
<% if map.authorize_to_edit(user) %>
|
|
<div class="permission canEdit">
|
|
<% end %>
|
|
|
|
<% if map.user == user %><%= link_to 'Delete', map_path(map), :class => 'delete', :confirm => 'Delete this map (nodes and synapses will remain)?', :method => :delete, :remote => true %><% end %>
|
|
<p class="type">Map</p>
|
|
<%= image_tag 'map.png', :class => 'icon', :size => '50x50' %>
|
|
<div class="cardSettings">
|
|
<div class="mapPerm" title="<%= map.permission %>"><%= map.mk_permission %></div>
|
|
<% if map.user == user %>
|
|
<div class="permActivator">
|
|
<div class="editSettings">
|
|
<span>Permissions: </span>
|
|
<span title="Click to Edit"><%= best_in_place map, :permission, :type => :select, :collection => [['commons', 'commons'], ['public','public'], ['private','private']], :classes => 'best_in_place_permission' %></span>
|
|
<div class="clearfloat"></div>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
<span class="title">
|
|
<span><%= best_in_place map, :name, :type => :input, :classes => 'best_in_place_name' %></span>
|
|
<a href="/maps/<%=map.id %>" class="topic-go-arrow">
|
|
<img class="topic-go-arrow"
|
|
title="Go to map"
|
|
src="/assets/go-arrow.png" />
|
|
</a>
|
|
<div class="clearfloat"></div>
|
|
</span>
|
|
<div class="contributor">
|
|
Added by: <a href="/users/<%=map.user.id %>" target="_blank"><%=map.user.name %>
|
|
</a>
|
|
</div>
|
|
<div class="scroll">
|
|
<div class="desc">
|
|
<p class="mapdata"><%= map.topics.count %> topics and <%= map.synapses.count %> synapses</p>
|
|
<p><%= best_in_place map, :desc, :type => :textarea, :nil => "<span class='gray'>Click to add description.</span>", :classes => 'best_in_place_desc' %></p>
|
|
</div>
|
|
</div>
|
|
|
|
<% if map.authorize_to_edit(user) %>
|
|
</div>
|
|
<% end %>
|
|
<% end %>
|