mirror of
https://github.com/Retrospring/retrospring.git
synced 2024-11-20 12:39:53 +01:00
41 lines
2.8 KiB
Text
41 lines
2.8 KiB
Text
%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 }
|
|
.container
|
|
%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"]
|
|
- if Rails.env.development?
|
|
%span.badge.rounded-pill.bg-warning.text-bg-warning.fs-7
|
|
DEV
|
|
%ul.nav.navbar-nav.me-auto
|
|
= nav_entry t("navigation.timeline"), root_path, icon: "home", hotkey: "g t"
|
|
= nav_entry t("navigation.inbox"), "/inbox", icon: "inbox", badge: inbox_count, badge_attr: { data: { controller: "pwa-badge" } }, hotkey: "g i", id: "nav-inbox-desktop"
|
|
- if APP_CONFIG.dig(:features, :discover, :enabled) || current_user.mod?
|
|
= 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: { 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")
|
|
= nav_entry t("navigation.notifications"), notifications_path, class: "d-block d-sm-none", hotkey: "g n"
|
|
%li.nav-item.dropdown.d-none.d-sm-block
|
|
%a.nav-link.dropdown-toggle{ href: '#', data: { bs_toggle: :dropdown } }
|
|
%turbo-frame#notification-desktop-icon
|
|
= render "navigation/icons/notifications", notification_count:
|
|
.dropdown-menu.dropdown-menu-end.notification-dropdown
|
|
%turbo-frame#notifications-dropdown-list
|
|
- 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: { 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
|
|
%a.nav-link.dropdown-toggle.p-sm-0{ href: "#", data: { bs_toggle: :dropdown } }
|
|
= render AvatarComponent.new(user: current_user, size: "md", classes: ["d-none", "d-sm-inline"])
|
|
%span.d-inline.d-sm-none
|
|
= current_user.screen_name
|
|
%b.caret
|
|
= render 'navigation/dropdown/profile', size: "desktop"
|