2022-05-09 19:09:24 +00:00
|
|
|
{{ define "nav" }}
|
2022-05-26 13:27:25 +00:00
|
|
|
{{ $user := .User }}
|
|
|
|
{{ if $user }}
|
|
|
|
{{ if canManageUsers $user }}
|
|
|
|
<nav class="ui top attached tabular menu">
|
|
|
|
<a class="{{ if eq .ActiveNav "motions" }}active {{ end }}item" href="/motions/">Motions</a>
|
|
|
|
<a class="{{ if eq .ActiveNav "users" }}active {{ end }}item" href="/users/">User management</a>
|
|
|
|
</nav>
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
{{ if eq .ActiveNav "motions"}}
|
|
|
|
<nav class="ui secondary pointing menu">
|
|
|
|
<a href="/motions/" class="{{ if eq .ActiveSubNav "all-motions" }}active {{ end }}item"
|
|
|
|
title="Show all motions">All
|
|
|
|
motions</a>
|
|
|
|
{{ if $user }}
|
|
|
|
{{ if canVote $user }}
|
|
|
|
<a href="/motions/?unvoted=1" class="{{ if eq .ActiveSubNav "unvoted-motions" }}active {{ end}}item"
|
|
|
|
title="My unvoted motions">My unvoted motions</a>
|
|
|
|
{{ end }}
|
|
|
|
{{ if canStartVote $user }}
|
|
|
|
<div class="right item">
|
2022-05-27 12:42:39 +00:00
|
|
|
<a class="ui primary labeled icon button" href="/newmotion/">
|
|
|
|
<i class="magic icon"></i>
|
|
|
|
New motion</a>
|
2022-05-26 13:27:25 +00:00
|
|
|
</div>
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
</nav>
|
|
|
|
{{ end }}
|
|
|
|
{{ if eq .ActiveNav "users"}}
|
|
|
|
{{ if $user }}
|
|
|
|
{{ if canManageUsers $user }}
|
|
|
|
<nav class="ui secondary pointing menu">
|
|
|
|
<a href="/users/" class="{{ if eq .ActiveSubNav "users" }}active {{ end }}item">Manage users</a>
|
2022-06-04 17:00:57 +00:00
|
|
|
<a href="/voters/" class="{{ if eq .ActiveSubNav "manage-voters" }}active {{ end }}item">Manage voters</a>
|
|
|
|
<div class="right item">
|
|
|
|
<a class="ui primary labeled icon button" href="/new-user/">
|
|
|
|
<i class="magic icon"></i> Add User</a>
|
|
|
|
</div>
|
2022-05-26 13:27:25 +00:00
|
|
|
</nav>
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
2022-05-09 19:09:24 +00:00
|
|
|
{{ end }}
|