{{ template "header.html" . }}
{{ $voter := .Voter }}
{{ $page := . }}
<div class="ui basic segment">
    <div class="ui secondary pointing menu">
        <a href="/motions/" class="{{ if not .Params.Flags.Unvoted }}active {{ end }}item" title="Show all votes">All
            votes</a>
        {{ if $voter }}
            <a href="/motions/?unvoted=1" class="{{ if .Params.Flags.Unvoted }}active {{ end}}item"
               title="Show my outstanding votes">My outstanding votes</a>
            <div class="right item">
                <a class="ui primary button" href="/newmotion/">New motion</a>
            </div>
        {{ end }}
    </div>
</div>
{{ if .Decisions }}
    <div class="ui labeled icon menu">
        {{ template "pagination_fragment" $page }}
    </div>
    {{ range .Decisions }}
        <div class="ui raised segment">
            {{ template "motion_fragment" . }}
            {{ if $voter }}{{ template "motion_actions" . }}{{ end }}
        </div>
    {{ end }}
    <div class="ui labeled icon menu">
        {{ template "pagination_fragment" $page }}
    </div>
{{ else }}
    <div class="ui basic segment">
        <div class="ui icon message">
            <i class="inbox icon"></i>
            <div class="content">
                <div class="header">No motions available</div>
                {{ if .Params.Flags.Unvoted }}
                    <p>There are no motions requiring a vote from you.</p>
                {{ else }}
                    <p>There are no motions in the system yet.</p>
                {{ end }}
            </div>
        </div>
    </div>
{{ end }}
{{ template "footer.html" . }}