diff --git a/app/abilities/ability.rb b/app/abilities/ability.rb
index e31e3e930..3ba2ab707 100644
--- a/app/abilities/ability.rb
+++ b/app/abilities/ability.rb
@@ -22,7 +22,7 @@ class Ability
can [:create, :update], :password
can :read, Redaction
can [:create, :destroy], :session
- can [:read, :data, :georss], Trace
+ can [:read, :data], Trace
can [:read, :create, :suspended, :auth_success, :auth_failure], User
can :read, UserBlock
end
diff --git a/app/controllers/traces/feeds_controller.rb b/app/controllers/traces/feeds_controller.rb
new file mode 100644
index 000000000..293fbab3b
--- /dev/null
+++ b/app/controllers/traces/feeds_controller.rb
@@ -0,0 +1,20 @@
+module Traces
+ class FeedsController < ApplicationController
+ before_action :authorize_web
+ before_action :set_locale
+ before_action :check_database_readable
+
+ authorize_resource :class => Trace
+
+ def show
+ @traces = Trace.visible_to_all.visible
+
+ @traces = @traces.joins(:user).where(:users => { :display_name => params[:display_name] }) if params[:display_name]
+
+ @traces = @traces.tagged(params[:tag]) if params[:tag]
+ @traces = @traces.order("timestamp DESC")
+ @traces = @traces.limit(20)
+ @traces = @traces.includes(:user)
+ end
+ end
+end
diff --git a/app/controllers/traces_controller.rb b/app/controllers/traces_controller.rb
index d723bac5b..14648dc9c 100644
--- a/app/controllers/traces_controller.rb
+++ b/app/controllers/traces_controller.rb
@@ -2,7 +2,7 @@ class TracesController < ApplicationController
include UserMethods
include PaginationMethods
- layout "site", :except => :georss
+ layout "site"
before_action :authorize_web
before_action :set_locale
@@ -192,17 +192,6 @@ class TracesController < ApplicationController
head :not_found
end
- def georss
- @traces = Trace.visible_to_all.visible
-
- @traces = @traces.joins(:user).where(:users => { :display_name => params[:display_name] }) if params[:display_name]
-
- @traces = @traces.tagged(params[:tag]) if params[:tag]
- @traces = @traces.order("timestamp DESC")
- @traces = @traces.limit(20)
- @traces = @traces.includes(:user)
- end
-
private
def do_create(file, tags, description, visibility)
diff --git a/app/views/traces/_description.html.erb b/app/views/traces/feeds/_description.html.erb
similarity index 100%
rename from app/views/traces/_description.html.erb
rename to app/views/traces/feeds/_description.html.erb
diff --git a/app/views/traces/georss.rss.builder b/app/views/traces/feeds/show.rss.builder
similarity index 88%
rename from app/views/traces/georss.rss.builder
rename to app/views/traces/feeds/show.rss.builder
index ad5bd45b2..dc10a12d6 100644
--- a/app/views/traces/georss.rss.builder
+++ b/app/views/traces/feeds/show.rss.builder
@@ -7,14 +7,14 @@ xml.rss("version" => "2.0",
xml.channel do
xml.title t(".title")
xml.description t(".title")
- xml.link url_for(:controller => :traces, :action => :index, :only_path => false)
+ xml.link url_for(:controller => "/traces", :action => :index, :only_path => false)
xml.image do
xml.url image_url("mag_map-rss2.0.png")
xml.title t(".title")
xml.width 100
xml.height 100
- xml.link url_for(:controller => :traces, :action => :index, :only_path => false)
+ xml.link url_for(:controller => "/traces", :action => :index, :only_path => false)
end
@traces.each do |trace|
diff --git a/app/views/traces/index.html.erb b/app/views/traces/index.html.erb
index 4311ba082..dfa5f03de 100644
--- a/app/views/traces/index.html.erb
+++ b/app/views/traces/index.html.erb
@@ -16,8 +16,8 @@
- <%= link_to({ :action => :georss, :display_name => @target_user&.display_name, :tag => params[:tag] },
- { :class => "btn btn-secondary btn-sm" }) do %>
+ <%= link_to traces_feed_path(:display_name => @target_user&.display_name, :tag => params[:tag]),
+ :class => "btn btn-secondary btn-sm" do %>