2014-02-04 01:43:31 +00:00
<%#
# Partial rendering form for a new topic on a map
# This code is called when viewing a metamap in show.html.erb in the views/maps folder
#%>
2014-08-27 02:51:50 +00:00
<div class="mapInfoBox mapElement mapElementHidden permission <%= @map && @map.user == user ? " yourMap" : "" %><%= @map && @map.authorize_to_edit(user) ? " canEdit" : "" %>">
2014-02-04 01:43:31 +00:00
2014-08-27 02:51:50 +00:00
<% if @map %>
2014-02-04 01:43:31 +00:00
<div class="mapInfoName"><%= best_in_place @map, :name, :type => :input, :classes => 'best_in_place_name' %></div>
<div class="mapInfoStat">
2014-02-05 03:03:24 +00:00
<div class="infoStatIcon mapContributors hoverForTip">
2014-02-04 01:43:31 +00:00
<%= @map.contributors.count %>
2014-02-05 03:03:24 +00:00
<% contributorList = ''
@map.contributors.each_with_index do |c, index|
comma = (index+1) == @map.contributors.count ? '' : ', '
contributorList += c.name + comma
2014-02-21 01:22:13 +00:00
end
if @map.contributors.count == 0
contributorList = 'No one has added anything yet.'
2014-02-05 03:03:24 +00:00
end %>
<div class="tip"><%= contributorList %></div>
2014-02-04 01:43:31 +00:00
</div>
<div class="infoStatIcon mapTopics">
<%= @map.topics.count %>
</div>
<div class="infoStatIcon mapSynapses">
<%= @map.synapses.count %>
</div>
2014-03-03 02:53:19 +00:00
<div class="infoStatIcon mapPermission <%= @map.permission %> hoverForTip">
<% if @map.user == user %>
<div class="tip">As the creator, you can change the permission of this map, but the permissions of the topics and synapses on it must be changed independently.</div>
<% end %>
</div>
2014-02-04 01:43:31 +00:00
<div class="clearfloat"></div>
</div>
<% if (authenticated? && @map.authorize_to_edit(user)) || (!authenticated? && @map.desc != "" && @map.desc != nil )%>
<div class="mapInfoDesc">
2014-06-04 19:24:16 +00:00
<%= best_in_place @map, :desc, :type => :textarea, :nil => "Click to add description.", :classes => 'best_in_place_desc' %>
2014-02-04 01:43:31 +00:00
</div>
<% end %>
<div class="mapInfoMeta">
2014-02-26 23:52:54 +00:00
<p>Created by <%= @map.user == user ? "you" : @map.user.name %> on <%= @map.created_at.strftime("%m/%d/%Y") %></p>
2014-02-26 20:23:29 +00:00
<p>Last edited <%= @map.updated_at.strftime("%m/%d/%Y") %></p>
2014-02-04 01:43:31 +00:00
</div>
<div class="mapInfoDelete">
<% if @map.user == user %>
2014-08-15 22:04:22 +00:00
<%= link_to 'Delete', map_path(@map), :class => 'delete', :confirm => 'Delete this map (nodes and synapses will remain)?', :method => :delete,
:data => { :bypass => 'true'} %>
2014-02-04 01:43:31 +00:00
<% end %>
</div>
2014-08-27 02:51:50 +00:00
<% end %>
</div>