OXYGENHUB
# 0a3b244b748f oxygenhub / templates / home.html
2.3 KiB · HTML · last changed feat(web): the hub's sky on Explore and the signed-out home (closes #165) 22 days 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
{% if !backdrop.is_empty() %}{% include "backdrop.html" %}{% endif %}
5
<div class="head">
6
  {% if let Some(o) = owner %}<h1>{{ o }} <small>{{ repos.len()|plural("repository", "repositories") }}</small></h1>
7
  {% else %}<h1>Repositories <small>{{ description }}</small></h1>{% endif %}
8
</div>
9
{% if owner.is_none() %}
10
<form class="bar explore-bar" method="get" action="/explore">
11
  <input type="search" name="q" value="{{ q }}" placeholder="Filter by name, description or topic" aria-label="Filter repositories">
12
  <select name="sort" aria-label="Sort">
13
    <option value="activity"{% if sort == "activity" %} selected{% endif %}>recently active</option>
14
    <option value="stars"{% if sort == "stars" %} selected{% endif %}>most stars</option>
15
    <option value="name"{% if sort == "name" %} selected{% endif %}>name</option>
16
  </select>
17
  {% 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 %}
18
  <button type="submit" class="small">FILTER</button>
19
</form>
20
{% endif %}
21
{% if repos.is_empty() %}
22
<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>
23
{% else %}
24
<ul class="rows repos" data-backdrop-avoid>
25
{% for r in repos %}
26
  <li>
27
    <div>
28
      <a class="name" href="/{{ r.owner }}/{{ r.name }}"><span class="mute">{{ r.owner }} /</span> <strong>{{ r.name }}</strong></a>
29
      {% if r.visibility != "public" %}<span class="tag">{{ r.visibility }}</span>{% endif %}
30
      {% if !r.description.is_empty() %}<p class="small">{{ r.description }}</p>{% endif %}
31
      {% 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 %}
32
    </div>
33
    <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>
34
  </li>
35
{% endfor %}
36
</ul>
37
{% endif %}
38
{% endblock %}