diff --git a/app/helpers/events_helper.rb b/app/helpers/events_helper.rb index c7aa72715..7c55f857e 100644 --- a/app/helpers/events_helper.rb +++ b/app/helpers/events_helper.rb @@ -68,7 +68,12 @@ module EventsHelper end def event_creator_name(event) - event.creator == Current.user ? "You" : h(event.creator.name) + tag.span data: { creator_id: event.creator.id } do + safe_join([ + tag.span("You", data: { only_visible_to_you: true }), + tag.span(h(event.creator.name), data: { only_visible_to_others: true }) + ]) + end end def card_event_action_sentence(event) diff --git a/app/views/layouts/shared/_head.html.erb b/app/views/layouts/shared/_head.html.erb index 8e96ff3bf..997bc48db 100644 --- a/app/views/layouts/shared/_head.html.erb +++ b/app/views/layouts/shared/_head.html.erb @@ -20,6 +20,8 @@ <%= javascript_importmap_tags %> <%= tenanted_action_cable_meta_tag %> + <%= render "layouts/shared/user_css" %> + <%= yield :head %> <% if ApplicationRecord.current_tenant %> diff --git a/app/views/layouts/shared/_user_css.html.erb b/app/views/layouts/shared/_user_css.html.erb new file mode 100644 index 000000000..3a9bfc3dc --- /dev/null +++ b/app/views/layouts/shared/_user_css.html.erb @@ -0,0 +1,10 @@ +<% if Current.user %> + +<% end %> diff --git a/test/controllers/events_controller_test.rb b/test/controllers/events_controller_test.rb index c89c06540..38affbac9 100644 --- a/test/controllers/events_controller_test.rb +++ b/test/controllers/events_controller_test.rb @@ -12,7 +12,7 @@ class EventsControllerTest < ActionDispatch::IntegrationTest get events_path assert_select "div.events__time-block[style='grid-area: 17/2']" do - assert_select "strong", text: "David assigned JZ to Layout is broken" + assert_select "strong", text: /assigned JZ to Layout is broken/ end end @@ -22,7 +22,7 @@ class EventsControllerTest < ActionDispatch::IntegrationTest get events_path assert_select "div.events__time-block[style='grid-area: 22/2']" do - assert_select "strong", text: "David assigned JZ to Layout is broken" + assert_select "strong", text: /assigned JZ to Layout is broken/ end end