Skip to content

Commit

Permalink
web,template: always show nav for researchers and admins
Browse files Browse the repository at this point in the history
  • Loading branch information
Bogdanp committed Oct 24, 2024
1 parent d65cba6 commit 3fff892
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions congame-web/components/template.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
koyo/profiler
koyo/url
racket/format
threading
web-server/http
xml)

Expand Down Expand Up @@ -46,6 +47,10 @@
(define (page/xexpr #:subtitle [subtitle #f]
#:show-nav? [show-nav? #f]
. content)
(define current-user-researcher?
(and~>
(current-user)
(user-admin-like?)))
(haml
(:html
(:head
Expand Down Expand Up @@ -79,8 +84,8 @@ SCRIPT
(:a
([:href (reverse-uri 'admin:stop-impersonation-page)])
"Stop impersonating user."))))
(when show-nav?
(cond [(and (current-user) (user-admin-like? (current-user)))
(when (or show-nav? current-user-researcher?)
(cond [current-user-researcher?
(nav
(nav-item (reverse-uri 'study-instances-page) (translate 'nav-dashboard))
(nav-item (reverse-uri 'logout-page) (translate 'nav-log-out))
Expand Down

0 comments on commit 3fff892

Please sign in to comment.