]> git.openstreetmap.org Git - rails.git/commitdiff
Remove unused trace_optionals partial
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 30 Oct 2019 14:02:35 +0000 (15:02 +0100)
committerAndy Allan <git@gravitystorm.co.uk>
Wed, 30 Oct 2019 14:02:35 +0000 (15:02 +0100)
Although the code to render the partial runs, `yield :optionals`
was removed from the site layout in 2013. So the code has been
ineffective since then.

app/controllers/traces_controller.rb
app/views/traces/_trace_optionals.html.erb [deleted file]
app/views/traces/index.html.erb

index 3497e92d5fdc9348e80e3c9b6bbaf40036bd9a7f..a0852d2ce2665959714c02c35c5cdc4c03504425 100644 (file)
@@ -65,19 +65,9 @@ class TracesController < ApplicationController
     @traces = @traces.limit(@page_size)
     @traces = @traces.includes(:user, :tags)
 
-    # put together SET of tags across traces, for related links
-    tagset = {}
-    @traces.each do |trace|
-      trace.tags.reload if params[:tag] # if searched by tag, ActiveRecord won't bring back other tags, so do explicitly here
-      trace.tags.each do |tag|
-        tagset[tag.tag] = tag.tag
-      end
-    end
-
     # final helper vars for view
     @target_user = target_user
     @display_name = target_user.display_name if target_user
-    @all_tags = tagset.values
   end
 
   def mine
diff --git a/app/views/traces/_trace_optionals.html.erb b/app/views/traces/_trace_optionals.html.erb
deleted file mode 100644 (file)
index d974965..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<% content_for :optionals do %>
-  <div class="optionalbox">
-    <h4><%= t ".tags" %></h4>
-    <% if @all_tags %>
-      <% @all_tags.each do |tag| %>
-        <%= link_to_tag tag %><br />
-      <% end %>
-    <% end %>
-  </div>
-<% end %>
index da40f5a4d64a16133f15b6083f9711c886ecc7a2..fff62ba551ee00d61f31164ebbdad3148edefa9e 100644 (file)
@@ -41,5 +41,3 @@
 <% else %>
   <h4><%= t ".empty_html", :upload_link => new_trace_path %></h4>
 <% end %>
-
-<%= render :partial => "trace_optionals" %>