OXYGENHUB
◆ v0.6.1 oxygenhub / templates / diffusion_rows.html
2.1 KiB · HTML · last changed feat(web): sidebar cards, a shaded tree head, icons, aligned Diffusion tables (closes #152) 22 days ago source blame history raw
1
{% macro chip(c) %}<span class="df-pill" role="img" aria-label="upstream {{ c.upstream.word }}, downstream {{ 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="Downstream: {{ c.downstream.title }}">{{ c.downstream.word }}</span></span>{% endmacro %}
2
3
{% macro rows(list) %}
4
<div class="table"><table class="diffusion">
5
  <colgroup><col class="df-c-repo"><col class="df-c-pin"><col class="df-c-behind"><col class="df-c-pill"><col class="df-c-bump"><col class="df-c-landed"><col class="df-c-follow"></colgroup>
6
  <tr><th>Repository</th><th>Pin on</th><th>Behind</th><th>Upstream │ downstream</th><th>Open bump</th><th>Last landed</th><th>Follows</th></tr>
7
  {% for c in list %}
8
  <tr>
9
    <td><a href="/{{ c.owner }}/{{ c.name }}">{{ c.owner }}/{{ c.name }}</a> <span class="small mute df-path">{{ c.path }}</span></td>
10
    <td class="small"><span class="lbl lbl-bm">{{ c.bookmark }}</span></td>
11
    <td class="small">{% match c.behind %}{% when Some(0) %}<span class="mute">0</span>{% when Some(n) %}{{ n }}{% when None %}<span class="mute" title="Its pin names changes this repository does not hold">?</span>{% endmatch %}</td>
12
    <td>{% call chip(c) %}</td>
13
    <td class="small">{% if let Some(n) = c.bump %}<a href="/{{ c.owner }}/{{ c.name }}/proposal/{{ n }}">#{{ n }}</a>{% if let Some((r, st)) = c.run %} · <a href="/{{ c.owner }}/{{ c.name }}/flow/{{ r }}">run #{{ r }}</a> <span class="mute">{{ st }}</span>{% endif %}{% else %}<span class="mute">none</span>{% endif %}</td>
14
    <td class="small">{% if let Some((n, at)) = c.landed %}<a href="/{{ c.owner }}/{{ c.name }}/proposal/{{ n }}">#{{ n }}</a> <time class="mute" title="{{ at|when_i }}">{{ at|ago_i }}</time>{% else %}<span class="mute">—</span>{% endif %}</td>
15
    <td class="small mute">{% match c.follow %}{% when crate::diffusion::Follow::Off %}off{% when crate::diffusion::Follow::Green %}when green{% when crate::diffusion::Follow::Any %}every move{% endmatch %}</td>
16
  </tr>
17
  {% endfor %}
18
</table></div>
19
{% endmacro %}