{% from "_includes/forms" import text -%} {% includeTranslations "Sort by {attribute}", "Score", "Structure", "Display in a table", "Display hierarchically", "Display as thumbnails" %} {% set context = context is defined ? context : 'index' %} {% set showStatusMenu = (showStatusMenu is defined and showStatusMenu != 'auto' ? showStatusMenu : elementType.hasStatuses()) %} {% set showLocaleMenu = (craft.isLocalized() ? (showLocaleMenu ?? 'auto') : false) %} {% if showLocaleMenu == 'auto' %} {% set showLocaleMenu = elementType.isLocalized() %} {% endif %} {% set sortableAttributes = elementType.defineSortableAttributes() %}
{% if showStatusMenu %} {% endif %} {% if showLocaleMenu %} {% set editableLocaleIds = craft.i18n.getEditableLocaleIds() %} {% if editableLocaleIds|length %} {% if craft.locale in editableLocaleIds %} {% set initialLocale = craft.i18n.getCurrentLocale() %} {% else %} {% set initialLocale = craft.i18n.getLocaleById(editableLocaleIds|first) %} {% endif %} {% endif %} {% endif %}