Extract partials
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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 %>
|
||||
Reference in New Issue
Block a user