From 8d9eacdb01357779a280b20bfeeabf66953d6a46 Mon Sep 17 00:00:00 2001 From: Andy Smith Date: Fri, 26 Sep 2025 12:43:54 -0500 Subject: [PATCH 1/2] Add reverse icon --- app/assets/stylesheets/icons.css | 2 ++ app/helpers/accesses_helper.rb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/icons.css b/app/assets/stylesheets/icons.css index 6eab28b1b..6c3eaa936 100644 --- a/app/assets/stylesheets/icons.css +++ b/app/assets/stylesheets/icons.css @@ -63,6 +63,8 @@ .icon--move { --svg: url("move.svg "); } .icon--notification-bell-access-only { --svg: url("bell.svg "); } .icon--notification-bell-watching { --svg: url("bell-off.svg "); } + .icon--notification-bell-reverse-access-only { --svg: url("bell-off.svg "); } + .icon--notification-bell-reverse-watching { --svg: url("bell.svg "); } .icon--password { --svg: url("password.svg "); } .icon--pencil { --svg: url("pencil.svg "); } .icon--person { --svg: url("person.svg "); } diff --git a/app/helpers/accesses_helper.rb b/app/helpers/accesses_helper.rb index 833a1a2b0..3a8aa3bce 100644 --- a/app/helpers/accesses_helper.rb +++ b/app/helpers/accesses_helper.rb @@ -54,7 +54,7 @@ module AccessesHelper params: { show_watchers: show_watchers, involvement: next_involvement(access.involvement) } ) do safe_join([ - icon_tag("notification-bell-#{access.involvement.dasherize}"), + icon_tag("notification-bell-#{icon_only ? 'reverse-' : nil}#{access.involvement.dasherize}"), tag.span( involvement_access_label(collection, access.involvement), class: class_names("txt-nowrap txt-uppercase", "for-screen-reader": icon_only), From ece2dae1541a83f6b2dee17d4c604efca64a5100 Mon Sep 17 00:00:00 2001 From: Andy Smith Date: Fri, 26 Sep 2025 12:50:39 -0500 Subject: [PATCH 2/2] Ensure icon_only persists after turbo frame reload --- app/helpers/accesses_helper.rb | 2 +- app/views/collections/involvements/update.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/accesses_helper.rb b/app/helpers/accesses_helper.rb index 3a8aa3bce..8e3dee6a3 100644 --- a/app/helpers/accesses_helper.rb +++ b/app/helpers/accesses_helper.rb @@ -51,7 +51,7 @@ module AccessesHelper method: :put, aria: { labelledby: involvement_label_id }, class: "btn", - params: { show_watchers: show_watchers, involvement: next_involvement(access.involvement) } + params: { show_watchers: show_watchers, involvement: next_involvement(access.involvement), icon_only: icon_only } ) do safe_join([ icon_tag("notification-bell-#{icon_only ? 'reverse-' : nil}#{access.involvement.dasherize}"), diff --git a/app/views/collections/involvements/update.html.erb b/app/views/collections/involvements/update.html.erb index 28c5cfe0e..3b9539e4f 100644 --- a/app/views/collections/involvements/update.html.erb +++ b/app/views/collections/involvements/update.html.erb @@ -1 +1 @@ -<%= access_involvement_advance_button(@collection, Current.user, show_watchers: params[:show_watchers] == 'true') %> +<%= access_involvement_advance_button(@collection, Current.user, show_watchers: params[:show_watchers] == 'true', icon_only: params[:icon_only] == 'true') %>