OXYGENHUB
◆ oh-comment-body-file oxygenhub / templates / overview.html
13.6 KiB · HTML · last changed Live L5: the issue page, the overview and Diffusion (closes #207) 18 days ago source blame history raw
d23464c0 Andy McCall ↶ 1
{% extends "base.html" %}
2
{% import "repo_tabs.html" as m %}
3
{% block title %}{{ repo.owner }}/{{ repo.name }}{% endblock %}
ffb67a81 Andy McCall 4
{% block bodyattrs %} data-repo="{{ repo.url }}" data-ref="{{ at }}"{% endblock %}
d23464c0 Andy McCall ↶ 5
{% block tabs %}{% call m::tabs(repo, "code") %}{% endblock %}
6
{% block content %}
ffb67a81 Andy McCall 7
{% include "repo_backdrop.html" %}
8
<div data-backdrop-avoid>
d23464c0 Andy McCall ↶ 9
<div class="side-layout rev">
10
  <div>
addec2bd Andy McCall ↶ 11
    {% if o.heads > 1 %}<div class="strip warn">{% if at.len() > 24 %}<span class="hash-tip" tabindex="0" data-full="{{ at }}" aria-label="{{ at }}">{{ at|ends }}</span>{% else %}{{ at }}{% endif %} has {{ o.heads }} heads; the tree below is their union. <a href="{{ repo.url }}/bookmarks">Bookmarks</a></div>{% endif %}
83d5052b Andy McCall ↶ 12
    {% if o.conflicted %}<div class="strip bad">This state carries conflicts. <a href="{{ repo.url }}/conflicts">See them</a></div>{% endif %}
d23464c0 Andy McCall ↶ 13
    <div class="bar">
ffb67a81 Andy McCall 14
      <details class="ref-pick">
addec2bd Andy McCall ↶ 15
        <summary class="go small" aria-haspopup="true" title="Choose a bookmark or tag"><span aria-hidden="true">{% if o.tree.target.kind == crate::repos::view::RefKind::Tag %}🏷{% else %}◆{% endif %}</span> {% if at.len() > 24 %}<span class="hash-tip" tabindex="0" data-full="{{ at }}" aria-label="{{ at }}">{{ at|ends }}</span>{% else %}{{ at }}{% endif %} <span aria-hidden="true">▾</span></summary>
ffb67a81 Andy McCall 16
        <div class="ref-panel" role="menu">
17
          <p class="small mute">Bookmarks</p>
18
          <ul class="plain">{% for b in o.bookmarks %}<li><a role="menuitem" href="{{ repo.url }}{% if b.name != repo.default_bookmark %}?at={{ b.name|urlencode }}{% endif %}"{% if b.name == at %} class="on"{% endif %}>◆ {{ b.name }}{% if b.name == repo.default_bookmark %} <span class="tag">default</span>{% endif %}</a></li>{% endfor %}</ul>
19
          {% if !o.tags.is_empty() %}<p class="small mute">Tags</p>
20
          <ul class="plain">{% for t in o.tags %}<li><a role="menuitem" href="{{ repo.url }}?at={{ t.name|urlencode }}"{% if t.name == at %} class="on"{% endif %}>🏷 {{ t.name }}</a></li>{% endfor %}</ul>{% endif %}
21
          <p class="small"><a href="{{ repo.url }}/bookmarks">All bookmarks ›</a></p>
22
        </div>
23
      </details>
24
      {% if o.latest.is_none() %}<a class="go small" href="{{ repo.url }}/changes/{{ at }}">{{ o.changes|plural("change", "changes") }}</a>{% endif %}
25
      {% if repo.can(crate::auth::Access::Write) %}<a class="go small" href="{{ repo.url }}/newfile/{{ at }}">new file</a>{% endif %}
3f4b0ea6 Andy McCall ↶ 26
      <form class="find inline-find" method="get" action="{{ repo.url }}/search"><input type="search" name="q" placeholder="Search code…"></form>
83d5052b Andy McCall ↶ 27
      <details class="clone-pop">
7f283f8e Andy McCall ↶ 28
        <summary class="go small primary" aria-haspopup="true"><span aria-hidden="true">&lt;&gt;</span> Code</summary>
67b24adb Andy McCall ↶ 29
        <div class="clone-panel" role="group" aria-label="Clone or download this repository">
83d5052b Andy McCall ↶ 30
          <label for="clone-cmd" class="small mute">Clone with oxy</label>
a7aa76ac Andy McCall 31
          <div class="clone"><input id="clone-cmd" type="text" readonly value="oxy clone {{ repo.clone_url }}" data-select><button type="button" class="small" data-copy="oxy clone {{ repo.clone_url }}">copy</button></div>
83d5052b Andy McCall ↶ 32
          <p class="small mute">The URL alone: <code>{{ repo.clone_url }}</code></p>
7b17d570 Andy McCall ↶ 33
          {% if let Some(git) = repo.git_url %}
34
          <label for="git-clone-cmd" class="small mute">Clone with Git (a read-only mirror)</label>
a7aa76ac Andy McCall 35
          <div class="clone"><input id="git-clone-cmd" type="text" readonly value="git clone {{ git }}" data-select><button type="button" class="small" data-copy="git clone {{ git }}">copy</button></div>
7b17d570 Andy McCall ↶ 36
          <p class="small mute">For tools that only speak Git. Push with oxy: the mirror refuses pushes.</p>
37
          {% endif %}
67b24adb Andy McCall ↶ 38
          {% if quickstart.is_none() %}
ffb67a81 Andy McCall 39
          <a class="download" href="{{ repo.url }}/archive?ref={{ at|urlencode }}&amp;format=zip" download><span aria-hidden="true">⤓</span> Download ZIP</a>
40
          <p class="small mute">{{ at }} as it is now, without its history. Also as <a href="{{ repo.url }}/archive?ref={{ at|urlencode }}&amp;format=tar.zst" download>.tar.zst</a>.</p>
67b24adb Andy McCall ↶ 41
          {% endif %}
83d5052b Andy McCall ↶ 42
        </div>
43
      </details>
d23464c0 Andy McCall ↶ 44
    </div>
4edcf240 Andy McCall ↶ 45
    {% if let Some(q) = quickstart %}
46
    {% include "quickstart.html" %}
47
    {% else %}
c9aacc0e Andy McCall ↶ 48
    <div class="tree-box">
a10446c6 Andy McCall ↶ 49
    {% if let Some(c) = o.latest %}<div class="tree-head" data-live="{{ repo.live_topic() }}" data-fragment="latest">
c9aacc0e Andy McCall ↶ 50
      <span class="tree-title">{% if let Some(a) = c.author.account %}<a class="who" href="/{{ a }}"><img class="avatar" src="/avatar/{{ a }}" alt="" width="20" height="20"> {{ a }}</a>{% else %}<span class="who">{{ c.author.name }}</span>{% endif %} <a class="t" href="{{ repo.url }}/change/{{ c.hash }}" title="{{ c.title }}">{{ c.title }}</a></span>
ffb67a81 Andy McCall 51
      <span class="tree-meta"><a href="{{ repo.url }}/change/{{ c.hash }}"><code>{{ c.short }}</code></a><time class="ago" title="{{ c.when_ms|when }}">{{ c.when_ms|ago }}</time><a class="hist" href="{{ repo.url }}/changes/{{ at }}">{{ crate::web::icons::svg("history")|safe }} {{ o.changes|plural("change", "changes") }}</a></span>
c9aacc0e Andy McCall ↶ 52
    </div>{% endif %}
d23464c0 Andy McCall ↶ 53
    {% include "tree_table.html" %}
c9aacc0e Andy McCall ↶ 54
    </div>
4edcf240 Andy McCall ↶ 55
    {% endif %}
d23464c0 Andy McCall ↶ 56
    {% if let Some(html) = readme_html %}
57
    <article class="doc readme"><h2 class="small mute">{{ o.tree.readme.as_ref().unwrap().path }}</h2>{{ html|safe }}</article>
58
    {% endif %}
59
  </div>
c9aacc0e Andy McCall ↶ 60
  <aside class="side cards">
7f283f8e Andy McCall ↶ 61
    <section class="side-card about"><h3>About <span class="more about-counts"><span title="{{ stars|plural("star", "stars") }}">{{ crate::web::icons::svg("star")|safe }} {{ stars }}</span><span title="{{ watchers|plural("watcher", "watchers") }}">{{ crate::web::icons::svg("eye")|safe }} {{ watchers }}</span>{% if fork.forks > 0 %}<a href="{{ repo.url }}/forks" title="{{ fork.forks|plural("fork", "forks") }}">{{ crate::web::icons::svg("fork")|safe }} {{ fork.forks }}</a>{% endif %}</span></h3><div class="body">
d23464c0 Andy McCall ↶ 62
    {% if repo.description.is_empty() %}<p class="mute small">No description.</p>{% else %}<p>{{ repo.description }}</p>{% endif %}
07b1a5bb Andy McCall ↶ 63
    {% if let Some(up) = fork.upstream %}<p class="small">forked from <a href="/{{ up.owner }}/{{ up.name }}">{{ up.owner }}/{{ up.name }}</a></p>{% endif %}
c9aacc0e Andy McCall ↶ 64
    {% if !topics.is_empty() %}<p class="topics">{% for t in topics %}<a class="topic" href="/explore?topic={{ t }}">{{ t }}</a>{% endfor %}</p>{% endif %}
ffb67a81 Andy McCall 65
    {% if let Some(l) = o.license %}<p class="small">Licence: <a href="{{ repo.url }}/file/{{ at }}/{{ l }}">{{ l }}</a></p>{% endif %}
7f283f8e Andy McCall ↶ 66
    {% if shell.user.is_some() %}<div class="about-actions">
67
      <form class="inline" method="post" action="{{ repo.url }}/star"><input type="hidden" name="_csrf" value="{{ shell.csrf }}"><button type="submit" class="small">{% if starred %}★ UNSTAR{% else %}☆ STAR{% endif %}</button></form>
68
      <form class="inline" method="post" action="{{ repo.url }}/watch"><input type="hidden" name="_csrf" value="{{ shell.csrf }}"><button type="submit" class="small">{% if watching %}UNWATCH{% else %}WATCH{% endif %}</button></form>
69
      <a class="go small" href="{{ repo.url }}/fork">fork</a>
70
    </div>{% endif %}
71
    {% if let Some(up) = fork.upstream %}{% if shell.user.is_some() %}<p class="about-propose"><a class="go small" href="/{{ up.owner }}/{{ up.name }}/proposals/new?source={{ repo.owner }}/{{ repo.name }}:{{ repo.default_bookmark }}">propose to {{ up.owner }}/{{ up.name }}</a></p>{% endif %}{% endif %}
c9aacc0e Andy McCall ↶ 72
    </div></section>
73
    {% if let Some(rel) = latest_release %}<section class="side-card"><h3>Latest release</h3><div class="body"><p><a href="{{ repo.url }}/releases/tag/{{ rel.tag }}">{{ rel.title }}</a> <span class="small mute">{{ rel.created_ms|ago_i }}</span></p></div></section>{% endif %}
74
    {% if !follows.is_empty() || !used_by.is_empty() %}
a10446c6 Andy McCall ↶ 75
    <section class="side-card" data-live="{{ repo.diffusion_topic() }}" data-fragment="diffusion"><h3>Diffusion <a class="more" href="{{ repo.url }}/diffusion">details ›</a></h3><div class="body">
7f283f8e Andy McCall ↶ 76
    {% if !follows.is_empty() %}<h4>Takes from <span class="count-chip">{{ follows.len() }}</span></h4>
77
    <ul class="plain df-list">{% for (up, c) in follows %}<li>
78
      <div class="df-row"><a class="df-name" href="/{{ up.owner }}/{{ up.name }}" title="{{ up.owner }}/{{ up.name }}, pinned at {{ c.path }}">{{ up.owner }}/{{ up.name }}</a><span class="df-pill" role="img" aria-label="upstream {{ c.upstream.word }}, here {{ c.downstream.word }}"><span class="df-half {{ c.upstream.class }}" title="Upstream: {{ c.upstream.title }}">{{ c.upstream.word }}</span><span class="df-half {{ c.downstream.class }}" title="Here: {{ c.downstream.title }}">{{ c.downstream.word }}</span></span></div>
79
      {% if c.behind.unwrap_or(0) > 0 || c.bump.is_some() %}<div class="df-sub">{% match c.behind %}{% when Some(0) %}{% when Some(n) %}<span>{{ n }} behind</span>{% when None %}{% endmatch %}{% if let Some(n) = c.bump %}<a href="{{ repo.url }}/proposal/{{ n }}">bump #{{ n }}</a>{% endif %}</div>{% endif %}
80
    </li>{% endfor %}</ul>{% endif %}
c9aacc0e Andy McCall ↶ 81
    {% if !used_by.is_empty() %}<h4>Diffuses to <span class="count-chip">{{ used_by.len() }}</span></h4>
7f283f8e Andy McCall ↶ 82
    <ul class="plain df-list">{% for c in used_by %}<li>
83
      <div class="df-row"><a class="df-name" href="/{{ c.owner }}/{{ c.name }}" title="{{ c.owner }}/{{ c.name }}">{{ c.owner }}/{{ c.name }}</a><span class="df-pill" role="img" aria-label="here {{ c.upstream.word }}, {{ c.name }} {{ c.downstream.word }}"><span class="df-half {{ c.upstream.class }}" title="Here: {{ c.upstream.title }}">{{ c.upstream.word }}</span><span class="df-half {{ c.downstream.class }}" title="{{ c.owner }}/{{ c.name }}: {{ c.downstream.title }}">{{ c.downstream.word }}</span></span></div>
84
      {% match c.behind %}{% when Some(0) %}{% when Some(n) %}<div class="df-sub"><span>{{ n }} behind</span></div>{% when None %}{% endmatch %}
85
    </li>{% endfor %}</ul>{% endif %}
c9aacc0e Andy McCall ↶ 86
    </div></section>
87
    {% endif %}
83d5052b Andy McCall ↶ 88
    {% if !o.contributors.is_empty() %}
c9aacc0e Andy McCall ↶ 89
    <section class="side-card"><h3>Contributors <span class="count-chip">{{ o.contributors.len() }}</span></h3><div class="body">
83d5052b Andy McCall ↶ 90
    <ul class="plain contributors">{% for c in o.contributors.iter().take(10) %}
c9aacc0e Andy McCall ↶ 91
      <li class="c">{% if let Some(u) = c.account %}<img class="avatar sm" src="/avatar/{{ u }}" alt="" width="20" height="20"><a class="who" href="/{{ u }}" title="{{ c.name }}">{{ u }} <span class="mute small">{{ c.name }}</span></a>{% else if c.hub %}<img class="avatar sm" src="/favicon.svg" alt="" width="20" height="20"><span class="who" title="{{ c.name }}: this hub's delegate key, signing the changes made in the browser for people who allowed it">{{ c.name }}</span>{% else %}<span class="avatar-none" aria-hidden="true">○</span><span class="who" title="{{ c.name }}">{{ c.name }}</span>{% endif %}<span class="n mute small" title="changes">{{ c.changes }}</span>{% if !c.via.is_empty() %}<ul class="plain via-list">{% for v in c.via %}<li><span class="mute" aria-hidden="true">↳</span> <span class="mute small">via</span> <img class="avatar sm" src="/avatar/agent/{{ v.0 }}" alt="" width="16" height="16"> {{ v.0 }} <span class="mute small" title="changes signed by this agent for them">· {{ v.1 }}</span></li>{% endfor %}</ul>{% endif %}</li>
83d5052b Andy McCall ↶ 92
    {% endfor %}</ul>
93
    {% if o.contributors.len() > 10 %}<p class="small mute">and {{ o.contributors.len() - 10 }} more</p>{% endif %}
c9aacc0e Andy McCall ↶ 94
    </div></section>
83d5052b Andy McCall ↶ 95
    {% endif %}
96
    {% if !o.languages.is_empty() %}
c9aacc0e Andy McCall ↶ 97
    <section class="side-card"><h3>Languages</h3><div class="body">
83d5052b Andy McCall ↶ 98
    <div class="lang-bar" role="img" aria-label="{% for l in o.languages %}{{ l.name }} {{ "{:.1}"|format(l.percent) }}%{% if !loop.last %}, {% endif %}{% endfor %}">{% for l in o.languages %}<span style="width: {{ "{:.3}"|format(l.percent) }}%; background: {{ l.colour }}" title="{{ l.name }} {{ "{:.1}"|format(l.percent) }}%"></span>{% endfor %}</div>
99
    <ul class="plain langs">{% for l in o.languages %}<li><span class="lang-dot" style="background: {{ l.colour }}" aria-hidden="true"></span> <strong>{{ l.name }}</strong> <span class="mute">{{ "{:.1}"|format(l.percent) }}%</span></li>{% endfor %}</ul>
c9aacc0e Andy McCall ↶ 100
    </div></section>
83d5052b Andy McCall ↶ 101
    {% endif %}
a10446c6 Andy McCall ↶ 102
    <section class="side-card" data-live="{{ repo.live_topic() }}" data-fragment="bookmarks"><h3>Bookmarks <span class="count-chip">{{ o.bookmarks.len() }}</span>{% if o.bookmarks.len() > 10 %}<a class="more" href="{{ repo.url }}/bookmarks">all {{ o.bookmarks.len() }} ›</a>{% endif %}</h3><div class="body">
ffb67a81 Andy McCall 103
    <ul class="plain bookmarks">{% for b in o.recent_bookmarks() %}<li><a href="{{ repo.url }}?at={{ b.name|urlencode }}" title="{{ b.name }}">{{ b.name }}</a>{% if b.heads.len() > 1 %}<span class="tag warn">{{ b.heads.len() }} heads</span>{% endif %}{% if b.conflicted %}<span class="tag bad">conflicts</span>{% endif %}<time class="small mute" title="{{ b.latest_ms|when }}">{{ b.latest_ms|ago }}</time></li>{% endfor %}</ul>
c9aacc0e Andy McCall ↶ 104
    </div></section>
105
    <section class="side-card"><h3>Tags</h3><div class="body">
ffb67a81 Andy McCall 106
    {% if o.tags.is_empty() %}<p class="mute small">None.</p>{% else %}<ul class="plain">{% for t in o.tags %}<li><a href="{{ repo.url }}?at={{ t.name|urlencode }}">{{ t.name }}</a>{% if t.signer.is_some() %} <span class="sig sig-valid" title="signed">✔</span>{% endif %}</li>{% endfor %}</ul>{% endif %}
c9aacc0e Andy McCall ↶ 107
    </div></section>
108
    <section class="side-card"><h3>Trust</h3><div class="body">
d23464c0 Andy McCall ↶ 109
    {% match o.policy %}
110
    {% when crate::repos::view::PolicyBadge::Active %}<p><a href="{{ repo.url }}/trust"><span class="sig sig-valid">✔</span> policy in force</a></p>
111
    {% when crate::repos::view::PolicyBadge::Expired %}<p><a href="{{ repo.url }}/trust"><span class="sig sig-invalid">✘</span> policy expired</a></p>
112
    {% when crate::repos::view::PolicyBadge::None %}<p><a href="{{ repo.url }}/trust"><span class="sig sig-unsigned">○</span> no policy</a></p>
113
    {% endmatch %}
c9aacc0e Andy McCall ↶ 114
    </div></section>
d23464c0 Andy McCall ↶ 115
  </aside>
ffb67a81 Andy McCall 116
</div>
d23464c0 Andy McCall ↶ 117
</div>
118
{% endblock %}