remarkbox/remarkbox/templates/snippets/forms.j2
russell@unturf.com f1cffe2e79 Resolve all 14 tracked tickets (T0-T13)
High priority fixes:
- T0: Profile page now filters comments by namespace (was leaking cross-site)
- T1: URI hostnames and namespace names normalized to lowercase (was causing
  duplicate threads and "stock comments" bug). Includes merge script.
- T2: Thread detail API now paginated with SQL-side filtering (was 502 on
  267+ reply threads)

Features:
- T3: GDPR account deletion (tombstone user with scrubbed PII) and data export
- T4: Customizable button text and comment labels per namespace
- T5: Self-service namespace deletion for owners
- T6: @mention notifications with profile links
- T7: Webmention receiving endpoint with h-card extraction
- T8: Configurable max nesting depth and collapse depth per namespace
- T9: AJAX thread title search to prevent duplicates
- T10: Browser push notification support (VAPID/service worker)

Docs and housekeeping:
- T11: Documented thread_uri behavior when moving embeds
- T12/T13: Drafted community replies for resolved feature requests
- Collapse depth defaults to infinite (load-more disabled unless configured)

364 tests pass, 4 skipped.
2026-02-01 20:02:47 -05:00

75 lines
2.7 KiB
Django/Jinja

{% macro reply(node, root) %}
{% if root.locked %}
<br>
<p>This thread was locked to prevent additional comments.</p>
{% else %}
<form method="post" action="{{ request.link_prefix }}/{{ node.id }}/reply" onsubmit="submit.disabled = true; return true;">
{# the first if statement gaurds the 2nd and is an optimization #}
{% if node.id == request.node.id %}
{% if node.has_uri %}
<input type="hidden" name="thread_uri" id="thread_uri_input" value="{{ node.uri.data }}" />
{% endif %}
{% endif %}
<textarea
name = "thread_data"
id = "textarea-{{ node.id }}"
class = "common-textarea"
onkeyup = "previewAjax( 'textarea-{{ node.id }}', 'preview-{{ node.id }}', show_raw=true, mathjax={{ request.mathjax }} )"
placeholder = "{% if request.namespace.placeholder_text %}{{ request.namespace.placeholder_text }}{% else %}What do you want to say? markdown{% endif %}"
required></textarea>
{% set submit_button_classes = 'green-button button-right' %}
{% set submit_button_value = request.namespace.submit_button_text or 'save message' %}
{% include 'submit.j2' %}
<details class="preview-details js-only" open>
<summary class="action link preview-toggle"><span class="when-open">hide preview ▲</span><span class="when-closed">show preview ▼</span></summary>
<div id='preview-{{ node.id }}' name='preview' class='preview js-only'></div>
</details>
{% include 'csrf.j2' %}
{% set show_whats_next_notifications = true %}
{% include 'email.j2' %}
</form>
{% endif %}
{% endmacro %}
{% macro edit(node) %}
<form method="post" action="{{ request.link_prefix }}/{{ node.id }}/edit" onsubmit="submit.disabled = true; return true;">
{% if node.title %}
<input
name = "thread_title"
id = "thread_title_input"
class = "common-text-input"
value = "{{ node.title }}"
placeholder = "Descriptive title"
required />
{% endif %}
<textarea
name = "thread_data"
id = "edit-textarea-{{ node.id }}"
class = "common-textarea textarea_edit"
onkeyup = "previewAjax( 'edit-textarea-{{ node.id }}', 'node-data-{{ node.id }}', show_raw=false, mathjax={{ request.mathjax }} )"
placeholder = "{% if request.namespace.placeholder_text %}{{ request.namespace.placeholder_text }}{% else %}What do you want to say? markdown{% endif %}"
required>{{ node.data }}</textarea>
{% include 'csrf.j2' %}
{% set submit_button_classes = 'green-button button-right' %}
{% set submit_button_value = request.namespace.submit_button_text or 'save message' %}
{% include 'submit.j2' %}
</form>
{% endmacro %}