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