|
1
|
{% extends "base.html" %} |
|
2
|
{% load fossil_filters %} |
|
3
|
{% block title %}Technotes — {{ 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 items-center justify-between mb-6"> |
|
10
|
<h2 class="text-lg font-semibold text-gray-200">Technotes</h2> |
|
11
|
<div class="flex items-center gap-3"> |
|
12
|
<span class="search-wrap"> |
|
13
|
<input type="search" |
|
14
|
name="search" |
|
15
|
value="{{ search }}" |
|
16
|
placeholder="Search technotes..." |
|
17
|
aria-label="Search technotes" |
|
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:technotes' slug=project.slug %}" |
|
20
|
hx-trigger="input changed delay:300ms, search" |
|
21
|
hx-target="#technote-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:technote_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"> |
|
30
|
New Technote |
|
31
|
</a> |
|
32
|
{% endif %} |
|
33
|
</div> |
|
34
|
</div> |
|
35
|
|
|
36
|
<div id="technote-content"> |
|
37
|
{% if notes %} |
|
38
|
<div class="space-y-3"> |
|
39
|
{% for note in notes %} |
|
40
|
<a href="{% url 'fossil:technote_detail' slug=project.slug technote_id=note.uuid %}" |
|
41
|
class="block rounded-lg bg-gray-800 border border-gray-700 px-5 py-4 hover:bg-gray-700/50 transition-colors"> |
|
42
|
<div class="flex items-start justify-between gap-3"> |
|
43
|
<div class="flex-1 min-w-0"> |
|
44
|
<p class="text-sm text-gray-200">{{ note.comment|truncatechars:200 }}</p> |
|
45
|
<div class="mt-2 flex items-center gap-3 text-xs text-gray-500"> |
|
46
|
<span class="hover:text-brand-light">{{ note.user|display_user }}</span> |
|
47
|
<span class="font-mono text-brand-light">{{ note.uuid|truncatechars:10 }}</span> |
|
48
|
<span>{{ note.timestamp|date:"Y-m-d H:i" }} UTC</span> |
|
49
|
</div> |
|
50
|
</div> |
|
51
|
</div> |
|
52
|
</a> |
|
53
|
{% endfor %} |
|
54
|
</div> |
|
55
|
{% else %} |
|
56
|
<div class="rounded-lg bg-gray-800 border border-gray-700 p-8 text-center"> |
|
57
|
<p class="text-sm text-gray-500">{% if search %}No technotes matching "{{ search }}".{% else %}No technotes.{% endif %}</p> |
|
58
|
{% if has_write and not search %} |
|
59
|
<a href="{% url 'fossil:technote_create' slug=project.slug %}" |
|
60
|
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"> |
|
61
|
Create the first technote |
|
62
|
</a> |
|
63
|
{% endif %} |
|
64
|
</div> |
|
65
|
{% endif %} |
|
66
|
{% include "includes/_pagination_manual.html" %} |
|
67
|
</div> |
|
68
|
{% endblock %} |
|
69
|
|