templates/network/profile/components/tab_navigation_component.html.twig line 1

Open in your IDE?
  1. {% if profile is defined %}
  2.   {% set entity = profile %}
  3.   {% do tab_navigation_add({ name: 'timeline', action: 'timeline' }) %}
  4.   {% do tab_navigation_add({ name: 'achievements', action: 'achievements' }) %}
  5.   {% do tab_navigation_add({ name: 'news', action: 'news' }) %}
  6.   {% do tab_navigation_add({ name: 'network', action: 'network' }) %}
  7.   {# {% do tab_navigation_add({ name: 'references', action: 'references' }) %} #}
  8.   {# {% do tab_navigation_add({ name: 'team', action: 'team' }) %} #}
  9.   {% if
  10.     profile.profiles.racingManagerProfile
  11.       or profile.profiles.ownerProfile
  12.       or profile.profiles.trainerProfile
  13.       or profile.profiles.breederProfile %}
  14.     {% do tab_navigation_add({ name: 'horse-lists', action: 'horse_lists' }) %}
  15.     {# {% do tab_navigation_add({ name: 'horse-events', action: 'horse_events' }) %} #}
  16.   {% endif %}
  17.   {% if profile.profiles.auctionhouseProfile %}
  18.     {% do tab_navigation_add({ name: 'auctions', action: 'auctions' }) %}
  19.   {% endif %}
  20.   {% if profile.profiles.racetrackProfile %}
  21.     {% do tab_navigation_add({ name: 'racedays', action: 'raceday_list' }) %}
  22.   {% endif %}
  23. {% endif %}
  24. <section id="tab_navigation"
  25.   class="{{ profile and profile.color ? '' : 'bg-primary-500' }} mb-4"
  26.   style="background-color: {{ profile and profile.color ? profile.color : '' }};">
  27.   <div class=" sm:flex-wrap sm:container sm:flex hidden w-full gap-4 p-4 {{
  28.     profile and profile.color
  29.       ? ''
  30.       : 'bg-primary-500'
  31.     }}"
  32.     style="background-color: {{ profile and profile.color ? profile.color : '' }};"
  33.     data-controller="tab-navigation">
  34.     {% for item in tab_navigation_get() %}
  35.       {% set highlighted = null %}
  36.       {% if highlightedTab is defined %}
  37.         {% set highlighted = highlightedTab
  38.           == path('profile_tab_navigation_' ~ item.action, { id: entity.id })
  39.         %}
  40.       {% endif %}
  41.       <turbo-frame class="{{ not highlighted ? 'bg-white' }}" target="tab_content">
  42.         <a id="{{ item.name ~ '-' ~ profile.id }}"
  43.           href="{{ path('profile_tab_navigation_' ~ item.action, { id: entity.id }) }}"
  44.           class="{{ highlighted ? 'btn-sm btn btn-white active' : 'btn-sm btn btn-neutral' }} "
  45.           style="{{
  46.           not highlighted
  47.             ? 'color:white;  background-color: rgba(' ~ profile.color.r ~ ',' ~ profile.color.g
  48.               ~ ','
  49.               ~ profile.color.b
  50.               ~ ',0.6'
  51.           }}">
  52.           {{ item.name|trans }}
  53.         </a>
  54.       </turbo-frame>
  55.     {% endfor %}
  56.   </div>
  57.   <div>
  58.     <div class="block sm:hidden sticky top-20 w-screen max-w-full z-1000  {{
  59.       profile and profile.color
  60.         ? ''
  61.         : 'bg-primary-500'
  62.       }} overflow-hidden shadow-md"
  63.       style="background-color: {{ profile and profile.color ? profile.color : '' }};">
  64.       <div data-controller="tab-navigation"
  65.         data-section-navigation-active-class="text-white bg-black"
  66.         data-section-navigation-inactive-class="text-black bg-neutral-200 "
  67.         id="profile-scroll-bar"
  68.         class="relative inline-flex items-center w-screen gap-4 p-3 mx-1 overflow-scroll sm:my-3 snap-x snap-mandatory sm:flex">
  69.         {% for item in tab_navigation_get() %}
  70.           {% set highlighted = null %}
  71.           {% if highlightedTab is defined %}
  72.             {% set highlighted = highlightedTab
  73.               == path('profile_tab_navigation_' ~ item.action, { id: profile.id })
  74.             %}
  75.           {% endif %}
  76.           <turbo-frame class=" w-fit min-w-fit {{ not highlighted ? 'bg-white' }}"
  77.             target="tab_content">
  78.             <a href="{{ path('profile_tab_navigation_' ~ item.action, { id: profile.id }) }}"
  79.               class="flex-none p-3 text-sm font-medium tracking-widest {{
  80.               highlighted
  81.                 ? 'btn-sm btn btn-white active'
  82.                 : 'btn-sm btn btn-neutral inactive'
  83.               }} uppercase  snap-center"
  84.               style="{{
  85.               not highlighted
  86.                 ? 'color:white;  background-color: rgba(' ~ profile.color.r ~ ',' ~ profile.color.g
  87.                   ~ ','
  88.                   ~ profile.color.b
  89.                   ~ ',0.6'
  90.               }}">
  91.               {{ item.name|trans }}
  92.             </a>
  93.           </turbo-frame>
  94.         {% endfor %}
  95.       </div>
  96.     </div>
  97.   </div>
  98.   {# <div class="flex items-center gap-8">
  99.     <div class="hidden md:block">
  100.       {% include 'icons/arrow-right-tail.svg.twig' with { class: 'w-6 rotate-180 ' } %}
  101.     </div>
  102.     <div class="sticky block w-screen max-w-full overflow-hidden top-20 z-1000">
  103.       <div data-controller="tab-navigation"
  104.         data-section-navigation-active-class="text-white bg-black"
  105.         data-section-navigation-inactive-class="text-black bg-neutral-200 "
  106.         id="profile-scroll-bar"
  107.         class="relative inline-flex items-center gap-4 p-3 overflow-scroll sm:my-3 snap-x snap-mandatory sm:flex">
  108.         {% for item in tab_navigation_get() %}
  109.           {% set highlighted = null %}
  110.           {% if highlightedTab is defined %}
  111.             {% set highlighted = highlightedTab
  112.               == path('profile_tab_navigation_' ~ item.action, { id: profile.id })
  113.             %}
  114.           {% endif %}
  115.           <turbo-frame class="py-2 w-fit min-w-fit" target="tab_content">
  116.             <a href="{{ path('profile_tab_navigation_' ~ item.action, { id: profile.id }) }}"
  117.               style="{{ highlighted ? 'color:white; background-color:' ~ profile.color }}"
  118.               class="flex-none p-3 text-sm font-medium tracking-widest {{
  119.               highlighted
  120.                 ? 'btn-primary btn btn-sm active'
  121.                 : 'btn-neutral btn btn-sm inactive'
  122.               }} uppercase  snap-center snap-always">
  123.               {{ item.name|trans }}
  124.             </a>
  125.           </turbo-frame>
  126.         {% endfor %}
  127.       </div>
  128.     </div>
  129.     <div class="hidden md:block">
  130.       {% include 'icons/arrow-right-tail.svg.twig' with { class: 'w-6' } %}
  131.     </div>
  132.   </div> #}
  133. </section>