2023-01-11 12:48:15 -08:00
|
|
|
%nav.navbar.navbar-themed.navbar-expand-lg.bg-primary.fixed-top.d-lg-block.d-none.d-print-none{ class: Rails.env.development? ? "navbar-dev" : "", role: :navigation }
|
2022-12-04 14:07:13 -08:00
|
|
|
.container
|
2022-10-24 13:55:48 -07:00
|
|
|
%a.navbar-brand{ href: '/', title: APP_CONFIG["site_name"] }
|
|
|
|
- if APP_CONFIG["use_svg_logo"]
|
|
|
|
= render inline: Rails.application.config.justask_svg_logo
|
|
|
|
- else
|
|
|
|
= APP_CONFIG["site_name"]
|
2023-01-11 12:48:42 -08:00
|
|
|
- if Rails.env.development?
|
|
|
|
%span.badge.rounded-pill.bg-warning.text-bg-warning.fs-7
|
|
|
|
DEV
|
2023-01-04 02:00:45 -08:00
|
|
|
%ul.nav.navbar-nav.me-auto
|
2023-03-05 10:38:31 -08:00
|
|
|
= nav_entry t("navigation.timeline"), root_path, icon: "home", hotkey: "g t"
|
2023-02-07 15:00:50 -08:00
|
|
|
= nav_entry t("navigation.inbox"), "/inbox", icon: "inbox", badge: inbox_count, badge_attr: { data: { controller: "pwa-badge" } }, hotkey: "g i"
|
2021-08-05 15:36:02 -07:00
|
|
|
- if APP_CONFIG.dig(:features, :discover, :enabled) || current_user.mod?
|
2023-03-05 10:38:31 -08:00
|
|
|
= nav_entry t("navigation.discover"), discover_path, icon: "compass", hotkey: "g d"
|
2021-08-05 15:36:02 -07:00
|
|
|
%ul.nav.navbar-nav
|
|
|
|
- if @user.present? && @user != current_user
|
2023-01-04 03:23:47 -08:00
|
|
|
%li.nav-item.d-none.d-sm-block{ data: { bs_toggle: 'tooltip', bs_placement: 'bottom' }, title: t(".list") }
|
|
|
|
%a.nav-link{ href: '#', data: { bs_target: '#modal-list-memberships', bs_toggle: :modal } }
|
2021-08-05 15:36:02 -07:00
|
|
|
%i.fa.fa-list.hidden-xs
|
2022-07-30 11:14:02 -07:00
|
|
|
%span.d-none.d-sm-inline.d-md-none= t(".list")
|
2023-03-07 10:53:57 -08:00
|
|
|
= nav_entry t("navigation.notifications"), notifications_path, class: "d-block d-sm-none", hotkey: "g n"
|
2022-07-17 11:53:53 -07:00
|
|
|
%li.nav-item.dropdown.d-none.d-sm-block
|
2023-01-04 03:23:47 -08:00
|
|
|
%a.nav-link.dropdown-toggle{ href: '#', data: { bs_toggle: :dropdown } }
|
2023-03-07 10:53:57 -08:00
|
|
|
%turbo-frame#notification-desktop-icon
|
|
|
|
- if notification_count.nil?
|
|
|
|
%i.fa.fa-bell-o
|
|
|
|
- else
|
|
|
|
%i.fa.fa-bell
|
|
|
|
%span.visually-hidden= t("navigation.notifications")
|
|
|
|
%span.badge= notification_count
|
|
|
|
.dropdown-menu.dropdown-menu-end.notification-dropdown
|
|
|
|
%turbo-frame#notifications-dropdown-list
|
2023-05-07 07:54:35 -07:00
|
|
|
- cache current_user.notification_dropdown_cache_key do
|
2023-05-05 07:45:42 -07:00
|
|
|
- notifications = Notification.for(current_user).where(new: true).includes([:target]).limit(4)
|
2023-05-07 03:51:40 -07:00
|
|
|
= render "navigation/dropdown/notifications", notifications:, size: "desktop"
|
2023-01-04 03:23:47 -08:00
|
|
|
%li.nav-item.d-none.d-sm-block{ data: { bs_toggle: 'tooltip', bs_placement: 'bottom' }, title: t('.ask_question') }
|
2023-03-05 10:38:31 -08:00
|
|
|
%a.nav-link{ href: "#", name: "toggle-all-ask", data: { bs_target: "#modal-ask-followers", bs_toggle: :modal, hotkey: "n" } }
|
2021-08-05 15:36:02 -07:00
|
|
|
%i.fa.fa-pencil-square-o
|
2022-07-17 11:53:53 -07:00
|
|
|
%li.nav-item.dropdown.profile--image-dropdown
|
2023-01-04 03:23:47 -08:00
|
|
|
%a.nav-link.dropdown-toggle.p-sm-0{ href: "#", data: { bs_toggle: :dropdown } }
|
2022-07-17 11:53:53 -07:00
|
|
|
%img.avatar-md.d-none.d-sm-inline{ src: current_user.profile_picture.url(:small) }
|
|
|
|
%span.d-inline.d-sm-none
|
|
|
|
= current_user.screen_name
|
|
|
|
%b.caret
|
|
|
|
= render 'navigation/dropdown/profile', size: "desktop"
|