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-10-15 03:20:40 +00:00
<div class="mapInfoBox mapElement mapElementHidden permission
<%= @map && @map.user == user ? " yourMap" : "" %>
<%= @map && @map.authorize_to_edit(user) ? " canEdit" : "" %>
<%= @map && @map.permission != 'private' ? " shareable" : "" %>">
2014-02-04 01:43:31 +00:00
2014-08-27 02:51:50 +00:00
<% if @map %>
2015-09-19 09:11:48 +00:00
<div class="mapInfoName" id="mapInfoName"><%= best_in_place @map, :name, :as => :textarea, :activator => "#mapInfoName", :class => 'best_in_place_name' %></div>
2014-02-04 01:43:31 +00:00
<div class="mapInfoStat">
2014-02-05 03:03:24 +00:00
<div class="infoStatIcon mapContributors hoverForTip">
2014-10-14 20:34:09 +00:00
<% if @map.contributors.count == 0 %>
2015-09-22 14:27:34 +00:00
<img id="mapContribs" width="25" height="25" src="<%= asset_path('user.png'); %>" />
2014-10-14 20:34:09 +00:00
<% elsif @map.contributors.count == 1 %>
2014-11-25 20:06:30 +00:00
<img id="mapContribs" width="25" height="25" src="<%= @map.contributors[0].image.url(:thirtytwo) %>" />
2014-10-14 20:34:09 +00:00
<% elsif @map.contributors.count == 2 %>
2014-11-25 20:06:30 +00:00
<img id="mapContribs" width="25" height="25" src="<%= @map.contributors[0].image.url(:thirtytwo) %>" class="multiple mTwo" />
2014-10-14 20:34:09 +00:00
<% elsif @map.contributors.count > 2 %>
2014-11-25 20:06:30 +00:00
<img id="mapContribs" width="25" height="25" src="<%= @map.contributors[0].image.url(:thirtytwo) %>" class="multiple" />
2014-10-14 20:34:09 +00:00
<% end %>
<span><%= @map.contributors.count %></span>
2014-11-20 03:42:14 +00:00
<div class="tip"> <ul><% @map.contributors.each_with_index do |c, index| %>
2014-11-29 20:56:38 +00:00
<li ><a href="/explore/mapper/<%= c.id %>" > <img class="rtUserImage" width="25" height="25" src="<%= c.image.url(:thirtytwo) %>" />
<%= c.name %></a>
2014-11-18 19:48:50 +00:00
</li>
<% end %></ul></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">
2014-11-20 03:42:14 +00:00
<div class="tooltips">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>
2014-03-03 02:53:19 +00:00
</div>
2014-02-04 01:43:31 +00:00
<div class="clearfloat"></div>
</div>
2014-10-14 20:34:09 +00:00
<div class="mapInfoDesc" id="mapInfoDesc">
2014-10-13 23:27:30 +00:00
<% if (authenticated? && @map.authorize_to_edit(user)) || (!authenticated? && @map.desc != "" && @map.desc != nil )%>
2015-09-19 09:11:48 +00:00
<%= best_in_place @map, :desc, :activator => "#mapInfoDesc", :as => :textarea, :placeholder => "Click to add description...", :class => 'best_in_place_desc' %>
2014-10-13 23:27:30 +00:00
<% end %>
2014-02-04 01:43:31 +00:00
</div>
<div class="mapInfoMeta">
2014-10-13 23:27:30 +00:00
<p class="mapCreatedAt"><span>Created by:</span> <%= @map.user == user ? "You" : @map.user.name %> on <%= @map.created_at.strftime("%m/%d/%Y") %></p>
<p class="mapEditedAt"><span>Last edited:</span> <%= @map.updated_at.strftime("%m/%d/%Y") %></p>
2014-10-14 20:34:09 +00:00
<div class="mapInfoButtonsWrapper">
<div class="mapInfoDelete">
2014-11-26 15:51:05 +00:00
<div class="deleteMap"></div>
2014-10-14 20:34:09 +00:00
<span>Delete</span>
</div>
<div class="mapInfoShare">
<div class="mapInfoShareIcon"></div>
<span>Share</span>
</div>
</div>
2014-02-04 01:43:31 +00:00
</div>
2014-08-27 02:51:50 +00:00
<% end %>
2015-09-19 09:11:48 +00:00
</div>