FossilRepo

fossilrepo / templates / fossil / forum_list.html
Source Blame History 82 lines
4ce269c… ragelink 1 {% extends "base.html" %}
fcd8df3… ragelink 2 {% load fossil_filters %}
4ce269c… ragelink 3 {% block title %}Forum — {{ project.name }} — Fossilrepo{% endblock %}
4ce269c… ragelink 4
4ce269c… ragelink 5 {% block content %}
4ce269c… ragelink 6 <h1 class="text-2xl font-bold text-gray-100 mb-2">{{ project.name }}</h1>
4ce269c… ragelink 7 {% include "fossil/_project_nav.html" %}
4ce269c… ragelink 8
313537c… ragelink 9 <div class="flex flex-wrap items-center justify-between gap-3 mb-6">
c588255… ragelink 10 <h2 class="text-lg font-semibold text-gray-200">Forum</h2>
313537c… ragelink 11 <div class="flex flex-wrap items-center gap-3">
7e1aaf6… ragelink 12 <span class="search-wrap">
c588255… ragelink 13 <input type="search"
c588255… ragelink 14 name="search"
c588255… ragelink 15 value="{{ search }}"
c588255… ragelink 16 placeholder="Search forum..."
7e1aaf6… ragelink 17 aria-label="Search forum"
c588255… ragelink 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"
c588255… ragelink 19 hx-get="{% url 'fossil:forum' slug=project.slug %}"
c588255… ragelink 20 hx-trigger="input changed delay:300ms, search"
c588255… ragelink 21 hx-target="#forum-content"
c588255… ragelink 22 hx-swap="innerHTML"
7e1aaf6… ragelink 23 hx-push-url="true"
7e1aaf6… ragelink 24 hx-indicator="closest .search-wrap" />
7e1aaf6… ragelink 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>
7e1aaf6… ragelink 26 </span>
c588255… ragelink 27 {% if has_write %}
c588255… ragelink 28 <a href="{% url 'fossil:forum_create' slug=project.slug %}"
2f13242… ragelink 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">
c588255… ragelink 30 New Thread
c588255… ragelink 31 </a>
c588255… ragelink 32 {% endif %}
c588255… ragelink 33 </div>
c588255… ragelink 34 </div>
c588255… ragelink 35
c588255… ragelink 36 <div id="forum-content">
4ce269c… ragelink 37 <div class="space-y-3">
4ce269c… ragelink 38 {% for post in posts %}
2f13242… ragelink 39 <div class="rounded-lg bg-gray-800 border border-gray-700 shadow-sm hover:border-gray-600 transition-colors">
4ce269c… ragelink 40 <div class="px-5 py-4">
c588255… ragelink 41 {% if post.source == "django" %}
c588255… ragelink 42 <a href="{% url 'fossil:forum_thread' slug=project.slug thread_uuid=post.uuid %}"
c588255… ragelink 43 class="text-base font-medium text-brand-light hover:text-brand">
c588255… ragelink 44 {{ post.title|default:"(untitled)" }}
c588255… ragelink 45 </a>
c588255… ragelink 46 {% else %}
4ce269c… ragelink 47 <a href="{% url 'fossil:forum_thread' slug=project.slug thread_uuid=post.uuid %}"
4ce269c… ragelink 48 class="text-base font-medium text-brand-light hover:text-brand">
4ce269c… ragelink 49 {{ post.title|default:"(untitled)" }}
4ce269c… ragelink 50 </a>
c588255… ragelink 51 {% endif %}
4ce269c… ragelink 52 {% if post.body %}
4ce269c… ragelink 53 <p class="mt-1 text-sm text-gray-400 line-clamp-2">{{ post.body|truncatechars:200 }}</p>
4ce269c… ragelink 54 {% endif %}
4ce269c… ragelink 55 <div class="mt-2 flex items-center gap-3 text-xs text-gray-500">
c588255… ragelink 56 {% if post.source == "fossil" %}
fcd8df3… ragelink 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>
c588255… ragelink 58 {% else %}
fcd8df3… ragelink 59 <span class="font-medium text-gray-400">{{ post.user|display_user }}</span>
c588255… ragelink 60 {% endif %}
4ce269c… ragelink 61 <span>{{ post.timestamp|timesince }} ago</span>
c588255… ragelink 62 {% if post.source == "django" %}
c588255… ragelink 63 <span class="inline-flex rounded-full bg-brand/20 px-2 py-0.5 text-xs text-brand-light">local</span>
c588255… ragelink 64 {% endif %}
4ce269c… ragelink 65 </div>
4ce269c… ragelink 66 </div>
4ce269c… ragelink 67 </div>
4ce269c… ragelink 68 {% empty %}
c588255… ragelink 69 <div class="rounded-lg bg-gray-800 border border-gray-700 p-8 text-center">
c588255… ragelink 70 <p class="text-sm text-gray-500">{% if search %}No forum posts matching "{{ search }}".{% else %}No forum posts.{% endif %}</p>
c588255… ragelink 71 {% if has_write and not search %}
c588255… ragelink 72 <a href="{% url 'fossil:forum_create' slug=project.slug %}"
c588255… ragelink 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">
c588255… ragelink 74 Start the first thread
c588255… ragelink 75 </a>
c588255… ragelink 76 {% endif %}
c588255… ragelink 77 </div>
4ce269c… ragelink 78 {% endfor %}
c588255… ragelink 79 </div>
c588255… ragelink 80 {% include "includes/_pagination_manual.html" %}
4ce269c… ragelink 81 </div>
4ce269c… ragelink 82 {% endblock %}

Keyboard Shortcuts

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