|
1
|
{% extends "base.html" %} |
|
2
|
{% load humanize %} |
|
3
|
{% block title %}Releases — {{ project.name }} — Fossilrepo{% endblock %} |
|
4
|
|
|
5
|
{% block content %} |
|
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-3 mb-6"> |
|
10
|
<h2 class="text-lg font-semibold text-gray-200">Releases</h2> |
|
11
|
<div class="flex flex-wrap items-center gap-3"> |
|
12
|
<span class="search-wrap"> |
|
13
|
<input type="search" |
|
14
|
name="search" |
|
15
|
value="{{ search }}" |
|
16
|
placeholder="Search releases..." |
|
17
|
aria-label="Search releases" |
|
18
|
class="rounded-md border-gray-700 bg-gray-800 text-gray-100 shadow-sm focus:border-brand focus:ring-brand text-sm px-3 py-1.5" |
|
19
|
hx-get="{% url 'fossil:releases' slug=project.slug %}" |
|
20
|
hx-trigger="input changed delay:300ms, search" |
|
21
|
hx-target="#release-content" |
|
22
|
hx-swap="innerHTML" |
|
23
|
hx-push-url="true" |
|
24
|
hx-indicator="closest .search-wrap" /> |
|
25
|
<svg class="search-spinner 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> |
|
26
|
</span> |
|
27
|
{% if has_write %} |
|
28
|
<a href="{% url 'fossil:release_create' slug=project.slug %}" |
|
29
|
class="inline-flex items-center rounded-md bg-brand px-3 py-1.5 text-sm font-semibold text-white shadow-sm hover:bg-brand-hover focus:outline-none focus:ring-2 focus:ring-brand focus:ring-offset-2 focus:ring-offset-gray-950 transition-colors"> |
|
30
|
Create Release |
|
31
|
</a> |
|
32
|
{% endif %} |
|
33
|
</div> |
|
34
|
</div> |
|
35
|
|
|
36
|
<div id="release-content"> |
|
37
|
{% if releases %} |
|
38
|
<div class="space-y-4"> |
|
39
|
{% for release in releases %} |
|
40
|
<div class="overflow-hidden rounded-lg bg-gray-800 shadow-sm border border-gray-700 hover:border-gray-600 transition-colors"> |
|
41
|
<div class="px-6 py-4"> |
|
42
|
<div class="flex items-start justify-between gap-4"> |
|
43
|
<div class="flex-1 min-w-0"> |
|
44
|
<div class="flex items-center gap-3 mb-1"> |
|
45
|
<a href="{% url 'fossil:release_detail' slug=project.slug tag_name=release.tag_name %}" |
|
46
|
class="text-lg font-bold text-brand-light hover:text-brand">{{ release.tag_name }}</a> |
|
47
|
{% if release.is_prerelease %} |
|
48
|
<span class="inline-flex rounded-full bg-yellow-900/50 px-2.5 py-0.5 text-xs font-semibold text-yellow-300">Pre-release</span> |
|
49
|
{% endif %} |
|
50
|
{% if release.is_draft %} |
|
51
|
<span class="inline-flex rounded-full bg-gray-700 px-2.5 py-0.5 text-xs font-semibold text-gray-400">Draft</span> |
|
52
|
{% endif %} |
|
53
|
</div> |
|
54
|
<p class="text-sm text-gray-200">{{ release.name }}</p> |
|
55
|
<p class="mt-1 text-xs text-gray-500"> |
|
56
|
{% if release.published_at %} |
|
57
|
Published {{ release.published_at|timesince }} ago |
|
58
|
{% else %} |
|
59
|
Created {{ release.created_at|timesince }} ago |
|
60
|
{% endif %} |
|
61
|
{% with asset_count=release.assets.count %} |
|
62
|
{% if asset_count %} |
|
63
|
· {{ asset_count }} asset{{ asset_count|pluralize }} |
|
64
|
{% endif %} |
|
65
|
{% endwith %} |
|
66
|
</p> |
|
67
|
</div> |
|
68
|
</div> |
|
69
|
</div> |
|
70
|
</div> |
|
71
|
{% endfor %} |
|
72
|
</div> |
|
73
|
{% else %} |
|
74
|
<div class="rounded-lg bg-gray-800 border border-gray-700 p-8 text-center"> |
|
75
|
<p class="text-sm text-gray-500">{% if search %}No releases matching "{{ search }}".{% else %}No releases yet.{% endif %}</p> |
|
76
|
{% if has_write and not search %} |
|
77
|
<a href="{% url 'fossil:release_create' slug=project.slug %}" |
|
78
|
class="mt-3 inline-flex items-center rounded-md bg-brand px-3 py-1.5 text-sm font-semibold text-white shadow-sm hover:bg-brand-hover"> |
|
79
|
Create the first release |
|
80
|
</a> |
|
81
|
{% endif %} |
|
82
|
</div> |
|
83
|
{% endif %} |
|
84
|
{% include "includes/_pagination.html" %} |
|
85
|
</div> |
|
86
|
{% endblock %} |
|
87
|
|