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