mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-02-13 21:33:20 +01:00
Put IDs directly on nav entries
This commit is contained in:
parent
bcfb215f8c
commit
cb89d42813
3 changed files with 7 additions and 8 deletions
|
@ -8,6 +8,7 @@ module BootstrapHelper
|
||||||
badge_attr: {},
|
badge_attr: {},
|
||||||
icon: nil,
|
icon: nil,
|
||||||
class: "",
|
class: "",
|
||||||
|
id: nil,
|
||||||
hotkey: nil,
|
hotkey: nil,
|
||||||
}.merge(options)
|
}.merge(options)
|
||||||
|
|
||||||
|
@ -34,7 +35,7 @@ module BootstrapHelper
|
||||||
body += " #{content_tag(:span, options[:badge], class: badge_class, **options[:badge_attr])}".html_safe
|
body += " #{content_tag(:span, options[:badge], class: badge_class, **options[:badge_attr])}".html_safe
|
||||||
end
|
end
|
||||||
|
|
||||||
content_tag(:li, link_to(body.html_safe, path, class: "nav-link", data: { hotkey: options[:hotkey] }), class: classes)
|
content_tag(:li, link_to(body.html_safe, path, class: "nav-link", data: { hotkey: options[:hotkey] }), class: classes, id: options[:id])
|
||||||
end
|
end
|
||||||
|
|
||||||
def list_group_item(body, path, options = {})
|
def list_group_item(body, path, options = {})
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
%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 }
|
%nav.navbar.navbar-themed.navbar-expand-lg.bg-primary.fixed-top.d-lg-block.d-none.d-print-none{ class: Rails.env.tdevelopment? ? "navbar-dev" : "", role: :navigation }
|
||||||
.container
|
.container
|
||||||
%a.navbar-brand{ href: '/', title: APP_CONFIG["site_name"] }
|
%a.navbar-brand{ href: '/', title: APP_CONFIG["site_name"] }
|
||||||
- if APP_CONFIG["use_svg_logo"]
|
- if APP_CONFIG["use_svg_logo"]
|
||||||
|
@ -10,8 +10,7 @@
|
||||||
DEV
|
DEV
|
||||||
%ul.nav.navbar-nav.me-auto
|
%ul.nav.navbar-nav.me-auto
|
||||||
= nav_entry t("navigation.timeline"), root_path, icon: "home", hotkey: "g t"
|
= nav_entry t("navigation.timeline"), root_path, icon: "home", hotkey: "g t"
|
||||||
#nav-inbox-desktop
|
= nav_entry t("navigation.inbox"), "/inbox", icon: "inbox", badge: inbox_count, badge_attr: { data: { controller: "pwa-badge" } }, hotkey: "g i", id: "nav-inbox-desktop"
|
||||||
= nav_entry t("navigation.inbox"), "/inbox", icon: "inbox", badge: inbox_count, badge_attr: { data: { controller: "pwa-badge" } }, hotkey: "g i"
|
|
||||||
- if APP_CONFIG.dig(:features, :discover, :enabled) || current_user.mod?
|
- if APP_CONFIG.dig(:features, :discover, :enabled) || current_user.mod?
|
||||||
= nav_entry t("navigation.discover"), discover_path, icon: "compass", hotkey: "g d"
|
= nav_entry t("navigation.discover"), discover_path, icon: "compass", hotkey: "g d"
|
||||||
%ul.nav.navbar-nav
|
%ul.nav.navbar-nav
|
||||||
|
|
|
@ -3,10 +3,9 @@
|
||||||
.container
|
.container
|
||||||
%ul.nav.navbar-nav.navbar-icon-row
|
%ul.nav.navbar-nav.navbar-icon-row
|
||||||
= nav_entry t("navigation.timeline"), root_path, icon: 'home', icon_only: true
|
= nav_entry t("navigation.timeline"), root_path, icon: 'home', icon_only: true
|
||||||
#nav-inbox-mobile
|
= nav_entry t("navigation.inbox"), '/inbox',
|
||||||
= nav_entry t("navigation.inbox"), '/inbox',
|
badge: inbox_count, badge_color: 'primary', badge_pill: true,
|
||||||
badge: inbox_count, badge_color: 'primary', badge_pill: true,
|
icon: 'inbox', icon_only: true, id: "nav-inbox-mobile"
|
||||||
icon: 'inbox', icon_only: true
|
|
||||||
- if APP_CONFIG.dig(:features, :discover, :enabled) || current_user.mod?
|
- if APP_CONFIG.dig(:features, :discover, :enabled) || current_user.mod?
|
||||||
= nav_entry t("navigation.discover"), discover_path, icon: 'compass', icon_only: true
|
= nav_entry t("navigation.discover"), discover_path, icon: 'compass', icon_only: true
|
||||||
= nav_entry t("navigation.notifications"), notifications_path("all"), icon: notifications_icon,
|
= nav_entry t("navigation.notifications"), notifications_path("all"), icon: notifications_icon,
|
||||||
|
|
Loading…
Reference in a new issue