source/View/Templates/Components/_navigationSidebar.html.twig line 1

Open in your IDE?
  1. {% set route_name = app.request.attributes.all().request.attributes.get('_route') %}
  2. {% set needs_saving = (
  3.     route_name == 'Study-documentation' or
  4.     route_name == 'Study-theory' or
  5.     route_name == 'Study-method' or
  6.     route_name == 'Study-measure' or
  7.     route_name == 'Study-sample'
  8.     ) %}
  9. <div class="py-[1.125rem] pl-6 pr-3 border-b bg-mono-100 border-mono-300" x-data="">
  10.     <span class="text-zpid-purple-700 text-xl font-bold break-all mr-0.5 leading-tight">{{ experiment.settingsMetaDataGroup.shortName }}
  11.     </span>
  12.     <a href="{{ path('Study-settings', {uuid: experiment.id}) }}"
  13.        class="inline-flex items-center mt-0.5 border rounded-lg border-mono-300 bg-sky-50 hover:underline"
  14.        title="{{ "generic.edit"|trans }}"
  15.        {%- if needs_saving -%}@click.prevent="document.querySelector('.Button_saveAndSettings').click()"{%- endif -%}>
  16.         {# Icon: ic:outline-edit #}
  17.         <svg class="m-1 text-sm" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
  18.              aria-hidden="true" role="img" style="vertical-align: -0.125em;" width="1em" height="1em"
  19.              preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24">
  20.             <path fill="none" stroke="currentColor" stroke-width="2"
  21.                   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"/>
  22.         </svg>
  23.     </a>
  24. </div>
  25. <nav>
  26.     <ul x-data="">
  27.         <li>
  28.             <a href="{{ path('Study-introduction', {uuid: experiment.id}) }}"
  29.                class="StudyNav-NavItem {{- route_name == 'Study-introduction' ? ' StudyNav-NavItem_active' -}}"
  30.                {%- if needs_saving -%}@click.prevent="document.querySelector('.Button_saveAndIntroduction').click()"{%- endif -%}>{{ "title.introduction.title"|trans }}</a>
  31.         </li>
  32.         <li>
  33.             <a href="{{ path('Study-documentation', {uuid: experiment.id}) }}"
  34.                class="StudyNav-NavItem
  35.                 {{- needs_saving ?' StudyNav-NavItem_active StudyNav-NavItem_active_isParent' -}}"
  36.                {%- if needs_saving -%}@click.prevent="document.querySelector('.Button_saveAndDocumentation').click()"{%- endif -%}>
  37.                 1. {{ "title.describe-study.title"|trans }}
  38.             </a>
  39.             <ul class="StudyNav-SubNav">
  40.                 <li>
  41.                     <a href="{{ path('Study-documentation', {uuid: experiment.id}) }}"
  42.                        class="StudyNav-SubNavItem
  43.                         {{- route_name == 'Study-documentation' ? ' StudyNav-SubNavItem_active' -}}"
  44.                        {%- if needs_saving -%}@click.prevent="document.querySelector('.Button_saveAndDocumentation').click()"{%- endif -%}>
  45.                         {{ "title.basic.title"|trans }}
  46.                     </a>
  47.                 </li>
  48.                 <li>
  49.                     <a href="{{ path('Study-theory', {uuid: experiment.id}) }}"
  50.                        class="StudyNav-SubNavItem
  51.                         {{- route_name == 'Study-theory' ? ' StudyNav-SubNavItem_active' -}}"
  52.                        {%- if needs_saving -%}@click.prevent="document.querySelector('.Button_saveAndTheory').click()"{%- endif -%}>
  53.                         {{ "title.theroies.title"|trans }}
  54.                     </a>
  55.                 </li>
  56.                 <li>
  57.                     <a href="{{ path('Study-method', {uuid: experiment.id}) }}"
  58.                        class="StudyNav-SubNavItem
  59.                         {{- route_name == 'Study-method' ? ' StudyNav-SubNavItem_active' -}}"
  60.                        {%- if needs_saving -%}@click.prevent="document.querySelector('.Button_saveAndMethod').click()"{%- endif -%}>
  61.                         {{ "title.method.title"|trans }}
  62.                     </a>
  63.                 </li>
  64.                 <li>
  65.                     <a href="{{ path('Study-measure', {uuid: experiment.id}) }}"
  66.                        class="StudyNav-SubNavItem
  67.                         {{- route_name == 'Study-measure' ? ' StudyNav-SubNavItem_active' -}}"
  68.                        {%- if needs_saving -%}@click.prevent="document.querySelector('.Button_saveAndMeasure').click()"{%- endif -%}>
  69.                         {{ "title.measures.title"|trans }}
  70.                     </a>
  71.                 </li>
  72.                 <li>
  73.                     <a href="{{ path('Study-sample', {uuid: experiment.id}) }}"
  74.                        class="StudyNav-SubNavItem
  75.                         {{- route_name == 'Study-sample' ? ' StudyNav-SubNavItem_active' -}}"
  76.                        {%- if needs_saving -%}@click.prevent="document.querySelector('.Button_saveAndSample').click()"{%- endif -%}>
  77.                         {{ "title.samples.title"|trans }}
  78.                     </a>
  79.                 </li>
  80.             </ul>
  81.         </li>
  82.         <li>
  83.             <a href="{{ path('Study-datasets', {uuid: experiment.id}) }}"
  84.                class="StudyNav-NavItem {{- route_name == 'Study-datasets' ? ' StudyNav-NavItem_active' -}}"
  85.                {%- if needs_saving -%}@click.prevent="document.querySelector('.Button_saveAndDatasets').click()"{%- endif -%}>
  86.                 2. {{ "title.dataset.title"|trans }}</a>
  87.         </li>
  88.         <li>
  89.             <a href="{{ path('Study-materials', {uuid: experiment.id}) }}"
  90.                class="StudyNav-NavItem {{- route_name == 'Study-materials' ? ' StudyNav-NavItem_active' -}}"
  91.                {%- if needs_saving -%}@click.prevent="document.querySelector('.Button_saveAndMaterials').click()"{%- endif -%}>
  92.                 3. {{ "title.material.title-short"|trans }}</a>
  93.         </li>
  94.         <li>
  95.             <a href="{{ path('Study-review', {uuid: experiment.id}) }}"
  96.                class="StudyNav-NavItem {{- route_name == 'Study-review' ? ' StudyNav-NavItem_active' -}}"
  97.                {%- if needs_saving -%}@click.prevent="document.querySelector('.Button_saveAndReview').click()"{%- endif -%}>
  98.                 4. {{ "title.review.title"|trans }}</a>
  99.         </li>
  100.         <li>
  101.             <a href="{{ path('export_index', {uuid: experiment.id}) }}"
  102.                class="StudyNav-NavItem {{- route_name == 'export_index' ? ' StudyNav-NavItem_active' -}}"
  103.                {%- if needs_saving -%}@click.prevent="document.querySelector('.Button_saveAndExport').click()"{%- endif -%}>
  104.                 5. {{ "title.export.title-short"|trans }}</a>
  105.         </li>
  106.         {# <hr class="border border-mono-400" /> #}
  107.         <li>
  108.             <a href="{{ path('Study-settings', {uuid: experiment.id}) }}"
  109.                class="StudyNav-NavItem StudyNav-NavItem_settings
  110.                 {{- route_name == 'Study-settings' ? ' StudyNav-NavItem_active StudyNav-NavItem_settings_active' -}}"
  111.                {%- if needs_saving -%}@click.prevent="document.querySelector('.Button_saveAndSettings').click()"{%- endif -%}>
  112.                 {# Icon: ic:round-settings #}
  113.                 <svg class="w-4 h-4 mt-px mr-1 text-mono-600" xmlns="http://www.w3.org/2000/svg"
  114.                      xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img"
  115.                      style="vertical-align: -0.125em;" width="1em" height="1em" preserveAspectRatio="xMidYMid meet"
  116.                      viewBox="0 0 24 24">
  117.                     <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"
  118.                           fill="currentColor"/>
  119.                 </svg>
  120.                 {{ "title.settings.title"|trans }}
  121.             </a>
  122.         </li>
  123.     </ul>
  124. </nav>