Initial cards view

This commit is contained in:
Jorge Manrubia
2025-09-26 17:19:11 +02:00
parent f5c7d3d35b
commit e3e051d4c1
2 changed files with 6 additions and 20 deletions
+1 -1
View File
@@ -11,8 +11,8 @@ class CardsController < ApplicationController
PAGE_SIZE = 25
def index
set_page_and_extract_portion_from @filter.cards
fresh_when etag: @columns
head :ok
end
def create
+5 -19
View File
@@ -12,12 +12,6 @@
<% content_for :header do %>
<%= render "filters/menu", user_filtering: @user_filtering %>
<div class="header__actions header__actions--start">
<% if collection = @filter.single_collection %>
<%= render "cards/webhooks", collection: collection if Current.user.admin? %>
<% end %>
</div>
<h1 class="header__title divider divider--fade full-width">
<span class="overflow-ellipsis"><%= @user_filtering.selected_collections_label %></span>
</h1>
@@ -31,16 +25,8 @@
<%= render "filters/settings", user_filtering: @user_filtering %>
<%= tag.div data: {
controller: "drag-and-drop",
drag_and_drop_dragged_item_class: "drag-and-drop__dragged-item",
drag_and_drop_hover_container_class: "drag-and-drop__hover-container",
drag_and_drop_url_value: cards_drops_path(**@filter.as_params),
action: "
dragstart->drag-and-drop#dragStart
dragover->drag-and-drop#dragOver
drop->drag-and-drop#drop
dragend->drag-and-drop#dragEnd" } do %>
<%= render "cards/index/columns", columns: @columns %>
<% end %>
<section class="cards">
<%= turbo_frame_tag :card_columns do %>
<%= render partial: "cards/display/preview", collection: @page.records, as: :card, locals: { draggable: true }, cached: ->(card) { cacheable_preview_parts_for(card) } %>
<% end %>
</section>