album/templates/head.rs.html
Rasmus Kaj 551c5c6897 Redirect from /random.
Use a redirect rather than just rendering a random photo page.
Also, add a link to /random to the menu.
2017-11-07 23:36:09 +01:00

19 lines
683 B
HTML

@use ::Link;
@use nickel::Request;
@use nickel_jwt_session::SessionRequestExtensions;
@(req: &Request, lpath: &[Link])
<header>
<span><a href="/">Images</a>
@for p in lpath { - <a href="@p.url">@p.name</a> }
</span>
<span>· <a href="/tag/">Tags</a></span>
<span>· <a href="/person/">People</a></span>
<span>· <a href="/place/">Places</a></span>
<span>· <a href="/thisday">On this day</a></span>
<span>· <a href="/random">Random pic</a></span>
@if let Some(ref u) = req.authorized_user() {<span class="user">@u (<a href="/logout">log out</a>)</span>}
else {<span class="user">(<a href="/login@if let Some(p) = req.path_without_query() {?next=@p}">log in</a>)</span>}
</header>