Add a line that describes the event action
This commit is contained in:
@@ -48,4 +48,19 @@ module EventsHelper
|
||||
content_tag(:h3, header, class: "event__grid-column-title margin-block-end-half position-sticky")
|
||||
end.join.html_safe
|
||||
end
|
||||
|
||||
def event_action_sentence(event)
|
||||
case event.action
|
||||
when "assigned"
|
||||
"Assigned to #{ event.assignees.pluck(:name).to_sentence }"
|
||||
when "boosted"
|
||||
"Boosted by #{ event.creator.name }"
|
||||
when "commented"
|
||||
"#{ event.creator.name } replied"
|
||||
when "published"
|
||||
"Added by #{ event.creator.name }"
|
||||
when "popped"
|
||||
"Popped by #{ event.creator.name }"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<% bubble = event.summary.bubble %>
|
||||
|
||||
<%= link_to bucket_bubble_path(bubble.bucket, bubble),
|
||||
class: "event panel shadow center center-block flex-inline align-center justify-start gap position-relative",
|
||||
class: "event panel shadow center center-block flex-inline align-start justify-start gap position-relative",
|
||||
style: "--bubble-color: #{ bubble.color }; #{ bubble_rotation(bubble) }",
|
||||
data: { controller: "animation",
|
||||
related_element_target: "related",
|
||||
@@ -10,8 +10,10 @@
|
||||
animation_play_on_load_value: "true",
|
||||
action: "mouseover->animation#play mouseover->related-element#highlight mouseout->related-element#unhighlight" } do %>
|
||||
<div class="bubble__shape flex-item-no-shrink txt-large"></div>
|
||||
|
||||
<div class="flex flex-column min-width txt-small txt-tight-lines align-start txt-align-start">
|
||||
<strong><%= bubble.title %></strong>
|
||||
<span class="txt-small translucent"><%= bubble.bucket.name %></span>
|
||||
<strong style="font-size: 1.1em;"><%= bubble.title %></strong>
|
||||
<span><%= event_action_sentence(event) %> </span>
|
||||
<span class="translucent"><%= bubble.bucket.name %></span>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user