Take in account instance's default license

Fix #145
This commit is contained in:
Bat
2018-07-27 20:31:47 +02:00
parent 6a062f78ff
commit fb2f4e9bcd
8 changed files with 84 additions and 6 deletions
+2 -1
View File
@@ -17,12 +17,13 @@
</p>
</div>
{% endmacro post_card %}
{% macro input(name, label, errors, form, type="text", props="", optional=false, default='') %}
{% macro input(name, label, errors, form, type="text", props="", optional=false, default='', details='') %}
<label for="{{ name }}">
{{ label | _ }}
{% if optional %}
<small>{{ "Optional" | _ }}</small>
{% endif %}
<small>{{ details }}</small>
</label>
{% if errors is defined and errors[name] %}
{% for err in errors[name] %}
+2 -1
View File
@@ -19,7 +19,8 @@
<label for="content">{{ "Content" | _ }}</label>
<textarea id="content" name="content" value="{{ form.content | default(value="") }}"></textarea>
{{ macros::input(name="license", label="License", errors=errors, form=form, optional=true) }}
{% set license_infos = "Default license will be {{ instance.default_license }}" | _(instance=instance) %}
{{ macros::input(name="license", label="License", errors=errors, form=form, optional=true, details=license_infos) }}
<input type="submit" value="{{ "Publish" | _ }}" />
</form>