OXYGENHUB
# 7c36794d3630 oxygenhub / templates / home.html
2.2 KiB · HTML · last changed Stars, topics, and a sortable, filterable Explore 1 month ago source blame history raw
1
{% extends "base.html" %}
2
{% block title %}{% if let Some(o) = owner %}{{ o }}{% else %}Repositories{% endif %}{% endblock %}
3
{% block content %}
4
<div class="head">
5
  {% if let Some(o) = owner %}<h1>{{ o }} <small>{{ repos.len()|plural("repository", "repositories") }}</small></h1>
6
  {% else %}<h1>Repositories <small>{{ description }}</small></h1>{% endif %}
7
</div>
8
{% if owner.is_none() %}
9
<form class="bar explore-bar" method="get" action="/explore">
10
  <input type="search" name="q" value="{{ q }}" placeholder="Filter by name, description or topic" aria-label="Filter repositories">
11
  <select name="sort" aria-label="Sort">
12
    <option value="activity"{% if sort == "activity" %} selected{% endif %}>recently active</option>
13
    <option value="stars"{% if sort == "stars" %} selected{% endif %}>most stars</option>
14
    <option value="name"{% if sort == "name" %} selected{% endif %}>name</option>
15
  </select>
16
  {% if !topic.is_empty() %}<input type="hidden" name="topic" value="{{ topic }}"><span class="topic">{{ topic }} <a href="/explore?sort={{ sort }}&amp;q={{ q }}" aria-label="Clear the topic">×</a></span>{% endif %}
17
  <button type="submit" class="small">FILTER</button>
18
</form>
19
{% endif %}
20
{% if repos.is_empty() %}
21
<p class="empty">No repositories yet. Create one with <code>oxygenhub admin repo create OWNER/NAME</code>, then <code>oxy push</code> into it.</p>
22
{% else %}
23
<ul class="rows repos">
24
{% for r in repos %}
25
  <li>
26
    <div>
27
      <a class="name" href="/{{ r.owner }}/{{ r.name }}"><span class="mute">{{ r.owner }} /</span> <strong>{{ r.name }}</strong></a>
28
      {% if r.visibility != "public" %}<span class="tag">{{ r.visibility }}</span>{% endif %}
29
      {% if !r.description.is_empty() %}<p class="small">{{ r.description }}</p>{% endif %}
30
      {% if !r.topics.is_empty() %}<p class="topics">{% for t in r.topic_list() %}<a class="topic" href="/explore?topic={{ t }}">{{ t }}</a>{% endfor %}</p>{% endif %}
31
    </div>
32
    <div class="right small">{% if star_count(r.id) > 0 %}<span class="mute" title="stars">★ {{ star_count(r.id) }}</span> · {% endif %}updated <time title="{{ r.updated_ms|when_i }}">{{ r.updated_ms|ago_i }}</time></div>
33
  </li>
34
{% endfor %}
35
</ul>
36
{% endif %}
37
{% endblock %}