FossilRepo

fossilrepo / templates / fossil / forum_list.html
1
{% extends "base.html" %}
2
{% load fossil_filters %}
3
{% block title %}Forum — {{ 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">Forum</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 forum..."
17
aria-label="Search forum"
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:forum' slug=project.slug %}"
20
hx-trigger="input changed delay:300ms, search"
21
hx-target="#forum-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:forum_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
New Thread
31
</a>
32
{% endif %}
33
</div>
34
</div>
35
36
<div id="forum-content">
37
<div class="space-y-3">
38
{% for post in posts %}
39
<div class="rounded-lg bg-gray-800 border border-gray-700 shadow-sm hover:border-gray-600 transition-colors">
40
<div class="px-5 py-4">
41
{% if post.source == "django" %}
42
<a href="{% url 'fossil:forum_thread' slug=project.slug thread_uuid=post.uuid %}"
43
class="text-base font-medium text-brand-light hover:text-brand">
44
{{ post.title|default:"(untitled)" }}
45
</a>
46
{% else %}
47
<a href="{% url 'fossil:forum_thread' slug=project.slug thread_uuid=post.uuid %}"
48
class="text-base font-medium text-brand-light hover:text-brand">
49
{{ post.title|default:"(untitled)" }}
50
</a>
51
{% endif %}
52
{% if post.body %}
53
<p class="mt-1 text-sm text-gray-400 line-clamp-2">{{ post.body|truncatechars:200 }}</p>
54
{% endif %}
55
<div class="mt-2 flex items-center gap-3 text-xs text-gray-500">
56
{% if post.source == "fossil" %}
57
<a href="{% url 'fossil:user_activity' slug=project.slug username=post.user %}" class="font-medium text-gray-400 hover:text-brand-light">{{ post.user|display_user }}</a>
58
{% else %}
59
<span class="font-medium text-gray-400">{{ post.user|display_user }}</span>
60
{% endif %}
61
<span>{{ post.timestamp|timesince }} ago</span>
62
{% if post.source == "django" %}
63
<span class="inline-flex rounded-full bg-brand/20 px-2 py-0.5 text-xs text-brand-light">local</span>
64
{% endif %}
65
</div>
66
</div>
67
</div>
68
{% empty %}
69
<div class="rounded-lg bg-gray-800 border border-gray-700 p-8 text-center">
70
<p class="text-sm text-gray-500">{% if search %}No forum posts matching "{{ search }}".{% else %}No forum posts.{% endif %}</p>
71
{% if has_write and not search %}
72
<a href="{% url 'fossil:forum_create' slug=project.slug %}"
73
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">
74
Start the first thread
75
</a>
76
{% endif %}
77
</div>
78
{% endfor %}
79
</div>
80
{% include "includes/_pagination_manual.html" %}
81
</div>
82
{% endblock %}
83

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button