From 47710749a897a38c4e6bfcdfc28bc9b6db5803d7 Mon Sep 17 00:00:00 2001 From: Connor Turland Date: Wed, 5 Feb 2014 12:38:17 -0500 Subject: [PATCH] started styling map forms --- app/views/maps/edit.html.erb | 21 ------- app/views/maps/new.html.erb | 21 ------- app/views/synapses/_synapse.html.erb | 16 ------ app/views/synapses/edit.html.erb | 27 --------- app/views/synapses/new.html.erb | 26 --------- app/views/synapses/show.html.erb | 27 --------- app/views/topics/_topic.html.erb | 83 ---------------------------- app/views/topics/edit.html.erb | 22 -------- app/views/topics/new.html.erb | 21 ------- 9 files changed, 264 deletions(-) delete mode 100644 app/views/maps/edit.html.erb delete mode 100644 app/views/maps/new.html.erb delete mode 100644 app/views/synapses/_synapse.html.erb delete mode 100644 app/views/synapses/edit.html.erb delete mode 100644 app/views/synapses/new.html.erb delete mode 100644 app/views/synapses/show.html.erb delete mode 100644 app/views/topics/_topic.html.erb delete mode 100644 app/views/topics/edit.html.erb delete mode 100644 app/views/topics/new.html.erb diff --git a/app/views/maps/edit.html.erb b/app/views/maps/edit.html.erb deleted file mode 100644 index 9e5c04dd..00000000 --- a/app/views/maps/edit.html.erb +++ /dev/null @@ -1,21 +0,0 @@ -<%# - # @file - # Form for editing a map - # Located at addresses /maps/:id/edit. In use. - #%> - -<% content_for :title, "Edit " + @map.name + " | Metamaps" %> - -<%= form_for @map, url: map_url(@map) do |form| %> -

Edit Map

- - <%= form.text_field :name %> - - <%= form.text_area :desc, class: "description", :rows => 5 %> - <% if @map.user == user %> - - <%= form.select :permission, options_for_select(['commons', 'public', 'private'], @map.permission) %> -

Topics and synapses you create newly on this map will be set by default to the permissions of your map.
Permissions of already created topics will not be changed to your new map permission.

- <% end %> - <%= form.submit "Update", class: "update" %> -<% end %> diff --git a/app/views/maps/new.html.erb b/app/views/maps/new.html.erb deleted file mode 100644 index 72a05495..00000000 --- a/app/views/maps/new.html.erb +++ /dev/null @@ -1,21 +0,0 @@ -<%# - # @file - # Form to create a new map. - # Accessible from /maps/new. Still in use. - #%> - -<% content_for :title, "New Map | Metamaps" %> - -
-<%= form_for @map || Map.new, url: maps_url do |form|%> -

Add Map

- - <%= form.text_field :name %> - - <%= form.text_area :desc, class: "description", :rows => 5 %> - - <%= form.select(:permission, options_for_select(['commons', 'public', 'private'])) %> -

Topics and synapses you create newly on this map will be set by default to the permissions of your map.

- <%= form.submit "Add Map", class: "add" %> -<% end %> -
diff --git a/app/views/synapses/_synapse.html.erb b/app/views/synapses/_synapse.html.erb deleted file mode 100644 index af274a79..00000000 --- a/app/views/synapses/_synapse.html.erb +++ /dev/null @@ -1,16 +0,0 @@ -<%# - # @file - # Render a synapse - # TODO: Where is this code used? - #%> -<%= div_for synapse do %> -
-

<%= link_to synapse.topic1.name, topic_url(synapse.topic1) %>

- <%= image_tag synapse.topic1.metacode.icon, :class => 'icon', :size => '50x50' %> -
-
<%= synapse.desc %>
-
- <%= image_tag synapse.topic2.metacode.icon, :class => 'icon', :size => '50x50' %> -

<%= link_to synapse.topic2.name, topic_url(synapse.topic2) %>

-
-<% end %> diff --git a/app/views/synapses/edit.html.erb b/app/views/synapses/edit.html.erb deleted file mode 100644 index 710e3b79..00000000 --- a/app/views/synapses/edit.html.erb +++ /dev/null @@ -1,27 +0,0 @@ -<%# - # @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| %> -

Edit Synapse

- <% if Topic.visibleToUser(user, nil).count > 0 %> - - <%= select "node1_id", "node1", Topic.order("name ASC").visibleToUser(user, nil).map {|p| [ p.name, p.id ] }, { :selected => @synapse.node1_id } %> - <% end %> - - <%= form.select :category, options_for_select(['none', 'both', 'from-to'], @synapse.category) %> - - <%= form.text_field :desc, class: "description" %> - <% if Topic.visibleToUser(user, nil).count > 0 %> - - <%= select "node2_id", "node2", Topic.order("name ASC").visibleToUser(user, nil).map {|p| [ p.name, p.id ] }, { :selected => @synapse.node2_id } %> - <% end %> - <% if @synapse.user == user %> - - <%= form.select :permission, options_for_select(['commons', 'public', 'private'], @synapse.permission) %> - <% end %> - <%= form.submit "Update", class: "update" %> -<% end %> diff --git a/app/views/synapses/new.html.erb b/app/views/synapses/new.html.erb deleted file mode 100644 index 72305117..00000000 --- a/app/views/synapses/new.html.erb +++ /dev/null @@ -1,26 +0,0 @@ -<%# - # @file - # Synapse creation form - # I think this code is no longer in use. - # TODO: Am I correct? - #%> -
- <%= form_for @synapse, url: synapses_url do |form| %> -

Add Synapse Between Topics

- <% if Topic.visibleToUser(user, nil).count > 0 %> - - <%= select_tag :node1_id, options_from_collection_for_select(Topic.order("name ASC").visibleToUser(user, nil), "id", "name") %> - <% end %> - - <%= form.select :category, options_for_select(['none', 'both', 'from-to']) %> - - <%= form.text_field :desc, class: "description" %> - <% if Topic.visibleToUser(user, nil).count > 0 %> - - <%= select_tag :node2_id, options_from_collection_for_select(Topic.order("name ASC").visibleToUser(user, nil), "id", "name") %> - <% end %> - - <%= form.select(:permission, options_for_select(['commons', 'public', 'private'])) %> - <%= form.submit "Add Synapse", class: "add" %> - <% end %> -
diff --git a/app/views/synapses/show.html.erb b/app/views/synapses/show.html.erb deleted file mode 100644 index 00cfc965..00000000 --- a/app/views/synapses/show.html.erb +++ /dev/null @@ -1,27 +0,0 @@ -<%# - # @file - # View all synapses. - # TODO: Is this code used? - # TODO: What URL is it? - #%> -
-
-
-
-
-
-
-
- - - -<% if authenticated? %> - <%= render :partial => 'topics/new' %> - <%= render :partial => 'synapses/new' %> -<% end %> diff --git a/app/views/topics/_topic.html.erb b/app/views/topics/_topic.html.erb deleted file mode 100644 index 56be87fd..00000000 --- a/app/views/topics/_topic.html.erb +++ /dev/null @@ -1,83 +0,0 @@ -<%# - # @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 %> - - <% if topic.authorize_to_edit(user) %> -
- <% end %> - -
- <% if topic.user == user %><%= link_to 'Delete', topic_path(topic), :class => 'delete', :confirm => 'Delete this topic and all synapses linking to it?', :method => :delete, :remote => true%><% end %> -

<%= topic.metacode.name %>

- <%= image_tag topic.metacode.icon, :class => 'icon', :size => '50x50' %> -
-
<%= topic.mk_permission %>
- <% if topic.user == user %> -
-
- Permissions:  - <%= best_in_place topic, :permission, :type => :select, :collection => [['commons', 'commons'], ['public','public'], ['private','private']], :classes => 'best_in_place_permission' %> -
-
-
- <% end %> -
- - <%=topic.name %> - - - -
-
- -
-
- <%=topic.desc %> -
-
-
- - -
-
- - <% if topic.authorize_to_edit(user) %> -
- <% end %> -<% end %> diff --git a/app/views/topics/edit.html.erb b/app/views/topics/edit.html.erb deleted file mode 100644 index 9f35d3c1..00000000 --- a/app/views/topics/edit.html.erb +++ /dev/null @@ -1,22 +0,0 @@ -<%# - # @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| %> -

Edit Topic

- - <%= select "category", "metacode_id", Metacode.order("name ASC").all.collect {|p| [ p.name, p.id ] }, { :selected => @topic.metacode.id } %> - - <%= form.text_field :name %> - - <%= form.text_area :desc, class: "description", :rows => 5 %> - - <%= form.text_field :link, class: "link" %> - <% if @topic.user == user %> - - <%= form.select :permission, options_for_select(['commons', 'public', 'private'], @topic.permission) %> - <% end %> - <%= form.submit "Update", class: "update" %> -<% end %> diff --git a/app/views/topics/new.html.erb b/app/views/topics/new.html.erb deleted file mode 100644 index da3ab0b1..00000000 --- a/app/views/topics/new.html.erb +++ /dev/null @@ -1,21 +0,0 @@ -<%# - # @file - # This file is a form for creating new topics. It is no longer used. - #%> - -
-<%= form_for @topic || Topic.new, url: topics_path do |form| %> -

Add Topic

- - <%= select_tag "category", options_from_collection_for_select(Metacode.order("name ASC").all, "id", "name") %> - - <%= form.text_field :name %> - - <%= form.text_area :desc, class: "description", :rows => 5 %> - - <%= form.text_field :link, class: "link" %> - - <%= form.select(:permission, options_for_select(['commons', 'public', 'private'])) %> - <%= form.submit "Add Topic", class: "addTopic", id: "addTopic" %> -<% end %> -