{# Browser config form fields for the add/edit page. Expects `form`, `applicable` (the set of FetcherConfig fields this base engine can honour - FetcherConfig.applicable_fields()) and `base_label` (read-only base engine name). The base engine is fixed by the page (chosen via the "Add variation" link, or the existing config's base), so it's shown read-only, not as a picker. Gating on `applicable` rather than on capability flags directly is deliberate: it is the same set the save path allows (FetcherConfig.from_submitted), so a field can never be rendered but unsaveable, or hidden but written from its widget default. Laid out as the tab panes of browser-config-form.html (#browser, #language, #request); that page only shows the Language and Request tabs when this engine has a setting in them. The dialog on /settings/browsers (browser-config-modal.html) shows the same panes behind its own tab strip, switched by class rather than by the URL #anchor. #} {% from '_helpers.html' import render_field, render_checkbox_field %} {# A plugin's section (hook browser_config_form_section): its own template if it gave one, otherwise each field of its sub-form in the usual layout #} {% macro render_plugin_section(section) %} {% set subform = form[section.field_name] %}
{% endmacro %} {% macro render_plugin_sections_for_tab(tab) %} {% for section in plugin_sections or [] if section.tab == tab %}{{ render_plugin_section(section) }}{% endfor %} {% endmacro %}