templates/template_parts/header.html.twig line 1

  1. <!--Start Header Section -->
  2. <header id="top-header" class="clearfix">
  3.     <!-- Navigation -->
  4.     <nav class="navbar navbar-expand-lg navbar-light bg-gray-100 fixed-top shadow">
  5.         <div class="container-fluid">
  6.             <div class="logo">
  7.                 <!-- Nav Item #1 - Home -->
  8.                 <a class="navbar-brand" href="{{ path('app_home') }}">
  9.                     {% if CompanyDetailsService.getCompanyDetails is not null %}
  10.                         <a style="color: black" href="{{ path('app_home') }}">
  11.                             <i class="fa fa-home"></i><span>    </span> {{ CompanyDetailsService.getCompanyDetails.companyName }}
  12.                         </a>
  13.                     {% endif %}
  14.                 </a>
  15.                 <!-- Nav Item #1 - Company Details Edit -->
  16.                 {% if is_granted('ROLE_ADMIN') %}
  17.                     {% if CompanyDetailsService.getCompanyDetails is not null %}
  18.                         <a target="_blank" href="{{ path('company_details_edit', {'id': '1'}) }}">
  19.                             <i style="color: red" class="fa fa-pen"></i>
  20.                         </a>
  21.                         <a target="_blank" href="{{ path('company_details_show', {'id': '1'}) }}">
  22.                             <i style="color: red" class="fa fa-eye"></i>
  23.                         </a>
  24.                     {% else %}
  25.                         <a target="_blank" href="{{ path('company_details_new') }}">
  26.                             <i style="color: blue" class="fa fa-pen"></i>
  27.                         </a>
  28.                     {% endif %}
  29.                 {% endif %}
  30.             </div>
  31.             <button class="navbar-toggler" type="button"
  32.                     data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent"
  33.                     aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
  34.                 <span class="navbar-toggler-icon"></span>
  35.             </button>
  36.             <div class="collapse navbar-collapse main-menu pr-5 mr-5" id="navbarSupportedContent">
  37.                 <ul class="navbar-nav ml-auto ">
  38.                     <!-- Nav Item #2 - Dashboard -->
  39.                     {% if is_granted('ROLE_ADMIN') %}
  40.                         <style>
  41.                             /* Hide mobile text by default */
  42.                             .text-mobile {
  43.                                 display: none;
  44.                             }
  45.                             /* Show mobile text only on small screens */
  46.                             @media (max-width: 767px) {
  47.                                 .text-mobile {
  48.                                     display: inline !important;
  49.                                 }
  50.                             }
  51.                         </style>
  52.                         <li class="nav-item">
  53.                             <a class="nav-link" target="_blank" href="{{ path('dashboard') }}">
  54.                                 <i title="Dashboard" style="color: green" class="fa fa-tachometer-alt"></i>
  55.                                 <span class="text-mobile">Dashboard</span>
  56.                             </a>
  57.                         </li>
  58.                         <li class="nav-item">
  59.                             <a class="nav-link" target="_blank" href="{{ path('advanced_dashboard') }}">
  60.                                 <i title="Advanced Dashboard" style="color: red" class="fa fa-tachometer-alt"></i>
  61.                                 <span class="text-mobile">Advanced Dashboard</span>
  62.                             </a>
  63.                         </li>
  64.                         {% if CountPendingWebsiteInquiriesService.countContacts >0 %}
  65.                             <li class="nav-item active">
  66.                                 <a style="color: red" class="nav-link" target="_blank"
  67.                                    href="{{ path('website_contacts_index') }}">
  68.                                     <i title="Website inquiries awaiting a response" style="color: purple"
  69.                                        class="fa fa-user-secret"></i>
  70.                                     ({{ CountPendingWebsiteInquiriesService.countContacts }})
  71.                                 </a>
  72.                             </li>
  73.                         {% endif %}
  74.                     {% endif %}
  75.                     <!-- Nav Item #3 - Products -->
  76.                     {% if CompanyDetailsService.companyDetails is not null %}
  77.                         {% if CompanyDetailsService.companyDetails.headerDisplayProducts ==1 %}
  78.                             <li class="nav-item dropdown">
  79.                                 <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button"
  80.                                    data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  81.                                     {% if CompanyDetailsService.companyDetails.titleProducts is not null %}
  82.                                         {{ CompanyDetailsService.companyDetails.titleProducts }}
  83.                                     {% else %}
  84.                                         Products
  85.                                     {% endif %}
  86.                                 </a>
  87.                                 <div class="dropdown-menu" aria-labelledby="navbarDropdown">
  88.                                     {% set products = ProductService.getProductMainAll %}
  89.                                     {% for product in products %}
  90.                                         {% if product.isActive==1 and CountCMSCopyPhotoService.countCMSCopy(product) >0 %}
  91.                                             <a class="dropdown-item" title="{{ product.notes|striptags }}"
  92.                                                href="{{ path('product_display', { product: product.product}) }}">
  93.                                                 <i style="color: {{ product.menuIconColour }}"
  94.                                                    class="mr-2 {{ product.menuIcon }}"></i>
  95.                                                 {{ product.product }}
  96.                                             </a>
  97.                                         {% elseif product.isActive==1 and CountCMSCopyPhotoService.countCMSCopy(product) ==0 %}
  98.                                             {% if is_granted('ROLE_ADMIN') %}
  99.                                                 <a class="dropdown-item" title="{{ product.notes|striptags }}"
  100.                                                    href="{{ path('product_display', { product: product.product}) }}">
  101.                                                     <i style="color: {{ product.menuIconColour }}"
  102.                                                        class="mr-2 {{ product.menuIcon }}"></i>
  103.                                                     <span style="color: red"> {{ product.product }}* (No CMS)  </span>
  104.                                                 </a>
  105.                                             {% endif %}
  106.                                         {% endif %}
  107.                                     {% endfor %}
  108.                                 </div>
  109.                             </li>
  110.                         {% endif %}
  111.                     {% endif %}
  112.                     <!-- Nav Item #4 - SubProducts -->
  113.                     {% if CompanyDetailsService.companyDetails is not null %}
  114.                         {% if CompanyDetailsService.companyDetails.headerDisplaySubProducts ==1 %}
  115.                             <li class="nav-item dropdown">
  116.                                 <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button"
  117.                                    data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  118.                                     {% if CompanyDetailsService.companyDetails.titleSubProducts is not null %}
  119.                                         {{ CompanyDetailsService.companyDetails.titleSubProducts }}
  120.                                     {% else %}
  121.                                         Sub-Products
  122.                                     {% endif %}
  123.                                 </a>
  124.                                 <div class="dropdown-menu" aria-labelledby="navbarDropdown">
  125.                                     {% set products = ProductService.getProductSubAll %}
  126.                                     {% for product in products %}
  127.                                         {% if product.isActive==1 and CountCMSCopyPhotoService.countCMSCopy(product) >0 %}
  128.                                             <a class="dropdown-item" title="{{ product.notes|striptags }}"
  129.                                                href="{{ path('product_display', { product: product.product}) }}">
  130.                                                 <i style="color: {{ product.menuIconColour }}"
  131.                                                    class="mr-2 {{ product.menuIcon }}"></i>
  132.                                                 {{ product.product }}
  133.                                             </a>
  134.                                         {% elseif product.isActive==1 and CountCMSCopyPhotoService.countCMSCopy(product) ==0 %}
  135.                                             {% if is_granted('ROLE_ADMIN') %}
  136.                                                 <a class="dropdown-item" title="{{ product.notes|striptags }}"
  137.                                                    href="{{ path('product_display', { product: product.product}) }}">
  138.                                                     <i style="color: {{ product.menuIconColour }}"
  139.                                                        class="mr-2 {{ product.menuIcon }}"></i>
  140.                                                     <span style="color: red"> {{ product.product }}* (No CMS)  </span>
  141.                                                 </a>
  142.                                             {% endif %}
  143.                                         {% endif %}
  144.                                     {% endfor %}
  145.                                 </div>
  146.                             </li>
  147.                         {% endif %}
  148.                     {% endif %}
  149.                     <!-- Nav Item #5 - Photos -->
  150.                     {% set user = app.user %}
  151.                     {% set userIsValid = user is not null and user.id is defined %}
  152.                     {% set isAdmin = userIsValid and is_granted('ROLE_ADMIN') %}
  153.                     {% set company = CompanyDetailsService.companyDetails %}
  154.                     {% set photoSort = company.photoLocationsSort ?? 'Date' %}
  155.                     {% if userIsValid %}
  156.                         {% set visibleLocations = CountPhotoLocationsService.listVisibleLocations(user) %}
  157.                     {% else %}
  158.                         {% set visibleLocations = CountPhotoLocationsService.listPublicLocations() %}
  159.                     {% endif %}
  160.                     {% set countVisibleVenues = visibleLocations|length %}
  161.                     {% set singleLocation = countVisibleVenues == 1 ? visibleLocations[0] : null %}
  162.                     {% if company is not null and company.headerDisplayPhotos == 1 %}
  163.                         {% if isAdmin %}
  164.                             <li class="nav-item">
  165.                                 <a class="nav-link" href="{{ path('photos_index') }}">
  166.                                     Photos
  167.                                 </a>
  168.                             </li>
  169.                         {% elseif countVisibleVenues > 1 %}
  170.                             <li class="nav-item dropdown">
  171.                                 <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button"
  172.                                    data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  173.                                     Photos
  174.                                 </a>
  175.                                 <div class="dropdown-menu" aria-labelledby="navbarDropdown">
  176.                                     {# Public Locations #}
  177.                                     {% for location in CountPhotoLocationsService.listPublicLocations() %}
  178.                                         <a target="_blank" class="dropdown-item"
  179.                                            href="{{ path('show_photos_by_location', { id: location.id, author: 'All', format: 'Full' }) }}">
  180.                                             {{ photoSort == 'Location'
  181.                                             ? location.location ~ ' - ' ~ location.date|date('M-Y')
  182.                                             : location.date|date('M-Y') ~ ' - ' ~ location.location }}
  183.                                             ({{ CountPhotosService.calculateTotalPhotos(location) }})
  184.                                         </a>
  185.                                     {% endfor %}
  186.                                     {# Private Locations if allowed #}
  187.                                     {% for location in CountPhotoLocationsService.listPrivateLocations() %}
  188.                                         {% if user and (user.id in location.enabledUsers) %}
  189.                                             <a style="color: red" target="_blank" class="dropdown-item"
  190.                                                href="{{ path('show_photos_by_location', { id: location.id, author: 'All', format: 'Full' }) }}">
  191.                                                 {{ photoSort == 'Location'
  192.                                                 ? location.location ~ ' - ' ~ location.date|date('M-Y')
  193.                                                 : location.date|date('M-Y') ~ ' - ' ~ location.location }}
  194.                                                 ({{ CountPhotosService.calculateTotalPhotos(location) }})
  195.                                             </a>
  196.                                         {% endif %}
  197.                                     {% endfor %}
  198.                                 </div>
  199.                             </li>
  200.                         {% elseif singleLocation is not null %}
  201.                             {# Exactly one visible location for non-admins — direct link with "Photos" label #}
  202.                             <li class="nav-item">
  203.                                 <a class="dropdown-item nav-link"
  204.                                    href="{{ path('show_photos_by_location', { id: singleLocation.id, author: 'All', format: 'Full' }) }}">
  205.                                     Photos
  206.                                 </a>
  207.                             </li>
  208.                         {% endif %}
  209.                     {% endif %}
  210.                     <!-- Nav Item #6 - Useful Contacts/ Weather -->
  211.                     {% if CompanyDetailsService.companyDetails is not null and CompanyDetailsService.companyDetails.headerDisplayUsefulLinks ==1 %}
  212.                         {% if CompanyDetailsService.companyDetails.headerDisplayBusinessContacts ==1
  213.                             or CompanyDetailsService.companyDetails.headerDisplayWeather ==1 %}
  214.                             <li class="nav-item dropdown">
  215.                                 <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button"
  216.                                    data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  217.                                     {% if CompanyDetailsService.companyDetails.titleUsefulLinks is not null %}
  218.                                         {{ CompanyDetailsService.companyDetails.titleUsefulLinks }}
  219.                                     {% else %}
  220.                                         Useful Links
  221.                                     {% endif %}
  222.                                 </a>
  223.                                 <div class="dropdown-menu" aria-labelledby="navbarDropdown">
  224.                                     {% if is_granted('ROLE_ADMIN') %}
  225.                                         <a class="dropdown-item"
  226.                                            href="{{ path('useful_links_index', {'category':'All'}) }}">
  227.                                             <i style="color: blue" class="mr-2 fa fa-link"></i>
  228.                                             Links
  229.                                         </a>
  230.                                         <a class="dropdown-item"
  231.                                            href="{{ path('file_attachments_index') }}">
  232.                                             <i style="color: red" class="mr-2 fa fa-file-pdf-o"></i>
  233.                                             Files
  234.                                         </a>
  235.                                         <hr>
  236.                                     {% endif %}
  237.                                     {% include 'template_parts_project_specific/header_project_specific1.html.twig' %}
  238.                                     {% if CompanyDetailsService.companyDetails.headerDisplayBusinessContacts ==1 %}
  239.                                         <a style="color: black" class="dropdown-item"
  240.                                            href="{{ path('business_contacts_index') }}">
  241.                                             <i style="color: purple" class="mr-2 fa fa-user-friends"></i>Useful Contacts</a>
  242.                                         </a>
  243.                                     {% endif %}
  244.                                     {% if  CompanyDetailsService.companyDetails.headerDisplayWeather ==1 %}
  245.                                         <a style="color: black" class="dropdown-item"
  246.                                            href="{{ path('weather_index') }}">
  247.                                             <i style="color: orange" class="mr-2 fa fa-cloud-rain"></i>Weather</a>
  248.                                         </a>
  249.                                     {% endif %}
  250.                                 </div>
  251.                             </li>
  252.                         {% endif %}
  253.                     {% endif %}
  254.                     <!-- Nav Item #6 - Contact -->
  255.                     {% if CompanyDetailsService.getCompanyDetails is not null %}
  256.                         {% if CompanyDetailsService.companyDetails.headerDisplayContactDetails ==1 %}
  257.                             <li class="nav-item dropdown">
  258.                                 <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button"
  259.                                    data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  260.                                     Contact
  261.                                 </a>
  262.                                 <div class="dropdown-menu" aria-labelledby="navbarDropdown">
  263.                                     {% if CompanyDetailsService.companyDetails.companyQrCode is not null %}
  264.                                         <a class="dropdown-item" target="_blank"
  265.                                            href="{{ path('company_qr_code') }}">
  266.                                             <i style="color: orange" class="mr-2 fa fa-qrcode"></i>
  267.                                             QR code
  268.                                         </a>
  269.                                     {% endif %}
  270.                                     {% if CompanyDetailsService.companyDetails.companyEmail is not null %}
  271.                                         <a title={{ CompanyDetailsService.companyDetails.companyEmail }} class="dropdown-item"
  272.                                            href="mailto:{{ CompanyDetailsService.companyDetails.companyEmail }}">
  273.                                             <i style="color: blue" class="mr-2 fa fa-envelope"></i>
  274.                                             {{ CompanyDetailsService.companyDetails.companyEmail }}
  275.                                         </a>
  276.                                     {% endif %}
  277.                                     {% if CompanyDetailsService.companyDetails.companyTel is not null and CompanyDetailsService.companyDetails.contactDetailsDisplayTelNumbers ==1 %}
  278.                                         <a class="dropdown-item"
  279.                                            title="{{ CompanyDetailsService.companyDetails.companyTel }}"
  280.                                            href="https://wa.me/{{ CompanyDetailsService.companyDetails.companyTel | replace({' ': ''}) }}">
  281.                                             <i style="color: #0f6848"
  282.                                                class="mr-2 fa fa-phone"></i> {{ CompanyDetailsService.companyDetails.companyTel }}
  283.                                         </a>
  284.                                     {% endif %}
  285.                                     {% if CompanyDetailsService.companyDetails.companyMobile is not null and CompanyDetailsService.companyDetails.contactDetailsDisplayTelNumbers ==1 %}
  286.                                         <a class="dropdown-item"
  287.                                            title="{{ CompanyDetailsService.companyDetails.companyMobile }}"
  288.                                            href="https://wa.me/{{ CompanyDetailsService.companyDetails.companyMobile | replace({' ': ''}) }}">
  289.                                             <i style="color: green"
  290.                                                class="mr-2 fab fa-whatsapp"></i> {{ CompanyDetailsService.companyDetails.companyMobile }}
  291.                                         </a>
  292.                                     {% endif %}
  293.                                     {% if app.user %}
  294.                                         {% if CompanyDetailsService.companyDetails.companyAddressStreet is not null and CompanyDetailsService.companyDetails.contactDetailsDisplayAddress ==1 %}
  295.                                             <a class="dropdown-item" target="_blank"
  296.                                                title="{{ CompanyDetailsService.companyDetails.companyAddressStreet }} "
  297.                                                href="{{ path('office_address') }}">
  298.                                                 <i style="color: royalblue"
  299.                                                    class="mr-2 fa fa-car"></i> {{ CompanyDetailsService.companyDetails.companyAddressStreet }}
  300.                                             </a>
  301.                                         {% endif %}
  302.                                     {% endif %}
  303.                                     {% if CompanyDetailsService.companyDetails.contactDetailsDisplayCompanyVCF ==1 %}
  304.                                         <a class="dropdown-item" title="Contact details"
  305.                                            href="{{ path('create_vcard_company') }}">
  306.                                             <i class="mr-2 fa fa-credit-card"></i> Business Card
  307.                                         </a>
  308.                                     {% endif %}
  309.                                 </div>
  310.                             </li>
  311.                         {% endif %}
  312.                     {% endif %}
  313.                     {% include 'template_parts_project_specific/header_project_specific2.html.twig' %}
  314.                     <!-- Nav Item #8 - Login -->
  315.                     {% if CompanyDetailsService.getCompanyDetails is not null and (CompanyDetailsService.companyDetails.headerDisplayLogin ==1 or app.user is not null) %}
  316.                         {% if app.user %}
  317.                             <li class="nav-item dropdown">
  318.                                 <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button"
  319.                                    data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  320.                                     {{ app.user.fullName }}
  321.                                     {% if app.user.autoLoginURL|length >0 %}
  322.                                         <i class="mr-2 fas fa-user-check"
  323.                                            title="Auto-login enabled: {{ user.autoLoginURL }}"></i>
  324.                                     {% endif %}
  325.                                     {% if is_granted('ROLE_SUPER_ADMIN') %}
  326.                                         <i title="Super-Admin" style="color: green" class="fa fa-hat-wizard"></i>
  327.                                     {% endif %}
  328.                                     {% if is_granted('ROLE_ADMIN') %}
  329.                                         <i title="Admin" style="color: orange" class="fa fa-user-cog"></i>
  330.                                     {% endif %}
  331.                                     {% include 'template_parts_project_specific/header_project_specific3.html.twig' %}
  332.                                 </a>
  333.                                 <div class="dropdown-menu" aria-labelledby="navbarDropdown">
  334.                                     <a class="dropdown-item" href="{{ path('user_edit',{'id':app.user.id}) }}">
  335.                                         <i class="mr-2 fa fa-user"></i>Profile</a>
  336.                                     {% if CompanyDetailsService.companyDetails.autoLoginAvailable == 1 %}
  337.                                         {% if app.user.autoLoginURL|length>0 %}
  338.                                             <a class="dropdown-item"
  339.                                                href="{{ path('auto_login_reset_pause_and_email_bookmark', {userId: app.user.id}) }}">
  340.                                                 <i style="color: green" class="mr-2 fa fa-book"></i>Resend Auto-login
  341.                                                 Bookmark</a>
  342.                                         {% endif %}
  343.                                         {% if app.user.autoLoginURL|length == 0 %}
  344.                                             <a class="dropdown-item"
  345.                                                href="{{ path('auto_login_create_personal_url_for_logged_user', {userId: app.user.id}) }}">
  346.                                                 <i style="color: red" class="mr-2 fa fa-bookmark"></i>Set up auto-login</a>
  347.                                         {% endif %}
  348.                                     {% endif %}
  349.                                     <a class="dropdown-item" href="{{ path('app_logout') }}">
  350.                                         <i style="color: red" class="mr-2 fas fa-sign-out-alt"></i>Logout</a>
  351.                                 </div>
  352.                             </li>
  353.                         {% else %}
  354.                             <li class="nav-item">
  355.                                 <a class="nav-link" href="{{ path('app_login') }}">Login</a>
  356.                             </li>
  357.                         {% endif %}
  358.                     {% endif %}
  359.                     {% if CompanyDetailsService.getCompanyDetails is not null and
  360.                         CompanyDetailsService.companyDetails.multiLingual == 1 and
  361.                         LanguagesService.getLanguages is not null and
  362.                         LanguagesService.getLanguageSelected is not null %}
  363.                         <li class="nav-item dropdown">
  364.                             <a class="nav-link dropdown-toggle p-0" href="#" id="navbarDropdown" role="button"
  365.                                data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  366.                                 <img src="{{ asset('administration/ATSSharedFiles/LanguageIcons/' ~ LanguagesService.getLanguageSelected.icon) }}"
  367.                                      width="24" height="24" alt="Selected language">
  368.                             </a>
  369.                             <div class="dropdown-menu dropdown-menu-end p-1 slim-lang-menu"
  370.                                  aria-labelledby="navbarDropdown">
  371.                                 {% set selected = LanguagesService.getLanguageSelected %}
  372.                                 {% for language in LanguagesService.getLanguagesByRankingOrder %}
  373.                                     {% if language.language != selected.language %}
  374.                                         <a class="dropdown-item icon-item"
  375.                                            href="{{ path('select_default_language', { id: language.id }) }}">
  376.                                             <img src="{{ asset('administration/ATSSharedFiles/LanguageIcons/' ~ language.icon) }}"
  377.                                                  width="20" height="20" alt="{{ language.language }}">
  378.                                         </a>
  379.                                     {% endif %}
  380.                                 {% endfor %}
  381.                             </div>
  382.                         </li>
  383.                     {% endif %}
  384.                 </ul>
  385.             </div>
  386.         </div>
  387.     </nav>
  388.     <!-- Navigation -->
  389. </header>
  390. <!--End Header Section -->