|
1
|
{% extends "base.html" %} |
|
2
|
{% load fossil_filters %} |
|
3
|
{% block title %}Forum Thread — {{ 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:forum' slug=project.slug %}" class="text-sm text-brand-light hover:text-brand">← Back to forum</a> |
|
11
|
</div> |
|
12
|
|
|
13
|
<div class="space-y-3"> |
|
14
|
{% for item in posts %} |
|
15
|
<div class="rounded-lg bg-gray-800 border border-gray-700 shadow-sm {% if item.post.in_reply_to %}ml-8{% endif %}"> |
|
16
|
<div class="px-5 py-4"> |
|
17
|
<div class="flex items-center justify-between mb-2"> |
|
18
|
{% if is_django_thread %} |
|
19
|
<span class="text-sm font-medium text-gray-200">{{ item.post.user|display_user }}</span> |
|
20
|
{% else %} |
|
21
|
<a href="{% url 'fossil:user_activity' slug=project.slug username=item.post.user %}" class="text-sm font-medium text-gray-200 hover:text-brand-light">{{ item.post.user|display_user }}</a> |
|
22
|
{% endif %} |
|
23
|
<span class="text-xs text-gray-500">{{ item.post.timestamp|timesince }} ago</span> |
|
24
|
</div> |
|
25
|
{% if item.post.title and forloop.first %} |
|
26
|
<h2 class="text-lg font-semibold text-gray-100 mb-3">{{ item.post.title }}</h2> |
|
27
|
{% endif %} |
|
28
|
{% if item.body_html %} |
|
29
|
<div class="prose prose-invert prose-sm prose-gray max-w-none"> |
|
30
|
{{ item.body_html }} |
|
31
|
</div> |
|
32
|
{% else %} |
|
33
|
<p class="text-sm text-gray-500 italic">{{ item.post.title|default:"(empty)" }}</p> |
|
34
|
{% endif %} |
|
35
|
</div> |
|
36
|
</div> |
|
37
|
{% empty %} |
|
38
|
<p class="text-sm text-gray-500 py-8 text-center">No posts in this thread.</p> |
|
39
|
{% endfor %} |
|
40
|
</div> |
|
41
|
|
|
42
|
{% if has_write and is_django_thread %} |
|
43
|
<div class="mt-6"> |
|
44
|
<h3 class="text-sm font-semibold text-gray-300 mb-3">Reply</h3> |
|
45
|
<form method="post" action="{% url 'fossil:forum_reply' slug=project.slug post_id=thread_uuid %}" class="space-y-3 rounded-lg bg-gray-800 p-5 border border-gray-700 shadow-sm"> |
|
46
|
{% csrf_token %} |
|
47
|
<textarea name="body" rows="6" required placeholder="Write your reply in Markdown..." |
|
48
|
aria-label="Write a reply" |
|
49
|
class="w-full rounded-md border-gray-600 bg-gray-900 text-gray-100 shadow-inner focus:border-brand focus:ring-1 focus:ring-brand sm:text-sm font-mono transition-colors"></textarea> |
|
50
|
<div class="flex justify-end"> |
|
51
|
<button type="submit" class="rounded-md bg-brand px-4 py-2 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"> |
|
52
|
Post Reply |
|
53
|
</button> |
|
54
|
</div> |
|
55
|
</form> |
|
56
|
</div> |
|
57
|
{% endif %} |
|
58
|
{% endblock %} |
|
59
|
|