summaryrefslogtreecommitdiff
path: root/views/header.ejs
blob: c8337fce923dfd8771c9d095d3183c265f3b1c49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1">
<% if (typeof refresh !== 'undefined' && refresh > 0) { %><meta http-equiv="refresh" content="<%= refresh %>"><% } %>
<link rel="icon" href="/favicon.svg">
<title><%= title %></title>
<style>
<%- include('../public/fonts/fonts.css') _%>
<%- include('../public/style.css') _%>
</style>
</head>
<body>
<div class="header">
<div><a href="/"><img src="/images/rally-the-troops.svg" width="48" height="48"></a></div>
<div>
<span><a href="/about">About</a></span>
<span><a href="/forum">Forum</a></span>
<%
	if (user) {
		let unread = user.unread | 0;
		if (unread > 0) {
			%><span><a href="/inbox">Inbox (<%= unread %>)</a></span><%
		} else {
			%><span><a href="/inbox">Inbox</a></span><%
		}
		%><span><a href="/profile">Profile (<%= user.name %>)</a></span><%
	} else {
		%><span><a href="/signup">Signup</a></span><%
		%><span><a href="/login">Login</a></span><%
	}
%>
</div>
</div>
<div class="main">
<h1><%= title %></h1>
<%
	if (typeof flash !== 'undefined' && flash.length > 0) {
		%><p class="error"><%= Array.isArray(flash) ? flash.join("\n") : flash %></p><%
	}
%>