{% set route_name = app.request.attributes.all().request.attributes.get('_route') %}
{% set needs_saving = (
route_name == 'Study-documentation' or
route_name == 'Study-theory' or
route_name == 'Study-method' or
route_name == 'Study-measure' or
route_name == 'Study-sample'
) %}
<div class="py-[1.125rem] pl-6 pr-3 border-b bg-mono-100 border-mono-300" x-data="">
<span class="text-zpid-purple-700 text-xl font-bold break-all mr-0.5 leading-tight">{{ experiment.settingsMetaDataGroup.shortName }}
</span>
<a href="{{ path('Study-settings', {uuid: experiment.id}) }}"
class="inline-flex items-center mt-0.5 border rounded-lg border-mono-300 bg-sky-50 hover:underline"
title="{{ "generic.edit"|trans }}"
{%- if needs_saving -%}@click.prevent="document.querySelector('.Button_saveAndSettings').click()"{%- endif -%}>
{# Icon: ic:outline-edit #}
<svg class="m-1 text-sm" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
aria-hidden="true" role="img" style="vertical-align: -0.125em;" width="1em" height="1em"
preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24">
<path fill="none" stroke="currentColor" stroke-width="2"
d="M14 4l6 6l-6-6zm8.294 1.294c.39.39.387 1.025-.008 1.42L9 20l-7 2l2-7L17.286 1.714a1 1 0 0 1 1.42-.008l3.588 3.588zM3 19l2 2m2-4l8-8"/>
</svg>
</a>
</div>
<nav>
<ul x-data="">
<li>
<a href="{{ path('Study-introduction', {uuid: experiment.id}) }}"
class="StudyNav-NavItem {{- route_name == 'Study-introduction' ? ' StudyNav-NavItem_active' -}}"
{%- if needs_saving -%}@click.prevent="document.querySelector('.Button_saveAndIntroduction').click()"{%- endif -%}>{{ "title.introduction.title"|trans }}</a>
</li>
<li>
<a href="{{ path('Study-documentation', {uuid: experiment.id}) }}"
class="StudyNav-NavItem
{{- needs_saving ?' StudyNav-NavItem_active StudyNav-NavItem_active_isParent' -}}"
{%- if needs_saving -%}@click.prevent="document.querySelector('.Button_saveAndDocumentation').click()"{%- endif -%}>
1. {{ "title.describe-study.title"|trans }}
</a>
<ul class="StudyNav-SubNav">
<li>
<a href="{{ path('Study-documentation', {uuid: experiment.id}) }}"
class="StudyNav-SubNavItem
{{- route_name == 'Study-documentation' ? ' StudyNav-SubNavItem_active' -}}"
{%- if needs_saving -%}@click.prevent="document.querySelector('.Button_saveAndDocumentation').click()"{%- endif -%}>
{{ "title.basic.title"|trans }}
</a>
</li>
<li>
<a href="{{ path('Study-theory', {uuid: experiment.id}) }}"
class="StudyNav-SubNavItem
{{- route_name == 'Study-theory' ? ' StudyNav-SubNavItem_active' -}}"
{%- if needs_saving -%}@click.prevent="document.querySelector('.Button_saveAndTheory').click()"{%- endif -%}>
{{ "title.theroies.title"|trans }}
</a>
</li>
<li>
<a href="{{ path('Study-method', {uuid: experiment.id}) }}"
class="StudyNav-SubNavItem
{{- route_name == 'Study-method' ? ' StudyNav-SubNavItem_active' -}}"
{%- if needs_saving -%}@click.prevent="document.querySelector('.Button_saveAndMethod').click()"{%- endif -%}>
{{ "title.method.title"|trans }}
</a>
</li>
<li>
<a href="{{ path('Study-measure', {uuid: experiment.id}) }}"
class="StudyNav-SubNavItem
{{- route_name == 'Study-measure' ? ' StudyNav-SubNavItem_active' -}}"
{%- if needs_saving -%}@click.prevent="document.querySelector('.Button_saveAndMeasure').click()"{%- endif -%}>
{{ "title.measures.title"|trans }}
</a>
</li>
<li>
<a href="{{ path('Study-sample', {uuid: experiment.id}) }}"
class="StudyNav-SubNavItem
{{- route_name == 'Study-sample' ? ' StudyNav-SubNavItem_active' -}}"
{%- if needs_saving -%}@click.prevent="document.querySelector('.Button_saveAndSample').click()"{%- endif -%}>
{{ "title.samples.title"|trans }}
</a>
</li>
</ul>
</li>
<li>
<a href="{{ path('Study-datasets', {uuid: experiment.id}) }}"
class="StudyNav-NavItem {{- route_name == 'Study-datasets' ? ' StudyNav-NavItem_active' -}}"
{%- if needs_saving -%}@click.prevent="document.querySelector('.Button_saveAndDatasets').click()"{%- endif -%}>
2. {{ "title.dataset.title"|trans }}</a>
</li>
<li>
<a href="{{ path('Study-materials', {uuid: experiment.id}) }}"
class="StudyNav-NavItem {{- route_name == 'Study-materials' ? ' StudyNav-NavItem_active' -}}"
{%- if needs_saving -%}@click.prevent="document.querySelector('.Button_saveAndMaterials').click()"{%- endif -%}>
3. {{ "title.material.title-short"|trans }}</a>
</li>
<li>
<a href="{{ path('Study-review', {uuid: experiment.id}) }}"
class="StudyNav-NavItem {{- route_name == 'Study-review' ? ' StudyNav-NavItem_active' -}}"
{%- if needs_saving -%}@click.prevent="document.querySelector('.Button_saveAndReview').click()"{%- endif -%}>
4. {{ "title.review.title"|trans }}</a>
</li>
<li>
<a href="{{ path('export_index', {uuid: experiment.id}) }}"
class="StudyNav-NavItem {{- route_name == 'export_index' ? ' StudyNav-NavItem_active' -}}"
{%- if needs_saving -%}@click.prevent="document.querySelector('.Button_saveAndExport').click()"{%- endif -%}>
5. {{ "title.export.title-short"|trans }}</a>
</li>
{# <hr class="border border-mono-400" /> #}
<li>
<a href="{{ path('Study-settings', {uuid: experiment.id}) }}"
class="StudyNav-NavItem StudyNav-NavItem_settings
{{- route_name == 'Study-settings' ? ' StudyNav-NavItem_active StudyNav-NavItem_settings_active' -}}"
{%- if needs_saving -%}@click.prevent="document.querySelector('.Button_saveAndSettings').click()"{%- endif -%}>
{# Icon: ic:round-settings #}
<svg class="w-4 h-4 mt-px mr-1 text-mono-600" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img"
style="vertical-align: -0.125em;" width="1em" height="1em" preserveAspectRatio="xMidYMid meet"
viewBox="0 0 24 24">
<path d="M19.5 12c0-.23-.01-.45-.03-.68l1.86-1.41c.4-.3.51-.86.26-1.3l-1.87-3.23a.987.987 0 0 0-1.25-.42l-2.15.91c-.37-.26-.76-.49-1.17-.68l-.29-2.31c-.06-.5-.49-.88-.99-.88h-3.73c-.51 0-.94.38-1 .88l-.29 2.31c-.41.19-.8.42-1.17.68l-2.15-.91c-.46-.2-1-.02-1.25.42L2.41 8.62c-.25.44-.14.99.26 1.3l1.86 1.41a7.343 7.343 0 0 0 0 1.35l-1.86 1.41c-.4.3-.51.86-.26 1.3l1.87 3.23c.25.44.79.62 1.25.42l2.15-.91c.37.26.76.49 1.17.68l.29 2.31c.06.5.49.88.99.88h3.73c.5 0 .93-.38.99-.88l.29-2.31c.41-.19.8-.42 1.17-.68l2.15.91c.46.2 1 .02 1.25-.42l1.87-3.23c.25-.44.14-.99-.26-1.3l-1.86-1.41c.03-.23.04-.45.04-.68zm-7.46 3.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5s3.5 1.57 3.5 3.5s-1.57 3.5-3.5 3.5z"
fill="currentColor"/>
</svg>
{{ "title.settings.title"|trans }}
</a>
</li>
</ul>
</nav>