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