{{define "digest"}}

<div style="{{style "digest"}}">

<p style="{{style "intro-paragraph"}}">
  GitHub activity time machine for
  <a href="https://github.com/{{.User.Login}}"
     title="{{.User.Name}}"
     style="{{style "link" "intro-paragraph.user-link"}}">
    <img src="{{.User.AvatarURL}}"
         width="20"
         height="20"
         border="0"
         style="{{style "intro-paragraph.user-avatar"}}">{{.User.Login}}
  </a>.
</p>

{{range .IntervalDigests }}
  {{$interval := .}}
  <h1 style="{{style "interval-header"}}">{{.Header}}</h1>

  <p>{{.Description}}</p>

  {{range .RepoDigests}}
    <h2 style="{{style "repository-header"}}">
      <a href="{{.Repo.HTMLURL}}" style="{{style "link"}}">{{.Repo.FullName}}</a>
    </h2>

    <div>
      {{range .Commits }}
        <div style="{{style "commit"}}">
          <h3 style="{{style "commit.title"}}">{{.Title}}</h3>
          {{if .Message}}
            <pre style="{{style "commit.message"}}">{{.Message}}</pre>
          {{end}}
          <div style="{{style "commit.footer"}}">
            <a href="{{.URL}}"
               style="{{style "link" "commit.footer.link"}}">{{.DisplaySHA}}</a>
            <i title={{.DisplayDateTooltip}}
               style="{{style "commit.footer.date"}}">{{if $interval.Weekly}}{{.WeeklyDisplayDate}}{{else}}{{.DisplayDate}}{{end}}</i>
          </div>
        </div>
      {{end}}
    </div>
  {{end}}

{{end}}

</div>

{{end}}
