Files
fizzy/app/views/cards/_closure_toggle.html.erb
T
Andy Smith 75a46356cc Merge branch 'main' into consolidate-cards
* main:
  Show more of the summary before truncating
  Improve event summaries
  Add this for debugging empty event cards
  Some actions shouldn't be available to closed cards
  Nicer spacing when the large button isn't present
  Update `card-color` in a couple more places
  Don't show the engagement toggle on closed cards
  Show more of the summary before truncating
  Improve event summaries
  Remove shadows from notifications you can't see
  Add this for debugging empty event cards
  Some actions shouldn't be available to closed cards
  Nicer spacing when the large button isn't present
  Update `card-color` in a couple more places
  Don't show the engagement toggle on closed cards
2025-04-11 15:38:57 -05:00

31 lines
1.5 KiB
Plaintext

<div class="card-perma__cutout card-perma__cutout--bottom" id="<%= dom_id(@card, :card_closure_toggle) %> style="--card-color: <%= @card.color %>">
<% if card.closed? %>
<span class="card-perma__closure-message">Completed by <%= card.closed_by.name %> on <%= local_datetime_tag(card.closed_at, style: :shortdate) %>.</span>
<%= button_to card_closure_path(card), method: :delete, class: "btn btn--plain borderless fill-transparent" do %>
<span class="pad-inline-end">Un-do</span>
<% end %>
<% else %>
<details class="expander" data-controller="details" data-details-target="details" data-action="keydown.esc->details#close click@document->details#closeOnClickOutside">
<summary class="expander__button btn borderless">
Close as
<%= icon_tag "caret-down" %>
</summary>
<div class="expander__content btn borderless">
<% Current.account.closure_reasons.labels.each do |label| %>
<%= button_to card_closure_path(card, reason: label), class: "expander__item btn" do %>
<span class="overflow-ellipsis"><%= label %></span>
<% end %>
<% end %>
</div>
</details>
<span class="card-perma__closure-message">
<% if card.doing? %>
Returns to <em>Considering</em> if no activity <%= local_datetime_tag(card.auto_reconsider_at, style: :indays) -%>.
<% else %>
Auto-closes if no activity <%= local_datetime_tag(card.auto_close_at, style: :indays) -%>.
<% end %>
</span>
<% end %>
</div>