added comments, heavily interspersed with TODO's, to every view

This commit is contained in:
Devin Howard 2013-01-11 18:49:59 -05:00
parent c26b45230f
commit 6aed92d22d
45 changed files with 284 additions and 29 deletions

View file

@ -1,3 +1,8 @@
<%#
# @file
# Google analytics, rendered on every page
#%>
<script type="text/javascript">
var _gaq = _gaq || [];
@ -10,4 +15,4 @@
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</script>

View file

@ -1,3 +1,10 @@
<%#
# @file
# Main application file. Holds scaffolding present on every page.
# Then a certain non-partial view (no _ preceding filename) will be
# displayed within, based on URL
#%>
<!DOCTYPE html>
<html>
<head>

View file

@ -1,6 +1,10 @@
<%#
# @file
# Analyze partial view. New options for the analyze menu go here.
#%>
<span id="closeAnalyze" class="closeSideOption">close</span>
<div class="sideOption" id="sideOptionAnalyze">
<span class="find_key">Analyze...</span>
<div class="clearfloat"></div>
<div class="analysis"></div>
</div>
</div>

View file

@ -1,3 +1,7 @@
<%#
# @file
# Find partial view. New options for the find menu go here.
#%>
<span id="closeFind" class="closeSideOption">close</span>
<form id="findWhere">
<span class="findWhereField onCanvas"><input type="checkbox" id="onCanvas"><p>On my Canvas</p></span>
@ -73,4 +77,4 @@
<%= text_field_tag(:synapses_by_user_id, "", :id => "synapsesByUser", :class => "getTopicsInput") %>
<%= text_field_tag(:synapses_by_map_id, "", :id => "synapsesByMap", :class => "getTopicsInput") %>
<% end %>
</div>
</div>

View file

@ -1,5 +1,9 @@
<%#
# @file
# Organize partial view. New options for the organize menu go here.
#%>
<span id="closeOrganize" class="closeSideOption">close</span>
<div class="sideOption" id="sideOptionOrganize">
<!-- <span class="find_key" onclick="setTimeout(function(){organize();},0)">Organize...</span> -->
<span class="find_key">Organize...</span>
</div>
</div>

View file

@ -1,3 +1,9 @@
<%#
# @file
# View rendering each map as a card, or empty message. Shows all regardless
# of authentication.
# TODO: What url is this located at?
#%>
<h1>All Maps</h1>
<div class="maps" id="cards">
@ -8,4 +14,4 @@
<p><br>Shucks, there are no maps.<p>
<% end %>
</div>
<div class="clearfloat"></div>
<div class="clearfloat"></div>

View file

@ -1,3 +1,10 @@
<%#
# @file
# Located at /console
# Console view has the Find/Analyze/Organize tabs, and starts mostly empty
# so it's kind of like a workspace. You can then save to map, etc.
# Emphasis is on pulling in and creating data.
#%>
<div class="headertop">
<button onclick="hideSelectedEdges();hideSelectedNodes();">Hide Selected</button>
<% if authenticated? %>
@ -33,4 +40,4 @@
<%= render :partial => 'find' %>
<%= render :partial => 'analyze' %>
<%= render :partial => 'organize' %>
<%= render :partial => 'organize' %>

View file

@ -1,3 +1,8 @@
<%#
# @file
# Located at /
# Shows 3 most recently created topics, synapses, and maps.
#%>
<div class="profile">
<h2>Recently Created Topics <%= link_to "see all", topics_url%></h2>
@ -28,4 +33,4 @@
<h1 class="index">
Home
</h1>
</h1>

View file

@ -1,3 +1,8 @@
<%#
# @file
# TODO: Where is this file located?
# Page allowing users to invite others to Metamaps.
#%>
<div class="invite">
<h3>Invite Others</h3>
<p>You can invite others to the Metamaps platform. Just send them the link to</p><p><strong>http://metamaps.cc/users/new</strong></p><p>and give them the access code shown below.</p>

View file

@ -1,3 +1,10 @@
<%#
# @file
# TODO: Where is this file located?
# TODO: What does this file do?
# TODO: Is this code old or in use?
# I think it shows all topics, and is deprecated. -Devin
#%>
<% unless @topic.nil? %>
<div class="home" id="container">
<div id="center-container">

View file

@ -1,3 +1,8 @@
/*
* @file
* This javascript code is run when you execute a search query.
* From the "Find"/"Seek" tab on the console.
*/
$('.getTopicsInput').attr('value','');
var h = Mconsole.canvas.element.clientHeight / 2;

View file

@ -1,3 +1,10 @@
<%#
# @file
# Shows a map as a card.
# I believe this is rendered on the profile pages.
# TODO: Am I correct?
# TODO: Is it rendered on any other pages?
#%>
<%= div_for map do %>
<% if map.user == user %><%= link_to 'Delete', map_path(map), :class => 'delete', :confirm => 'Delete this map (nodes and synapses will remain)?', :method => :delete, :remote => true %><% end %>
<p class="type">Map</p>
@ -21,4 +28,4 @@
<p><%= map.desc %></p>
</div>
</div>
<% end %>
<% end %>

View file

@ -1,3 +1,7 @@
<%#
# @file
# Partial view, renders a form that creates a new map.
#%>
<div class="onConsole">
<%= form_for Map.new, url: maps_url, remote: true do |form|%>
<h3>Save to Map</h3>

View file

@ -1,3 +1,8 @@
<%#
# @file
# partial generating a new synapse
# TODO: Where is this code used?
#%>
<div class="anypage">
<%= form_for Synapse.new, url: synapses_url, remote: true do |form| %>
<%= form.autocomplete_field :desc, autocomplete_synapse_desc_synapses_path, :placeholder => "Describe the connection..." %>
@ -5,4 +10,4 @@
<%= form.hidden_field :topic2id, :value => 0 %>
<%= form.hidden_field :map, :value => @map.id %>
<% end %>
</div>
</div>

View file

@ -1,3 +1,7 @@
<%#
# Partial rendering form for a new topic on a map
# TODO: Where is this code used?
#%>
<div class="anypage">
<%= form_for Topic.new, url: topics_url, remote: true do |form| %>
<div id="metacodeImg"><img class="cloudcarousel" width="40" height="40" src="/assets/action.png" alt="Action" title="Action"/><img class="cloudcarousel" width="40" height="40" src="/assets/activity.png" alt="Activity" title="Activity"/><img class="cloudcarousel" width="40" height="40" src="/assets/bizarre.png" alt="Bizarre" title="Bizarre"/><img class="cloudcarousel" width="40" height="40" src="/assets/catalyst.png" alt="Catalyst" title="Catalyst"/><img class="cloudcarousel" width="40" height="40" src="/assets/closed.png" alt="Closed" title="Closed"/><img class="cloudcarousel" width="40" height="40" src="/assets/experience.png" alt="Experience" title="Experience"/><img class="cloudcarousel" width="40" height="40" src="/assets/futuredev.png" alt="Future Dev" title="Future Dev"/><img class="cloudcarousel" width="40" height="40" src="/assets/group.png" alt="Group" title="Group"/><img class="cloudcarousel" width="40" height="40" src="/assets/idea.png" alt="Idea" title="Idea"/><img class="cloudcarousel" width="40" height="40" src="/assets/implication.png" alt="Implication" title="Implication"/><img class="cloudcarousel" width="40" height="40" src="/assets/insight.png" alt="Insight" title="Insight"/><img class="cloudcarousel" width="40" height="40" src="/assets/intention.png" alt="Intention" title="Intention"/><img class="cloudcarousel" width="40" height="40" src="/assets/knowledge.png" alt="Knowledge" title="Knowledge"/><img class="cloudcarousel" width="40" height="40" src="/assets/location.png" alt="Location" title="Location"/><img class="cloudcarousel" width="40" height="40" src="/assets/openissue.png" alt="Open Issue" title="Open Issue"/><img class="cloudcarousel" width="40" height="40" src="/assets/opinion.png" alt="Opinion" title="Opinion"/><img class="cloudcarousel" width="40" height="40" src="/assets/opportunity.png" alt="Opportunity" title="Opportunity"/><img class="cloudcarousel" width="40" height="40" src="/assets/person.png" alt="Person" title="Person"/><img class="cloudcarousel" width="40" height="40" src="/assets/platform.png" alt="Platform" title="Platform"/><img class="cloudcarousel" width="40" height="40" src="/assets/problem.png" alt="Problem" title="Problem"/><img class="cloudcarousel" width="40" height="40" src="/assets/question.png" alt="Question" title="Question"/><img class="cloudcarousel" width="40" height="40" src="/assets/reference.png" alt="Reference" title="Reference"/><img class="cloudcarousel" width="40" height="40" src="/assets/requirement.png" alt="Requirement" title="Requirement"/><img class="cloudcarousel" width="40" height="40" src="/assets/resource.png" alt="Resource" title="Resource"/><img class="cloudcarousel" width="40" height="40" src="/assets/role.png" alt="Role" title="Role"/><img class="cloudcarousel" width="40" height="40" src="/assets/task.png" alt="Task" title="Task"/><img class="cloudcarousel" width="40" height="40" src="/assets/tool.png" alt="Tool" title="Tool"/><img class="cloudcarousel" width="40" height="40" src="/assets/trajectory.png" alt="Trajectory" title="Trajectory"/></div>
@ -13,4 +17,4 @@
<!--<input id="right-but" type="button" value="Right" />-->
<div class="clearfloat"></div>
<% end %>
</div>
</div>

View file

@ -1,3 +1,7 @@
/*
* @file
* Javascript run on creation of a new map
*/
$('#map_name').val('');
$('#map_desc').val('');
$('#map_permission').val('commons');
@ -15,4 +19,4 @@ function closeIt() {
$('#new_map').fadeOut('fast', function(){
$('#new_map').html(tempForm);
});
}
}

View file

@ -1 +1,5 @@
$('#<%= dom_id(@map) %>').fadeOut('slow');
/*
* @file
* Javascript run on destruction of a map. Fades it out from map index.
*/
$('#<%= dom_id(@map) %>').fadeOut('slow');

View file

@ -1,3 +1,9 @@
<%#
# @file
# Form for editing a map
# TODO: I think this code is no longer in use. Is it?
# TODO: What URL is this accessible at?
#%>
<%= form_for @map, url: map_url(@map) do |form| %>
<h3>Edit Map</h3>
<label for="map_name">Name</label>

View file

@ -1,3 +1,8 @@
<%#
# @file
# Shows a list of all maps, or just a user's maps.
# TODO: What url is this accessible at?
#%>
<h1 class="index"><% if @user %><%= @user.name %>'s<% end %> Maps</h1>
<div class="maps" id="cards">
@ -8,4 +13,4 @@
<p class="empty"><br>Shucks, there are no maps. <% if authenticated? %><%= link_to "Create one if you want.", new_map_url %><% end %></p>
<% end %>
</div>
<div class="clearfloat"></div>
<div class="clearfloat"></div>

View file

@ -1,3 +1,9 @@
<%#
# @file
# Form to create a new map.
# TODO: What URL is this accessible from?
# TODO: Is this code being used anymore?
#%>
<div class="nothidden">
<%= form_for @map || Map.new, url: maps_url do |form|%>
<h3>Add Map</h3>

View file

@ -1,3 +1,8 @@
/*
* @file
* Javascript code for realtime callbacks
* TODO: Connor, could you explain this code sometime?
*/
var tempForT, tempForS, tempForM;
<% @topics.each do |topic| %>
@ -86,4 +91,4 @@ var tempForT, tempForS, tempForM;
transition: $jit.Trans.Quad.easeInOut,
duration: 500
});
<% end %>
<% end %>

View file

@ -1,2 +1,6 @@
/*
* @file
* Javascript executed when you save the layout of a map.
*/
$('#saveLayout').attr('value','Saved!');
setTimeout(function(){$('#saveLayout').attr('value','Save Layout')},1500);
setTimeout(function(){$('#saveLayout').attr('value','Save Layout')},1500);

View file

@ -1,3 +1,10 @@
<%#
# @file
# Code to display a map
# TODO: Where is this accessible from?
# Top card is currently hidden to just show beautiful expanses of unadultered
# mappy goodness.
#%>
<!--<div class="focus">
<div class="focusleft">
<p># of Topics: <%= @map.topics.count %></p>
@ -105,4 +112,4 @@
<%= render :partial => 'main/find' %>
<%= render :partial => 'main/analyze' %>
<%= render :partial => 'main/organize' %>
<%= render :partial => 'main/organize' %>

View file

@ -1,3 +1,8 @@
<%#
# @file
# Located at /sessions/new
# Form to log in
#%>
<%= form_for @session || Session.new, url: session_path do |form| %>
<h3>Login</h3>
<label for="session_email">Email</label>
@ -5,4 +10,4 @@
<label for="session_password">Password</label>
<%= form.password_field :password, class: "password" %>
<%= form.submit "Login", class: "add" %>
<% end %>
<% end %>

View file

@ -1,7 +1,12 @@
<%#
# @file
# Partial for rendered a new synapse form
# TODO: Is this used? Where?
#%>
<div class="anypage">
<%= form_for Synapse.new, url: synapses_url, remote: true do |form| %>
<%= form.autocomplete_field :desc, autocomplete_synapse_desc_synapses_path, :placeholder => "Describe the connection..." %>
<%= form.hidden_field :topic1id, :value => 0 %>
<%= form.hidden_field :topic2id, :value => 0 %>
<% end %>
</div>
</div>

View file

@ -1,3 +1,8 @@
<%#
# @file
# Render a synapse
# TODO: Where is this code used?
#%>
<%= div_for synapse do %>
<div class="synapseTopic1">
<p class="topic1desc"><%= link_to synapse.topic1.name, topic_url(synapse.topic1) %></p>
@ -8,4 +13,4 @@
<%= image_tag synapse.topic2.metacode.icon, :class => 'icon', :size => '50x50' %>
<p class="topic2desc"><%= link_to synapse.topic2.name, topic_url(synapse.topic2) %></p>
</div>
<% end %>
<% end %>

View file

@ -1,3 +1,7 @@
/*
* @file
* Javascript called when you create a new synapse.
*/
$('#new_synapse').fadeOut('fast');
$('#synapse_desc').attr('value','');
$('#synapse_topic1id').attr('value','0');

View file

@ -0,0 +1,4 @@
/*
* @file
* Javascript called when you destroy a node
*/

View file

@ -1,3 +1,10 @@
<%#
# @file
# Synapse creation form. OOOOOLD!
# TODO: Is it actually old, or is it in use?
# Can probably be removed, otherwise:
# TODO: What URL is this?
#%>
<%= form_for @synapse, url: synapse_url do |form| %>
<h3>Edit Synapse</h3>
<% if Topic.visibleToUser(user, nil).count > 0 %>
@ -15,4 +22,4 @@
<label for="synapse_permission">Permission</label>
<%= form.select :permission, options_for_select(['commons', 'public', 'private'], @synapse.permission) %>
<%= form.submit "Update", class: "update" %>
<% end %>
<% end %>

View file

@ -1,3 +1,9 @@
<%#
# @file
# Render all synapses, or all of a user's synapses
# Fun fact: this is Devin's favourite view!
# TODO: What URL is this?
#%>
<h1 class="index"><% if @user %><%= @user.name %>'s<% end %> Synapses</h1>
<div class="synapses" id="container">

View file

@ -1,3 +1,9 @@
<%#
# @file
# Synapse creation form
# I think this code is no longer in use.
# TODO: Am I correct?
#%>
<div class="newsynapses">
<%= form_for @synapse, url: synapses_url do |form| %>
<h3>Add Synapse Between Topics</h3>
@ -17,4 +23,4 @@
<%= form.select(:permission, options_for_select(['commons', 'public', 'private'])) %>
<%= form.submit "Add Synapse", class: "add" %>
<% end %>
</div>
</div>

View file

@ -0,0 +1,5 @@
/*
* @file
* Javascript executed when a synapse is removed from a map
* TODO: Is this file even used?
*/

View file

@ -1,3 +1,9 @@
<%#
# @file
# View all synapses.
# TODO: Is this code used?
# TODO: What URL is it?
#%>
<div class="relatives" id="container">
<div id="center-container">
<div id="infovis"></div>
@ -18,4 +24,4 @@
<% if authenticated? %>
<%= render :partial => 'topics/new' %>
<%= render :partial => 'synapses/new' %>
<% end %>
<% end %>

View file

@ -1,3 +1,9 @@
<%#
# @file
# This file contains code for rendering a new topic form.
# TODO: What code actually calls this? Is it old?
#%>
<div class="anypage">
<%= form_for Topic.new, url: topics_url, remote: true do |form| %>
<div id="metacodeImg"><img class="cloudcarousel" width="40" height="40" src="/assets/action.png" alt="Action" title="Action"/><img class="cloudcarousel" width="40" height="40" src="/assets/activity.png" alt="Activity" title="Activity"/><img class="cloudcarousel" width="40" height="40" src="/assets/bizarre.png" alt="Bizarre" title="Bizarre"/><img class="cloudcarousel" width="40" height="40" src="/assets/catalyst.png" alt="Catalyst" title="Catalyst"/><img class="cloudcarousel" width="40" height="40" src="/assets/closed.png" alt="Closed" title="Closed"/><img class="cloudcarousel" width="40" height="40" src="/assets/experience.png" alt="Experience" title="Experience"/><img class="cloudcarousel" width="40" height="40" src="/assets/futuredev.png" alt="Future Dev" title="Future Dev"/><img class="cloudcarousel" width="40" height="40" src="/assets/group.png" alt="Group" title="Group"/><img class="cloudcarousel" width="40" height="40" src="/assets/idea.png" alt="Idea" title="Idea"/><img class="cloudcarousel" width="40" height="40" src="/assets/implication.png" alt="Implication" title="Implication"/><img class="cloudcarousel" width="40" height="40" src="/assets/insight.png" alt="Insight" title="Insight"/><img class="cloudcarousel" width="40" height="40" src="/assets/intention.png" alt="Intention" title="Intention"/><img class="cloudcarousel" width="40" height="40" src="/assets/knowledge.png" alt="Knowledge" title="Knowledge"/><img class="cloudcarousel" width="40" height="40" src="/assets/location.png" alt="Location" title="Location"/><img class="cloudcarousel" width="40" height="40" src="/assets/openissue.png" alt="Open Issue" title="Open Issue"/><img class="cloudcarousel" width="40" height="40" src="/assets/opinion.png" alt="Opinion" title="Opinion"/><img class="cloudcarousel" width="40" height="40" src="/assets/opportunity.png" alt="Opportunity" title="Opportunity"/><img class="cloudcarousel" width="40" height="40" src="/assets/person.png" alt="Person" title="Person"/><img class="cloudcarousel" width="40" height="40" src="/assets/platform.png" alt="Platform" title="Platform"/><img class="cloudcarousel" width="40" height="40" src="/assets/problem.png" alt="Problem" title="Problem"/><img class="cloudcarousel" width="40" height="40" src="/assets/question.png" alt="Question" title="Question"/><img class="cloudcarousel" width="40" height="40" src="/assets/reference.png" alt="Reference" title="Reference"/><img class="cloudcarousel" width="40" height="40" src="/assets/requirement.png" alt="Requirement" title="Requirement"/><img class="cloudcarousel" width="40" height="40" src="/assets/resource.png" alt="Resource" title="Resource"/><img class="cloudcarousel" width="40" height="40" src="/assets/role.png" alt="Role" title="Role"/><img class="cloudcarousel" width="40" height="40" src="/assets/task.png" alt="Task" title="Task"/><img class="cloudcarousel" width="40" height="40" src="/assets/tool.png" alt="Tool" title="Tool"/><img class="cloudcarousel" width="40" height="40" src="/assets/trajectory.png" alt="Trajectory" title="Trajectory"/></div>

View file

@ -1,3 +1,9 @@
<%#
# @file
# This file renders a card showing a topic
# TODO: Is this code in use or deprecated? What's it's purpose?
#%>
<%= div_for topic do %>
<div class="CardOnGraph"
id="topic_<%=topic.id %>">

View file

@ -1,3 +1,8 @@
/*
* @file
* This javascript is returned and executed when you create a new node.
*/
$('#new_topic').fadeOut('fast');
$('#topic_name').data().autocomplete.term = null;
$('.ui-autocomplete').children().remove();

View file

@ -1,3 +1,9 @@
/*
* @file
* The javascript returned when destroy is called in the topic controller
* This happens when a DELETE is sent to /topics/:id
*/
if (Mconsole != null) {
var node = Mconsole.graph.getNode(<%= @topic.id %>);
node.setData('alpha', 0, 'end');
@ -14,4 +20,4 @@ if (Mconsole != null) {
}
else {
$('#<%= dom_id(@topic) %>').fadeOut('slow');
}
}

View file

@ -1,3 +1,9 @@
<%#
# @file
# This code renders the edit form. It is not used anymore; we use
# best_in_place instead.
#%>
<%= form_for @topic, url: topic_url do |form| %>
<h3>Edit Topic</h3>
<label for="category">Category</label>
@ -11,4 +17,4 @@
<label for="topic_permission">Permission</label>
<%= form.select :permission, options_for_select(['commons', 'public', 'private'], @topic.permission) %>
<%= form.submit "Update", class: "update" %>
<% end %>
<% end %>

View file

@ -1,3 +1,10 @@
<%#
# @file
# This view shows an index of all topics, or just your topics if you're
# logged in
# TODO: What URL accesses this view?
#%>
<h1 class="index"><% if @user %><%= @user.name %>'s <% end %>Topics</h1>
<div class="topics" id="cards">
@ -25,4 +32,4 @@
$(this).parent().find('.go-link').attr('href', link);
});
</script>
</script>

View file

@ -1,3 +1,8 @@
<%#
# @file
# This file is a form for creating new topics. It is no longer used.
#%>
<div class="nothidden">
<%= form_for @topic || Topic.new, url: topics_path do |form| %>
<h3>Add Topic</h3>
@ -13,4 +18,4 @@
<%= form.select(:permission, options_for_select(['commons', 'public', 'private'])) %>
<%= form.submit "Add Topic", class: "addTopic", id: "addTopic" %>
<% end %>
</div>
</div>

View file

@ -1,3 +1,12 @@
/*
* @file
* This code removes a mapping from a topic on to a map, which removes the
* topic from that map.
* TODO: is this code still used?
* TODO: What URL accesses this code?
*/
if (Mconsole != null) {
var node = Mconsole.graph.getNode(<%= @mapping.topic_id %>);
node.setData('alpha', 0, 'end');
@ -11,4 +20,4 @@ if (Mconsole != null) {
});
Mconsole.graph.removeNode(<%= @mapping.topic_id %>);
Mconsole.labels.disposeLabel(<%= @mapping.topic_id %>);
}
}

View file

@ -1,3 +1,19 @@
<%#
# @file
# This shows a topic view. It is used.
# The first commented out section used to be a card at the top showing all
# info. Now we're moving towards most screens looking the same. The
# consequence of accessing data from this view is that you can't remove
# the topic that corresponds to the page you're on. Originally, accessing this
# page showed the topic with its neighbours arrayed around. Now it shows the
# same, but there's no cues to say which topic's page you're on. So when the
# map recenters on a new topic, it's like you're on that topic's page.
# Nice, but the URL and being unable to remove the root node still hamper that
# experience.
# TODO: What URL accesses this view?
#
#%>
<!--<div class="focus topic_<%= @topic.id %>">
<div class="focusleft">
<p><%= @topic.metacode.name %></p>

View file

@ -1,7 +1,12 @@
<%#
# @file
# TODO: What URL is this?
# User edit form
#%>
<%= formula_form_for @user, url: user_url do |form| %>
<h3>Edit Account</h3>
<%= form.input :name, label: "Name", class: "name" %>
<%= form.input :email, label: "Email", class: "email" %>
<%= form.input :password, label: "Password", class: "password" %>
<%= form.submit "Update", class: "update" %>
<% end %>
<% end %>

View file

@ -1,3 +1,8 @@
<%#
# @file
# Located at /users/new
# New user form
#%>
<%= formula_form_for @user, url: users_url do |form| %>
<h3>Create Account</h3>
<%= form.input :name, label: "Name", class: "name" %>

View file

@ -1,3 +1,9 @@
<%#
# @file
# User profile page
# TODO: What URL?
# TODO: Is this code used?
#%>
<!--<div class="focus">
<div class="focusleft">
<p># of Topics: <%= @user.topics.count %></p>
@ -47,4 +53,4 @@
<h1 class="index">
Viewing Mapper: <%= @user.name %>
</h1>
</h1>