Stub out considering bubble
This commit is contained in:
@@ -51,3 +51,8 @@
|
||||
inset-inline-start: calc(-1 * var(--bubble-gap));
|
||||
translate: -100% -50%;
|
||||
}
|
||||
|
||||
.bubble--considering {
|
||||
inset-inline-end: calc(-1 * var(--bubble-gap));
|
||||
translate: 100% -50%;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ module Card::Closeable
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
AUTO_CLOSE_AFTER = 30.days
|
||||
AUTO_CLOSE_REMINDER_BEFORE = 7.days
|
||||
AUTO_CLOSE_REMINDER_BEFORE = 29.days
|
||||
|
||||
included do
|
||||
has_one :closure, dependent: :destroy
|
||||
@@ -37,6 +37,11 @@ module Card::Closeable
|
||||
considering? && auto_closing? && Time.current >= auto_close_at - AUTO_CLOSE_REMINDER_BEFORE
|
||||
end
|
||||
|
||||
# TMP
|
||||
def considering_soon?
|
||||
true
|
||||
end
|
||||
|
||||
def closed?
|
||||
closure.present?
|
||||
end
|
||||
|
||||
@@ -30,7 +30,11 @@
|
||||
<%= render "cards/display/common/background", card: card %>
|
||||
|
||||
<% if card.closing_soon? %>
|
||||
<%= render "cards/display/preview/bubble", days: card.days_until_close, class: "bubble--closing" %>
|
||||
<%= render "cards/display/preview/bubble", label: "Closes", days: card.days_until_close, class: "bubble--closing" %>
|
||||
<% end %>
|
||||
|
||||
<% if card.considering_soon? %>
|
||||
<%= render "cards/display/preview/bubble", label: "Considering", days: card.days_until_close, class: "bubble--considering" %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
<div class="bubble <%= local_assigns[:class] || "" %>">
|
||||
<div class="bubble <%= local_assigns[:class] %>">
|
||||
<svg viewBox="0 0 200 100">
|
||||
<path id="top-half" fill="transparent" d="M 20,100 A 80,80 0 0,1 180,100" />
|
||||
<text text-anchor="middle" fill="currentColor">
|
||||
<textPath href="#top-half" startOffset="50%" dominant-baseline="middle">
|
||||
<%= days < 1 ? "Closes" : "Closes in" %>
|
||||
<%= local_assigns[:label] %>
|
||||
<%= " in" if days < 1 %>
|
||||
</textPath>
|
||||
</text>
|
||||
</svg>
|
||||
|
||||
Reference in New Issue
Block a user