Mark optional fields as optionals

Fix #121
pull/156/head
Bat 6 years ago
parent 9701340c84
commit 8ad0abd921

@ -336,3 +336,6 @@ msgstr[1] "Du bist kein Autor in diesem Blog."
msgid "Login or use your Fediverse account to interact with this article" msgid "Login or use your Fediverse account to interact with this article"
msgstr "" msgstr ""
msgid "Optional"
msgstr ""

@ -329,3 +329,6 @@ msgstr[1] ""
msgid "Login or use your Fediverse account to interact with this article" msgid "Login or use your Fediverse account to interact with this article"
msgstr "" msgstr ""
msgid "Optional"
msgstr ""

@ -329,4 +329,9 @@ msgstr[0] "{{ count }} aut⋅eur⋅rice dans ce blog : "
msgstr[1] "{{ count }} aut⋅eur⋅rice⋅s dans ce blog : " msgstr[1] "{{ count }} aut⋅eur⋅rice⋅s dans ce blog : "
msgid "Login or use your Fediverse account to interact with this article" msgid "Login or use your Fediverse account to interact with this article"
msgstr "Connectez-vous ou utilisez votre compte sur le Fediverse pour interagir avec cet article" msgstr ""
"Connectez-vous ou utilisez votre compte sur le Fediverse pour interagir avec "
"cet article"
msgid "Optional"
msgstr "Optionnel"

@ -339,5 +339,8 @@ msgstr[2] "Nie jesteś autorem tego bloga."
msgid "Login or use your Fediverse account to interact with this article" msgid "Login or use your Fediverse account to interact with this article"
msgstr "" msgstr ""
msgid "Optional"
msgstr ""
#~ msgid "Logowanie" #~ msgid "Logowanie"
#~ msgstr "Zaloguj się" #~ msgstr "Zaloguj się"

@ -322,3 +322,6 @@ msgstr[1] ""
msgid "Login or use your Fediverse account to interact with this article" msgid "Login or use your Fediverse account to interact with this article"
msgstr "" msgstr ""
msgid "Optional"
msgstr ""

@ -21,8 +21,13 @@
</p> </p>
</div> </div>
{% endmacro post_card %} {% endmacro post_card %}
{% macro input(name, label, errors, form, type="text", props="") %} {% macro input(name, label, errors, form, type="text", props="", optional=false) %}
<label for="{{ name }}">{{ label | _ }}</label> <label for="{{ name }}">
{{ label | _ }}
{% if optional %}
<small>{{ "Optional" | _ }}</small>
{% endif %}
</label>
{% if errors is defined and errors[name] %} {% if errors is defined and errors[name] %}
{% for err in errors[name] %} {% for err in errors[name] %}
<p class="error">{{ err.message | default(value="Unknown error") | _ }}</p> <p class="error">{{ err.message | default(value="Unknown error") | _ }}</p>

@ -19,7 +19,7 @@
<label for="content">{{ "Content" | _ }}</label> <label for="content">{{ "Content" | _ }}</label>
<textarea id="content" name="content" value="{{ form.content | default(value="") }}"></textarea> <textarea id="content" name="content" value="{{ form.content | default(value="") }}"></textarea>
{{ macros::input(name="license", label="License", errors=errors, form=form) }} {{ macros::input(name="license", label="License", errors=errors, form=form, optional=true) }}
<input type="submit" value="{{ "Publish" | _ }}" /> <input type="submit" value="{{ "Publish" | _ }}" />
</form> </form>

Loading…
Cancel
Save