{% set current_path = request.path %} {% if current_path.startswith('/loras/recipes') %} {% set current_page = 'recipes' %} {% elif current_path.startswith('/checkpoints') %} {% set current_page = 'checkpoints' %} {% elif current_path.startswith('/embeddings') %} {% set current_page = 'embeddings' %} {% elif current_path.startswith('/other') %} {% set current_page = 'other' %} {% elif current_path.startswith('/workflows') %} {% set current_page = 'workflows' %} {% elif current_path.startswith('/statistics') %} {% set current_page = 'statistics' %} {% else %} {% set current_page = 'loras' %} {% endif %} {# The key is resolved through a variable, like the search placeholder below: writing t('header.navigation.' ~ current_page) makes the i18n scanner treat the literal prefix as a key of its own. #} {% set page_title_key = 'header.navigation.' ~ current_page %} {# The filter panel lists the page's own items: recipes and workflows are not models, so their titles name the page's collection instead. #} {% set filter_title_key = {'recipes': 'recipes.filter.title', 'workflows': 'workflows.filter.title'}.get(current_page, 'header.filter.title') %}
{% set search_disabled = current_page == 'statistics' %} {% set search_placeholder_key = 'header.search.notAvailable' if search_disabled else 'header.search.placeholder' %} {% set header_search_class = 'header-search disabled' if search_disabled else 'header-search' %}
CtrlF