Squashed 'CTFd/themes/core-beta/' changes from 9126d77d..5ce3003b

5ce3003b Merge pull request #47 from aCursedComrade/patch-1
c9887cb1 Fix team template

git-subtree-dir: CTFd/themes/core-beta
git-subtree-split: 5ce3003b4d68352e629ee2d390bc999e7d6b071e
This commit is contained in:
Kevin Chung
2023-06-11 15:56:28 -04:00
parent 692c4b086c
commit a64e7d51ef
815 changed files with 683 additions and 101218 deletions

View File

@@ -0,0 +1,60 @@
{% macro render_extra_fields(fields, show_labels=True, show_optionals=True, show_descriptions=True) -%}
{% for field in fields %}
{% if field.field_type == "text" %}
<div class="mb-3">
{% if show_labels %}
<b>{{ field.label(class="form-label") }}</b>
{% endif %}
{% if show_optionals %}
{% if field.flags.required is false %}
<small class="ms-1 text-muted">
{% trans %}(Optional){% endtrans %}
</small>
{% endif %}
{% endif %}
{{ field(class="form-control") }}
{% if show_descriptions %}
{% if field.description %}
<small class="form-text text-muted">
{{ field.description }}
</small>
{% endif %}
{% endif %}
</div>
{% elif field.field_type == "boolean" %}
<div>
{{ field.label(class="form-label") }}
{% if show_optionals %}
{% if field.flags.required is false %}
<small class="ms-1 text-muted">
{% trans %}(Optional){% endtrans %}
</small>
{% endif %}
{% endif %}
</div>
<div class="mb-3 border border-1 p-3">
<div class="form-check">
{{ field(class="form-check-input") }}
{{ field.label(class="form-check-label") }}
</div>
{% if show_descriptions %}
{% if field.description %}
<small class="form-text text-muted">
{{ field.description }}
</small>
{% endif %}
{% endif %}
</div>
{% endif %}
{% endfor %}
{%- endmacro %}