@ -2,42 +2,55 @@
@@ -2,42 +2,55 @@
{% if ctx and ctx.can_publish|default(false) and ctx.rows|default([])|length > 0 %}
{% for row in ctx.rows %}
{% if row.mode|default('') == 'article' %}
<div class="comment-reply comment-reply--article card">
<div class="card-body">
<h3 class="comment-reply__heading">Reply to this article</h3>
<form
class="comment-reply__form"
data-controller="comment-reply"
data-action="submit->comment-reply#publish"
data-comment-reply-publish-url-value="{{ path('comment_reply_publish')|e('html_attr') }}"
data-comment-reply-csrf-value="{{ csrf_token('comment_reply')|e('html_attr') }}"
data-comment-reply-expected-coordinate-value="{{ ctx.coordinate|e('html_attr') }}"
data-comment-reply-article-event-id-value="{{ ctx.article_event_id|default('')|e('html_attr') }}"
data-comment-reply-fragment-url-value="{{ ctx.fragment_url|default('')|e('html_attr') }}"
data-comment-reply-refresh-after-value="1"
data-comment-reply-blurb-label-value="{{ row.blurbLabel|default('Article')|e('html_attr') }}"
data-comment-reply-expected-tags-value='{{ row.expectedTags|default([])|json_encode|e('html_attr') }}'
data-comment-reply-parent-kind-value="{{ row.parentKind|default(0) }}"
data-comment-reply-parent-id-value="{{ row.parentId|default('')|e('html_attr') }}"
data-comment-reply-author-pubkey-value="{{ row.authorPubkey|default('')|e('html_attr') }}"
>
<div class="comment-reply__body">
<label class="visually-hidden" for="comment-reply-article-body">Your reply</label>
<textarea
class="form-control"
id="comment-reply-article-body"
name="body"
rows="4"
required
minlength="1"
placeholder="Write a Nostr comment (kind 1111). A quoted parent line is added automatically."
></textarea>
</div>
<div class="comment-reply__actions">
<button class="btn btn-primary" type="submit">Sign & publish</button>
</div>
<p class="comment-reply__hint text-subtle" data-comment-reply-target="hint" aria-live="polite"></p>
</form>
<div
class="comment-reply comment-reply--article card"
data-controller="comment-reply"
data-comment-reply-publish-url-value="{{ path('comment_reply_publish')|e('html_attr') }}"
data-comment-reply-csrf-value="{{ csrf_token('comment_reply')|e('html_attr') }}"
data-comment-reply-expected-coordinate-value="{{ ctx.coordinate|e('html_attr') }}"
data-comment-reply-article-event-id-value="{{ ctx.article_event_id|default('')|e('html_attr') }}"
data-comment-reply-fragment-url-value="{{ ctx.fragment_url|default('')|e('html_attr') }}"
data-comment-reply-refresh-after-value="1"
data-comment-reply-blurb-label-value="{{ row.blurbLabel|default('Article')|e('html_attr') }}"
data-comment-reply-expected-tags-value='{{ row.expectedTags|default([])|json_encode|e('html_attr') }}'
data-comment-reply-parent-kind-value="{{ row.parentKind|default(0) }}"
data-comment-reply-parent-id-value="{{ row.parentId|default('')|e('html_attr') }}"
data-comment-reply-author-pubkey-value="{{ row.authorPubkey|default('')|e('html_attr') }}"
>
<div class="card-body comment-reply--article__inner">
<div class="comment-reply__toolbar">
<p class="comment-reply__lede text-subtle">Reply to this note on Nostr (kind 1111).</p>
<button
type="button"
class="btn btn-secondary btn-sm comment-reply__toggle"
data-comment-reply-target="toggleBtn"
data-action="click->comment-reply#togglePanel"
aria-expanded="false"
>Reply</button>
</div>
<div class="comment-reply__panel comment-reply__panel--hidden" data-comment-reply-target="panel">
<form
class="comment-reply__form"
data-action="submit->comment-reply#publish"
>
<div class="comment-reply__body">
<label class="visually-hidden" for="comment-reply-article-body">Your reply</label>
<textarea
class="form-control"
id="comment-reply-article-body"
name="body"
rows="4"
required
minlength="1"
placeholder="Write a NIP-22 comment (kind 1111). A quoted parent line is added when you publish."
></textarea>
</div>
<div class="comment-reply__actions">
<button class="btn btn-primary" type="submit">Sign & publish</button>
</div>
<p class="comment-reply__hint text-subtle" data-comment-reply-target="hint" aria-live="polite"></p>
</form>
</div>
</div>
</div>
{% endif %}
@ -49,7 +62,8 @@
@@ -49,7 +62,8 @@
{% set cid = item.id|default('') %}
{% set cpk = item.pubkey|default('') %}
{% set cts = item.created_at|default(null) %}
<div class="card comment">
{% set cdepth = item.unfold_depth|default(0) %}
<div class="card comment comment--depth-{{ cdepth }}">
<div class="metadata">
<p>
{% if item.kind is defined and item.kind == 1 %}
@ -61,8 +75,13 @@
@@ -61,8 +75,13 @@
</p>
<small>{% if cts is not null and cts != '' %}{{ cts|date('F j Y') }}{% endif %}</small>
</div>
{% if item.unfold_reply_blurb|default('')|trim != '' %}
<div class="comment__reply-blurb" role="note" aria-label="Reply context">
<twig:Atoms:Content content="{{ item.unfold_reply_blurb }}" />
</div>
{% endif %}
<div class="card-body">
<twig:Atoms:Content content="{{ item.content|default('') }}" />
<twig:Atoms:Content content="{{ item.unfold_body|default(item. content|default('') ) }}" />
</div>
{% if cid != '' and commentLinks[cid] is defined and commentLinks[cid]|length > 0 %}
<div class="card-footer nostr-previews mt-3">
@ -78,41 +97,54 @@
@@ -78,41 +97,54 @@
{% if ctx and ctx.can_publish|default(false) and item.kind|default(0) == 1111 %}
{% for row in ctx.rows|default([]) %}
{% if row.mode|default('') == 'comment' and row.parentId|default('') == cid %}
<div class="comment-reply comment-reply--nested">
<form
class="comment-reply__form"
data-controller="comment-reply"
data-action="submit->comment-reply#publish"
data-comment-reply-publish-url-value="{{ path('comment_reply_publish')|e('html_attr') }}"
data-comment-reply-csrf-value="{{ csrf_token('comment_reply')|e('html_attr') }}"
data-comment-reply-expected-coordinate-value="{{ ctx.coordinate|e('html_attr') }}"
data-comment-reply-article-event-id-value="{{ ctx.article_event_id|default('')|e('html_attr') }}"
data-comment-reply-fragment-url-value="{{ ctx.fragment_url|default('')|e('html_attr') }}"
data-comment-reply-refresh-after-value="1"
data-comment-reply-blurb-label-value="{{ row.blurbLabel|default('Comment')|e('html_attr') }}"
data-comment-reply-expected-tags-value='{{ row.expectedTags|default([])|json_encode|e('html_attr') }}'
data-comment-reply-parent-kind-value="{{ row.parentKind|default(0) }}"
data-comment-reply-parent-id-value="{{ row.parentId|default('')|e('html_attr') }}"
data-comment-reply-author-pubkey-value="{{ row.authorPubkey|default('')|e('html_attr') }}"
>
<div class="comment-reply__head text-subtle">Reply to this note</div>
<div class="comment-reply__body">
<label class="visually-hidden" for="comment-reply-{{ cid }}">Your reply</label>
<textarea
class="form-control"
id="comment-reply-{{ cid }}"
name="body"
rows="3"
required
minlength="1"
placeholder="Sign with your Nostr extension (kind 1111)…"
></textarea>
</div>
<div class="comment-reply__actions">
<button class="btn btn-primary" type="submit">Sign & publish</button>
</div>
<p class="comment-reply__hint text-subtle" data-comment-reply-target="hint" aria-live="polite"></p>
</form>
<div
class="comment-reply comment-reply--nested"
data-controller="comment-reply"
data-comment-reply-publish-url-value="{{ path('comment_reply_publish')|e('html_attr') }}"
data-comment-reply-csrf-value="{{ csrf_token('comment_reply')|e('html_attr') }}"
data-comment-reply-expected-coordinate-value="{{ ctx.coordinate|e('html_attr') }}"
data-comment-reply-article-event-id-value="{{ ctx.article_event_id|default('')|e('html_attr') }}"
data-comment-reply-fragment-url-value="{{ ctx.fragment_url|default('')|e('html_attr') }}"
data-comment-reply-refresh-after-value="1"
data-comment-reply-blurb-label-value="{{ row.blurbLabel|default('Comment')|e('html_attr') }}"
data-comment-reply-expected-tags-value='{{ row.expectedTags|default([])|json_encode|e('html_attr') }}'
data-comment-reply-parent-kind-value="{{ row.parentKind|default(0) }}"
data-comment-reply-parent-id-value="{{ row.parentId|default('')|e('html_attr') }}"
data-comment-reply-author-pubkey-value="{{ row.authorPubkey|default('')|e('html_attr') }}"
>
<div class="comment-reply__toolbar comment-reply__toolbar--inline">
<button
type="button"
class="btn btn-secondary btn-sm comment-reply__toggle"
data-comment-reply-target="toggleBtn"
data-action="click->comment-reply#togglePanel"
aria-expanded="false"
>Reply</button>
</div>
<div class="comment-reply__panel comment-reply__panel--hidden" data-comment-reply-target="panel">
<form
class="comment-reply__form"
data-action="submit->comment-reply#publish"
>
<div class="comment-reply__head text-subtle">Reply to this note</div>
<div class="comment-reply__body">
<label class="visually-hidden" for="comment-reply-{{ cid }}">Your reply</label>
<textarea
class="form-control"
id="comment-reply-{{ cid }}"
name="body"
rows="3"
required
minlength="1"
placeholder="NIP-22 comment; parent quote line is added on publish…"
></textarea>
</div>
<div class="comment-reply__actions">
<button class="btn btn-primary" type="submit">Sign & publish</button>
</div>
<p class="comment-reply__hint text-subtle" data-comment-reply-target="hint" aria-live="polite"></p>
</form>
</div>
</div>
{% endif %}
{% endfor %}