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