8c51108a0c
* enable shared private and public maps * change the list * yeehaw add collaborators * I believe this fixes the error connor brought up * when topic or synapse is no longer on a map, don't defer * needs to be before? * just do it in the controller * make recommendation they sign in and retry * better email * config for mailer previews * improve wording * shouldn't have included that * switch to green * don't execute if there's no map * wasn't including the right people in some circumstances * Finish breaking out JS files (#551) * metamaps.Realtime refactor * Metamaps.Util * Metamaps.Visualize * Metamaps.SynapseCard * Metamaps.TopicCard * Metamaps.Create.js * Remove erb extension from Metamaps.Map.js * Metmaps.Account and Metamaps.GlobalUI remove extension * Metamaps.JIT no more erb extension * move Backbone.init; standard-format on Metamaps.js.erb * factor out canvas support check function * some llittle template bugs * remove featured from signed in explore maps bar * don't let it overflow off the page
77 lines
3.7 KiB
Text
77 lines
3.7 KiB
Text
<%#
|
|
# 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
|
|
#%>
|
|
<div class="mapInfoBox mapElement mapElementHidden permission
|
|
<%= @map && @map.user == user ? " yourMap" : "" %>
|
|
<%= @map && policy(@map).update? ? " canEdit" : "" %>
|
|
<%= @map && @map.permission != 'private' ? " shareable" : "" %>">
|
|
|
|
<% if @map %>
|
|
<div class="mapInfoName" id="mapInfoName"><%= best_in_place @map, :name, :as => :textarea, :activator => "#mapInfoName", :class => 'best_in_place_name' %></div>
|
|
|
|
<div class="mapInfoStat">
|
|
<div class="infoStatIcon mapContributors hoverForTip">
|
|
<% relevantPeople = @map.permission == "commons" ? @map.contributors : @map.editors %>
|
|
<% if relevantPeople.count == 0 %>
|
|
<img id="mapContribs" width="25" height="25" src="<%= asset_path('user.png'); %>" />
|
|
<% elsif relevantPeople.count == 1 %>
|
|
<img id="mapContribs" width="25" height="25" src="<%= relevantPeople[0].image.url(:thirtytwo) %>" />
|
|
<% elsif relevantPeople.count == 2 %>
|
|
<img id="mapContribs" width="25" height="25" src="<%= relevantPeople[0].image.url(:thirtytwo) %>" class="multiple mTwo" />
|
|
<% elsif relevantPeople.count > 2 %>
|
|
<img id="mapContribs" width="25" height="25" src="<%= relevantPeople[0].image.url(:thirtytwo) %>" class="multiple" />
|
|
<% end %>
|
|
<span class="count"><%= relevantPeople.count %></span>
|
|
<div class="tip">
|
|
<ul><% relevantPeople.each_with_index do |c, index| %>
|
|
<li>
|
|
<a href="/explore/mapper/<%= c.id %>" > <img class="rtUserImage" width="25" height="25" src="<%= asset_path c.image.url(:thirtytwo) %>" />
|
|
<%= c.name %>
|
|
<% if @map.user == c %> (creator)<% end %>
|
|
</a>
|
|
<% if @map.user != c && @map.user == current_user %>
|
|
<span class="removeCollaborator" data-id=" + m.get('id') + "></span>
|
|
<% end %>
|
|
</li>
|
|
<% end %>
|
|
</ul>
|
|
<% if @map.user == current_user %>
|
|
<div class="collabSearchField"><span class="addCollab"></span><input class="collaboratorSearchField" placeholder="Add a collaborator!"></input></div>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
<div class="infoStatIcon mapTopics">
|
|
<%= @map.topics.count %>
|
|
</div>
|
|
<div class="infoStatIcon mapSynapses">
|
|
<%= @map.synapses.count %>
|
|
</div>
|
|
<div class="infoStatIcon mapPermission <%= @map.permission %> hoverForTip">
|
|
<div class="tooltips">As the creator, you can change the permission of this map, and the permission of all the topics and synapses you have authority to change will change as well.</div>
|
|
</div>
|
|
<div class="clearfloat"></div>
|
|
</div>
|
|
|
|
<div class="mapInfoDesc" id="mapInfoDesc">
|
|
<% if (authenticated? && policy(@map).update?) || (!authenticated? && @map.desc != "" && @map.desc != nil )%>
|
|
<%= best_in_place @map, :desc, :activator => "#mapInfoDesc", :as => :textarea, :placeholder => "Click to add description...", :class => 'best_in_place_desc' %>
|
|
<% end %>
|
|
</div>
|
|
|
|
<div class="mapInfoMeta">
|
|
<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>
|
|
<div class="mapInfoButtonsWrapper">
|
|
<div class="mapInfoDelete">
|
|
<div class="deleteMap"></div>
|
|
<span>Delete</span>
|
|
</div>
|
|
<div class="mapInfoShare">
|
|
<div class="mapInfoShareIcon"></div>
|
|
<span>Share</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
</div>
|