mirror of
https://codeberg.org/catask-org/catask.git
synced 2025-04-20 13:53:42 -05:00
81 lines
4.1 KiB
HTML
81 lines
4.1 KiB
HTML
<div class="row">
|
|
{% include 'snippets/layout/description/retrospring.html' %}
|
|
<div class="col-lg-9{% if not combined %} m-auto{% endif %}">
|
|
<div class="pt-3">
|
|
{% if not cfg.lockInbox %}
|
|
<div class="mb-4 card">
|
|
<div class="card-header d-flex justify-content-between align-items-center">
|
|
<span>Ask a question</span>
|
|
<button class="btn btn-sm btn-outline-secondary" type="button" data-bs-toggle="collapse" data-bs-target="#cw-collapse" aria-expanded="false" aria-controls="cw-collapse">
|
|
<i class="bi bi-plus-lg me-1"></i> Add CW
|
|
</button>
|
|
</div>
|
|
<div class="card-body">
|
|
<form class="d-lg-block" hx-post="{{ url_for('api.addQuestion') }}" id="question-form" hx-target="#response-container" hx-swap="none" hx-disabled-elt="#ask-btn">
|
|
<div class="collapse" id="cw-collapse">
|
|
<div class="form-group mb-2">
|
|
<input class="form-control" type="text" name="cw" id="cw" placeholder="Content warning">
|
|
<label for="cw" class="visually-hidden">Content warning</label>
|
|
</div>
|
|
</div>
|
|
<div class="form-group mb-2">
|
|
<input maxlength="{{ cfg.charLimit }}" {% if cfg.allowAnonQuestions == false %}required{% endif %} class="form-control" type="text" name="from_who" id="from_who" placeholder="Name {% if cfg.allowAnonQuestions == true %}(optional){% else %}(required){% endif %}">
|
|
<label for="from_who" class="visually-hidden">Name {% if cfg.allowAnonQuestions == true %}(optional){% else %}(required){% endif %}</label>
|
|
</div>
|
|
<div class="form-group mb-2">
|
|
<textarea maxlength="{{ cfg.charLimit }}" class="form-control" required name="question" id="question" placeholder="Type your question here..."></textarea>
|
|
<label for="question" class="visually-hidden">Write your question here...</label>
|
|
<p class="text-end mt-1 small d-flex align-items-center justify-content-between"><span class="text-body-secondary"><i class="bi bi-markdown me-1"></i> Markdown supported</span> <span id="charCount">{{ cfg.charLimit }}</span></p>
|
|
</div>
|
|
{% if cfg.antispam.enabled %}
|
|
{% if cfg.antispam.type == 'basic' %}
|
|
<div class="form-group mb-2">
|
|
<label for="antispam">Anti-spam: please enter the word <code class="text-uppercase">{{ getRandomWord() }}</code> in lowercase</label>
|
|
<input class="form-control" type="text" required name="antispam" id="antispam" autocomplete="off">
|
|
</div>
|
|
{% elif cfg.antispam.type == 'recaptcha' %}
|
|
<div class="form-group mb-2">
|
|
{% if cfg.antispam.recaptcha.sitekey %}
|
|
<div class="g-recaptcha" data-sitekey="{{ cfg.antispam.recaptcha.sitekey }}"></div>
|
|
{% else %}
|
|
<div class="alert alert-warning" role="alert"><b>Warning:</b> reCAPTCHA site key is not set!</div>
|
|
{% endif %}
|
|
</div>
|
|
{% elif cfg.antispam.type == 'turnstile' %}
|
|
<div class="cf-turnstile" data-sitekey="{{ cfg.antispam.turnstile.sitekey }}"></div>
|
|
{% elif cfg.antispam.type == 'frc' %}
|
|
<div class="frc-captcha" data-sitekey="{{ cfg.antispam.frc.sitekey }}"></div>
|
|
{% else %}
|
|
<div class="alert alert-warning"><b>Warning:</b> antispam type is not set!</div>
|
|
{% endif %}
|
|
{% endif %}
|
|
<div class="form-group d-grid d-lg-flex align-items-center justify-content-lg-end mt-3">
|
|
{#
|
|
<div class="form-check mb-0 w-100">
|
|
reserved for version 1.6.0 or later
|
|
<input
|
|
class="form-check-input"
|
|
type="checkbox"
|
|
name="_private"
|
|
id="_private">
|
|
<input type="hidden" id="private" name="private">
|
|
<label for="_private" class="form-check-label">Ask privately</label>
|
|
</div>
|
|
#}
|
|
<button type="submit" class="btn btn-primary col-sm-2" id="ask-btn">
|
|
<span class="me-1 spinner-border spinner-border-sm htmx-indicator" aria-hidden="true"></span>
|
|
<span class="visually-hidden" role="status">Loading...</span>
|
|
Ask
|
|
</button>
|
|
</div>
|
|
</form>
|
|
<div id="response-container"></div>
|
|
</div>
|
|
</div>
|
|
{% else %}
|
|
<h2 class="text-center">New questions cannot be asked right now.</h2>
|
|
{% endif %}
|
|
</div>
|
|
{% include 'snippets/layout/questions_list.html' %}
|
|
</div>
|
|
</div>
|