diff --git a/app/views/timeline/timeline.html.haml b/app/views/timeline/timeline.html.haml index e767ea01..06610059 100644 --- a/app/views/timeline/timeline.html.haml +++ b/app/views/timeline/timeline.html.haml @@ -4,8 +4,11 @@ - if @more_data_available .d-flex.justify-content-center#paginator - = button_to "#{request.path}?last_id=#{@timeline_last_id}", class: "btn btn-light" do - = t("voc.load") + = button_to t("voc.load"), request.path, + class: "btn btn-light", + method: :get, + params: { last_id: @timeline_last_id }, + form: { data: { turbo_stream: true } } - provide(:title, @title || APP_CONFIG["site_name"]) - parent_layout 'feed' diff --git a/app/views/timeline/timeline.turbo_stream.haml b/app/views/timeline/timeline.turbo_stream.haml index a840812e..525cbba9 100644 --- a/app/views/timeline/timeline.turbo_stream.haml +++ b/app/views/timeline/timeline.turbo_stream.haml @@ -4,5 +4,8 @@ = turbo_stream.update "paginator" do - if @more_data_available - = button_to "#{request.path}?last_id=#{@timeline_last_id}", class: "btn btn-light" do - = t("voc.load") + = button_to t("voc.load"), request.path, + class: "btn btn-light", + method: :get, + params: { last_id: @timeline_last_id }, + form: { data: { turbo_stream: true } } diff --git a/config/routes.rb b/config/routes.rb index c68933ef..368b746c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -40,7 +40,7 @@ Rails.application.routes.draw do end authenticate :user do - root to: "timeline#index", via: [:get, :post], as: :timeline + root to: "timeline#index", via: :get, as: :timeline end get "/about", to: "about#about" @@ -143,8 +143,8 @@ Rails.application.routes.draw do resource :anonymous_block, controller: :anonymous_block, only: %i[create destroy] 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) - match "/list/:list_name", to: "timeline#list", via: [:get, :post], as: :list_timeline + get "/public", to: "timeline#public", as: :public_timeline if APP_CONFIG.dig(:features, :public, :enabled) + get "/list/:list_name", to: "timeline#list", as: :list_timeline match "/notifications(/:type)", to: "notifications#index", via: [:get, :post], as: :notifications, defaults: { type: "new" }