{{define "content"}}
<section class="hero">
  <p class="eyebrow">{{.Eyebrow}}</p>
  <h1>{{.Heading}}</h1>
  <p class="lede">{{.Description}}</p>
</section>

<section class="toolbar">
  <a class="button" href="/admin/projects/new">Create project</a>
</section>

{{if .Projects}}
<section class="resource-grid">
  {{range .Projects}}
  <article class="resource-card">
    <div class="resource-header">
      <div>
        <h2><a href="/admin/projects/{{.Project.ID}}">{{.Project.Name}}</a></h2>
        <p class="resource-slug">{{.Project.Slug}}</p>
      </div>
      <span class="pill {{if .Project.IsActive}}pill-success{{else}}pill-muted{{end}}">
        {{if .Project.IsActive}}Active{{else}}Archived{{end}}
      </span>
    </div>

    <p class="resource-description">{{if .Project.Description}}{{.Project.Description}}{{else}}No description yet.{{end}}</p>

    <div class="stat-row">
      <span>{{.TagCount}} tags</span>
      <span>{{.ReleaseCount}} releases</span>
      <span>Updated {{.Project.UpdatedAt.Format "2006-01-02 15:04 UTC"}}</span>
    </div>

    <a class="text-link" href="/admin/projects/{{.Project.ID}}">Open project</a>
  </article>
  {{end}}
</section>
{{else}}
<section class="empty-state">
  <h2>No projects yet</h2>
  <p>Create the first project to start grouping releases and tags.</p>
</section>
{{end}}
{{end}}
