File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4343 const header = document . querySelector ( 'header' ) ;
4444 if ( header && ! header . innerHTML . trim ( ) ) {
4545 header . innerHTML = headerHTML ;
46+
47+ // Add Stats link if logged in as owner
48+ if ( localStorage . getItem ( 'thoughts_is_owner' ) === 'true' ) {
49+ const nav = header . querySelector ( 'nav' ) ;
50+ if ( nav ) {
51+ const statsLink = document . createElement ( 'a' ) ;
52+ statsLink . href = '/stats/' ;
53+ statsLink . textContent = 'Stats' ;
54+ nav . appendChild ( statsLink ) ;
55+ }
56+ }
4657 }
4758
4859 // Hamburger menu functionality
98109 ( pagePath . startsWith ( 'diffchecker' ) && href . includes ( 'diffchecker' ) ) ||
99110 ( pagePath . startsWith ( 'job_search' ) && href . includes ( 'job_search' ) ) ||
100111 ( pagePath . startsWith ( 'thoughts' ) && href . includes ( 'thoughts' ) ) ||
112+ ( pagePath . startsWith ( 'stats' ) && href . includes ( 'stats' ) ) ||
101113 ( pagePath . startsWith ( 'post' ) && href . includes ( '/blogs/' ) ) ) {
102114 link . classList . add ( 'active' ) ;
103115 }
You can’t perform that action at this time.
0 commit comments