mirror of
https://codeberg.org/catask-org/catask.git
synced 2025-04-19 21:33:41 -05:00
babel + slight layout change
This commit is contained in:
parent
3b19d27fad
commit
cadce98fc2
2 changed files with 32 additions and 32 deletions
|
@ -5,31 +5,31 @@
|
|||
<div class="mb-5 sticky-md-top">
|
||||
{% if cfg.lockInbox == false %}
|
||||
<br>
|
||||
<h2 class="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>
|
||||
</h2>
|
||||
<h2>{{ _('Ask a question') }}</h2>
|
||||
<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-floating mb-2">
|
||||
<input class="form-control" type="text" name="cw" id="cw" placeholder="Content warning">
|
||||
<label for="cw">Content warning</label>
|
||||
<input class="form-control" type="text" name="cw" id="cw" placeholder="{{ _('Content warning') }}">
|
||||
<label for="cw">{{ _('Content warning') }}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-floating 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">Name {% if cfg.allowAnonQuestions == true %}(optional){% else %}(required){% endif %}</label>
|
||||
<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">{{ _('Name') }} {% if cfg.allowAnonQuestions == true %}{{ _('(optional)') }}{% else %}{{ _('(required)') }}{% endif %}</label>
|
||||
</div>
|
||||
<div class="form-floating mb-2">
|
||||
<textarea maxlength="{{ cfg.charLimit }}" class="form-control" style="height: 100px;" required name="question" id="question" placeholder="Write your question..."></textarea>
|
||||
<label for="question">Write your question...</label>
|
||||
<p class="text-end mt-1 small d-flex align-itemcenter 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 class="form-floating">
|
||||
<textarea maxlength="{{ cfg.charLimit }}" class="form-control border-bottom-0 rounded-bottom-0" style="height: 100px;" required name="question" id="question" placeholder="{{ _('Write your question...') }}"></textarea>
|
||||
<label for="question">{{ _('Write your question...') }}</label>
|
||||
</div>
|
||||
|
||||
{% with includeCharLimit = True %}
|
||||
{% include 'snippets/q-input-footer.html' %}
|
||||
{% endwith %}
|
||||
|
||||
{% if cfg.antispam.enabled %}
|
||||
{% if cfg.antispam.type == 'basic' %}
|
||||
<div class="form-group mb-2">
|
||||
{#- how am i supposed to use babel here #}
|
||||
<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>
|
||||
|
@ -38,7 +38,7 @@
|
|||
{% 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>
|
||||
<div class="alert alert-warning" role="alert"><b>{{ _('Warning:') }}</b> {{ _('reCAPTCHA site key is not set!') }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% elif cfg.antispam.type == 'turnstile' %}
|
||||
|
@ -46,7 +46,7 @@
|
|||
{% 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>
|
||||
<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">
|
||||
|
|
|
@ -4,32 +4,32 @@
|
|||
<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-header d-flex justify-content-between align-items-center">{{ _('Ask a question') }}</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>
|
||||
<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>
|
||||
<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 class="form-group">
|
||||
<textarea maxlength="{{ cfg.charLimit }}" class="form-control border-bottom-0 rounded-bottom-0" required name="question" id="question" placeholder="{{ _('Write your question here...') }}"></textarea>
|
||||
<label for="question" class="visually-hidden">{{ _('Write your question here...') }}</label>
|
||||
</div>
|
||||
|
||||
{% with includeCharLimit = True %}
|
||||
{% include 'snippets/q-input-footer.html' %}
|
||||
{% endwith %}
|
||||
|
||||
{% if cfg.antispam.enabled %}
|
||||
{% if cfg.antispam.type == 'basic' %}
|
||||
<div class="form-group mb-2">
|
||||
{#- skipping babel here for now #}
|
||||
<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>
|
||||
|
@ -38,7 +38,7 @@
|
|||
{% 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>
|
||||
<div class="alert alert-warning" role="alert"><b>{{ _('Warning:') }}</b> {{ _('reCAPTCHA site key is not set!') }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% elif cfg.antispam.type == 'turnstile' %}
|
||||
|
@ -46,7 +46,7 @@
|
|||
{% 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>
|
||||
<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">
|
||||
|
|
Loading…
Add table
Reference in a new issue