|
1
|
{% extends "base.html" %} |
|
2
|
{% block title %}Timeline — {{ project.name }} — Fossilrepo{% endblock %} |
|
3
|
|
|
4
|
{% block content %} |
|
5
|
{% include "fossil/_live_reload.html" %} |
|
6
|
<h1 class="text-2xl font-bold text-gray-100 mb-2">{{ project.name }}</h1> |
|
7
|
{% include "fossil/_project_nav.html" %} |
|
8
|
|
|
9
|
<div class="flex flex-wrap items-center justify-between gap-2 mb-4"> |
|
10
|
<div class="flex flex-wrap items-center gap-2 text-xs text-gray-500"> |
|
11
|
<span>Filter:</span> |
|
12
|
<a href="{% url 'fossil:timeline' slug=project.slug %}" |
|
13
|
class="rounded-full px-2.5 py-1 {% if not event_type %}bg-brand text-white{% else %}bg-gray-800 text-gray-400 hover:text-white border border-gray-700{% endif %}">All</a> |
|
14
|
<a href="{% url 'fossil:timeline' slug=project.slug %}?type=ci" |
|
15
|
class="rounded-full px-2.5 py-1 {% if event_type == 'ci' %}bg-brand text-white{% else %}bg-gray-800 text-gray-400 hover:text-white border border-gray-700{% endif %}">Checkins</a> |
|
16
|
<a href="{% url 'fossil:timeline' slug=project.slug %}?type=w" |
|
17
|
class="rounded-full px-2.5 py-1 {% if event_type == 'w' %}bg-brand text-white{% else %}bg-gray-800 text-gray-400 hover:text-white border border-gray-700{% endif %}">Wiki</a> |
|
18
|
<a href="{% url 'fossil:timeline' slug=project.slug %}?type=t" |
|
19
|
class="rounded-full px-2.5 py-1 {% if event_type == 't' %}bg-brand text-white{% else %}bg-gray-800 text-gray-400 hover:text-white border border-gray-700{% endif %}">Tickets</a> |
|
20
|
</div> |
|
21
|
<a href="{% url 'fossil:timeline_rss' slug=project.slug %}" class="text-xs text-gray-500 hover:text-brand-light flex items-center gap-1" title="RSS Feed"> |
|
22
|
<svg class="h-3.5 w-3.5" fill="currentColor" viewBox="0 0 24 24"><path d="M6.18 15.64a2.18 2.18 0 0 1 2.18 2.18C8.36 19 7.38 20 6.18 20C5 20 4 19 4 17.82a2.18 2.18 0 0 1 2.18-2.18M4 4.44A15.56 15.56 0 0 1 19.56 20h-2.83A12.73 12.73 0 0 0 4 7.27V4.44m0 5.66a9.9 9.9 0 0 1 9.9 9.9h-2.83A7.07 7.07 0 0 0 4 12.93V10.1Z"/></svg> |
|
23
|
RSS |
|
24
|
</a> |
|
25
|
</div> |
|
26
|
|
|
27
|
{% include "fossil/partials/timeline_entries.html" %} |
|
28
|
|
|
29
|
{% if entries|length == 50 %} |
|
30
|
<div id="load-more" class="mt-4 text-center" |
|
31
|
hx-get="{% url 'fossil:timeline' slug=project.slug %}?page={{ page|add:1 }}{% if event_type %}&type={{ event_type }}{% endif %}" |
|
32
|
hx-trigger="revealed" |
|
33
|
hx-target="#timeline-entries" |
|
34
|
hx-swap="beforeend" |
|
35
|
hx-select="#timeline-entries > *" |
|
36
|
hx-indicator="#load-spinner"> |
|
37
|
<div id="load-spinner" class="htmx-indicator"> |
|
38
|
<div class="inline-flex items-center gap-2 text-sm text-gray-500"> |
|
39
|
<svg class="animate-spin h-4 w-4" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"></path></svg> |
|
40
|
Loading more... |
|
41
|
</div> |
|
42
|
</div> |
|
43
|
</div> |
|
44
|
{% endif %} |
|
45
|
|
|
46
|
<script> |
|
47
|
// Keyboard navigation: j/k to move between timeline entries |
|
48
|
(function() { |
|
49
|
let current = -1; |
|
50
|
const rows = document.querySelectorAll('.tl-row'); |
|
51
|
function highlight(idx) { |
|
52
|
rows.forEach(r => r.style.background = ''); |
|
53
|
if (idx >= 0 && idx < rows.length) { |
|
54
|
rows[idx].style.background = 'rgba(220,57,76,0.06)'; |
|
55
|
rows[idx].scrollIntoView({ behavior: 'smooth', block: 'center' }); |
|
56
|
} |
|
57
|
} |
|
58
|
document.addEventListener('keydown', function(e) { |
|
59
|
if (document.activeElement.tagName === 'INPUT' || document.activeElement.tagName === 'TEXTAREA') return; |
|
60
|
if (e.key === 'j') { current = Math.min(current + 1, rows.length - 1); highlight(current); } |
|
61
|
else if (e.key === 'k') { current = Math.max(current - 1, 0); highlight(current); } |
|
62
|
else if (e.key === 'Enter' && current >= 0) { |
|
63
|
const link = rows[current].querySelector('a[href*="/checkin/"]'); |
|
64
|
if (link) window.location = link.href; |
|
65
|
} |
|
66
|
}); |
|
67
|
})(); |
|
68
|
</script> |
|
69
|
{% endblock %} |
|
70
|
|