2026-03-15 21:55:10 +01:00
|
|
|
<!DOCTYPE html>
|
2026-03-15 22:42:51 +01:00
|
|
|
<html lang="en">
|
2026-03-15 21:55:10 +01:00
|
|
|
<head>
|
|
|
|
|
<meta charset="utf-8">
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
|
|
<title>{% block title %}Package Repository{% endblock %}</title>
|
2026-03-15 22:49:33 +01:00
|
|
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
|
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
|
|
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&family=Source+Sans+3:wght@300;400;500;600;700&display=swap">
|
2026-03-15 21:55:10 +01:00
|
|
|
<link rel="stylesheet" href="/ui/static/css/style.css">
|
|
|
|
|
<script src="/ui/static/js/htmx.min.js"></script>
|
|
|
|
|
</head>
|
|
|
|
|
<body>
|
|
|
|
|
<nav class="depot-nav">
|
|
|
|
|
<div class="nav-inner">
|
|
|
|
|
<a href="/ui/" class="brand">pkg depot</a>
|
2026-03-15 22:25:29 +01:00
|
|
|
<div class="nav-links">
|
|
|
|
|
<a href="/ui/"{% block nav_publishers %}{% endblock %}>Publishers</a>
|
|
|
|
|
<a href="/ui/search"{% block nav_search %}{% endblock %}>Search</a>
|
|
|
|
|
</div>
|
2026-03-15 21:55:10 +01:00
|
|
|
</div>
|
|
|
|
|
</nav>
|
|
|
|
|
<main class="container">
|
|
|
|
|
{% block content %}{% endblock %}
|
|
|
|
|
</main>
|
2026-03-15 22:25:29 +01:00
|
|
|
<div id="p5i-cart" class="p5i-cart" style="display:none">
|
|
|
|
|
<span class="cart-count" id="p5i-count">0</span>
|
|
|
|
|
<span class="cart-label">selected</span>
|
|
|
|
|
<a href="#" class="cart-action" id="p5i-download" onclick="downloadP5i(); return false;">Download P5I</a>
|
2026-03-15 21:55:10 +01:00
|
|
|
</div>
|
|
|
|
|
<script>
|
|
|
|
|
const p5iSelection = new Set();
|
|
|
|
|
function toggleP5i(checkbox, publisher, fmri) {
|
|
|
|
|
const key = publisher + '|' + fmri;
|
|
|
|
|
if (checkbox.checked) {
|
|
|
|
|
p5iSelection.add(key);
|
|
|
|
|
} else {
|
|
|
|
|
p5iSelection.delete(key);
|
|
|
|
|
}
|
|
|
|
|
const cart = document.getElementById('p5i-cart');
|
|
|
|
|
const count = document.getElementById('p5i-count');
|
|
|
|
|
count.textContent = p5iSelection.size;
|
2026-03-15 22:25:29 +01:00
|
|
|
cart.style.display = p5iSelection.size > 0 ? 'flex' : 'none';
|
2026-03-15 21:55:10 +01:00
|
|
|
}
|
|
|
|
|
function downloadP5i() {
|
|
|
|
|
const byPub = {};
|
|
|
|
|
for (const key of p5iSelection) {
|
2026-03-15 22:25:29 +01:00
|
|
|
const [pub_, fmri] = key.split('|', 2);
|
|
|
|
|
if (!byPub[pub_]) byPub[pub_] = [];
|
|
|
|
|
byPub[pub_].push(fmri);
|
2026-03-15 21:55:10 +01:00
|
|
|
}
|
|
|
|
|
const publishers = Object.keys(byPub);
|
|
|
|
|
if (publishers.length === 0) return;
|
2026-03-15 22:25:29 +01:00
|
|
|
const pub_ = publishers[0];
|
2026-03-15 21:55:10 +01:00
|
|
|
const params = new URLSearchParams();
|
2026-03-15 22:25:29 +01:00
|
|
|
params.set('publisher', pub_);
|
|
|
|
|
for (const fmri of byPub[pub_]) {
|
2026-03-15 21:55:10 +01:00
|
|
|
params.append('pkg', fmri);
|
|
|
|
|
}
|
|
|
|
|
window.location.href = '/ui/p5i?' + params.toString();
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|