2.1 KiB · text History 644543b
{% extends "root.html" %}
{% import "_avatar.html" as ui %}

{% block content %}
<div class="space-y-4 text-left">
  <div class="text-sm opacity-70">
    <a href="/c/" class="link link-hover">Categories</a>
    {% for a in ancestors %} / <a href="/c/{{ a.slug }}" class="link link-hover">{{ a.name }}</a>{% endfor %}
    / {{ category.name }}
  </div>

  <div class="flex items-center justify-between gap-3">
    <h1 class="text-3xl font-bold flex items-center gap-2">
      <span class="size-6 rounded-full border border-base-content/20" style="background: {{ category_widget_bg }}"></span>
      {{ category.name }}
    </h1>
    <div class="flex items-center gap-2 shrink-0">
    {% set toggle_base = "/c/" ~ category.slug ~ "?sort=" ~ current_sort %}{% set view_mode = "classic" %}
    {% include "forum/_view_toggle.html" %}
    {% if user %}
      {% include "forum/_watch_button.html" %}
      {% if user.email_verified_at or not require_email_verification %}
      <a href="/c/{{ category.slug }}/new" class="btn btn-primary btn-sm">
        <i class="fas fa-plus mr-1"></i> New Topic
      </a>
      {% endif %}
    {% endif %}
    </div>
  </div>
  {% if category.description %}<p class="opacity-70">{{ category.description }}</p>{% endif %}

  <div class="flex flex-wrap items-center justify-between gap-2">
    <div class="flex flex-wrap gap-2">
      {% for s in subcategories %}
      <a href="/c/{{ s.slug }}" class="badge badge-outline gap-1 py-3">
        <span class="size-3 rounded-full border border-base-content/20" style="background: {{ s.widget_bg }}"></span>{{ s.name }}
      </a>
      {% endfor %}
    </div>
    <div role="tablist" class="tabs tabs-bordered w-fit">
      {% for opt in ["latest", "top", "hot", "bottom"] %}
      <a role="tab" class="tab {% if current_sort == opt %}tab-active{% endif %}"
         href="/c/{{ category.slug }}?sort={{ opt }}">{{ opt | capitalize }}</a>
      {% endfor %}
    </div>
  </div>

  {% if topics|length == 0 %}
    <p class="opacity-70">No topics yet.{% if user %} Be the first to post one.{% endif %}</p>
  {% else %}
    {% include "forum/_topic_list.html" %}
  {% endif %}
</div>
{% endblock %}