Extract partials

This commit is contained in:
Jorge Manrubia
2025-04-21 14:52:21 +02:00
parent 491e743c27
commit 7925cd7bf9
4 changed files with 18 additions and 17 deletions
+3 -17
View File
@@ -3,12 +3,7 @@
<%= render "cards/container/engagement", card: card %>
<aside class="card-perma__actions card-perma__actions--left" role="toolbar">
<% if card.published? %>
<%= link_to edit_collection_card_path(card.collection, card), class: "btn", data: { turbo_frame: dom_id(card, :edit) } do %>
<%= icon_tag "pencil" %>
<span class="for-screen-reader">Edit</span>
<% end %>
<% end %>
<%= render "cards/container/edit", card: card if card.published? %>
<%= render "cards/container/gild", card: card if card.doing? %>
<%= render "cards/container/image", card: card %>
@@ -38,17 +33,8 @@
</div>
<% if card.published? %>
<%# FIXME: Let's move this aside outside of the card container section so these frames don't reload/flicker when card is replaced %>
<aside class="card-perma__actions card-perma__actions--right" role="toolbar">
<%= turbo_frame_tag card, :watch, src: card_watch_path(card) %>
<%= turbo_frame_tag card, :pin, src: card_pin_path(card) %>
</aside>
<%= render "cards/container/closure", card: card %>
<%= render "cards/container/footer/published", card: card %>
<% elsif card.creating? %>
<div class="card-perma__notch card-perma__notch--bottom">
<%= button_to "Create card", card_publish_path(card), class: "btn" %>
<%= button_to "Save as draft", collection_card_path(card.collection, card), name: "card[status]", value: "drafted", method: :put, class: "btn btn--reversed" %>
</div>
<%= render "cards/container/footer/draft", card: card %>
<% end %>
</section>
+4
View File
@@ -0,0 +1,4 @@
<%= link_to edit_collection_card_path(card.collection, card), class: "btn", data: { turbo_frame: dom_id(card, :edit) } do %>
<%= icon_tag "pencil" %>
<span class="for-screen-reader">Edit</span>
<% end %>
@@ -0,0 +1,4 @@
<div class="card-perma__notch card-perma__notch--bottom">
<%= button_to "Create card", card_publish_path(card), class: "btn" %>
<%= button_to "Save as draft", collection_card_path(card.collection, card), name: "card[status]", value: "drafted", method: :put, class: "btn btn--reversed" %>
</div>
@@ -0,0 +1,7 @@
<%# FIXME: Let's move this aside outside of the card container section so these frames don't reload/flicker when card is replaced %>
<aside class="card-perma__actions card-perma__actions--right" role="toolbar">
<%= turbo_frame_tag card, :watch, src: card_watch_path(card) %>
<%= turbo_frame_tag card, :pin, src: card_pin_path(card) %>
</aside>
<%= render "cards/container/closure", card: card %>