{# Notes starting with a '# Heading' have a title (Q22; Note.has_title) #}
{% set has_explicit_title = note.has_title %}
{# p-name only if note has explicit title (per Q22) #}
{% if has_explicit_title %}
{{ note.title }}
{% endif %}
{# Reply context (v1.6.0 Phase 4) - displayed if this is a reply post #}
{% if note.in_reply_to %}
In reply to:
{# u-in-reply-to on the h-cite itself makes it the entry's property (Post Type Discovery) #}
{% if reply_context and reply_context.fetch_status == 'fetched' %}
{% if reply_context.content_snippet %}
{{ reply_context.content_snippet }}
{% endif %}
{% if reply_context.author_name %}{{ reply_context.author_name }}{% endif %}
{% if reply_context.site_name %} on {{ reply_context.site_name }}{% endif %}
{% if not reply_context.author_name and not reply_context.site_name %}{{ note.in_reply_to }}{% endif %}
{% else %}
{{ note.in_reply_to }}
{% endif %}
{% endif %}
{{ reaction(note) }}
{# u-photo placement: Per draft spec, u-photo must be direct child of h-entry, #}
{# NOT inside e-content. Media is rendered ABOVE e-content to meet this requirement. #}
{{ display_media(note.media, note.excerpt|truncate(150)) }}
{# e-content: note content BELOW media (per ADR-057) #}
{{ note.body_html|safe }}
← All notes
{# Webmentions section (v1.6.0 Phase 5) - only shown if approved webmentions exist #}
{% if webmentions %}
Responses
{% if replies %}
{{ replies|length }} {{ 'Reply' if replies|length == 1 else 'Replies' }}
{% for wm in replies %}{{ responses.reply(wm) }}{% endfor %}
{% endif %}
{% if likes %}
{{ likes|length }} {{ 'Like' if likes|length == 1 else 'Likes' }}
{{ responses.facepile(likes, 'u-like') }}
{% endif %}
{% if reposts %}
{{ reposts|length }} {{ 'Repost' if reposts|length == 1 else 'Reposts' }}
{{ responses.facepile(reposts, 'u-repost') }}
{% endif %}
{% if bookmarks %}
{{ bookmarks|length }} {{ 'Bookmark' if bookmarks|length == 1 else 'Bookmarks' }}
{{ responses.facepile(bookmarks, 'u-bookmark') }}
{% endif %}
{% if mentions %}
{{ mentions|length }} {{ 'Mention' if mentions|length == 1 else 'Mentions' }}
{% for wm in mentions %}{{ responses.mention(wm) }}{% endfor %}
{% endif %}
{% endif %}
{% endblock %}