Merge remote-tracking branch 'upstream/pull/5517'

This commit is contained in:
Tom Hughes 2025-01-19 15:01:25 +00:00
commit fb7762feb9
10 changed files with 152 additions and 133 deletions

View file

@ -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

View file

@ -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)