artifactview/templates/selection.hbs

81 lines
3.1 KiB
Handlebars

{{#> partial/header ~}}
<title>Artifacts: {{run_name}}</title>
{{~/partial/header }}
{{> partial/fileIcons }}
<header>
{{> partial/logoLink }}
<h1><a href="/?url={{run_url}}">{{run_name}}</a><span class="sep">/</span></h1>
</header>
<main>
<div class="metadata">
<div id="summary">
<span class="meta-item"><b>{{artifacts.len()}}</b> artifact{{#if artifacts.len() != 1}}s{{/if}}</span>
<span class="meta-item"><a href="{{run_url}}" target="_blank" rel="noopener noreferrer">CI run</a></span>
<span class="meta-item"><input type="text" placeholder="filter" id="filter" onkeyup="filter()"/></span>
</div>
</div>
<div class="listing">
<table id="list" aria-describedby="summary">
<thead>
<tr>
<th>Artifact</th>
<th>Size</th>
<th>Download</th>
</tr>
</thead>
<tbody>
{{#each artifacts}}
<tr class="file">
{{#if expired}}
<td>
<svg
class="expired"
width="1.5em"
height="1em"
version="1.1"
viewBox="0 0 317 259"
><use xlink:href="#folder"></use></svg>
<span class="name light">{{name}}</span>
</td>
{{else}}
<td>
<a href="{{url}}">
<svg
width="1.5em"
height="1em"
version="1.1"
viewBox="0 0 317 259"
><use xlink:href="#folder"></use></svg>
<span class="name">{{name}}</span>
</a>
</td>
{{/if}}
<td>{{size}}</td>
<td>
{{#if expired}}
&mdash;
{{else}}
<a href="{{download_url}}" rel="noopener noreferrer">Download</a>
{{/if}}
</td>
</tr>
{{/each}}
</tbody>
</table>
</div>
</main>
{{#> partial/footer ~}}
<script>
// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT
var filterEl = document.getElementById("filter");
function initFilter() { if (!filterEl.value) { var filterParam = new URL(window.location.href).searchParams.get("filter"); if (filterParam) { filterEl.value = filterParam } } filter() }
function filter() { var q = filterEl.value.trim().toLowerCase(); var elems = document.querySelectorAll("tr.file"); elems.forEach(function (el) { if (!q) { el.style.display = ""; return } var nameEl = el.querySelector("td"); var nameVal = nameEl.textContent.trim().toLowerCase(); if (nameVal.indexOf(q) !== -1) { el.style.display = "" } else { el.style.display = "none" } }) }
document.addEventListener("DOMContentLoaded", initFilter);
// @license-end
</script>
{{~/partial/footer }}