From 7410b59a50af1eeee3a5b31dbb19fbfbb629c99c Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Wed, 30 Oct 2019 15:02:35 +0100 Subject: [PATCH] Remove unused trace_optionals partial 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 | 10 ---------- app/views/traces/_trace_optionals.html.erb | 10 ---------- app/views/traces/index.html.erb | 2 -- 3 files changed, 22 deletions(-) delete mode 100644 app/views/traces/_trace_optionals.html.erb diff --git a/app/controllers/traces_controller.rb b/app/controllers/traces_controller.rb index 3497e92d5..a0852d2ce 100644 --- a/app/controllers/traces_controller.rb +++ b/app/controllers/traces_controller.rb @@ -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 index d9749653d..000000000 --- a/app/views/traces/_trace_optionals.html.erb +++ /dev/null @@ -1,10 +0,0 @@ -<% content_for :optionals do %> -
-

<%= t ".tags" %>

- <% if @all_tags %> - <% @all_tags.each do |tag| %> - <%= link_to_tag tag %>
- <% end %> - <% end %> -
-<% end %> diff --git a/app/views/traces/index.html.erb b/app/views/traces/index.html.erb index da40f5a4d..fff62ba55 100644 --- a/app/views/traces/index.html.erb +++ b/app/views/traces/index.html.erb @@ -41,5 +41,3 @@ <% else %>

<%= t ".empty_html", :upload_link => new_trace_path %>

<% end %> - -<%= render :partial => "trace_optionals" %> -- 2.43.2