60 lines
2 KiB
Text
60 lines
2 KiB
Text
<%#
|
|
# @file
|
|
# Shows a list of all maps, or just a user's maps.
|
|
# TODO: What url is this accessible at?
|
|
#%>
|
|
|
|
<% content_for :title, "Explore Maps | Metamaps" %>
|
|
|
|
<div class="mapOrder">
|
|
<span class="displaying">Displaying:</span>
|
|
<div class="whichMaps">
|
|
<% if @request == "other" %>
|
|
<a href="/maps/mappers/<%= @user.id %>" class="active">By <%= @user.name %></a> /
|
|
<% end %>
|
|
<% if @request == "topic" %>
|
|
<a href="/maps/topics/<%= @topic.id %>" class="active">Maps Containing Topic <%= @topic.id.to_s %>: "<%= @topic.name.truncate(30) %>"</a>
|
|
<% end %>
|
|
|
|
<% if @request != "topic" %>
|
|
<% if authenticated? %>
|
|
<a href="/maps/mappers/<%= @current.id %>" class="<%= @request == "you" ? "active" : "" %>">My Maps</a> /
|
|
<% end %>
|
|
<a href="/explore/active" class="<%= @request == "active" ? "active" : "" %>">Recently Active</a> /
|
|
<a href="/explore/featured" class="<%= @request == "featured" ? "active" : "" %>">Featured</a> /
|
|
<a href="/explore/new" class="<%= @request == "new" ? "active" : "" %>">Newest First</a>
|
|
<% end %>
|
|
</div>
|
|
<div class="clearfloat"></div>
|
|
</div>
|
|
|
|
<div class="mapsWrapper">
|
|
<div class="maps" id="cards">
|
|
<% @maps.each do |map| %>
|
|
<%= render map %>
|
|
<% end %>
|
|
<div class="clearfloat"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
$(document).ready(function() {
|
|
$('.authenticated div.permission.canEdit .best_in_place').best_in_place();
|
|
|
|
$('.scroll').each(function(index) {
|
|
$(this).height( $(this).height() ).mCustomScrollbar();
|
|
});
|
|
|
|
// when you change the title, make sure that the description doesn't overflow
|
|
$('.best_in_place_name').bind('ajax:success', function() {
|
|
var p = $(this).parents('.mapCard').find('.scroll');
|
|
p.height( p.height() ).mCustomScrollbar('update');
|
|
});
|
|
|
|
// when you change the description, update the scroll box field
|
|
$('.best_in_place_desc').bind('ajax:success', function() {
|
|
var s = $(this).parents('.scroll');
|
|
s.height( s.height() ).mCustomScrollbar('update');
|
|
});
|
|
});
|
|
</script>
|