@@ -41,8 +41,9 @@ html data-theme="light"
4141 - if user_signed_in? && current_user.username.blank?
4242 .global-warning
4343 span Please set a username in Settings.
44+ - starred_active = controller_name == " topics" && action_name == " index" && params[:filter ].to_s == " starred_by_me"
4445 nav .main-navigation
45- .nav-container
46+ .nav-container data-controller = " nav-overflow " data-nav-overflow-target = " container "
4647 .nav-brand
4748 - if content_for?(:sidebar )
4849 button .nav-burger type =" button" aria-label =" Toggle sidebar" data-action =" click->sidebar#toggleMobile"
@@ -56,6 +57,13 @@ html data-theme="light"
5657 i .fa-solid .fa-caret-down
5758 .mobile-nav-menu data-action =" click->sidebar#closeMenuOnNavigate"
5859 = link_to " Topics" , topics_path, class : " nav-link"
60+ - if user_signed_in?
61+ - icon_class = starred_active ? " fa-solid fa-star" : " fa-regular fa-star"
62+ - link_classes = [" nav-link" ]
63+ - link_classes << " is-active" if starred_active
64+ = link_to topics_path(filter: " starred_by_me" ), class : link_classes.join(" " ), title: " Starred by me" , aria: { label: " Starred by me" } do
65+ i class =icon_class aria-hidden =" true"
66+ span .sr-only Starred
5967 = link_to " Search" , topics_path(anchor: " search" ), class : " nav-link"
6068 = link_to " Statistics" , stats_path, class : " nav-link"
6169 = link_to " Reports" , reports_path, class : " nav-link"
@@ -74,35 +82,54 @@ html data-theme="light"
7482 span .tagline PostgreSQL Hackers Archive
7583 - if user_signed_in?
7684 - unread = activity_unread_count
85+ - starred_href = starred_active ? topics_path : topics_path(filter: " starred_by_me" )
86+ - starred_title = starred_active ? " All topics" : " Starred by me"
87+ = link_to starred_href, class : " nav-link nav-mobile-star#{ ' is-active' if starred_active} " , title: starred_title, aria: { label: starred_title } do
88+ i class =(starred_active ? " fa-solid fa-star" : " fa-regular fa-star" ) aria-hidden =" true"
89+ span .sr-only Starred
7790 = link_to activities_path, class : " nav-link nav-link-activity nav-mobile-bell" , title: " Activity" do
7891 i .fa-regular .fa-bell
7992 - if unread.positive?
8093 span .nav-badge = unread
81- .nav-links
82- = link_to " Topics" , topics_path, class : " nav-link"
83- - search_link = content_for?(:search_sidebar ) ? " #search" : topics_path(anchor: " search" )
84- = link_to " Search" , search_link, class : " nav-link"
85- = link_to " Statistics" , stats_path, class : " nav-link"
86- = link_to " Reports" , reports_path, class : " nav-link"
87- = link_to " Help" , help_index_path, class : " nav-link"
88- .nav-right
89- button .nav-link .theme-toggle type =" button" aria-label =" Toggle theme" data-controller =" theme" data-action =" click->theme#toggle"
90- i .fas .fa-moon data-theme-target =" icon"
91- span data-theme-target =" label" Theme
92- .nav-auth
94+ .nav-menu data-nav-overflow-target =" menu"
95+ .nav-links
9396 - if user_signed_in?
94- - if current_user&.person&.default_alias
95- = link_to current_user.person.default_alias.name, person_path(current_user.person.default_alias.email), class : " nav-link nav-user"
96- - unread = activity_unread_count
97- = link_to activities_path, class : " nav-link nav-link-activity" , title: " Activity" do
98- i .fa-regular .fa-bell
99- - if unread.positive?
100- span .nav-badge = unread
101- = link_to " Settings" , settings_root_path, class : " nav-link"
102- = button_to " Sign out" , session_path, method: :delete , class : " nav-link" , form: { style: ' display:inline' }, data: { turbo: false }
103- - else
104- = link_to " Sign in" , new_session_path, class : " nav-link"
105- = link_to " Register" , new_registration_path, class : " nav-link"
97+ - starred_href = starred_active ? topics_path : topics_path(filter: " starred_by_me" )
98+ - starred_title = starred_active ? " All topics" : " Starred by me"
99+ - icon_class = starred_active ? " fa-solid fa-star" : " fa-regular fa-star"
100+ - link_classes = [" nav-link" ]
101+ - link_classes << " is-active" if starred_active
102+ = link_to starred_href, class : link_classes.join(" " ), title: starred_title, aria: { label: starred_title }, data: { " nav-overflow-target" : " item" } do
103+ i class =icon_class aria-hidden =" true"
104+ span .sr-only Starred
105+ = link_to " Topics" , topics_path, class : " nav-link" , data: { " nav-overflow-target" : " item" }
106+ - search_link = content_for?(:search_sidebar ) ? " #search" : topics_path(anchor: " search" )
107+ = link_to " Search" , search_link, class : " nav-link" , data: { " nav-overflow-target" : " item" }
108+ = link_to " Statistics" , stats_path, class : " nav-link" , data: { " nav-overflow-target" : " item" }
109+ = link_to " Reports" , reports_path, class : " nav-link" , data: { " nav-overflow-target" : " item" }
110+ = link_to " Help" , help_index_path, class : " nav-link" , data: { " nav-overflow-target" : " item" }
111+ .nav-right
112+ button .nav-link .theme-toggle type =" button" aria-label =" Toggle theme" data-controller =" theme" data-action =" click->theme#toggle" data-nav-overflow-target =" item"
113+ i .fas .fa-moon data-theme-target =" icon"
114+ span data-theme-target =" label" Theme
115+ .nav-auth
116+ - if user_signed_in?
117+ - if current_user&.person&.default_alias
118+ = link_to current_user.person.default_alias.name, person_path(current_user.person.default_alias.email), class : " nav-link nav-user" , data: { " nav-overflow-target" : " item" }
119+ - unread = activity_unread_count
120+ = link_to activities_path, class : " nav-link nav-link-activity" , title: " Activity" , data: { " nav-overflow-target" : " item" } do
121+ i .fa-regular .fa-bell
122+ - if unread.positive?
123+ span .nav-badge = unread
124+ = link_to " Settings" , settings_root_path, class : " nav-link" , data: { " nav-overflow-target" : " item" }
125+ = button_to " Sign out" , session_path, method: :delete , class : " nav-link" , form: { style: ' display:inline' , data: { " nav-overflow-target" : " item" } }, data: { turbo: false }
126+ - else
127+ = link_to " Sign in" , new_session_path, class : " nav-link" , data: { " nav-overflow-target" : " item" }
128+ = link_to " Register" , new_registration_path, class : " nav-link" , data: { " nav-overflow-target" : " item" }
129+ details .nav-overflow-dropdown data-nav-overflow-target =" overflow"
130+ summary .nav-link .nav-overflow-toggle aria-label =" More" data-action =" click->sidebar#closeMenuOnNavigate"
131+ i .fa-solid .fa-bars
132+ .nav-overflow-menu data-nav-overflow-target =" overflowMenu"
106133
107134 - if content_for?(:sidebar )
108135 .page-layout .with-sidebar data-sidebar-target =" layout"
0 commit comments