Adapt public collections/cards to the new columns model

This commit is contained in:
Jorge Manrubia
2025-09-28 18:32:43 +02:00
parent 6e1e0eddd8
commit 4103e0c346
26 changed files with 188 additions and 43 deletions
@@ -0,0 +1,14 @@
class Public::Collections::Columns::ClosedsController < ApplicationController
include PublicCollectionScoped
allow_unauthenticated_access only: :show
layout "public"
def show
set_page_and_extract_portion_from @collection.cards.closed.recently_closed_first
# To enable caching at intermediate proxies during traffic spikes
expires_in 5.seconds, public: true
end
end
@@ -0,0 +1,14 @@
class Public::Collections::Columns::NotNowsController < ApplicationController
include PublicCollectionScoped
allow_unauthenticated_access only: :show
layout "public"
def show
set_page_and_extract_portion_from @collection.cards.postponed.reverse_chronologically
# To enable caching at intermediate proxies during traffic spikes
expires_in 5.seconds, public: true
end
end
@@ -0,0 +1,14 @@
class Public::Collections::Columns::StreamsController < ApplicationController
include PublicCollectionScoped
allow_unauthenticated_access only: :show
layout "public"
def show
set_page_and_extract_portion_from @collection.cards.awaiting_triage.reverse_chronologically
# To enable caching at intermediate proxies during traffic spikes
expires_in 5.seconds, public: true
end
end
@@ -0,0 +1,21 @@
class Public::Collections::ColumnsController < ApplicationController
include ActionView::RecordIdentifier, PublicCollectionScoped
allow_unauthenticated_access only: :show
layout "public"
before_action :set_column, only: :show
def show
set_page_and_extract_portion_from @column.cards.active.reverse_chronologically
# To enable caching at intermediate proxies during traffic spikes
expires_in 5.seconds, public: true
end
private
def set_column
@column = @collection.columns.find(params[:id])
end
end
@@ -6,10 +6,7 @@ class Public::CollectionsController < ApplicationController
layout "public"
def show
# @considering = current_page_from @collection.cards.considering.latest, per_page: CardsController::PAGE_SIZE
# @on_deck = current_page_from @collection.cards.on_deck.latest, per_page: CardsController::PAGE_SIZE
# @doing = current_page_from @collection.cards.doing.latest, per_page: CardsController::PAGE_SIZE
# @closed = current_page_from @collection.cards.closed.recently_closed_first, per_page: CardsController::PAGE_SIZE
set_page_and_extract_portion_from @collection.cards.awaiting_triage.reverse_chronologically
# To enable caching at intermediate proxies during traffic spikes
expires_in 5.seconds, public: true