Files
fizzy/app/views/cards/display/_perma.html.erb
T
Jason Zimdars 5560976091 Merge branch 'main' into gold-cards
* main:
  Try a segmented toggle for engagement
  Fix tests
  Rework min card design and meta section for all cards
  Move `title` to the `img` element so we get hover in both cases
  Remove sorting filter UI
  Sort Considering and Doing by `updated_at`
  Restore comment action icon
  Fix dot escaping container
  Seen cards should be flat
  Ensure overflow cards are hidden
  Arrow needs to match derived color
  Dialog target needs to be present
  This isn't necessary in the mini card template
  Revert "The button and dialog need not render in previews"
2025-04-10 16:42:45 -05:00

44 lines
2.0 KiB
Plaintext

<% cache card do %>
<article class="card shadow border flex flex-column position-relative txt-align-start border-radius <%= 'card--golden' if card.golden? %>"
style="--card-color: <%= card.color %>; view-transition-name: <%= dom_id(card, :ticket) %>;"
id="<%= dom_id(card, :ticket) %>">
<header class="card__header flex align-center gap min-width">
<%= link_to card.collection.name, cards_path(collection_ids: [card.collection]),
class: "card__collection txt-uppercase overflow-ellipsis txt-reversed" %>
<%= render "cards/display/perma/tags", card: card %>
</header>
<div class="card__body flex gap full-width flex-item-grow">
<div class="card__body-header">
<h1 class="card__title">
<% if card.published? %>
<%= turbo_frame_tag card, :edit do %>
<%= link_to card_title(card), edit_collection_card_path(card.collection, card), class: "card__title-link overflow-line-clamp" %>
<% end %>
<% else %>
<%= form_with model: card, url: collection_card_path(card.collection, card), id: "card_form", data: { controller: "auto-save" } do |form| %>
<%= form.text_area :title, placeholder: "Name it…",
class: "input input--textarea full-width borderless txt-align-start #{ "fill-highlight" if card.creating? }",
autofocus: card.title.blank?,
data: { action: "auto-save#change blur->auto-save#submit keydown.enter->auto-save#submit:prevent keydown.ctrl+enter->auto-save#submit:prevent" } %>
<% end %>
<% end %>
</h1>
</div>
<% if card.doing? %>
<%= turbo_frame_tag dom_id(@card, :stages) do %>
<%= render "cards/stagings/stages", card: card %>
<% end %>
<% end %>
</div>
<footer class="card__footer full-width flex align-start gap">
<%= render "cards/display/perma/meta", card: card %>
</footer>
<%= render "cards/display/common/background", card: card %>
</article>
<% end %>