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