{{ template "base.html" . }}

{{ define "content" }}
<div class="content-block">
    <div class="optionbar">
        <div class="options">
            <a class="button" href="{{ .AtomFeedUrl }}"><span class="icon big pr1">4</span> RSS Feed</a>
            {{ if .User }}
                <form method="POST" action="{{ .MarkAllReadUrl }}">
                    {{ csrftoken .Session }}
                    <button type="submit"><span class="big pr1">&#x2713;</span> Mark all posts on site as read</button>
                </form>
            {{ end }}
        </div>
        <div class="options">
            {{ template "pagination.html" .Pagination }}
        </div>
    </div>
    {{ range .Posts }}
		<div class="post-list-item flex items-center ph3 pv2 {{ if .Unread }}unread{{ else }}read{{ end }} {{ .Classes }}">
			<img class="avatar-icon mr2" src="{{ .User.AvatarUrl }}">
			<div class="flex-grow-1 overflow-hidden">
				{{ template "breadcrumbs.html" .Breadcrumbs }}
				<div class="title nowrap truncate"><a href="{{ .Url }}" title="{{ .Preview }}">{{ if .PostTypePrefix }}{{ .PostTypePrefix }}: {{ end }}{{ .Title }}</a></div>
				<div class="details">
					<a class="user" href="{{ .User.ProfileUrl }}">{{ .User.Name }}</a> &mdash; {{ timehtml (relativedate .Date) .Date }}
				</div>
				{{ with .Preview }}
					<div class="mt1">
						{{ noescape . }}
					</div>
				{{ end }}
			</div>
			<div class="goto">
				<a href="{{ .Url }}">&raquo;</a>
			</div>
		</div>
    {{ end }}
    <div class="optionbar bottom">
        <div>
        </div>
        <div class="options">
            {{ template "pagination.html" .Pagination }}
        </div>
    </div>
</div>
{{ end }}
