{# =================================================================== Start Page controls — used twice, with two different scopes: scope="user" what I see -> /api/user/preferences scope="global" what a new account sees by default -> PUT /api/settings (admin) Both render the same objects, so learning one teaches the other. The ids carry the scope so the settings page can show both at once, and static/start_page.js drives them from the same code path. Each scope is ONE card. Rows, cards-per-row and the filters are facets of a single decision ("what does this home page look like"), not three unrelated settings -- rendering them as three separate cards made the page read as six independent things and buried the fact that the whole lower half is just the same form again for a different audience. The row labels/hints are rendered here (through Flask-Babel) and read by the JS from window.__STARTPAGE_I18N -- the row list itself is built client-side from /api/home-feed/sources, because which sources exist depends on which modules are installed. =================================================================== #} {% macro start_page_i18n() %} {% endmacro %} {# heading/intro are optional: the settings page passes them so the card carries its own title, the home page modal leaves them empty because the modal already has a title of its own. #} {% macro start_page_form(scope, show_new_home_toggle=False, heading='', intro='') %}
{% if heading %}

{{ heading }}

{% if intro %}
{{ intro }}
{% endif %} {% endif %} {# Layout comes first: it decides which home page the rows underneath are rendered into at all, so the card reads from the biggest decision to the smallest. #} {% if show_new_home_toggle %}

{{ _('Layout') }}

{{ _('Groups the discovery rows by question instead of by source: "New this week" and "Popular right now" mix every enabled source and each poster names where it came from. The classic layout keeps one block per source with its own rows. Reload the home page after changing this.') }}
{{ _('This is the default for accounts that have not picked a layout themselves — everyone can overrule it under "Your home page".') }}
{% endif %} {# The same decision for THIS account. A select and not a checkbox, because "follow whatever the admin set" is a real third state and a checkbox cannot say it: switching to the new layout and switching back are two different things, and only one of them should keep following the instance default afterwards. #} {% if scope == 'user' %}

{{ _('Layout') }}

{{ _('Which home page you see. Only you — nobody else on this instance is affected.') }}
{% endif %}

{{ _('Rows') }}

{% if scope == 'user' %} {{ _('Which rows your home page shows, and in which order. Switch one off and MediaForge stops collecting its data as well.') }} {% else %} {{ _('The order and visibility a new account starts with. Every user can overrule this for themselves.') }} {% endif %}
{% if scope == 'user' %}
{% endif %}

{{ _('Cards per row') }}

{{ _('How many cards a discovery row holds at most. Fewer cards means less to fetch and a shorter page.') }}
{% if scope == 'global' %}

{{ _('Default filters') }}

{{ _('Which chips are off when someone opens the home page for the first time. This is a starting point, not a restriction — every user can switch them back on. To take a source away entirely, disable it under Sources.') }}
{# One level below .settings-subtitle: these two only label the check grids inside the "Default filters" group, so they must not compete with the group headings themselves. #}
{{ _('Sources') }}
{{ _('Type') }}
{% endif %}
{% endmacro %}