{% extends "base.html" %}
{% block title %}{% if signed_in %}{{ username }}{% else %}Repositories{% endif %} · tit{% endblock %}
{% block content %}
{% if signed_in %}
  <div class="two-column">
  <section>
  <h1>{{ username }}</h1>
  <p><a href="/account">Open your account profile</a>.</p>
  <h2>Your repositories</h2>
{% if repositories.is_empty() %}
  <p>You do not own a repository.</p>
{% else %}
  <ul>
  {% for item in repositories %}
{% if item.state == "archived" %}
    <li>
      {{ item.owner }}/{{ item.slug }} · archived
      <form class="inline-form" method="post" action="/{{ item.owner }}/{{ item.slug }}/settings/unarchive">
        <input type="hidden" name="csrf" value="{{ csrf }}">
        <input type="hidden" name="confirm" value="yes">
        <button type="submit">Unarchive repository</button>
      </form>
    </li>
{% else %}
    <li><a href="/{{ item.owner }}/{{ item.slug }}">{{ item.owner }}/{{ item.slug }}</a> · {{ item.visibility }} · updated <time datetime="{{ item.updated_at }}">{{ item.updated_at|human_time }}</time>{% if item.description.is_empty() %}{% else %}<br>{{ item.description }}{% endif %}</li>
{% endif %}
  {% endfor %}
  </ul>
{% endif %}
  </section>
  <section>
  <h2>Recently updated public repositories</h2>
{% else %}
  <section>
  <h1>Recently updated public repositories</h1>
{% endif %}
{% if recent_repositories.is_empty() %}
{% if signed_in %}
  <p>No public repositories are available.</p>
{% else %}
  <p>No repositories are available.</p>
{% endif %}
{% else %}
  <ul>
  {% for item in recent_repositories %}
    <li><a href="/{{ item.owner }}/{{ item.slug }}">{{ item.owner }}/{{ item.slug }}</a> · updated <time datetime="{{ item.updated_at }}">{{ item.updated_at|human_time }}</time>{% if item.description.is_empty() %}{% else %}<br>{{ item.description }}{% endif %}</li>
  {% endfor %}
  </ul>
{% endif %}
  </section>
{% if signed_in %}
  </div>
{% endif %}
{% endblock %}
