d23464c0 Andy McCall 1 month ago ↶
1
{% extends "base.html" %}
2
{% import "repo_tabs.html" as m %}
3
{% block title %}{{ repo.owner }}/{{ repo.name }}{% endblock %}
ffb67a81 Andy McCall 22 days ago
4
{% block bodyattrs %} data-repo="{{ repo.url }}" data-ref="{{ at }}"{% endblock %}
d23464c0 Andy McCall 1 month ago ↶
5
{% block tabs %}{% call m::tabs(repo, "code") %}{% endblock %}
6
{% block content %}
ffb67a81 Andy McCall 22 days ago
7
{% include "repo_backdrop.html" %}
8
< div data-backdrop-avoid >
d23464c0 Andy McCall 1 month ago ↶
9
< div class = " side-layout rev " >
10
< div >
addec2bd Andy McCall 22 days ago ↶
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 1 month ago ↶
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 1 month ago ↶
13
< div class = " bar " >
ffb67a81 Andy McCall 22 days ago
14
< details class = " ref-pick " >
addec2bd Andy McCall 22 days ago ↶
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 22 days ago
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 1 month ago ↶
26
< form class = " find inline-find " method = " get" action = " {{ repo.url }}/search" > < input type = " search" name = " q" placeholder = " Search code…" > </ form >
83d5052b Andy McCall 1 month ago ↶
27
< details class = " clone-pop " >
7f283f8e Andy McCall 23 days ago ↶
28
< summary class = " go small primary " aria-haspopup = " true" > < span aria-hidden = " true" > & lt; & gt; </ span > Code</ summary >
67b24adb Andy McCall 1 month ago ↶
29
< div class = " clone-panel " role = " group" aria-label = " Clone or download this repository" >
83d5052b Andy McCall 1 month ago ↶
30
< label for = " clone-cmd" class = " small mute " > Clone with oxy</ label >
31
< 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 >
32
< p class = " small mute " > The URL alone: < code > {{ repo.clone_url }}</ code > </ p >
67b24adb Andy McCall 1 month ago ↶
33
{% if quickstart.is_none() %}
ffb67a81 Andy McCall 22 days ago
34
< a class = " download " href = " {{ repo.url }}/archive?ref={{ at|urlencode }}& amp; format=zip" download > < span aria-hidden = " true" > ⤓</ span > Download ZIP</ a >
35
< 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 1 month ago ↶
36
{% endif %}
83d5052b Andy McCall 1 month ago ↶
37
</ div >
38
</ details >
d23464c0 Andy McCall 1 month ago ↶
39
</ div >
4edcf240 Andy McCall 1 month ago ↶
40
{% if let Some(q) = quickstart %}
41
{% include "quickstart.html" %}
42
{% else %}
c9aacc0e Andy McCall 23 days ago ↶
43
< div class = " tree-box " >
44
{% if let Some(c) = o.latest %}< div class = " tree-head " >
45
< 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 22 days ago
46
< 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 23 days ago ↶
47
</ div > {% endif %}
d23464c0 Andy McCall 1 month ago ↶
48
{% include "tree_table.html" %}
c9aacc0e Andy McCall 23 days ago ↶
49
</ div >
4edcf240 Andy McCall 1 month ago ↶
50
{% endif %}
d23464c0 Andy McCall 1 month ago ↶
51
{% if let Some(html) = readme_html %}
52
< article class = " doc readme " > < h2 class = " small mute " > {{ o.tree.readme.as_ref().unwrap().path }}</ h2 > {{ html|safe }}</ article >
53
{% endif %}
54
</ div >
c9aacc0e Andy McCall 23 days ago ↶
55
< aside class = " side cards " >
7f283f8e Andy McCall 23 days ago ↶
56
< 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 1 month ago ↶
57
{% if repo.description.is_empty() %}< p class = " mute small " > No description.</ p > {% else %}< p > {{ repo.description }}</ p > {% endif %}
07b1a5bb Andy McCall 1 month ago ↶
58
{% 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 23 days ago ↶
59
{% 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 22 days ago
60
{% if let Some(l) = o.license %}< p class = " small " > Licence: < a href = " {{ repo.url }}/file/{{ at }}/{{ l }}" > {{ l }}</ a > </ p > {% endif %}
7f283f8e Andy McCall 23 days ago ↶
61
{% if shell.user.is_some() %}< div class = " about-actions " >
62
< 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 >
63
< 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 >
64
< a class = " go small " href = " {{ repo.url }}/fork" > fork</ a >
65
</ div > {% endif %}
66
{% 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 23 days ago ↶
67
</ div > </ section >
68
{% 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 %}
69
{% if !follows.is_empty() || !used_by.is_empty() %}
70
< section class = " side-card " > < h3 > Diffusion < a class = " more " href = " {{ repo.url }}/diffusion" > details ›</ a > </ h3 > < div class = " body " >
7f283f8e Andy McCall 23 days ago ↶
71
{% if !follows.is_empty() %}< h4 > Takes from < span class = " count-chip " > {{ follows.len() }}</ span > </ h4 >
72
< ul class = " plain df-list " > {% for (up, c) in follows %}< li >
73
< 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 >
74
{% 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 %}
75
</ li > {% endfor %}</ ul > {% endif %}
c9aacc0e Andy McCall 23 days ago ↶
76
{% if !used_by.is_empty() %}< h4 > Diffuses to < span class = " count-chip " > {{ used_by.len() }}</ span > </ h4 >
7f283f8e Andy McCall 23 days ago ↶
77
< ul class = " plain df-list " > {% for c in used_by %}< li >
78
< 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 >
79
{% match c.behind %}{% when Some(0) %}{% when Some(n) %}< div class = " df-sub " > < span > {{ n }} behind</ span > </ div > {% when None %}{% endmatch %}
80
</ li > {% endfor %}</ ul > {% endif %}
c9aacc0e Andy McCall 23 days ago ↶
81
</ div > </ section >
82
{% endif %}
83d5052b Andy McCall 1 month ago ↶
83
{% if !o.contributors.is_empty() %}
c9aacc0e Andy McCall 23 days ago ↶
84
< section class = " side-card " > < h3 > Contributors < span class = " count-chip " > {{ o.contributors.len() }}</ span > </ h3 > < div class = " body " >
83d5052b Andy McCall 1 month ago ↶
85
< ul class = " plain contributors " > {% for c in o.contributors.iter().take(10) %}
c9aacc0e Andy McCall 23 days ago ↶
86
< 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 1 month ago ↶
87
{% endfor %}</ ul >
88
{% if o.contributors.len() > 10 %}< p class = " small mute " > and {{ o.contributors.len() - 10 }} more</ p > {% endif %}
c9aacc0e Andy McCall 23 days ago ↶
89
</ div > </ section >
83d5052b Andy McCall 1 month ago ↶
90
{% endif %}
91
{% if !o.languages.is_empty() %}
c9aacc0e Andy McCall 23 days ago ↶
92
< section class = " side-card " > < h3 > Languages</ h3 > < div class = " body " >
83d5052b Andy McCall 1 month ago ↶
93
< 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 >
94
< 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 23 days ago ↶
95
</ div > </ section >
83d5052b Andy McCall 1 month ago ↶
96
{% endif %}
c9aacc0e Andy McCall 23 days ago ↶
97
< section class = " side-card " > < 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 22 days ago
98
< 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 23 days ago ↶
99
</ div > </ section >
100
< section class = " side-card " > < h3 > Tags</ h3 > < div class = " body " >
ffb67a81 Andy McCall 22 days ago
101
{% 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 23 days ago ↶
102
</ div > </ section >
103
< section class = " side-card " > < h3 > Trust</ h3 > < div class = " body " >
d23464c0 Andy McCall 1 month ago ↶
104
{% match o.policy %}
105
{% when crate::repos::view::PolicyBadge::Active %}< p > < a href = " {{ repo.url }}/trust" > < span class = " sig sig-valid " > ✔</ span > policy in force</ a > </ p >
106
{% when crate::repos::view::PolicyBadge::Expired %}< p > < a href = " {{ repo.url }}/trust" > < span class = " sig sig-invalid " > ✘</ span > policy expired</ a > </ p >
107
{% when crate::repos::view::PolicyBadge::None %}< p > < a href = " {{ repo.url }}/trust" > < span class = " sig sig-unsigned " > ○</ span > no policy</ a > </ p >
108
{% endmatch %}
c9aacc0e Andy McCall 23 days ago ↶
109
</ div > </ section >
d23464c0 Andy McCall 1 month ago ↶
110
</ aside >
ffb67a81 Andy McCall 22 days ago
111
</ div >
d23464c0 Andy McCall 1 month ago ↶
112
</ div >
113
{% endblock %}