{# =================================================================== 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 on their profile 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.') }}
{# The Jellyfin/Plex profile picker used to sit here, in the user scope. It moved to /profile (templates/profile.html), which is where the account's own settings belong -- it only landed in this modal because /settings is admin-only and there was nowhere else a normal account could reach. #} {% 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') }}
{# Kids mode is armed HERE, not on the home page. Instance-wide because it is an instance decision: a per-account PIN would be set by the very account it is supposed to restrict. The button only appears on the home page once this is on AND a PIN exists -- both, because a mode nobody can leave would lock the account out of its own home page. #}

{{ _('Kids mode') }}

{{ _('Adds a “Kids” button to the home page that limits it to an age rating. The limit is applied on the server while the rows are built, so it cannot be bypassed from the browser. Leaving the mode asks for the PIN; entering it never does.') }}
{# .chb-main goes on the INPUT and .settings-checkbox-row on the label -- that is the pattern every other checkbox in this app uses. Putting chb-main on the
{% endif %}
{% endmacro %}