{% extends "root.html" %}
{# Focus layout for /t/{id}: the topic full screen, like the reader, with the
rail of its category's siblings and a filmstrip of the category's topics
(←/→ or k/j step, Escape back to the category). Posts, reply, editing,
tags and topic moderation are the same partials as the Classic page. #}
{% block width %}w-full max-w-none{% endblock %}
{% block main_class %}px-3 py-3 sm:px-4 lg:px-5{% endblock %}
{% block content %}
<div class="flex min-h-[calc(100dvh-5.5rem)] flex-col gap-4 text-left md:flex-row md:items-stretch" id="focus" data-reader="{{ topic.id }}">
{% if rail %}{% include "forum/_rail.html" %}{% endif %}
<div class="flex min-w-0 flex-1 flex-col gap-4">
<div class="flex flex-wrap items-center justify-between gap-2 text-sm">
<nav class="opacity-70" aria-label="Breadcrumb">
<a href="/c/" class="link link-hover">Categories</a>
{% for a in ancestors %} / <a href="{{ a.href }}" class="link link-hover">{{ a.name }}</a>{% endfor %}
</nav>
<div class="flex items-center gap-2">
{% if user and category %}{% set slug = category.slug %}{% include "forum/_watch_button.html" %}{% endif %}
{% if position %}<span id="reader-count" class="badge badge-ghost font-mono">{{ position.index }} / {{ position.count }}</span>{% endif %}
{% if close_href %}
<a href="{{ close_href }}" id="reader-close" class="btn btn-ghost btn-sm btn-square" title="Back to {{ category.name }} (Esc)" aria-label="Back to {{ category.name }}"><i class="fas fa-xmark"></i></a>
{% endif %}
</div>
</div>
<article class="mx-auto w-full max-w-4xl space-y-4" aria-labelledby="topic-title">
{% set toggle_base = "/t/" ~ topic.id %}{% set view_mode = "focus" %}{% include "forum/_topic_head.html" %}
{% include "forum/_topic_body.html" %}
</article>
{% if strip %}
<footer class="sticky bottom-0 z-10 mt-auto space-y-1 rounded-box border border-base-300 bg-base-100/95 p-2 backdrop-blur">
<div class="flex items-center justify-between gap-2">
{% if position.prev %}
<a href="/t/{{ position.prev }}" id="reader-prev" aria-label="Previous topic" title="Previous topic (← or k)" class="btn btn-sm btn-circle"><i class="fas fa-chevron-left"></i></a>
{% else %}<span class="btn btn-sm btn-circle btn-disabled" aria-hidden="true"><i class="fas fa-chevron-left"></i></span>{% endif %}
<p class="hidden text-xs opacity-50 sm:block">← → or j k to step · Esc back to {{ category.name }}</p>
{% if position.next %}
<a href="/t/{{ position.next }}" id="reader-next" aria-label="Next topic" title="Next topic (→ or j)" class="btn btn-sm btn-circle"><i class="fas fa-chevron-right"></i></a>
{% else %}<span class="btn btn-sm btn-circle btn-disabled" aria-hidden="true"><i class="fas fa-chevron-right"></i></span>{% endif %}
</div>
<ol id="reader-strip" class="flex gap-1.5 overflow-x-auto px-1 py-2" aria-label="Topics in {{ category.name }}">
{% for s in strip %}
<li class="shrink-0">
<a href="/t/{{ s.id }}" id="strip-{{ s.id }}" {% if s.current %}aria-current="true"{% endif %}
aria-label="Topic {{ loop.index }}: {{ s.title }}" title="{{ s.title }}"
class="relative flex size-16 flex-col justify-end overflow-hidden rounded-field border bg-base-200 p-1 text-[0.55rem] leading-tight transition {% if s.current %}-translate-y-1 border-primary ring-2 ring-primary ring-offset-2 ring-offset-base-100 shadow-md{% else %}border-base-300 opacity-70 hover:-translate-y-1 hover:opacity-100 focus-visible:opacity-100{% endif %}">
<span class="absolute inset-x-0 top-0 h-1" style="background: {{ s.widget_bg }}" aria-hidden="true"></span>
{% if s.unread %}<span class="absolute right-1 top-1.5 size-1.5 rounded-full bg-primary" aria-hidden="true"></span>{% endif %}
<span class="line-clamp-3">{{ s.title }}</span>
</a>
</li>
{% endfor %}
</ol>
</footer>
{% endif %}
</div>
</div>
{% endblock %}
neiam
/recourse
public · Issues · Pulls · Labels · Forks · Compare · Actions running · Badges · Packages
⭐
Log in to mark this repository.
4.0 KiB · text
History
644543b