{{ define "head" }}
<link rel="alternate" type="application/atom+xml" title="Atom feed" href="/users/{{ .user }}.atom" />
{{ end }}

{{ define "title" }}{{ .user }} - {{ end }}

{{ define "content" }}
<div class="cols">
    <section>
        <h2>{{ .user }}</h2>
        {{ if .picture }}
        <img src="{{ .picture }}" class="profile-picture"/>
        {{ end }}
        <p><a href="/users/{{ .user }}.atom">Subscribe via Atom</a></p>
        <dl>
            <dt class="homepage">Homepage</dt>
            <dd class="homepage">
                {{ if .homepage }}
                <a href="{{ .homepage }}" target="_blank">{{ .homepage }}</a></dd>
                {{ else }}
                Not defined
                {{ end }}
            <dt class="email">Email</dt>
            <dd class="email">
                {{ if .email }}
                <a href="mailto:{{ .email }}" target="_blank">{{ .email }}</a></dd>
                {{ else }}
                Not defined
                {{ end }}
            <dt class="about">About</dt>
            <dd class="about">
                {{ if .about }}
                {{ .about }}
                {{ else }}
                Not defined
                {{ end }}
            </dd>
        </dl>
    </section>
    <section>
        <h2>Statuses</h2>
        {{ range .statuses }}
        <article class="status">
            {{ template "status" . }}
        </article>
        {{ end }}
        {{ if or .showMore (ne 0 .page) }}
        <p>
            {{ if ne 0 .page }}
            {{ if eq 0 .prev_page }}
            <a href="{{ .user }}">Newer statuses</a>
            {{ else }}
            <a href="{{ .user }}?page={{ .prev_page }}">Newer statuses</a>
            {{ end }}
            {{ end }}
            {{ if .showMore }}
            <a href="{{ .user }}?page={{ .next_page }}">Older statuses</a>
            {{- end }}
        </p>
        {{ end }}
    </section>
</div>
{{ end }}