{% macro metric_table(metric_name, data, row_limit=3) -%} {% if data %}
{{ metric_name }} | Count |
---|---|
{{ metric_name }} | Unique / Total count |
---|---|
Related packages | Count |
---|---|
Frame # | Function | {% if type != 'PYTHON' %}Binary | {% endif %}Source or offset | Line |
---|---|---|---|---|
{{ oops }}{% endif %} {%- endmacro %} {% macro external_bugs(bugs) -%} {% for bug in bugs %} {% if bug.status == "CLOSED" %}
{{field.description}}
{% endif %} {% if field.errors %} {% for e in field.errors %}{{ e }}
{% endfor %} {% endif %}{{field.description}}
{% endif %} {%- endmacro %} {# Renders radio field Params: field - WTForm field (there are no check, but you should put here only BooleanField. kwargs - pass any arguments you want in order to put them into the html attributes. There are few exceptions: for - for_, class - class_, class__ - class_ Example usage: {{ macros.render_radio_field(form.answers) }} #} {% macro render_radio_field(field) -%} {% for value, label, _ in field.iter_choices() %}{{field.description}}
{% endif %} {%- endmacro %} {% macro render_field(f) -%} {% if f.type == 'BooleanField' %} {{ render_checkbox_field(f, **kwargs) }} {% elif f.type == 'RadioField' %} {{ render_radio_field(f, **kwargs) }} {% else %} {{ render_field_default(f, **kwargs) }} {% endif %} {%- endmacro %} {# Renders WTForm in bootstrap way. There are two ways to call function: - as macros: it will render all field forms using cycle to iterate over them - as call: it will insert form fields as you specify: e.g. {% call macros.render_form(form, action_url=url_for('login_view'), action_text='Login', class_='login-form') %} {{ macros.render_field(form.email, placeholder='Input email', type='email') }} {{ macros.render_field(form.password, placeholder='Input password', type='password') }} {{ macros.render_checkbox_field(form.remember_me, type='checkbox') }} {% endcall %} Params: form - WTForm class action_url - url where to submit this form action_text - text of submit button class_ - sets a class for form #} {% macro render_form(form, action_url='', action_text='Submit', class_='', btn_class='btn btn-default') -%} {%- endmacro %}