filterbox progress
This commit is contained in:
parent
e08c702494
commit
2b267ea0c6
10 changed files with 5761 additions and 136 deletions
BIN
app/assets/images/icons/synapsevisualize.png
Normal file
BIN
app/assets/images/icons/synapsevisualize.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 909 B |
|
@ -14,7 +14,7 @@
|
|||
});
|
||||
Metamaps.Router = new Router();
|
||||
Metamaps.Router.init = function () {
|
||||
Backbone.history.start({
|
||||
/*Backbone.history.start({
|
||||
pushState: true,
|
||||
root: ''
|
||||
});
|
||||
|
@ -30,6 +30,6 @@
|
|||
evt.preventDefault();
|
||||
Backbone.history.navigate(href.attr, true);
|
||||
}
|
||||
});
|
||||
});*/
|
||||
}
|
||||
})();
|
||||
})();
|
||||
|
|
35
app/assets/javascripts/metamaps/Metamaps.Router.js~
Normal file
35
app/assets/javascripts/metamaps/Metamaps.Router.js~
Normal file
|
@ -0,0 +1,35 @@
|
|||
(function () {
|
||||
var Router = Backbone.Router.extend({
|
||||
routes: {
|
||||
"": "home", // #home
|
||||
"explore/:section": "explore", // #explore/active
|
||||
"maps/:id": "maps" // #maps/7
|
||||
},
|
||||
explore: function (section) {
|
||||
console.log(section);
|
||||
},
|
||||
maps: function (id) {
|
||||
console.log(id);
|
||||
}
|
||||
});
|
||||
Metamaps.Router = new Router();
|
||||
Metamaps.Router.init = function () {
|
||||
Backbone.history.start({
|
||||
pushState: true,
|
||||
root: ''
|
||||
});
|
||||
console.log('router started');
|
||||
$(document).on("click", "a:not([data-bypass])", function (evt) {
|
||||
var href = {
|
||||
prop: $(this).prop("href"),
|
||||
attr: $(this).attr("href")
|
||||
};
|
||||
var root = location.protocol + "//" + location.host + Backbone.history.options.root;
|
||||
|
||||
if (href.prop && href.prop.slice(0, root.length) === root) {
|
||||
evt.preventDefault();
|
||||
Backbone.history.navigate(href.attr, true);
|
||||
}
|
||||
});
|
||||
}
|
||||
})();
|
2713
app/assets/javascripts/metamaps/Metamaps.js
Normal file
2713
app/assets/javascripts/metamaps/Metamaps.js
Normal file
File diff suppressed because it is too large
Load diff
2711
app/assets/javascripts/metamaps/Metamaps.js~
Normal file
2711
app/assets/javascripts/metamaps/Metamaps.js~
Normal file
File diff suppressed because it is too large
Load diff
|
@ -38,9 +38,7 @@
|
|||
<div class="sidebarFilter <%= authenticated? ? 'loggedin' : 'loggedout' %>">
|
||||
<div class="sidebarFilterIcon"></div>
|
||||
<div class="sidebarFilterBox">
|
||||
<h3 class="filterByMetacode">Filter By Metacode</h3><span class="showAll">all</span><span class="hideAll">none</span>
|
||||
<div class="clearfloat"></div>
|
||||
<%= render :partial => 'shared/filterbymetacode' %>
|
||||
<%= render :partial => 'shared/filterBox' %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -79,4 +77,4 @@
|
|||
Metamaps.Topics = <%= @alltopics.to_json.html_safe %>;
|
||||
Metamaps.Synapses = <%= @allsynapses.to_json.html_safe %>;
|
||||
Metamaps.Mappings = <%= @allmappings.to_json.html_safe %>;
|
||||
</script>
|
||||
</script>
|
||||
|
|
82
app/views/maps/show.html.erb~
Normal file
82
app/views/maps/show.html.erb~
Normal file
|
@ -0,0 +1,82 @@
|
|||
<%#
|
||||
# @file
|
||||
# Code to display a map
|
||||
# /maps/:id
|
||||
#%>
|
||||
|
||||
<% content_for :title, @map.name + " | Metamaps" %>
|
||||
|
||||
<div id="preloaded-images">
|
||||
<img src="/assets/MMCCicon_realtime_blue.png" />
|
||||
</div>
|
||||
|
||||
|
||||
<% if authenticated? %>
|
||||
<div class="sidebarFork">
|
||||
<div class="sidebarForkIcon">
|
||||
</div>
|
||||
<div class="sidebarForkBox"></div>
|
||||
</div>
|
||||
<% if @map.permission == "commons" || @map.user == user %>
|
||||
<div class="sidebarCollaborate">
|
||||
<div class="sidebarCollaborateIcon blue"></div>
|
||||
<div class="sidebarCollaborateBox">
|
||||
<h3 class="realtimeBoxTitle">Realtime: </h3>
|
||||
<span class="realtimeOnOff rtOn">ON</span>
|
||||
<div class="clearfloat"></div>
|
||||
<div class="realtimeMapperList">
|
||||
<ul>
|
||||
<li class="rtMapper littleRtOn rtMapperSelf">
|
||||
<%= user.name %> (me)
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div class="sidebarFilter <%= authenticated? ? 'loggedin' : 'loggedout' %>">
|
||||
<div class="sidebarFilterIcon"></div>
|
||||
<div class="sidebarFilterBox">
|
||||
<h3 class="filterByMetacode">Filter By Metacode</h3><span class="showAll">all</span><span class="hideAll">none</span>
|
||||
<div class="clearfloat"></div>
|
||||
<%= render :partial => 'shared/filterBox' %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="index">
|
||||
<div class="openCheatsheet openLightbox" data-open="cheatsheet"></div>
|
||||
<span class="mapInfo"></span>
|
||||
<div class="clearfloat"></div>
|
||||
<%= render :partial => 'maps/mapinfobox' %>
|
||||
</div>
|
||||
|
||||
<div class="maps onMap" id="container">
|
||||
<div id="center-container">
|
||||
<div id="infovis"></div>
|
||||
</div>
|
||||
<div class="showcard" id="showcard"></div>
|
||||
</div>
|
||||
<div class="clearfloat"></div>
|
||||
|
||||
<% if authenticated? %>
|
||||
|
||||
<% # add these if you have edit permissions on the map %>
|
||||
<% if @map.permission == "commons" || @map.user == user %>
|
||||
<% # for creating and pulling in topics and synapses %>
|
||||
<%= render :partial => 'newtopic' %>
|
||||
<%= render :partial => 'newsynapse' %>
|
||||
<% end %>
|
||||
|
||||
<% # for populating the change metacode list on the topic card %>
|
||||
<%= render :partial => 'shared/metacodeoptions' %>
|
||||
<% end %>
|
||||
|
||||
|
||||
<script>
|
||||
Metamaps.Active.Map = <%= @map.to_json.html_safe %>;
|
||||
Metamaps.Metacodes = <%= @allmetacodes.to_json.html_safe %>;
|
||||
Metamaps.Topics = <%= @alltopics.to_json.html_safe %>;
|
||||
Metamaps.Synapses = <%= @allsynapses.to_json.html_safe %>;
|
||||
Metamaps.Mappings = <%= @allmappings.to_json.html_safe %>;
|
||||
</script>
|
44
app/views/shared/_filterBox.html.erb
Normal file
44
app/views/shared/_filterBox.html.erb
Normal file
|
@ -0,0 +1,44 @@
|
|||
<%#
|
||||
# @file
|
||||
# this code generates the list of icons in the filter by metacode box in the upper right menu area
|
||||
#%>
|
||||
|
||||
<%
|
||||
@mappers = []
|
||||
@synapses = []
|
||||
@metacodes = []
|
||||
@metacodelist = ''
|
||||
@mapperlist = ''
|
||||
@synapselist = ''
|
||||
@map.topics.each_with_index do |topic, index|
|
||||
if @metacodes.index(topic.metacode_id) == nil
|
||||
@metacodes.push(topic.metacode_id)
|
||||
@metacodelist += '<li><img src="' + topic.metacode.icon + '" alt="' + topic.metacode.id.to_s + '" /><p>' + topic.metacode.name.downcase + '</p></li>'
|
||||
end
|
||||
end
|
||||
|
||||
@map.synapses.each_with_index do |synapses, index|
|
||||
if @synapses.index(synapses.synapse_id) == nil
|
||||
@synapses.push(synapses.synapse_id)
|
||||
@synapselist += '<li><img src="/assets/images/icons/synapsevisualize.png" alt="' + synapse.id.to_s + '" /><p>' + synapse.name.downcase + '</p></li>'
|
||||
end
|
||||
|
||||
end
|
||||
%>
|
||||
|
||||
<h3 class="filterByMetacode">Filter By Metacode</h3><span class="showAll">all</span><span class="hideAll">none</span>
|
||||
<div class="clearfloat"></div>
|
||||
<div id="filter_by_metacode">
|
||||
<ul>
|
||||
<%= @metacodelist.html_safe %>
|
||||
</ul>
|
||||
<div class="clearfloat"></div>
|
||||
|
||||
<div id="filter_by_synapse">
|
||||
<ul>
|
||||
<%= @synapselist.html_safe %>
|
||||
</ul>
|
||||
<div class="clearfloat"></div>
|
||||
|
||||
</div>
|
||||
</div>
|
42
app/views/shared/_filterBox.html.erb~
Normal file
42
app/views/shared/_filterBox.html.erb~
Normal file
|
@ -0,0 +1,42 @@
|
|||
<%#
|
||||
# @file
|
||||
# this code generates the list of icons in the filter by metacode box in the upper right menu area
|
||||
#%>
|
||||
|
||||
<%
|
||||
@mappers = []
|
||||
@synapses = []
|
||||
@metacodes = []
|
||||
@metacodelist = ''
|
||||
@mapperlist = ''
|
||||
@synapselist = ''
|
||||
@map.topics.each_with_index do |topic, index|
|
||||
if @metacodes.index(topic.metacode_id) == nil
|
||||
@metacodes.push(topic.metacode_id)
|
||||
@metacodelist += '<li><img src="' + topic.metacode.icon + '" alt="' + topic.metacode.id.to_s + '" /><p>' + topic.metacode.name.downcase + '</p></li>'
|
||||
end
|
||||
end
|
||||
|
||||
@map.synapses.each_with_index do |synapses, index|
|
||||
if @synapses.index(synapses.synapse_id) == nil
|
||||
@synapses.push(synapses.synapse_id)
|
||||
@synapselist += '<li><img src="/assets/images/icons/synapsevisualize.png" alt="' + synapse.id.to_s + '" /><p>' + synapse.name.downcase + '</p></li>'
|
||||
end
|
||||
|
||||
end
|
||||
%>
|
||||
|
||||
<h3 class="filterByMetacode">Filter By Metacode</h3><span class="showAll">all</span><span class="hideAll">none</span>
|
||||
<div class="clearfloat"></div>
|
||||
<div id="filter_by_metacode">
|
||||
<ul>
|
||||
<%= @metacodelist.html_safe %>
|
||||
</ul>
|
||||
<div class="clearfloat"></div>
|
||||
|
||||
<div id="filter_by_synapse">
|
||||
<ul>
|
||||
<%= @synapselist.html_safe %>
|
||||
</ul>
|
||||
<div class="clearfloat"></div>
|
||||
</div>
|
258
db/schema.rb
258
db/schema.rb
|
@ -1,129 +1,129 @@
|
|||
# encoding: UTF-8
|
||||
# This file is auto-generated from the current state of the database. Instead
|
||||
# of editing this file, please use the migrations feature of Active Record to
|
||||
# incrementally modify your database, and then regenerate this schema definition.
|
||||
#
|
||||
# Note that this schema.rb definition is the authoritative source for your
|
||||
# database schema. If you need to create the application database on another
|
||||
# system, you should be using db:schema:load, not running all the migrations
|
||||
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
||||
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
||||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20140707161810) do
|
||||
|
||||
create_table "in_metacode_sets", :force => true do |t|
|
||||
t.integer "metacode_id"
|
||||
t.integer "metacode_set_id"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
add_index "in_metacode_sets", ["metacode_id"], :name => "index_in_metacode_sets_on_metacode_id"
|
||||
add_index "in_metacode_sets", ["metacode_set_id"], :name => "index_in_metacode_sets_on_metacode_set_id"
|
||||
|
||||
create_table "mappings", :force => true do |t|
|
||||
t.text "category"
|
||||
t.integer "xloc"
|
||||
t.integer "yloc"
|
||||
t.integer "topic_id"
|
||||
t.integer "synapse_id"
|
||||
t.integer "map_id"
|
||||
t.integer "user_id"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "maps", :force => true do |t|
|
||||
t.text "name"
|
||||
t.boolean "arranged"
|
||||
t.text "desc"
|
||||
t.text "permission"
|
||||
t.integer "user_id"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.boolean "featured"
|
||||
end
|
||||
|
||||
create_table "metacode_sets", :force => true do |t|
|
||||
t.string "name"
|
||||
t.text "desc"
|
||||
t.integer "user_id"
|
||||
t.boolean "mapperContributed"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
add_index "metacode_sets", ["user_id"], :name => "index_metacode_sets_on_user_id"
|
||||
|
||||
create_table "metacodes", :force => true do |t|
|
||||
t.text "name"
|
||||
t.string "icon"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "synapses", :force => true do |t|
|
||||
t.text "desc"
|
||||
t.text "category"
|
||||
t.text "weight"
|
||||
t.text "permission"
|
||||
t.integer "node1_id"
|
||||
t.integer "node2_id"
|
||||
t.integer "user_id"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "topics", :force => true do |t|
|
||||
t.text "name"
|
||||
t.text "desc"
|
||||
t.text "link"
|
||||
t.text "permission"
|
||||
t.integer "user_id"
|
||||
t.integer "metacode_id"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.string "image_file_name"
|
||||
t.string "image_content_type"
|
||||
t.integer "image_file_size"
|
||||
t.datetime "image_updated_at"
|
||||
t.string "audio_file_name"
|
||||
t.string "audio_content_type"
|
||||
t.integer "audio_file_size"
|
||||
t.datetime "audio_updated_at"
|
||||
end
|
||||
|
||||
create_table "users", :force => true do |t|
|
||||
t.string "name"
|
||||
t.string "email"
|
||||
t.text "settings"
|
||||
t.string "code", :limit => 8
|
||||
t.string "joinedwithcode", :limit => 8
|
||||
t.string "crypted_password"
|
||||
t.string "password_salt"
|
||||
t.string "persistence_token"
|
||||
t.string "perishable_token"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.string "encrypted_password", :limit => 128, :default => ""
|
||||
t.string "remember_token"
|
||||
t.datetime "remember_created_at"
|
||||
t.string "reset_password_token"
|
||||
t.datetime "last_sign_in_at"
|
||||
t.string "last_sign_in_ip"
|
||||
t.integer "sign_in_count", :default => 0
|
||||
t.datetime "current_sign_in_at"
|
||||
t.string "current_sign_in_ip"
|
||||
t.datetime "reset_password_sent_at"
|
||||
t.boolean "admin"
|
||||
t.string "image_file_name"
|
||||
t.string "image_content_type"
|
||||
t.integer "image_file_size"
|
||||
t.datetime "image_updated_at"
|
||||
end
|
||||
|
||||
add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true
|
||||
|
||||
end
|
||||
# encoding: UTF-8
|
||||
# This file is auto-generated from the current state of the database. Instead
|
||||
# of editing this file, please use the migrations feature of Active Record to
|
||||
# incrementally modify your database, and then regenerate this schema definition.
|
||||
#
|
||||
# Note that this schema.rb definition is the authoritative source for your
|
||||
# database schema. If you need to create the application database on another
|
||||
# system, you should be using db:schema:load, not running all the migrations
|
||||
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
||||
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
||||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20140707161810) do
|
||||
|
||||
create_table "in_metacode_sets", :force => true do |t|
|
||||
t.integer "metacode_id"
|
||||
t.integer "metacode_set_id"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
add_index "in_metacode_sets", ["metacode_id"], :name => "index_in_metacode_sets_on_metacode_id"
|
||||
add_index "in_metacode_sets", ["metacode_set_id"], :name => "index_in_metacode_sets_on_metacode_set_id"
|
||||
|
||||
create_table "mappings", :force => true do |t|
|
||||
t.text "category"
|
||||
t.integer "xloc"
|
||||
t.integer "yloc"
|
||||
t.integer "topic_id"
|
||||
t.integer "synapse_id"
|
||||
t.integer "map_id"
|
||||
t.integer "user_id"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "maps", :force => true do |t|
|
||||
t.text "name"
|
||||
t.boolean "arranged"
|
||||
t.text "desc"
|
||||
t.text "permission"
|
||||
t.integer "user_id"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.boolean "featured"
|
||||
end
|
||||
|
||||
create_table "metacode_sets", :force => true do |t|
|
||||
t.string "name"
|
||||
t.text "desc"
|
||||
t.integer "user_id"
|
||||
t.boolean "mapperContributed"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
add_index "metacode_sets", ["user_id"], :name => "index_metacode_sets_on_user_id"
|
||||
|
||||
create_table "metacodes", :force => true do |t|
|
||||
t.text "name"
|
||||
t.string "icon"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "synapses", :force => true do |t|
|
||||
t.text "desc"
|
||||
t.text "category"
|
||||
t.text "weight"
|
||||
t.text "permission"
|
||||
t.integer "node1_id"
|
||||
t.integer "node2_id"
|
||||
t.integer "user_id"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "topics", :force => true do |t|
|
||||
t.text "name"
|
||||
t.text "desc"
|
||||
t.text "link"
|
||||
t.text "permission"
|
||||
t.integer "user_id"
|
||||
t.integer "metacode_id"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.string "image_file_name"
|
||||
t.string "image_content_type"
|
||||
t.integer "image_file_size"
|
||||
t.datetime "image_updated_at"
|
||||
t.string "audio_file_name"
|
||||
t.string "audio_content_type"
|
||||
t.integer "audio_file_size"
|
||||
t.datetime "audio_updated_at"
|
||||
end
|
||||
|
||||
create_table "users", :force => true do |t|
|
||||
t.string "name"
|
||||
t.string "email"
|
||||
t.text "settings"
|
||||
t.string "code", :limit => 8
|
||||
t.string "joinedwithcode", :limit => 8
|
||||
t.string "crypted_password"
|
||||
t.string "password_salt"
|
||||
t.string "persistence_token"
|
||||
t.string "perishable_token"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.string "encrypted_password", :limit => 128, :default => ""
|
||||
t.string "remember_token"
|
||||
t.datetime "remember_created_at"
|
||||
t.string "reset_password_token"
|
||||
t.datetime "last_sign_in_at"
|
||||
t.string "last_sign_in_ip"
|
||||
t.integer "sign_in_count", :default => 0
|
||||
t.datetime "current_sign_in_at"
|
||||
t.string "current_sign_in_ip"
|
||||
t.datetime "reset_password_sent_at"
|
||||
t.boolean "admin"
|
||||
t.string "image_file_name"
|
||||
t.string "image_content_type"
|
||||
t.integer "image_file_size"
|
||||
t.datetime "image_updated_at"
|
||||
end
|
||||
|
||||
add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue