{% extends "base.html" %} {% from 'utils.html' import custom_render_form_row,make_tabs %} {% from 'bootstrap/form.html' import render_form, render_field, render_form_row %} {% set col_size = ('lg',2,6) %} {% set col_size_seq = ('lg',10,1) %} {% macro render_fields(fields) %} {% for field in fields %} {% if field is sequence %} {{ custom_render_form_row(field|list,col_map={'transcode_edit':('lg',1),'transcode_new':('lg',1)},render_args={'form_type':'horizontal'}) }} {% else %} {{ custom_render_form_row([field],render_args={'form_type':'horizontal','horizontal_columns':col_size}) }} {% endif %} {% endfor %} {% endmacro %} {% set config_tabs = [] %} {% for name, fields in [ ('Jellyfin',[form.jellyfin_url,form.jellyfin_username,form.jellyfin_passwd]), ('QBittorrent',[form.qbt_url,form.qbt_username,form.qbt_passwd]), ('Sonarr',[form.sonarr_url,form.sonarr_api_key]), ('Radarr',[form.radarr_url,form.radarr_api_key]), ('Portainer',[form.portainer_url,form.portainer_username,form.portainer_passwd]), ('Jackett',[form.jackett_url,form.jackett_api_key]), ('Transcode',[form.transcode_default_profile,form.transcode_profiles]), ] %} {% do config_tabs.append((name,render_fields(fields))) %} {% endfor %} {% block app_content %}

{{title}}

{% if test %} {% if test.success %}

Sucess

{% else %}
{% for module,error in test.errors.items() %} {% if error %}

{{module}}

{% if error is mapping %} {% for key,value in error.items() %}

{{key}}: {{value}}

{% endfor %} {% else %} {{error}} {% endif %} {% endif %} {% endfor %}
{% endif %} {% endif %} {% for field in form %} {% for error in field.errors %}
{{error}}
{% endfor %} {% endfor %}
{{ form.csrf_token() }} {{ make_tabs(config_tabs) }} {{ custom_render_form_row([form.test, form.save],button_map={'test':'primary','save':'success'},col_map={'test':0,'primary':0},render_args={'form_type':'horizontal'})}}
{# render_form(form, form_type ="horizontal", button_map={'test':'primary','save':'success'}) #}
{% endblock %}