| 1 |
{% extends "base.html" %} |
| 2 |
{% import "repo_tabs.html" as m %} |
| 3 |
{% block title %}{{ repo.owner }}/{{ repo.name }}{% endblock %} |
| 4 |
{% block bodyattrs %} data-repo="{{ repo.url }}" data-ref="{{ repo.default_bookmark }}"{% endblock %} |
| 5 |
{% block tabs %}{% call m::tabs(repo, "code") %}{% endblock %} |
| 6 |
{% block content %} |
| 7 |
<div class="side-layout rev"> |
| 8 |
<div> |
| 9 |
{% if o.heads > 1 %}<div class="strip warn">{{ repo.default_bookmark }} has {{ o.heads }} heads; the tree below is their union. <a href="{{ repo.url }}/bookmarks">Bookmarks</a></div>{% endif %} |
| 10 |
{% if o.conflicted %}<div class="strip bad">This state carries conflicts. <a href="{{ repo.url }}/conflicts">See them</a></div>{% endif %} |
| 11 |
<div class="bar"> |
| 12 |
<span class="ref px"><a href="{{ repo.url }}/bookmarks">◆ {{ repo.default_bookmark }}</a></span> |
| 13 |
<a class="go small" href="{{ repo.url }}/changes/{{ repo.default_bookmark }}">{{ o.changes|plural("change", "changes") }}</a> |
| 14 |
{% if repo.can(crate::auth::Access::Write) %}<a class="go small" href="{{ repo.url }}/newfile/{{ repo.default_bookmark }}">new file</a>{% endif %} |
| 15 |
<form class="find inline-find" method="get" action="{{ repo.url }}/search"><input type="search" name="q" placeholder="Search code…"></form> |
| 16 |
<details class="clone-pop"> |
| 17 |
<summary class="go small" aria-haspopup="true">⤓ Clone</summary> |
| 18 |
<div class="clone-panel" role="group" aria-label="Clone this repository"> |
| 19 |
<label for="clone-cmd" class="small mute">Clone with oxy</label> |
| 20 |
<div class="clone"><input id="clone-cmd" type="text" readonly value="oxy clone {{ repo.clone_url }}" onfocus="this.select()" onclick="this.select()"><button type="button" class="small" data-copy="oxy clone {{ repo.clone_url }}">copy</button></div> |
| 21 |
<p class="small mute">The URL alone: <code>{{ repo.clone_url }}</code></p> |
| 22 |
</div> |
| 23 |
</details> |
| 24 |
</div> |
| 25 |
{% if let Some(c) = o.latest %}<p class="small mute latest-line">latest <a href="{{ repo.url }}/change/{{ c.hash }}">{{ c.title }}</a> · {{ c.when_ms|ago }}</p>{% endif %} |
| 26 |
{% if let Some(q) = quickstart %} |
| 27 |
{% include "quickstart.html" %} |
| 28 |
{% else %} |
| 29 |
{% include "tree_table.html" %} |
| 30 |
{% endif %} |
| 31 |
{% if let Some(html) = readme_html %} |
| 32 |
<article class="doc readme"><h2 class="small mute">{{ o.tree.readme.as_ref().unwrap().path }}</h2>{{ html|safe }}</article> |
| 33 |
{% endif %} |
| 34 |
</div> |
| 35 |
<aside class="side"> |
| 36 |
<h3>About</h3> |
| 37 |
{% if repo.description.is_empty() %}<p class="mute small">No description.</p>{% else %}<p>{{ repo.description }}</p>{% endif %} |
| 38 |
{% if let Some(up) = fork.upstream %}<p class="small">forked from <a href="/{{ up.owner }}/{{ up.name }}">{{ up.owner }}/{{ up.name }}</a></p>{% endif %} |
| 39 |
<div class="bar"> |
| 40 |
{% if !topics.is_empty() %}<p class="topics">{% for t in topics %}<a class="topic" href="/explore?topic={{ t }}">{{ t }}</a>{% endfor %}</p>{% endif %} |
| 41 |
<p class="small mute counts-line"><span title="stars">★ {{ stars }}</span> · <span title="watchers">👁 {{ watchers }}</span></p> |
| 42 |
{% if shell.user.is_some() %}<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> |
| 43 |
<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> |
| 44 |
<a class="go small" href="{{ repo.url }}/fork">fork</a>{% endif %} |
| 45 |
{% if fork.forks > 0 %}<a class="small" href="{{ repo.url }}/forks">{{ fork.forks|plural("fork", "forks") }}</a>{% endif %} |
| 46 |
</div> |
| 47 |
{% if let Some(up) = fork.upstream %}{% if shell.user.is_some() %}<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>{% endif %}{% endif %} |
| 48 |
{% if !o.contributors.is_empty() %} |
| 49 |
<h3>Contributors <span class="count-chip">{{ o.contributors.len() }}</span></h3> |
| 50 |
<ul class="plain contributors">{% for c in o.contributors.iter().take(10) %} |
| 51 |
<li>{% if let Some(u) = c.account %}<a href="/{{ u }}"><img class="avatar sm" src="/avatar/{{ u }}" alt="" width="20" height="20"> {{ u }}</a> <span class="mute small">{{ c.name }}</span>{% else %}<span class="avatar-none" aria-hidden="true">○</span> {{ c.name }}{% endif %} <span class="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> |
| 52 |
{% endfor %}</ul> |
| 53 |
{% if o.contributors.len() > 10 %}<p class="small mute">and {{ o.contributors.len() - 10 }} more</p>{% endif %} |
| 54 |
{% endif %} |
| 55 |
{% if !o.languages.is_empty() %} |
| 56 |
<h3>Languages</h3> |
| 57 |
<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> |
| 58 |
<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> |
| 59 |
{% endif %} |
| 60 |
<h3>Bookmarks</h3> |
| 61 |
<ul class="plain">{% for b in o.bookmarks %}<li><a href="{{ repo.url }}/tree/{{ 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 %}</li>{% endfor %}</ul> |
| 62 |
{% if let Some(rel) = latest_release %}<h3>Latest release</h3><p><a href="{{ repo.url }}/releases/tag/{{ rel.tag }}">{{ rel.title }}</a> <span class="small mute">{{ rel.created_ms|ago_i }}</span></p>{% endif %} |
| 63 |
{% if !used_by.is_empty() %}<h3>Used by <span class="count-chip">{{ used_by.len() }}</span></h3> |
| 64 |
<ul class="plain used-by">{% for c in used_by %}<li><a href="/{{ c.owner }}/{{ c.name }}">{{ c.owner }}/{{ c.name }}</a> <span class="small mute">{{ c.bookmark }} · {{ c.path }}</span><br><span class="small">{% match c.behind %}{% when Some(0) %}<span class="tag">up to date</span>{% when Some(n) %}<span class="tag warn" title="Changes on {{ repo.default_bookmark }} its pin lacks">{{ n }} behind</span>{% when None %}<span class="mute" title="Its pin names changes this repository does not hold">pin not here</span>{% endmatch %}</span></li>{% endfor %}</ul>{% endif %} |
| 65 |
<h3>Tags</h3> |
| 66 |
{% 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 }}/tree/{{ t.name }}">{{ t.name }}</a>{% if t.signer.is_some() %} <span class="sig sig-valid" title="signed">✔</span>{% endif %}</li>{% endfor %}</ul>{% endif %} |
| 67 |
<h3>Trust</h3> |
| 68 |
{% match o.policy %} |
| 69 |
{% when crate::repos::view::PolicyBadge::Active %}<p><a href="{{ repo.url }}/trust"><span class="sig sig-valid">✔</span> policy in force</a></p> |
| 70 |
{% when crate::repos::view::PolicyBadge::Expired %}<p><a href="{{ repo.url }}/trust"><span class="sig sig-invalid">✘</span> policy expired</a></p> |
| 71 |
{% when crate::repos::view::PolicyBadge::None %}<p><a href="{{ repo.url }}/trust"><span class="sig sig-unsigned">○</span> no policy</a></p> |
| 72 |
{% endmatch %} |
| 73 |
{% if let Some(l) = o.license %}<h3>Licence</h3><p><a href="{{ repo.url }}/file/{{ repo.default_bookmark }}/{{ l }}">{{ l }}</a></p>{% endif %} |
| 74 |
</aside> |
| 75 |
</div> |
| 76 |
{% endblock %} |