timeline: only provide #index, #public and #list as GET

This commit is contained in:
Georg Gadinger 2023-01-21 19:11:05 +01:00 committed by Andreas Nedbal
parent 9e25a36196
commit 59d94d7ba0
3 changed files with 13 additions and 7 deletions

View File

@ -4,8 +4,11 @@
- if @more_data_available - if @more_data_available
.d-flex.justify-content-center#paginator .d-flex.justify-content-center#paginator
= button_to "#{request.path}?last_id=#{@timeline_last_id}", class: "btn btn-light" do = button_to t("voc.load"), request.path,
= t("voc.load") class: "btn btn-light",
method: :get,
params: { last_id: @timeline_last_id },
form: { data: { turbo_stream: true } }
- provide(:title, @title || APP_CONFIG["site_name"]) - provide(:title, @title || APP_CONFIG["site_name"])
- parent_layout 'feed' - parent_layout 'feed'

View File

@ -4,5 +4,8 @@
= turbo_stream.update "paginator" do = turbo_stream.update "paginator" do
- if @more_data_available - if @more_data_available
= button_to "#{request.path}?last_id=#{@timeline_last_id}", class: "btn btn-light" do = button_to t("voc.load"), request.path,
= t("voc.load") class: "btn btn-light",
method: :get,
params: { last_id: @timeline_last_id },
form: { data: { turbo_stream: true } }

View File

@ -40,7 +40,7 @@ Rails.application.routes.draw do
end end
authenticate :user do authenticate :user do
root to: "timeline#index", via: [:get, :post], as: :timeline root to: "timeline#index", via: :get, as: :timeline
end end
get "/about", to: "about#about" get "/about", to: "about#about"
@ -143,8 +143,8 @@ Rails.application.routes.draw do
resource :anonymous_block, controller: :anonymous_block, only: %i[create destroy] resource :anonymous_block, controller: :anonymous_block, only: %i[create destroy]
get "/discover", to: "discover#index", as: :discover get "/discover", to: "discover#index", as: :discover
match "/public", to: "timeline#public", via: [:get, :post], as: :public_timeline if APP_CONFIG.dig(:features, :public, :enabled) get "/public", to: "timeline#public", as: :public_timeline if APP_CONFIG.dig(:features, :public, :enabled)
match "/list/:list_name", to: "timeline#list", via: [:get, :post], as: :list_timeline get "/list/:list_name", to: "timeline#list", as: :list_timeline
match "/notifications(/:type)", to: "notifications#index", via: [:get, :post], as: :notifications, defaults: { type: "new" } match "/notifications(/:type)", to: "notifications#index", via: [:get, :post], as: :notifications, defaults: { type: "new" }