|
1
|
{% extends "base.html" %} |
|
2
|
{% load humanize %} |
|
3
|
{% block title %}{{ release.tag_name }} — {{ 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="mb-4"> |
|
10
|
<a href="{% url 'fossil:releases' slug=project.slug %}" class="text-sm text-brand-light hover:text-brand">← Back to releases</a> |
|
11
|
</div> |
|
12
|
|
|
13
|
<div class="overflow-hidden rounded-lg bg-gray-800 shadow border border-gray-700"> |
|
14
|
<!-- Header --> |
|
15
|
<div class="px-6 py-5 border-b border-gray-700"> |
|
16
|
<div class="flex items-start justify-between gap-4"> |
|
17
|
<div class="flex-1"> |
|
18
|
<div class="flex items-center gap-3 mb-1"> |
|
19
|
<h2 class="text-xl font-bold text-gray-100">{{ release.tag_name }}</h2> |
|
20
|
{% if release.is_prerelease %} |
|
21
|
<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> |
|
22
|
{% endif %} |
|
23
|
{% if release.is_draft %} |
|
24
|
<span class="inline-flex rounded-full bg-gray-700 px-2.5 py-0.5 text-xs font-semibold text-gray-400">Draft</span> |
|
25
|
{% endif %} |
|
26
|
</div> |
|
27
|
<p class="text-sm text-gray-200">{{ release.name }}</p> |
|
28
|
<p class="mt-1 text-xs text-gray-500"> |
|
29
|
{% if release.published_at %} |
|
30
|
Published {{ release.published_at|timesince }} ago |
|
31
|
{% else %} |
|
32
|
Created {{ release.created_at|timesince }} ago |
|
33
|
{% endif %} |
|
34
|
{% if release.checkin_uuid %} |
|
35
|
· <a href="{% url 'fossil:checkin_detail' slug=project.slug checkin_uuid=release.checkin_uuid %}" |
|
36
|
class="text-brand-light hover:text-brand font-mono">{{ release.checkin_uuid|truncatechars:16 }}</a> |
|
37
|
{% endif %} |
|
38
|
</p> |
|
39
|
</div> |
|
40
|
<div class="flex items-center gap-2 flex-shrink-0"> |
|
41
|
{% if has_write %} |
|
42
|
<a href="{% url 'fossil:release_edit' slug=project.slug tag_name=release.tag_name %}" |
|
43
|
class="rounded-md bg-gray-700 px-3 py-1.5 text-xs font-semibold text-gray-300 hover:bg-gray-600">Edit</a> |
|
44
|
{% endif %} |
|
45
|
{% if has_admin %} |
|
46
|
<form method="post" action="{% url 'fossil:release_delete' slug=project.slug tag_name=release.tag_name %}" |
|
47
|
onsubmit="return confirm('Delete this release? This cannot be undone.')"> |
|
48
|
{% csrf_token %} |
|
49
|
<button type="submit" class="rounded-md bg-red-900/50 px-3 py-1.5 text-xs font-semibold text-red-300 hover:bg-red-900">Delete</button> |
|
50
|
</form> |
|
51
|
{% endif %} |
|
52
|
</div> |
|
53
|
</div> |
|
54
|
</div> |
|
55
|
|
|
56
|
<!-- Body / Changelog --> |
|
57
|
{% if body_html %} |
|
58
|
<div class="px-6 py-5 border-b border-gray-700"> |
|
59
|
<h3 class="text-sm font-semibold text-gray-300 uppercase tracking-wider mb-3">Changelog</h3> |
|
60
|
<div class="prose prose-invert prose-gray prose-sm max-w-none"> |
|
61
|
{{ body_html }} |
|
62
|
</div> |
|
63
|
</div> |
|
64
|
{% endif %} |
|
65
|
</div> |
|
66
|
|
|
67
|
<!-- Source Archives --> |
|
68
|
{% if release.checkin_uuid %} |
|
69
|
<div class="mt-6"> |
|
70
|
<h3 class="text-sm font-semibold text-gray-300 uppercase tracking-wider mb-3">Source Code</h3> |
|
71
|
<div class="flex gap-3"> |
|
72
|
<a href="{% url 'fossil:release_source_archive' slug=project.slug tag_name=release.tag_name fmt='tar.gz' %}" |
|
73
|
class="inline-flex items-center gap-2 rounded-md bg-gray-800 border border-gray-700 px-4 py-2 text-sm text-gray-200 hover:bg-gray-700 hover:border-gray-600"> |
|
74
|
<svg class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> |
|
75
|
<path stroke-linecap="round" stroke-linejoin="round" d="M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3" /> |
|
76
|
</svg> |
|
77
|
Source code (tar.gz) |
|
78
|
</a> |
|
79
|
<a href="{% url 'fossil:release_source_archive' slug=project.slug tag_name=release.tag_name fmt='zip' %}" |
|
80
|
class="inline-flex items-center gap-2 rounded-md bg-gray-800 border border-gray-700 px-4 py-2 text-sm text-gray-200 hover:bg-gray-700 hover:border-gray-600"> |
|
81
|
<svg class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> |
|
82
|
<path stroke-linecap="round" stroke-linejoin="round" d="M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3" /> |
|
83
|
</svg> |
|
84
|
Source code (zip) |
|
85
|
</a> |
|
86
|
</div> |
|
87
|
</div> |
|
88
|
{% endif %} |
|
89
|
|
|
90
|
<!-- Assets --> |
|
91
|
<div class="mt-6"> |
|
92
|
<h3 class="text-sm font-semibold text-gray-300 uppercase tracking-wider mb-3"> |
|
93
|
Assets |
|
94
|
{% if assets %}({{ assets|length }}){% endif %} |
|
95
|
</h3> |
|
96
|
|
|
97
|
{% if assets %} |
|
98
|
<div class="overflow-hidden rounded-lg bg-gray-800 shadow border border-gray-700"> |
|
99
|
<table class="min-w-full divide-y divide-gray-700"> |
|
100
|
<thead class="bg-gray-900"> |
|
101
|
<tr> |
|
102
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-400 uppercase tracking-wider">Name</th> |
|
103
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-400 uppercase tracking-wider">Size</th> |
|
104
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-400 uppercase tracking-wider">Downloads</th> |
|
105
|
<th class="px-6 py-3 text-right text-xs font-medium text-gray-400 uppercase tracking-wider"></th> |
|
106
|
</tr> |
|
107
|
</thead> |
|
108
|
<tbody class="divide-y divide-gray-700"> |
|
109
|
{% for asset in assets %} |
|
110
|
<tr class="hover:bg-gray-700/30"> |
|
111
|
<td class="px-6 py-3 text-sm text-gray-200 font-mono">{{ asset.name }}</td> |
|
112
|
<td class="px-6 py-3 text-sm text-gray-400">{{ asset.file_size_bytes|filesizeformat }}</td> |
|
113
|
<td class="px-6 py-3 text-sm text-gray-400">{{ asset.download_count|intcomma }}</td> |
|
114
|
<td class="px-6 py-3 text-right"> |
|
115
|
<a href="{% url 'fossil:release_asset_download' slug=project.slug tag_name=release.tag_name asset_id=asset.pk %}" |
|
116
|
class="inline-flex items-center rounded-md bg-gray-700 px-3 py-1 text-xs font-semibold text-gray-300 hover:bg-gray-600"> |
|
117
|
Download |
|
118
|
</a> |
|
119
|
</td> |
|
120
|
</tr> |
|
121
|
{% endfor %} |
|
122
|
</tbody> |
|
123
|
</table> |
|
124
|
</div> |
|
125
|
{% else %} |
|
126
|
<div class="rounded-lg bg-gray-800 border border-gray-700 p-6 text-center"> |
|
127
|
<p class="text-sm text-gray-500">No assets attached to this release.</p> |
|
128
|
</div> |
|
129
|
{% endif %} |
|
130
|
|
|
131
|
{% if has_write %} |
|
132
|
<div class="mt-4"> |
|
133
|
<form method="post" |
|
134
|
action="{% url 'fossil:release_asset_upload' slug=project.slug tag_name=release.tag_name %}" |
|
135
|
enctype="multipart/form-data" |
|
136
|
class="rounded-lg bg-gray-800 border border-gray-700 p-4"> |
|
137
|
{% csrf_token %} |
|
138
|
<h4 class="text-sm font-medium text-gray-300 mb-3">Upload Asset</h4> |
|
139
|
<div class="flex items-center gap-3"> |
|
140
|
<input type="file" name="file" required |
|
141
|
class="block w-full text-sm text-gray-400 file:mr-4 file:py-1.5 file:px-3 file:rounded-md file:border-0 file:text-sm file:font-semibold file:bg-brand file:text-white hover:file:bg-brand-hover" /> |
|
142
|
<button type="submit" |
|
143
|
class="rounded-md bg-brand px-4 py-1.5 text-sm font-semibold text-white shadow-sm hover:bg-brand-hover whitespace-nowrap"> |
|
144
|
Upload |
|
145
|
</button> |
|
146
|
</div> |
|
147
|
</form> |
|
148
|
</div> |
|
149
|
{% endif %} |
|
150
|
</div> |
|
151
|
{% endblock %} |
|
152
|
|