Render a special state when no one is watching
This commit is contained in:
@@ -32,17 +32,20 @@ module AccessesHelper
|
||||
displayed_watchers = watchers.limit(MAX_DISPLAYED_WATCHERS)
|
||||
overflow_count = watchers.count - MAX_DISPLAYED_WATCHERS
|
||||
|
||||
tag.div(class: "collection-tools__watching") do
|
||||
safe_join([
|
||||
safe_join(displayed_watchers.map { |watcher| avatar_tag(watcher) }),
|
||||
(tag.div(data: { controller: "dialog", action: "keydown.esc->dialog#close click@document->dialog#closeOnClickOutside" }) do
|
||||
concat tag.button("+#{overflow_count}", class: "overflow-count btn btn--circle borderless", data: { action: "dialog#open" }, aria: { label: "Show #{overflow_count} more watchers" })
|
||||
concat(tag.dialog(class: "collection-tools__watching-dialog dialog panel", data: { dialog_target: "dialog" }, aria: { hidden: "true" }) do
|
||||
safe_join(watchers.map { |watcher| avatar_tag(watcher) })
|
||||
end)
|
||||
end if overflow_count > 0)
|
||||
].compact)
|
||||
end
|
||||
safe_join([
|
||||
tag.strong(displayed_watchers.any? ? "Watching for new cards" : "No one is watching for new cards", class: "txt-uppercase"),
|
||||
tag.div(class: "collection-tools__watching") do
|
||||
safe_join([
|
||||
safe_join(displayed_watchers.map { |watcher| avatar_tag(watcher) }),
|
||||
(tag.div(data: { controller: "dialog", action: "keydown.esc->dialog#close click@document->dialog#closeOnClickOutside" }) do
|
||||
concat tag.button("+#{overflow_count}", class: "overflow-count btn btn--circle borderless", data: { action: "dialog#open" }, aria: { label: "Show #{overflow_count} more watchers" })
|
||||
concat(tag.dialog(class: "collection-tools__watching-dialog dialog panel", data: { dialog_target: "dialog" }, aria: { hidden: "true" }) do
|
||||
safe_join(watchers.map { |watcher| avatar_tag(watcher) })
|
||||
end)
|
||||
end if overflow_count > 0)
|
||||
].compact)
|
||||
end
|
||||
])
|
||||
end
|
||||
|
||||
def involvement_button(collection, access, show_watchers, icon_only)
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
<hr class="separator--horizontal full-width" aria-hidden="true">
|
||||
|
||||
<footer>
|
||||
<strong class="txt-uppercase">Watching for new cards</strong>
|
||||
<%= access_involvement_advance_button(collection, Current.user, show_watchers: true) %>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user