{# Shared collapsible settings card for auto-registered extensions (see web/thirdparties/registry.py's register_thirdparty()). Rendered wherever a "card" dict from resolve_settings_cards()/thirdparty_cards shows up — the classic Integrations "Third Party" tab, any other existing tab/pill an extension attaches to, or a brand-new one (get_dynamic_tabs()). One macro instead of copy-pasting this markup into integrations.html and notifications.html keeps every host visually and behaviourally identical for free. The toggle(s) are backed by the generic GET/PUT /api/settings/thirdparty/ API (registry.py's register_generic_settings_routes) via static/extension_cards.js, which scans the whole document for .thirdparty-toggle[data-thirdparty-id] — so this works no matter which page/tab the card ends up rendered on, with zero extra JS wiring per host. allow_module_toggle: whether a MODULE-provided card may show its master on/off switch here. Off everywhere by default, and deliberately so. A module's master toggle is the same switch as the one in the module manager, and having it on the Integrations page was a one-way door: turning it off makes resolve_settings_cards() drop the card, so the switch you used to disable the module is gone the moment you use it, and the only way back is the module manager anyway. Worse, "off" here means the whole module is off -- every provider, hoster and page it registered -- while the row sits between Crunchyroll and Fernsehserien, where "off" means one integration. Built-in integrations (no card.module_name) are unaffected: their toggle is what it looks like, and they keep it. #} {% macro render_settings_card(card, allow_module_toggle=false) %} {% set show_master_toggle = allow_module_toggle or not card.module_name %} {# data-thirdparty-id on the CARD, not just on the master toggle. static/ extension_cards.js's loadThirdpartyToggles() used to iterate `.thirdparty-toggle[data-thirdparty-id]` and read the card's stored values from inside that loop -- so on a page where the master toggle is not rendered (a module card, see show_master_toggle below) it found nothing, never issued the GET, and every extra field, extra toggle and select on the card stayed at its markup default. That is the "the number box is empty and nothing is saved" report: the card was never loaded in the first place. #}