Skip to content

Commit 22fe8f1

Browse files
committed
Move the navbar into a container so it sticks on top
Signed-off-by: Kai Wagner <kai.wagner@percona.com>
1 parent c06c2a7 commit 22fe8f1

File tree

2 files changed

+30
-30
lines changed

2 files changed

+30
-30
lines changed

app/assets/stylesheets/components/navigation.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44

55
.main-navigation {
6-
background-color: var(--color-bg-nav);
6+
background-color: var(--color-bg-page);
77
border-bottom: var(--border-width) solid var(--color-border);
88
box-shadow: var(--shadow-sm);
99
position: sticky;

app/views/layouts/application.html.slim

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -34,35 +34,35 @@ html data-theme="light"
3434
.global-warning
3535
span Please set a username in Settings.
3636
nav.main-navigation
37-
.nav-container
38-
.nav-brand
39-
= link_to root_path, class: "brand-link" do
40-
img.brand-icon src="/icon.png" alt="Hackorum" width="24" height="24"
41-
span.brand-text Hackorum
42-
span.tagline PostgreSQL Hackers Archive
43-
.nav-links
44-
= link_to "Topics", topics_path, class: "nav-link"
45-
- search_link = content_for?(:search_sidebar) ? "#search" : topics_path(anchor: "search")
46-
= link_to "Search", search_link, class: "nav-link"
47-
= link_to "Statistics", stats_path, class: "nav-link"
48-
.nav-right
49-
button.nav-link.theme-toggle type="button" aria-label="Toggle theme" data-controller="theme" data-action="click->theme#toggle"
50-
i.fas.fa-moon data-theme-target="icon"
51-
span data-theme-target="label" Theme
52-
.nav-auth
53-
- if user_signed_in?
54-
- if current_user&.person&.default_alias
55-
span.nav-user = current_user.person.default_alias.name
56-
- unread = activity_unread_count
57-
= link_to activities_path, class: "nav-link nav-link-activity", title: "Activity" do
58-
i.fa-regular.fa-bell
59-
- if unread.positive?
60-
span.nav-badge = unread
61-
= link_to "Settings", settings_path, class: "nav-link"
62-
= button_to "Sign out", session_path, method: :delete, class: "nav-link", form: { style: 'display:inline' }, data: { turbo: false }
63-
- else
64-
= link_to "Sign in", new_session_path, class: "nav-link"
65-
= link_to "Register", new_registration_path, class: "nav-link"
37+
.nav-container
38+
.nav-brand
39+
= link_to root_path, class: "brand-link" do
40+
img.brand-icon src="/icon.png" alt="Hackorum" width="24" height="24"
41+
span.brand-text Hackorum
42+
span.tagline PostgreSQL Hackers Archive
43+
.nav-links
44+
= link_to "Topics", topics_path, class: "nav-link"
45+
- search_link = content_for?(:search_sidebar) ? "#search" : topics_path(anchor: "search")
46+
= link_to "Search", search_link, class: "nav-link"
47+
= link_to "Statistics", stats_path, class: "nav-link"
48+
.nav-right
49+
button.nav-link.theme-toggle type="button" aria-label="Toggle theme" data-controller="theme" data-action="click->theme#toggle"
50+
i.fas.fa-moon data-theme-target="icon"
51+
span data-theme-target="label" Theme
52+
.nav-auth
53+
- if user_signed_in?
54+
- if current_user&.person&.default_alias
55+
span.nav-user = current_user.person.default_alias.name
56+
- unread = activity_unread_count
57+
= link_to activities_path, class: "nav-link nav-link-activity", title: "Activity" do
58+
i.fa-regular.fa-bell
59+
- if unread.positive?
60+
span.nav-badge = unread
61+
= link_to "Settings", settings_path, class: "nav-link"
62+
= button_to "Sign out", session_path, method: :delete, class: "nav-link", form: { style: 'display:inline' }, data: { turbo: false }
63+
- else
64+
= link_to "Sign in", new_session_path, class: "nav-link"
65+
= link_to "Register", new_registration_path, class: "nav-link"
6666

6767
- if content_for?(:sidebar)
6868
.page-layout.with-sidebar

0 commit comments

Comments
 (0)