From 6aed92d22d931993fa599e1cf2c69f6c29f9aac9 Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Fri, 11 Jan 2013 18:49:59 -0500 Subject: [PATCH] added comments, heavily interspersed with TODO's, to every view --- app/views/layouts/_ga.html.erb | 7 ++++++- app/views/layouts/application.html.erb | 7 +++++++ app/views/main/_analyze.html.erb | 6 +++++- app/views/main/_find.html.erb | 6 +++++- app/views/main/_organize.html.erb | 6 +++++- app/views/main/allmaps.html.erb | 8 +++++++- app/views/main/console.html.erb | 9 ++++++++- app/views/main/home.html.erb | 7 ++++++- app/views/main/invite.html.erb | 5 +++++ app/views/main/metamap.html.erb | 7 +++++++ app/views/main/search.js.erb | 5 +++++ app/views/maps/_map.html.erb | 9 ++++++++- app/views/maps/_new.html.erb | 4 ++++ app/views/maps/_newsynapse.html.erb | 7 ++++++- app/views/maps/_newtopic.html.erb | 6 +++++- app/views/maps/create.js.erb | 6 +++++- app/views/maps/destroy.js.erb | 6 +++++- app/views/maps/edit.html.erb | 6 ++++++ app/views/maps/index.html.erb | 7 ++++++- app/views/maps/new.html.erb | 6 ++++++ app/views/maps/realtime.js.erb | 7 ++++++- app/views/maps/savelayout.js.erb | 6 +++++- app/views/maps/show.html.erb | 9 ++++++++- app/views/sessions/new.html.erb | 7 ++++++- app/views/synapses/_new.html.erb | 7 ++++++- app/views/synapses/_synapse.html.erb | 7 ++++++- app/views/synapses/create.js.erb | 4 ++++ app/views/synapses/destroy.js.erb | 4 ++++ app/views/synapses/edit.html.erb | 9 ++++++++- app/views/synapses/index.html.erb | 6 ++++++ app/views/synapses/new.html.erb | 8 +++++++- app/views/synapses/removefrommap.js.erb | 5 +++++ app/views/synapses/show.html.erb | 8 +++++++- app/views/topics/_new.html.erb | 6 ++++++ app/views/topics/_topic.html.erb | 6 ++++++ app/views/topics/create.js.erb | 5 +++++ app/views/topics/destroy.js.erb | 8 +++++++- app/views/topics/edit.html.erb | 8 +++++++- app/views/topics/index.html.erb | 9 ++++++++- app/views/topics/new.html.erb | 7 ++++++- app/views/topics/removefrommap.js.erb | 11 ++++++++++- app/views/topics/show.html.erb | 16 ++++++++++++++++ app/views/users/edit.html.erb | 7 ++++++- app/views/users/new.html.erb | 5 +++++ app/views/users/show.html.erb | 8 +++++++- 45 files changed, 284 insertions(+), 29 deletions(-) diff --git a/app/views/layouts/_ga.html.erb b/app/views/layouts/_ga.html.erb index b2667b2f..1e909cad 100644 --- a/app/views/layouts/_ga.html.erb +++ b/app/views/layouts/_ga.html.erb @@ -1,3 +1,8 @@ +<%# + # @file + # Google analytics, rendered on every page + #%> + \ No newline at end of file + diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index a6f9dc2e..25514526 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -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 + #%> + diff --git a/app/views/main/_analyze.html.erb b/app/views/main/_analyze.html.erb index c4f92841..c96d3cb6 100644 --- a/app/views/main/_analyze.html.erb +++ b/app/views/main/_analyze.html.erb @@ -1,6 +1,10 @@ +<%# + # @file + # Analyze partial view. New options for the analyze menu go here. + #%> close
Analyze...
-
\ No newline at end of file + diff --git a/app/views/main/_find.html.erb b/app/views/main/_find.html.erb index cbf05fd4..b9e5d335 100644 --- a/app/views/main/_find.html.erb +++ b/app/views/main/_find.html.erb @@ -1,3 +1,7 @@ +<%# + # @file + # Find partial view. New options for the find menu go here. + #%> close

On my Canvas

@@ -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 %> - \ No newline at end of file + diff --git a/app/views/main/_organize.html.erb b/app/views/main/_organize.html.erb index a34f2680..05a723f0 100644 --- a/app/views/main/_organize.html.erb +++ b/app/views/main/_organize.html.erb @@ -1,5 +1,9 @@ +<%# + # @file + # Organize partial view. New options for the organize menu go here. + #%> close
Organize... -
\ No newline at end of file + diff --git a/app/views/main/allmaps.html.erb b/app/views/main/allmaps.html.erb index dbe8b55d..05a60a18 100644 --- a/app/views/main/allmaps.html.erb +++ b/app/views/main/allmaps.html.erb @@ -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? + #%>

All Maps

@@ -8,4 +14,4 @@


Shucks, there are no maps.

<% end %>

-
\ No newline at end of file +
diff --git a/app/views/main/console.html.erb b/app/views/main/console.html.erb index 6d41dfab..b992b2fd 100644 --- a/app/views/main/console.html.erb +++ b/app/views/main/console.html.erb @@ -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. + #%>
<% if authenticated? %> @@ -33,4 +40,4 @@ <%= render :partial => 'find' %> <%= render :partial => 'analyze' %> -<%= render :partial => 'organize' %> \ No newline at end of file +<%= render :partial => 'organize' %> diff --git a/app/views/main/home.html.erb b/app/views/main/home.html.erb index 6f3815c7..6ffbc708 100644 --- a/app/views/main/home.html.erb +++ b/app/views/main/home.html.erb @@ -1,3 +1,8 @@ +<%# + # @file + # Located at / + # Shows 3 most recently created topics, synapses, and maps. + #%>

Recently Created Topics <%= link_to "see all", topics_url%>

@@ -28,4 +33,4 @@

Home -

\ No newline at end of file + diff --git a/app/views/main/invite.html.erb b/app/views/main/invite.html.erb index 404d12c5..1c5e0dad 100644 --- a/app/views/main/invite.html.erb +++ b/app/views/main/invite.html.erb @@ -1,3 +1,8 @@ +<%# + # @file + # TODO: Where is this file located? + # Page allowing users to invite others to Metamaps. + #%>

Invite Others

You can invite others to the Metamaps platform. Just send them the link to

http://metamaps.cc/users/new

and give them the access code shown below.

diff --git a/app/views/main/metamap.html.erb b/app/views/main/metamap.html.erb index 23191a42..ef617257 100644 --- a/app/views/main/metamap.html.erb +++ b/app/views/main/metamap.html.erb @@ -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? %>
diff --git a/app/views/main/search.js.erb b/app/views/main/search.js.erb index b515d2ec..f3df1b9c 100644 --- a/app/views/main/search.js.erb +++ b/app/views/main/search.js.erb @@ -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; diff --git a/app/views/maps/_map.html.erb b/app/views/maps/_map.html.erb index e5c097cd..9d3e5410 100644 --- a/app/views/maps/_map.html.erb +++ b/app/views/maps/_map.html.erb @@ -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 %>

Map

@@ -21,4 +28,4 @@

<%= map.desc %>

-<% end %> \ No newline at end of file +<% end %> diff --git a/app/views/maps/_new.html.erb b/app/views/maps/_new.html.erb index 5b30ace2..a9526cb3 100644 --- a/app/views/maps/_new.html.erb +++ b/app/views/maps/_new.html.erb @@ -1,3 +1,7 @@ +<%# + # @file + # Partial view, renders a form that creates a new map. + #%>
<%= form_for Map.new, url: maps_url, remote: true do |form|%>

Save to Map

diff --git a/app/views/maps/_newsynapse.html.erb b/app/views/maps/_newsynapse.html.erb index 06691e5e..33d3e758 100644 --- a/app/views/maps/_newsynapse.html.erb +++ b/app/views/maps/_newsynapse.html.erb @@ -1,3 +1,8 @@ +<%# + # @file + # partial generating a new synapse + # TODO: Where is this code used? + #%>
<%= 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 %> -
\ No newline at end of file +
diff --git a/app/views/maps/_newtopic.html.erb b/app/views/maps/_newtopic.html.erb index 5fd6eb61..273ef15e 100644 --- a/app/views/maps/_newtopic.html.erb +++ b/app/views/maps/_newtopic.html.erb @@ -1,3 +1,7 @@ +<%# + # Partial rendering form for a new topic on a map + # TODO: Where is this code used? + #%>
<%= form_for Topic.new, url: topics_url, remote: true do |form| %>
ActionActivityBizarreCatalystClosedExperienceFuture DevGroupIdeaImplicationInsightIntentionKnowledgeLocationOpen IssueOpinionOpportunityPersonPlatformProblemQuestionReferenceRequirementResourceRoleTaskToolTrajectory
@@ -13,4 +17,4 @@
<% end %> -
\ No newline at end of file +
diff --git a/app/views/maps/create.js.erb b/app/views/maps/create.js.erb index e72b61ff..ba2e14e9 100644 --- a/app/views/maps/create.js.erb +++ b/app/views/maps/create.js.erb @@ -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); }); -} \ No newline at end of file +} diff --git a/app/views/maps/destroy.js.erb b/app/views/maps/destroy.js.erb index b48cbd79..851efd3a 100644 --- a/app/views/maps/destroy.js.erb +++ b/app/views/maps/destroy.js.erb @@ -1 +1,5 @@ -$('#<%= dom_id(@map) %>').fadeOut('slow'); \ No newline at end of file +/* + * @file + * Javascript run on destruction of a map. Fades it out from map index. + */ +$('#<%= dom_id(@map) %>').fadeOut('slow'); diff --git a/app/views/maps/edit.html.erb b/app/views/maps/edit.html.erb index c1ead879..9fe916a3 100644 --- a/app/views/maps/edit.html.erb +++ b/app/views/maps/edit.html.erb @@ -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| %>

Edit Map

diff --git a/app/views/maps/index.html.erb b/app/views/maps/index.html.erb index db35d41a..0ce86102 100644 --- a/app/views/maps/index.html.erb +++ b/app/views/maps/index.html.erb @@ -1,3 +1,8 @@ +<%# + # @file + # Shows a list of all maps, or just a user's maps. + # TODO: What url is this accessible at? + #%>

<% if @user %><%= @user.name %>'s<% end %> Maps

@@ -8,4 +13,4 @@


Shucks, there are no maps. <% if authenticated? %><%= link_to "Create one if you want.", new_map_url %><% end %>

<% end %>
-
\ No newline at end of file +
diff --git a/app/views/maps/new.html.erb b/app/views/maps/new.html.erb index e8c8cb8b..b1378dc8 100644 --- a/app/views/maps/new.html.erb +++ b/app/views/maps/new.html.erb @@ -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? + #%>
<%= form_for @map || Map.new, url: maps_url do |form|%>

Add Map

diff --git a/app/views/maps/realtime.js.erb b/app/views/maps/realtime.js.erb index e5b814e9..588faa8e 100644 --- a/app/views/maps/realtime.js.erb +++ b/app/views/maps/realtime.js.erb @@ -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 %> \ No newline at end of file +<% end %> diff --git a/app/views/maps/savelayout.js.erb b/app/views/maps/savelayout.js.erb index 4fe9226c..22fdd690 100644 --- a/app/views/maps/savelayout.js.erb +++ b/app/views/maps/savelayout.js.erb @@ -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); \ No newline at end of file +setTimeout(function(){$('#saveLayout').attr('value','Save Layout')},1500); diff --git a/app/views/maps/show.html.erb b/app/views/maps/show.html.erb index b9a90483..f4a359bf 100644 --- a/app/views/maps/show.html.erb +++ b/app/views/maps/show.html.erb @@ -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. + #%>