clickable map cards

This commit is contained in:
Connor Turland 2014-08-12 18:14:04 -04:00
parent 35835fcc80
commit 6422b54dc0
23 changed files with 137 additions and 3873 deletions

View file

@ -78,7 +78,7 @@
Metamaps.Loading.loader.show();
setTimeout(function(){
Metamaps.Maps[capitalize].getMaps(); // this will trigger an explore maps render
}, 1000); // wait 500 milliseconds till the other animations are done to do the fetch
}, 300); // wait 300 milliseconds till the other animations are done to do the fetch
}
else {
Metamaps.Views.exploreMaps.render();

View file

@ -1,23 +0,0 @@
#inner-details {
}
.label {
display:block;
white-space: nowrap;
padding: 2px 4px;
background:#ddd;
opacity:0.8;
border-radius:5px;
}
span.name {
cursor: pointer;
position: absolute;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}

View file

@ -1,6 +1,3 @@
// Place all the styles related to the users controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
.allMetacodes {

File diff suppressed because it is too large Load diff

View file

@ -11,10 +11,8 @@
*= require_self
*= require_tree .
*= require base
*= require ForceDirected
*= require jquery.mCustomScrollbar
*= require jquery-ui
*= require animate
*/
/* clear styles */
@ -1767,14 +1765,6 @@ div.mapInfoStat {
}
/* --- styling the logo button ---*/
.footer {
display: block;
position: fixed;
bottom: 10px;
left: 50%;
margin-left: -55px;
z-index: 15000;
}
.home_bg {
display: block;
height: 100%;

View file

@ -546,13 +546,14 @@ font-family: 'LatoLight';
.map {
display:inline-block;
width:226px;
height:320px;
width:220px;
height:308px;
padding: 16px 0;
color:#FFF;
text-align: left;
overflow: visible;
background: #FFF;
border-radius:5px;
background: #424242;
border-radius:2px;
box-shadow: 6px 6px 8px rgba(0,0,0,0.4);
margin:16px 16px 16px 19px;
}

View file

@ -71,6 +71,11 @@
/* logo */
.footer {
z-index: 3;
}
.logo {
color: #6B6B6B;
font-family: "vinyl", sans-serif;
@ -653,8 +658,7 @@
}
.exploreMapsCenter {
width: 700px;
margin: 0 auto;
z-index: 3;
}
.exploreMapsCenter a {
@ -664,9 +668,9 @@
font-family: 'din-medium';
font-size: 14px;
height: 14px;
padding-top: 16px;
padding: 14px;
display: inline-block;
padding-bottom: 12px;
cursor: pointer;
}
.exploreMapsCenter a.active {
text-decoration: none;
@ -680,6 +684,7 @@
.mapsWrapper {
margin: 100px 60px 0 60px;
display: none;
z-index: 1;
}
.explorePage .mapsWrapper {
display:block;

View file

@ -1,57 +0,0 @@
// Place all the styles related to the synapses controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
.synapse {
display:block;
position:relative;
width:215px;
height:320px;
float:left;
margin: 30px 0 30px 50px;
}
.synapseTopic1 {
position:absolute;
top:0;
}
.topic1desc {
display: block;
width: 190px;
background: url("bg.png") repeat;
position: relative;
margin-left: 25px;
border-radius: 15px;
padding: 10px 5px 10px 28px;
color: #000;
}
.synapseTopic1 img {
position:absolute;
top: 15px;
z-index: 30;
}
.synapseTopic2 {
position:absolute;
bottom:0;
}
.synapseTopic2 img {
position:absolute;
top:-24px;
z-index:30;
}
.topic2desc {
display: block;
width: 190px;
background: url("bg.png") repeat;
position: relative;
margin-left: 25px;
border-radius: 15px;
padding: 10px 5px 10px 28px;
color: #000;
}

View file

@ -4,8 +4,6 @@ class MappingsController < ApplicationController
respond_to :json
#skip_before_filter :verify_authenticity_token, :only => [:create]
# GET /mappings/1.json
def show
@mapping = Mapping.find(params[:id])

View file

@ -64,7 +64,7 @@ class SynapsesController < ApplicationController
@synapse.delete if @synapse
respond_to do |format|
format.json { render :json => "success" }
format.json { head :no_content }
end
end
end

View file

@ -9,16 +9,16 @@ class UsersController < ApplicationController
@user = User.find(params[:id])
render json: @user
end
end
# GET /user/edit
# GET /users/:id/edit
def edit
@user = current_user
respond_with(@user)
end
# PUT /user
# PUT /users/:id
def update
@user = current_user
@user.attributes = params[:user]

View file

@ -22,7 +22,7 @@ module TopicsHelper
return temp
end
#find all nodes in any given nodes network
#find all nodes in any given nodes network
def network(node, array, count)
# recurse starting with a node to find all connected nodes and return an array of topics that constitutes the starting nodes network
@ -55,102 +55,4 @@ module TopicsHelper
return array
end
end
#return a json object containing all of a users added synapses
def synapses_as_json(current, synapses)
Jbuilder.encode do |json|
@topics = Array.new
synapses.each do |synapse|
@topics.push(synapse.topic1) if (not @topics.include?(synapse.topic1)) && synapse.topic1.authorize_to_view(current)
@topics.push(synapse.topic2) if (not @topics.include?(synapse.topic2)) && synapse.topic2.authorize_to_view(current)
end
json.array!(@topics) do |topic|
json.adjacencies topic.synapses2.delete_if{|synapse| not @topics.include?(Topic.find_by_id(synapse.node1_id))} do |json, synapse|
json.nodeTo synapse.node1_id
json.nodeFrom synapse.node2_id
@synapsedata = Hash.new
@synapsedata['$desc'] = synapse.desc
@synapsedata['$showDesc'] = false
@synapsedata['$category'] = synapse.category
@synapsedata['$id'] = synapse.id
@synapsedata['$userid'] = synapse.user.id
@synapsedata['$username'] = synapse.user.name
@synapsedata['$direction'] = [synapse.node1_id.to_s(), synapse.node2_id.to_s()]
@synapsedata['$permission'] = synapse.permission
json.data @synapsedata
end
@inmaps = Array.new
topic.maps.each do |map|
@inmaps.push(map.id)
end
@topicdata = Hash.new
@topicdata['$desc'] = topic.desc
@topicdata['$link'] = topic.link
@topicdata['$metacode'] = topic.metacode.name
@topicdata['$inmaps'] = @inmaps
@topicdata['$userid'] = topic.user.id
@topicdata['$username'] = topic.user.name
@topicdata['$permission'] = topic.permission
json.data @topicdata
json.id topic.id
json.name topic.name
end
end
end
def all_as_json(current, user)
# current is current user
Jbuilder.encode do |json|
if user.nil?
@topics = Topic.visibleToUser(current, nil)
@synapses = Synapse.visibleToUser(current, nil)
else
@topics = Topic.visibleToUser(current, user)
@synapses = Synapse.visibleToUser(current, user)
end
json.array!(@topics) do |topic|
json.adjacencies topic.synapses2.delete_if{|synapse| (not @topics.include?(Topic.find_by_id(synapse.node1_id))) || (not @synapses.include?(synapse))} do |json, synapse|
json.nodeTo synapse.node1_id
json.nodeFrom synapse.node2_id
@synapsedata = Hash.new
@synapsedata['$desc'] = synapse.desc
@synapsedata['$showDesc'] = false
@synapsedata['$category'] = synapse.category
@synapsedata['$id'] = synapse.id
@synapsedata['$userid'] = synapse.user.id
@synapsedata['$username'] = synapse.user.name
@synapsedata['$direction'] = [synapse.node1_id.to_s(), synapse.node2_id.to_s()]
@synapsedata['$permission'] = synapse.permission
json.data @synapsedata
end
@inmaps = Array.new
topic.maps.each do |map|
@inmaps.push(map.id)
end
@topicdata = Hash.new
@topicdata['$desc'] = topic.desc
@topicdata['$link'] = topic.link
@topicdata['$metacode'] = topic.metacode.name
@topicdata['$inmaps'] = @inmaps
@topicdata['$userid'] = topic.user.id
@topicdata['$username'] = topic.user.name
@topicdata['$permission'] = topic.permission
json.data @topicdata
json.id topic.id
json.name topic.name
end
end
end
end

View file

@ -1,26 +1,26 @@
class Map < ActiveRecord::Base
belongs_to :user
belongs_to :user
has_many :topicmappings, :class_name => 'Mapping', :conditions => {:category => 'Topic'}
has_many :synapsemappings, :class_name => 'Mapping', :conditions => {:category => 'Synapse'}
has_many :topicmappings, :class_name => 'Mapping', :conditions => {:category => 'Topic'}
has_many :synapsemappings, :class_name => 'Mapping', :conditions => {:category => 'Synapse'}
has_many :topics, :through => :topicmappings
has_many :synapses, :through => :synapsemappings
has_many :topics, :through => :topicmappings
has_many :synapses, :through => :synapsemappings
def mappings
topicmappings + synapsemappings
end
def mk_permission
if self.permission == "commons"
"co"
elsif self.permission == "public"
"pu"
elsif self.permission == "private"
"pr"
def mappings
topicmappings + synapsemappings
end
def mk_permission
if self.permission == "commons"
"co"
elsif self.permission == "public"
"pu"
elsif self.permission == "private"
"pr"
end
end
end
#return an array of the contributors to the map
def contributors
@ -55,44 +55,30 @@ end
##### PERMISSIONS ######
scope :visibleToUser, lambda { |current, user|
if user != nil
if user != current
Map.find_all_by_user_id_and_permission(user.id, "commons") | Map.find_all_by_user_id_and_permission(user.id, "public")
elsif user == current
Map.find_all_by_user_id_and_permission(user.id, "commons") | Map.find_all_by_user_id_and_permission(user.id, "public") | current.maps.where(:permission => "private")
end
elsif (current != nil && user == nil)
Map.find_all_by_permission("commons") | Map.find_all_by_permission("public") | current.maps.where(:permission => "private")
elsif (current == nil)
Map.find_all_by_permission("commons") | Map.find_all_by_permission("public")
end
}
# returns false if user not allowed to 'show' Topic, Synapse, or Map
def authorize_to_show(user)
if (self.permission == "private" && self.user != user)
return false
end
return self
if (self.permission == "private" && self.user != user)
return false
end
return self
end
# returns false if user not allowed to 'edit' Topic, Synapse, or Map
def authorize_to_edit(user)
if (self.permission == "private" && self.user != user)
return false
elsif (self.permission == "public" && self.user != user)
return false
end
return self
if (self.permission == "private" && self.user != user)
return false
elsif (self.permission == "public" && self.user != user)
return false
end
return self
end
# returns Boolean if user allowed to view Topic, Synapse, or Map
def authorize_to_view(user)
if (self.permission == "private" && self.user != user)
return false
end
return true
if (self.permission == "private" && self.user != user)
return false
end
return true
end
end

View file

@ -1,10 +1,10 @@
class Mapping < ActiveRecord::Base
belongs_to :topic, :class_name => "Topic", :foreign_key => "topic_id"
belongs_to :synapse, :class_name => "Synapse", :foreign_key => "synapse_id"
belongs_to :map, :class_name => "Map", :foreign_key => "map_id"
belongs_to :topic, :class_name => "Topic", :foreign_key => "topic_id"
belongs_to :synapse, :class_name => "Synapse", :foreign_key => "synapse_id"
belongs_to :map, :class_name => "Map", :foreign_key => "map_id"
belongs_to :user
belongs_to :user
def user_name
self.user.name

View file

@ -1,12 +1,12 @@
class Synapse < ActiveRecord::Base
belongs_to :user
belongs_to :user
belongs_to :topic1, :class_name => "Topic", :foreign_key => "node1_id"
belongs_to :topic2, :class_name => "Topic", :foreign_key => "node2_id"
belongs_to :topic1, :class_name => "Topic", :foreign_key => "node1_id"
belongs_to :topic2, :class_name => "Topic", :foreign_key => "node2_id"
has_many :mappings
has_many :maps, :through => :mappings
has_many :mappings
has_many :maps, :through => :mappings
def user_name
self.user.name
@ -38,83 +38,9 @@ has_many :maps, :through => :mappings
$redis.publish 'maps', msg.to_json
end
end
##### JSON ######
def self_as_json
Jbuilder.encode do |json|
@synapsedata = Hash.new
@synapsedata['$desc'] = self.desc
@synapsedata['$showDesc'] = false
@synapsedata['$category'] = self.category
@synapsedata['$id'] = self.id
@synapsedata['$userid'] = self.user.id
@synapsedata['$username'] = self.user.name
@synapsedata['$direction'] = [self.node1_id.to_s(), self.node2_id.to_s()]
@synapsedata['$permission'] = self.permission
json.data @synapsedata
end
end
def selfplusnodes_as_json
Jbuilder.encode do |json|
@topics = Array.new
@topics.push(self.topic1)
@topics.push(self.topic2)
json.array!(@topics) do |topic|
json.adjacencies topic.synapses1.delete_if{|synapse| not @topics.include?(Topic.find_by_id(synapse.node2_id))} do |json, synapse|
json.nodeTo synapse.node2_id
json.nodeFrom synapse.node1_id
@synapsedata = Hash.new
@synapsedata['$desc'] = synapse.desc
@synapsedata['$showDesc'] = false
@synapsedata['$category'] = synapse.category
@synapsedata['$id'] = synapse.id
@synapsedata['$userid'] = synapse.user.id
@synapsedata['$username'] = synapse.user.name
@synapsedata['$direction'] = [synapse.node1_id.to_s(), synapse.node2_id.to_s()]
@synapsedata['$permission'] = synapse.permission
json.data @synapsedata
end
@inmaps = Array.new
topic.maps.each do |map|
@inmaps.push(map.id)
end
@topicdata = Hash.new
@topicdata['$desc'] = topic.desc
@topicdata['$link'] = topic.link
@topicdata['$metacode'] = topic.metacode.name
@topicdata['$inmaps'] = @inmaps
@topicdata['$userid'] = topic.user.id
@topicdata['$username'] = topic.user.name
@topicdata['$permission'] = topic.permission
json.data @topicdata
json.id topic.id
json.name topic.name
end
end
end
##### PERMISSIONS ######
scope :visibleToUser, lambda { |current, user|
if user != nil
if user != current
Synapse.find_all_by_user_id_and_permission(user.id, "commons") | Synapse.find_all_by_user_id_and_permission(user.id, "public")
elsif user == current
Synapse.find_all_by_user_id_and_permission(user.id, "commons") | Synapse.find_all_by_user_id_and_permission(user.id, "public") | current.synapses.where(:permission => "private")
end
elsif (current != nil && user == nil)
Synapse.find_all_by_permission("commons") | Synapse.find_all_by_permission("public") | current.synapses.where(:permission => "private")
elsif (current == nil)
Synapse.find_all_by_permission("commons") | Synapse.find_all_by_permission("public")
end
}
# returns false if user not allowed to 'show' Topic, Synapse, or Map
def authorize_to_show(user)
if (self.permission == "private" && self.user != user)
@ -140,15 +66,5 @@ has_many :maps, :through => :mappings
end
return true
end
# returns Boolean based on whether user has permissions to edit or not
def authorize_linkto_edit(user)
if (self.user == user)
return true
elsif (self.permission == "commons")
return true
end
return false
end
end

View file

@ -1,16 +1,15 @@
class Topic < ActiveRecord::Base
include TopicsHelper
include TopicsHelper
belongs_to :user
belongs_to :user
has_many :synapses1, :class_name => 'Synapse', :foreign_key => 'node1_id'
has_many :synapses2, :class_name => 'Synapse', :foreign_key => 'node2_id'
has_many :topics1, :through => :synapses2, :source => :topic1
has_many :topics2, :through => :synapses1, :source => :topic2
has_many :synapses1, :class_name => 'Synapse', :foreign_key => 'node1_id'
has_many :synapses2, :class_name => 'Synapse', :foreign_key => 'node2_id'
has_many :topics1, :through => :synapses2, :source => :topic1
has_many :topics2, :through => :synapses1, :source => :topic2
has_many :mappings
has_many :maps, :through => :mappings
has_many :mappings
has_many :maps, :through => :mappings
# This method associates the attribute ":image" with a file attachment
has_attached_file :image
@ -86,168 +85,17 @@ has_many :maps, :through => :mappings
# has no viewable synapses helper function
def has_viewable_synapses(current)
result = false
self.synapses.each do |synapse|
if synapse.authorize_to_view(current)
result = true
end
end
return result
end
###### JSON ######
def self_as_json
Jbuilder.encode do |json|
@inmaps = Array.new
@mapsString = ""
self.maps.each_with_index do |map, index|
@inmaps.push(map.id)
@mapsString += map.name
@mapsString += (index+1) == self.maps.count ? "" : ", "
end
@topicdata = Hash.new
@topicdata['$desc'] = self.desc
@topicdata['$link'] = self.link
@topicdata['$metacode'] = self.metacode.name
@topicdata['$inmaps'] = @inmaps
@topicdata['$inmapsString'] = @mapsString
@topicdata['$synapseCount'] = self.synapses.count
@topicdata['$userid'] = self.user.id
@topicdata['$username'] = self.user.name
@topicdata['$permission'] = self.permission
@topicdata['$date'] = self.created_at.strftime("%m/%d/%Y")
json.data @topicdata
json.id self.id
json.name self.name
end
end
def selfonmap_as_json(mapid)
Jbuilder.encode do |json|
@inmaps = Array.new
@mapsString = ""
self.maps.each_with_index do |map, index|
@inmaps.push(map.id)
@mapsString += map.name
@mapsString += (index+1) == self.maps.count ? "" : ", "
end
@topicdata = Hash.new
@topicdata['$desc'] = self.desc
@topicdata['$link'] = self.link
@topicdata['$metacode'] = self.metacode.name
@topicdata['$inmaps'] = @inmaps
@topicdata['$inmapsString'] = @mapsString
@topicdata['$synapseCount'] = self.synapses.count
@topicdata['$userid'] = self.user.id
@topicdata['$username'] = self.user.name
@mapping = Mapping.find_by_topic_id_and_map_id(self.id,mapid)
@topicdata['$xloc'] = @mapping.xloc
@topicdata['$yloc'] = @mapping.yloc
@topicdata['$mappingid'] = @mapping.id
@topicdata['$permission'] = self.permission
@topicdata['$date'] = self.created_at.strftime("%m/%d/%Y")
json.data @topicdata
json.id self.id
json.name self.name
end
end
#build a json object of everything connected to a specified node
def network_as_json(current)
Jbuilder.encode do |json|
@topics = network(self,nil,1)
if @topics.count > 1
json.array!(@topics.delete_if{|topic| (not topic.authorize_to_view(current)) || (not topic.has_viewable_synapses(current))}) do |topic|
json.adjacencies topic.synapses1.delete_if{|synapse| (not @topics.include?(synapse.topic2)) || (not synapse.authorize_to_view(current)) || (not synapse.topic2.authorize_to_view(current)) } do |json, synapse|
json.nodeTo synapse.node2_id
json.nodeFrom synapse.node1_id
@synapsedata = Hash.new
@synapsedata['$alpha'] = 0.4
@synapsedata['$desc'] = synapse.desc
@synapsedata['$showDesc'] = false
@synapsedata['$category'] = synapse.category
@synapsedata['$id'] = synapse.id
@synapsedata['$userid'] = synapse.user.id
@synapsedata['$username'] = synapse.user.name
@synapsedata['$direction'] = [synapse.node1_id.to_s(), synapse.node2_id.to_s()]
@synapsedata['$permission'] = synapse.permission
json.data @synapsedata
end
@inmaps = Array.new
@mapsString = ""
topic.maps.each_with_index do |map, index|
@inmaps.push(map.id)
@mapsString += map.name
@mapsString += (index+1) == topic.maps.count ? "" : ", "
end
@topicdata = Hash.new
@topicdata['$desc'] = topic.desc
@topicdata['$link'] = topic.link
@topicdata['$metacode'] = topic.metacode.name
@topicdata['$inmaps'] = @inmaps
@topicdata['$inmapsString'] = @mapsString
@topicdata['$synapseCount'] = topic.synapses.count
@topicdata['$userid'] = topic.user.id
@topicdata['$username'] = topic.user.name
@topicdata['$permission'] = topic.permission
@topicdata['$date'] = topic.created_at.strftime("%m/%d/%Y")
json.data @topicdata
json.id topic.id
json.name topic.name
end
elsif @topics.count == 1
json.array!(@topics) do |topic|
@inmaps = Array.new
@mapsString = ""
topic.maps.each_with_index do |map, index|
@inmaps.push(map.id)
@mapsString += map.name
@mapsString += (index+1) == topic.maps.count ? "" : ", "
end
@topicdata = Hash.new
@topicdata['$desc'] = topic.desc
@topicdata['$link'] = topic.link
@topicdata['$metacode'] = topic.metacode.name
@topicdata['$inmaps'] = @inmaps
@topicdata['$inmapsString'] = @mapsString
@topicdata['$synapseCount'] = topic.synapses.count
@topicdata['$userid'] = topic.user.id
@topicdata['$username'] = topic.user.name
@topicdata['$permission'] = topic.permission
@topicdata['$date'] = topic.created_at.strftime("%m/%d/%Y")
json.data @topicdata
json.id topic.id
json.name topic.name
end
end
end
result = false
self.synapses.each do |synapse|
if synapse.authorize_to_view(current)
result = true
end
end
return result
end
##### PERMISSIONS ######
scope :visibleToUser, lambda { |current, user|
if user != nil
if user != current
Topic.find_all_by_user_id_and_permission(user.id, "commons") | Topic.find_all_by_user_id_and_permission(user.id, "public")
elsif user == current
Topic.find_all_by_user_id_and_permission(user.id, "commons") | Topic.find_all_by_user_id_and_permission(user.id, "public") | current.topics.where(:permission => "private")
end
elsif (current != nil && user == nil)
Topic.find_all_by_permission("commons") | Topic.find_all_by_permission("public") | current.topics.where(:permission => "private")
elsif (current == nil)
Topic.find_all_by_permission("commons") | Topic.find_all_by_permission("public")
end
}
# returns false if user not allowed to 'show' Topic, Synapse, or Map
def authorize_to_show(user)
if (self.permission == "private" && self.user != user)
@ -273,15 +121,4 @@ has_many :maps, :through => :mappings
end
return true
end
# returns Boolean based on whether user has permissions to edit or not
def authorize_linkto_edit(user)
if (self.user == user)
return true
elsif (self.permission == "commons")
return true
end
return false
end
end

View file

@ -2,10 +2,10 @@ require 'open-uri'
class User < ActiveRecord::Base
has_many :topics
has_many :synapses
has_many :maps
has_many :mappings
has_many :topics
has_many :synapses
has_many :maps
has_many :mappings
before_create :generate_code
@ -42,7 +42,6 @@ has_many :mappings
def as_json(options={})
{ :id => self.id,
:name => self.name,
:email => self.email,
:image => self.image.url
}
end

View file

@ -7,23 +7,19 @@
<script type="text/template" id="mapCardTemplate">
<a href="/maps/{{id}}">
<div class="permission {{editPermission}}"> <!-- must be canEdit or cannotEdit -->
<div class="mapCard">
<span class="title">
<span class="best_in_place best_in_place_name" id="best_in_place_map_{{id}}_name" data-url="/maps/{{id}}" data-object="map" data-attribute="name" data-type="textarea">{{name}}</span>
</span>
<div class="links">
<div class="linkItem icon">
<div class="metacodeImage" style="background-image:url(/assets/map.png);"></div>
</div>
<div class="links">
<div class="linkItem contributor hoverForTip">
<div class="tip">Created by {{username}} on {{createdAt}}</div>
</div>
<div class="linkItem topicCount">{{topicCount}}</div>
<div class="linkItem synapseCount">{{synapseCount}}</div>
<div class="linkItem mapPerm {{mkPermission}}"></div>
<a href="/maps/{{id}}" class="linkItem topicPopout"></a>
<div class="clearfloat"></div>
<div class="linkItem mapPerm {{mkPermission}}"></div>
</div>
<div class="scroll">
<div class="desc">
@ -34,6 +30,7 @@
<div class="clearfloat"></div>
</div>
</div>
</a>
</script>
<script type="text/template" id="topicSearchTemplate">

View file

@ -4,7 +4,7 @@
<div class="upperLeftUI">
<!-- home button -->
<div class="homeButton">
<a href="<%= root_url %>"></a>
<a href="<%= root_url %>" <% if !authenticated? %><%= 'data-bypass=true' %><% end %>></a>
</div> <!-- end homeButton -->
<!-- search box -->

View file

@ -4,23 +4,20 @@
# Any list of maps uses this rendering.
#%>
<%= div_for map do %>
<a href="/maps/<%= map.id %>">
<div class="permission <%= map.authorize_to_edit(user) ? "canEdit" : "cannotEdit" %>">
<div class="mapCard">
<span class="title">
<%= best_in_place map, :name, :type => :textarea, :classes => 'best_in_place_name' %>
</span>
<div class="links">
<div class="linkItem icon">
<div class="metacodeImage" style="background-image:url(/assets/map.png);"></div>
</div>
<div class="links">
<div class="linkItem contributor hoverForTip">
<div class="tip">Created by <%= map.user.name %> on <%= map.created_at.strftime("%m/%d/%Y") %></div>
</div>
<div class="linkItem topicCount"><%= map.topics.count %></div>
<div class="linkItem synapseCount"><%= map.synapses.count %></div>
<div class="linkItem mapPerm <%= map.mk_permission %>"></div>
<a href="/maps/<%= map.id %>" class="linkItem topicPopout"></a>
<div class="linkItem mapPerm <%= map.mk_permission %>"></div>
<div class="clearfloat"></div>
</div>
<div class="scroll">
@ -33,4 +30,5 @@
</div>
</div>
</a>
<% end %>

View file

@ -2,14 +2,16 @@ Metamaps::Application.routes.draw do
root to: 'main#home', via: :get
get '/join', to: redirect('/users/sign_up')
devise_scope :user do
get "join" => "devise/registrations#new"
end
match 'request', to: 'main#requestinvite', via: :get, as: :request
match '/search/topics', to: 'main#searchtopics', via: :get, as: :searchtopics
match '/search/maps', to: 'main#searchmaps', via: :get, as: :searchmaps
match '/search/mappers', to: 'main#searchmappers', via: :get, as: :searchmappers
match '/search/synapses', to: 'main#searchsynapses', via: :get, as: :searchsynapses
match 'search/topics', to: 'main#searchtopics', via: :get, as: :searchtopics
match 'search/maps', to: 'main#searchmaps', via: :get, as: :searchmaps
match 'search/mappers', to: 'main#searchmappers', via: :get, as: :searchmappers
match 'search/synapses', to: 'main#searchsynapses', via: :get, as: :searchsynapses
resources :mappings, except: [:index, :new, :edit]
resources :metacode_sets, :except => [:show]

View file

@ -112,11 +112,17 @@ define(function(require, exports, module) {
// EXPLORE MAPS BAR
f.explore = {};
f.explore.surf = new Surface({
size: [undefined, 94],
size: [true, 42],
content: templates.mineContent,
classes: ['exploreMapsCenter']
});
f.explore.surfBg = new Surface({
size: [undefined, 94],
content: '<div class="exploreMapsMenu"></div>',
classes: ['exploreMapsBar', 'exploreElement']
});
f.explore.mod = new Modifier({
size: [undefined, 94],
origin: [0.5, 0],
transform: Transform.translate(0, -94, 0)
});
@ -136,14 +142,22 @@ define(function(require, exports, module) {
var loggedIn = Metamaps.Active.Mapper ? 'Auth' : '';
f.explore.surf.setContent(templates[section + loggedIn + 'Content']);
};
f.mainContext.add(f.explore.mod).add(f.explore.surf);
var exploreMod = f.mainContext.add(f.explore.mod);
exploreMod.add(new Modifier({
size: [undefined, 42],
origin: [0.5, 1]
})).add(new Modifier({
origin: [0.5, 1]
})).add(f.explore.surf);
exploreMod.add(f.explore.surfBg);
// LOGO
f.logo = {};
f.logo.surf = new Surface({
size: [258, 56],
content: templates.logoContent,
classes: []
classes: ['footer']
});
f.logo.mod = new Modifier({

View file

@ -11,73 +11,38 @@ t.logoContent += '<li class="openLightbox" data-open="getInvolved">Get Involved!
t.logoContent += '</ul>';
/* logged out explore maps bars */
t.activeContent = '<div class="exploreMapsMenu">';
t.activeContent += '<div class="exploreMapsCenter">';
t.activeContent += '<a href="/explore/active" class="active">Recently Active</a>';
t.activeContent += '<a href="/explore/featured">Featured</a>';
t.activeContent += '<a href="/explore/new">New</a>';
t.activeContent += '<div class="clearfloat"></div>';
t.activeContent += '</div';
t.activeContent += '</div>';
t.activeContent = '<a href="/explore/active" class="active">Recently Active</a>';
t.activeContent += '<a href="/explore/featured">Featured</a>';
t.activeContent += '<a href="/explore/new">New</a>';
t.featuredContent = '<div class="exploreMapsMenu">';
t.featuredContent += '<div class="exploreMapsCenter">';
t.featuredContent += '<a href="/explore/active">Recently Active</a>';
t.featuredContent += '<a href="/explore/featured" class="active">Featured</a>';
t.featuredContent += '<a href="/explore/new">New</a>';
t.featuredContent += '<div class="clearfloat"></div>';
t.featuredContent += '</div';
t.featuredContent += '</div>';
t.featuredContent = '<a href="/explore/active">Recently Active</a>';
t.featuredContent += '<a href="/explore/featured" class="active">Featured</a>';
t.featuredContent += '<a href="/explore/new">New</a>';
t.newContent = '<div class="exploreMapsMenu">';
t.newContent += '<div class="exploreMapsCenter">';
t.newContent += '<a href="/explore/active">Recently Active</a>';
t.newContent += '<a href="/explore/featured">Featured</a>';
t.newContent += '<a href="/explore/new" class="active">New</a>';
t.newContent += '<div class="clearfloat"></div>';
t.newContent += '</div';
t.newContent += '</div>';
t.newContent = '<a href="/explore/active">Recently Active</a>';
t.newContent += '<a href="/explore/featured">Featured</a>';
t.newContent += '<a href="/explore/new" class="active">New</a>';
/* logged in explore maps bars */
t.mineAuthContent = '<div class="exploreMapsMenu">';
t.mineAuthContent += '<div class="exploreMapsCenter">';
t.mineAuthContent += '<a href="/" class="active">My Maps</a>';
t.mineAuthContent += '<a href="/explore/active">Recently Active</a>';
t.mineAuthContent += '<a href="/explore/featured">Featured</a>';
t.mineAuthContent += '<a href="/explore/new">New</a>';
t.mineAuthContent += '<div class="clearfloat"></div>';
t.mineAuthContent += '</div';
t.mineAuthContent += '</div>';
t.mineAuthContent = '<a href="/" class="active">My Maps</a>';
t.mineAuthContent += '<a href="/explore/active">Recently Active</a>';
t.mineAuthContent += '<a href="/explore/featured">Featured</a>';
t.mineAuthContent += '<a href="/explore/new">New</a>';
t.activeAuthContent = '<div class="exploreMapsMenu">';
t.activeAuthContent += '<div class="exploreMapsCenter">';
t.activeAuthContent += '<a href="/">My Maps</a>';
t.activeAuthContent += '<a href="/explore/active" class="active">Recently Active</a>';
t.activeAuthContent += '<a href="/explore/featured">Featured</a>';
t.activeAuthContent += '<a href="/explore/new">New</a>';
t.activeAuthContent += '<div class="clearfloat"></div>';
t.activeAuthContent += '</div';
t.activeAuthContent += '</div>';
t.activeAuthContent = '<a href="/">My Maps</a>';
t.activeAuthContent += '<a href="/explore/active" class="active">Recently Active</a>';
t.activeAuthContent += '<a href="/explore/featured">Featured</a>';
t.activeAuthContent += '<a href="/explore/new">New</a>';
t.featuredAuthContent = '<div class="exploreMapsMenu">';
t.featuredAuthContent += '<div class="exploreMapsCenter">';
t.featuredAuthContent += '<a href="/">My Maps</a>';
t.featuredAuthContent += '<a href="/explore/active">Recently Active</a>';
t.featuredAuthContent += '<a href="/explore/featured" class="active">Featured</a>';
t.featuredAuthContent += '<a href="/explore/new">New</a>';
t.featuredAuthContent += '<div class="clearfloat"></div>';
t.featuredAuthContent += '</div';
t.featuredAuthContent += '</div>';
t.featuredAuthContent = '<a href="/">My Maps</a>';
t.featuredAuthContent += '<a href="/explore/active">Recently Active</a>';
t.featuredAuthContent += '<a href="/explore/featured" class="active">Featured</a>';
t.featuredAuthContent += '<a href="/explore/new">New</a>';
t.newAuthContent = '<div class="exploreMapsMenu">';
t.newAuthContent += '<div class="exploreMapsCenter">';
t.newAuthContent += '<a href="/">My Maps</a>';
t.newAuthContent += '<a href="/explore/active">Recently Active</a>';
t.newAuthContent += '<a href="/explore/featured">Featured</a>';
t.newAuthContent += '<a href="/explore/new" class="active">New</a>';
t.newAuthContent += '<div class="clearfloat"></div>';
t.newAuthContent += '</div';
t.newAuthContent += '</div>';
t.newAuthContent = '<a href="/">My Maps</a>';
t.newAuthContent += '<a href="/explore/active">Recently Active</a>';
t.newAuthContent += '<a href="/explore/featured">Featured</a>';
t.newAuthContent += '<a href="/explore/new" class="active">New</a>';
module.exports = t;
});