From cf5ddbbb783c37c414fffcac754d6c4e6ffa697f Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Wed, 26 Feb 2025 16:47:48 -0600 Subject: [PATCH] Style watchers block --- app/views/bubbles/show.html.erb | 8 ++-- app/views/bubbles/watches/_watcher.html.erb | 2 +- app/views/bubbles/watches/show.html.erb | 42 +++++++++++++-------- 3 files changed, 32 insertions(+), 20 deletions(-) diff --git a/app/views/bubbles/show.html.erb b/app/views/bubbles/show.html.erb index 99e7ca775..0b61270da 100644 --- a/app/views/bubbles/show.html.erb +++ b/app/views/bubbles/show.html.erb @@ -85,10 +85,6 @@ <%= image_tag "trash.svg", aria: { hidden: true }, size: 24 %> Delete <% end %> - - <% if @bubble.published? %> - <%= turbo_frame_tag dom_id(@bubble, :watch), src: bucket_bubble_watch_path(@bubble.bucket, @bubble) %> - <% end %> @@ -116,6 +112,10 @@ <% end %> + <% if @bubble.published? %> + <%= turbo_frame_tag dom_id(@bubble, :watch), src: bucket_bubble_watch_path(@bubble.bucket, @bubble) %> + <% end %> + <% if @bubble.creating? %>
<%= button_to "Save as draft", bucket_bubble_path(@bubble.bucket, @bubble), name: "bubble[status]", value: "drafted", method: :put, class: "btn btn--plain borderless fill-transparent" %> diff --git a/app/views/bubbles/watches/_watcher.html.erb b/app/views/bubbles/watches/_watcher.html.erb index e79fb972a..35a1d3f91 100644 --- a/app/views/bubbles/watches/_watcher.html.erb +++ b/app/views/bubbles/watches/_watcher.html.erb @@ -1 +1 @@ -<%= avatar_tag watcher, size: 24 %> +<%= avatar_tag watcher, loading: :lazy %> diff --git a/app/views/bubbles/watches/show.html.erb b/app/views/bubbles/watches/show.html.erb index f5147e541..67bcf5d80 100644 --- a/app/views/bubbles/watches/show.html.erb +++ b/app/views/bubbles/watches/show.html.erb @@ -1,20 +1,32 @@ <%= turbo_frame_tag dom_id(@bubble, :watch) do %> - <% if @bubble.watched_by? Current.user %> - <%= button_to bucket_bubble_watch_path(@bubble.bucket, @bubble), method: :delete, class: "btn" do %> - <%= image_tag "bookmark.svg", aria: { hidden: true }, size: 24 %> - Stop watching - <% end %> - <% else %> - <%= button_to bucket_bubble_watch_path(@bubble.bucket, @bubble), class: "btn" do %> - <%= image_tag "bookmark-outline.svg", aria: { hidden: true }, size: 24 %> - Watch this - <% end %> - <% end %> +
+
+

Watchers

+
<%= pluralize @watchers.count, "person" %> are being notified when someone comments on this bubble.
+
+
+ <%= render partial: "bubbles/watches/watcher", collection: @watchers %> +
- <%= pluralize @watchers.count, "other" %> watching this bubble - -
- <%= render partial: "bubbles/watches/watcher", collection: @watchers %> +
+ <% if @bubble.watched_by? Current.user %> + You are watching this bubble +
You will be notified when someone comments.
+
+ <%= button_to bucket_bubble_watch_path(@bubble.bucket, @bubble), method: :delete, class: "btn" do %> + Stop watching + <% end %> +
+ <% else %> + You’re not watching this bubble +
You won’t be notified when someone comments.
+
+ <%= button_to bucket_bubble_watch_path(@bubble.bucket, @bubble), class: "btn" do %> + Watch this + <% end %> +
+ <% end %> +
<% end %>