100 lines
4.8 KiB
HTML
100 lines
4.8 KiB
HTML
<header class="mb3">
|
|
<div class="user-options flex justify-center justify-end-ns">
|
|
{{ if .User }}
|
|
{{ if .User.IsSuperuser }}
|
|
<a class="admin-panel" href="{{ .Header.AdminUrl }}"><span class="icon-settings"> Admin</span></a>
|
|
{{ end }}
|
|
<a class="username settings" href="{{ .Header.UserSettingsUrl }}"><span class="icon-settings"></span> {{ .User.Username }}</a>
|
|
<a class="logout" href="{{ .Header.LogoutActionUrl }}"><span class="icon-logout"></span> Log Out</a>
|
|
{{ else }}
|
|
<a class="register" id="register-link" href="{{ .Header.RegisterUrl }}">Register</a>
|
|
<a class="login" id="login-link" href="{{ .LoginPageUrl }}">Log in</a>
|
|
<div id="login-popup">
|
|
<form action="{{ .Header.LoginActionUrl }}" method="post">
|
|
{{/* TODO: CSRF */}}
|
|
<table>
|
|
<tr>
|
|
<th><label>Username:</label></th>
|
|
<td><input type="text" name="username" class="textbox username" value="" /></td>
|
|
</tr>
|
|
<tr>
|
|
<th><label>Password:</label></th>
|
|
<td><input type="password" name="password" class="textbox password" value="" /></td>
|
|
</tr>
|
|
{{/* TODO: Forgot password flow? Or just on standalone page? */}}
|
|
</table>
|
|
<input type="hidden" name="redirect" value="{{ $.CurrentUrl }}">
|
|
<div class="actionbar pt2">
|
|
<input type="submit" value="Log In" />
|
|
</div>
|
|
</form>
|
|
</div>
|
|
{{ end }}
|
|
</div>
|
|
<div class="menu-bar flex flex-column flex-row-l justify-between {{ if .IsProjectPage }}project{{ end }}">
|
|
<div class="flex flex-column flex-row-ns">
|
|
<a href="{{ .Header.HMNHomepageUrl }}" class="logo hmdev-logo">
|
|
<div class="underscore"></div>
|
|
</a>
|
|
<div class="items flex items-center justify-center justify-start-ns">
|
|
{{ if .IsProjectPage }}
|
|
<a class="project-logo" href="{{ .Header.ProjectHomepageUrl }}">
|
|
<h1>{{ .Project.Name }}</h1>
|
|
</a>
|
|
{{ end }}
|
|
{{ if not .IsProjectPage }}
|
|
<a href="{{ .Header.ProjectIndexUrl }}" class="projects">Projects</a>
|
|
{{ end }}
|
|
{{ if .Project.HasBlog }}
|
|
<a href="{{ .Header.BlogUrl }}" class="blog">{{ if .IsProjectPage }}Blog{{ else }}News{{ end }}</a>
|
|
{{ end }}
|
|
{{ if .Project.HasForum }}
|
|
<a href="{{ .Header.ForumsUrl }}" class="forums">Forums</a>
|
|
{{ end }}
|
|
{{ if .Project.HasWiki }}
|
|
<a href="{{ .Header.WikiUrl }}" class="wiki">Wiki</a>
|
|
{{ end }}
|
|
{{ if .Project.HasLibrary }}
|
|
<a href="{{ .Header.LibraryUrl }}" class="library">Library</a>
|
|
{{ end }}
|
|
{{ if .Project.IsHMN }}
|
|
<a href="{{ .Header.ManifestoUrl }}" class="misson">Mission</a>
|
|
{{ end }}
|
|
{{/* {% if project.default_annotation_category %} */}}
|
|
{{ if false }}
|
|
<a href="{{ .Header.EpisodeGuideUrl }}" class="annotations">Episode Guide</a>
|
|
{{ end }}
|
|
{{/* {% if showEditLink == True %} */}}
|
|
{{/* {{ if false }}
|
|
<a class="edit" href="{{ .Header.EditUrl }}" title="Edit {{ project.name }}"><span class="icon">0</span> Settings</a>
|
|
{{ end }} */}}
|
|
</div>
|
|
</div>
|
|
<form class="dn ma0 flex-l flex-column justify-center items-end" method="post" action="{{ .Header.SearchActionUrl }}" target="_blank">
|
|
{{/* TODO: CSRF? */}}
|
|
<input class="site-search bn lite pa2 fira" type="text" name="term" value="" placeholder="Search with Google" size="17" />
|
|
<input id="search_button_homepage" type="submit" value="Go"/>
|
|
</form>
|
|
</div>
|
|
</header>
|
|
|
|
<script type="text/javascript">
|
|
document.addEventListener("DOMContentLoaded", function() {
|
|
var loginPopup = document.getElementById("login-popup");
|
|
var loginLink = document.getElementById("login-link");
|
|
|
|
if (loginPopup !== null) {
|
|
loginLink.removeAttribute("href");
|
|
|
|
loginLink.onclick = function() {
|
|
loginPopup.classList.toggle("open");
|
|
}
|
|
}
|
|
|
|
for (const time of document.querySelectorAll('time')) {
|
|
const d = new Date(Date.parse(time.dateTime));
|
|
time.title = d.toLocaleString();
|
|
}
|
|
});
|
|
</script>
|