|
1
|
{% extends "base.html" %} |
|
2
|
{% load fossil_filters %} |
|
3
|
{% block title %}Search — {{ 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
|
<form method="get" class="mb-6"> |
|
10
|
<div class="flex flex-col sm:flex-row gap-2"> |
|
11
|
<input type="text" name="q" value="{{ query }}" placeholder="Search checkins, tickets, wiki..." |
|
12
|
aria-label="Search repository" |
|
13
|
class="flex-1 rounded-md border-gray-700 bg-gray-800 text-gray-100 shadow-sm focus:border-brand focus:ring-brand sm:text-sm px-4 py-2" |
|
14
|
autofocus> |
|
15
|
<button type="submit" class="rounded-md bg-brand px-4 py-2 text-sm font-semibold text-white hover:bg-brand-hover">Search</button> |
|
16
|
</div> |
|
17
|
</form> |
|
18
|
|
|
19
|
{% if results %} |
|
20
|
<div class="space-y-6"> |
|
21
|
{% if results.checkins %} |
|
22
|
<div> |
|
23
|
<h3 class="text-sm font-semibold text-gray-300 uppercase tracking-wider mb-2">Checkins ({{ results.checkins|length }})</h3> |
|
24
|
<div class="rounded-lg bg-gray-800 border border-gray-700 divide-y divide-gray-700"> |
|
25
|
{% for c in results.checkins %} |
|
26
|
<div class="px-4 py-3"> |
|
27
|
<a href="{% url 'fossil:checkin_detail' slug=project.slug checkin_uuid=c.uuid %}" class="text-sm text-gray-200 hover:text-brand-light">{{ c.comment|truncatechars:100 }}</a> |
|
28
|
<div class="mt-0.5 flex items-center gap-3 text-xs text-gray-500"> |
|
29
|
<a href="{% url 'fossil:user_activity' slug=project.slug username=c.user %}" class="hover:text-gray-300">{{ c.user|display_user }}</a> |
|
30
|
<a href="{% url 'fossil:checkin_detail' slug=project.slug checkin_uuid=c.uuid %}" class="font-mono text-brand-light">{{ c.uuid|truncatechars:10 }}</a> |
|
31
|
<span>{{ c.timestamp|timesince }} ago</span> |
|
32
|
</div> |
|
33
|
</div> |
|
34
|
{% endfor %} |
|
35
|
</div> |
|
36
|
</div> |
|
37
|
{% endif %} |
|
38
|
|
|
39
|
{% if results.tickets %} |
|
40
|
<div> |
|
41
|
<h3 class="text-sm font-semibold text-gray-300 uppercase tracking-wider mb-2">Tickets ({{ results.tickets|length }})</h3> |
|
42
|
<div class="rounded-lg bg-gray-800 border border-gray-700 divide-y divide-gray-700"> |
|
43
|
{% for t in results.tickets %} |
|
44
|
<div class="px-4 py-3 flex items-center justify-between"> |
|
45
|
<a href="{% url 'fossil:ticket_detail' slug=project.slug ticket_uuid=t.uuid %}" class="text-sm text-brand-light hover:text-brand">{{ t.title }}</a> |
|
46
|
<span class="text-xs text-gray-500">{{ t.status }}</span> |
|
47
|
</div> |
|
48
|
{% endfor %} |
|
49
|
</div> |
|
50
|
</div> |
|
51
|
{% endif %} |
|
52
|
|
|
53
|
{% if results.wiki %} |
|
54
|
<div> |
|
55
|
<h3 class="text-sm font-semibold text-gray-300 uppercase tracking-wider mb-2">Wiki Pages ({{ results.wiki|length }})</h3> |
|
56
|
<div class="rounded-lg bg-gray-800 border border-gray-700 divide-y divide-gray-700"> |
|
57
|
{% for w in results.wiki %} |
|
58
|
<div class="px-4 py-3"> |
|
59
|
<a href="{% url 'fossil:wiki_page' slug=project.slug page_name=w.name %}" class="text-sm text-brand-light hover:text-brand">{{ w.name }}</a> |
|
60
|
</div> |
|
61
|
{% endfor %} |
|
62
|
</div> |
|
63
|
</div> |
|
64
|
{% endif %} |
|
65
|
|
|
66
|
{% if not results.checkins and not results.tickets and not results.wiki %} |
|
67
|
<p class="text-sm text-gray-500 text-center py-8">No results for "{{ query }}"</p> |
|
68
|
{% endif %} |
|
69
|
</div> |
|
70
|
{% elif query %} |
|
71
|
<p class="text-sm text-gray-500 text-center py-8">No results for "{{ query }}"</p> |
|
72
|
{% endif %} |
|
73
|
{% endblock %} |
|
74
|
|