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

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