Adjust manual tooltip initializations

This commit is contained in:
Andreas Nedbal 2024-03-10 15:29:31 +01:00 committed by Andreas Nedbal
parent 95c79216cb
commit 04931b627c
4 changed files with 10 additions and 7 deletions

View File

@ -6,12 +6,15 @@
.flex-grow-1
%h6.text-muted.question__user
- if @question.author_is_anonymous
%i.fas.fa-user-secret{ title: t(".anon_hint") }
%span{ title: t(".anon_hint"), data: { controller: :tooltip, bs_placement: :bottom } }
%i.fas.fa-user-secret
- if @profile_question && @question.direct
- if user_signed_in? && @question.user == current_user
%i.fa.fa-eye-slash{ data: { bs_toggle: "tooltip", bs_title: t(".visible_to_you") } }
%span.d-inline-block{ title: t(".visible_to_you"), data: { controller: :tooltip, bs_placement: :bottom } }
%i.fa.fa-eye-slash
- elsif moderation_view?
%i.fa.fa-eye-slash{ data: { bs_toggle: "tooltip", bs_title: t(".visible_mod_mode") } }
%span{ title: t(".visible_mod_mode"), data: { controller: :tooltip, bs_placement: :bottom } }
%i.fa.fa-eye-slash
= user_screen_name(@question.user, context_user: @context_user, author_identifier: author_identifier)
- if follower_question?
·

View File

@ -8,5 +8,5 @@
- a.smiles.all.each do |smile|
%a{ href: user_path(smile.user),
title: user_screen_name(smile.user, url: false),
data: { bs_toggle: :tooltip, bs_placement: :top, smile_id: smile.id, turbo: :false } }
data: { controller: :tooltip, bs_placement: :top, smile_id: smile.id, turbo: :false } }
= render AvatarComponent.new(user: smile.user, size: "xs")

View File

@ -15,7 +15,7 @@
= nav_entry t("navigation.discover"), discover_path, icon: "compass", hotkey: "g d"
%ul.nav.navbar-nav
- if @user.present? && @user != current_user
%li.nav-item.d-none.d-sm-block{ data: { bs_toggle: 'tooltip', bs_placement: 'bottom' }, title: t(".list") }
%li.nav-item.d-none.d-sm-block{ data: { controller: 'tooltip', bs_placement: 'bottom' }, title: t(".list") }
%a.nav-link{ href: '#', data: { bs_target: '#modal-list-memberships', bs_toggle: :modal } }
%i.fa.fa-list.hidden-xs
%span.d-none.d-sm-inline.d-md-none= t(".list")
@ -29,7 +29,7 @@
- cache current_user.notification_dropdown_cache_key, expires_in: 12.hours do
- notifications = Notification.for(current_user).where(new: true).includes([:target]).limit(4)
= render "navigation/dropdown/notifications", notifications:, size: "desktop"
%li.nav-item.d-none.d-sm-block{ data: { bs_toggle: 'tooltip', bs_placement: 'bottom' }, title: t('.ask_question') }
%li.nav-item.d-none.d-sm-block{ data: { controller: :tooltip, bs_placement: 'bottom' }, title: t('.ask_question') }
%a.nav-link{ href: "#", name: "toggle-all-ask", data: { bs_target: "#modal-ask-followers", bs_toggle: :modal, hotkey: "n" } }
%i.fa.fa-pencil-square-o
%li.nav-item.dropdown.profile--image-dropdown

View File

@ -17,7 +17,7 @@
- else
%p.px-4.pb-2
- list.members.each do |member|
%a{ href: user_path(member.user), title: member.user.screen_name, data: { bs_toggle: :tooltip, bs_placement: :top } }
%a{ href: user_path(member.user), title: member.user.screen_name, data: { controller: :tooltip, bs_placement: :top } }
= render AvatarComponent.new(user: member.user, size: "xs")
- if !list && lists.empty?
.p-3= t(".lists.notice_html")