{% comment %}
Shared post-composer form. `input_id` lets each surface give the line input a
distinct id (new-post applet → id_new_post_text; room.html → id_room_post_text);
`submit_id` likewise for the OK button. Mirrors the New Game applet: a flex row
with the line input + an OK .btn-confirm submit. The validation feedback sits
below the row (and its id tracks `input_id` for aria-describedby).
{% endcomment %}
{% with input_id=input_id|default:"id_new_post_text" submit_id=submit_id|default:"id_new_post_btn" %}
<form method="POST" action="{{ form_action }}">
    {% csrf_token %}
    <div class="composer-row" style="display:flex; gap:0.5rem; align-items:center;">
        <input
            id="{{ input_id }}"
            name="text"
            class="form-control form-control-lg{% if form.errors.text %} is-invalid{% endif %}"
            placeholder="Enter a post line"
            value="{{ form.text.value | default:'' }}"
            aria-describedby="{{ input_id }}_feedback"
            style="flex:1; min-width:0;"
            required
        />
        <div class="applet-btn-panel">
            <button type="submit" id="{{ submit_id }}" class="btn btn-confirm">OK</button>
        </div>
    </div>
    {% if form.errors %}
        <div id="{{ input_id }}_feedback" class="invalid-feedback">
            {{ form.errors.text.0 }}
        </div>
    {% endif %}
</form>
{% endwith %}
