templates/app/menus.html.twig line 1

Open in your IDE?
  1. {% set current = app.request.attributes.get('_route') %}
  2. {# Styles du nouveau menu #}
  3. {% block stylesheets %}
  4.   <style>
  5.     :root {
  6.       --primary: #3D7299;
  7.       --secondary: #a4286d;
  8.     }
  9.     *, ::before, ::after {
  10.       box-sizing: inherit;
  11.     }
  12.     #navbar-container {
  13.       bottom: 0;
  14.       align-items: center;
  15.       display: flex;
  16.       height: 100vh;
  17.       justify-content: center;
  18.       left: 0;
  19.       padding: 3rem 3rem;
  20.       position: fixed;
  21.       width: 330px;
  22.     }
  23.     #navbar {
  24.       background: #fff;
  25.       border-radius: 20px;
  26.       box-shadow: 15px 15px 10px #00000029;
  27.       display: flex;
  28.       flex-direction: column;
  29.       height: 100%;
  30.       align-items: center;
  31.       color: var(--primary);
  32.       width: 100%;
  33.     }
  34.     header {
  35.       align-items: center;
  36.       display: flex;
  37.       padding: 1.5rem 2rem;
  38.       width: 100%;
  39.     }
  40.     header svg {
  41.       fill: var(--primary);
  42.     }
  43.     header #header-title {
  44.       display: flex;
  45.       flex-direction: column;
  46.       height: 100%;
  47.       justify-content: center;
  48.       margin-left: 1rem;
  49.       position: relative;
  50.     }
  51.     header #header-title #hello {
  52.       font-size: 1.6em;
  53.       font-weight: 400;
  54.     }
  55.     header #header-title #app-version {
  56.       bottom: -5px;
  57.       font-size: .9em;
  58.       font-weight: 100;
  59.       left: 0;
  60.       position: absolute;
  61.     }
  62.     .nav {
  63.       height: 100%;
  64.       padding: 2rem 0;
  65.       width: 100%;
  66.     }
  67.     .nav ul {
  68.       list-style: none;
  69.       display: flex;
  70.       flex-direction: column;
  71.       height: 100%;
  72.       margin: 0;
  73.       padding: 0;
  74.     }
  75.     #nav-item-end {
  76.       margin-top: auto;
  77.     }
  78.     .nav li {
  79.       display: flex;
  80.       flex-direction: column;
  81.       padding: .2rem 2rem;
  82.     }
  83.     .nav li:hover .link-bottom {
  84.       background: var(--secondary);
  85.       width: 100%;
  86.     }
  87.     .nav li .link-bottom {
  88.       background: var(--primary);
  89.       border-radius: 6px;
  90.       height: .2rem;
  91.       transition: .2s linear;
  92.       width: 0;
  93.     }
  94.     .nav li .nav-link {
  95.       color: var(--primary);
  96.       display: flex;
  97.       align-items: center;
  98.       width: 100%;
  99.     }
  100.     .nav li .icon-container {
  101.       align-items: center;
  102.       display: flex;
  103.       height: 50px;
  104.       justify-content: center;
  105.       width: 50px;
  106.     }
  107.     .nav li .nav-icon {
  108.       align-items: center;
  109.       color: var(--primary);
  110.       display: flex;
  111.       font-size: 2.25em;
  112.       justify-content: center;
  113.     }
  114.     .nav li .nav-link-content {
  115.       display: flex;
  116.       align-items: center;
  117.     }
  118.     .nav li .nav-link-content .link-text {
  119.       font-size: 1.1em;
  120.       font-weight: 500;
  121.       margin-left: 1rem;
  122.     }
  123.     .nav li .router-link-active + .link-bottom {
  124.       width: 100%;
  125.     }
  126.     .nav li .router-link-active + .link-bottom:hover {
  127.       color: #065580;
  128.       font-weight: 400;
  129.     }
  130.   </style>
  131. {% endblock %}
  132. {% if (is_granted('ROLE_SURVEY')) %}
  133.   {% if app.user.hasGroup('GROUP_LANDLORD') %}
  134.     {% set hasAdministrativeInterface = app.user.organization.isAdminInterfaceVisible %}
  135.     {% set hasPrivateMessage = app.user.organization.hasPrivateMessage %}
  136.     {% set isManager = app.user.isManager %}
  137.     {% set hasIncident = false %}
  138.     {% set hasSocialAd = false %}
  139.     {% set batiConnect = app.user.organization.corporateName | lower == "noralsy" %}
  140.   {% elseif  app.user.hasGroup('GROUP_RESIDENT') %}
  141.     {% set isManager = false %}
  142.     {% set hasAdministrativeInterface = app.user.organization.isAdminInterfaceVisible %}
  143.     {% set hasPrivateMessage = app.user.apartment.entrance.residence.hasPrivateMessage %}
  144.     {% set hasIncident = app.user.apartment.entrance.residence.hasIncident %}
  145.     {% set hasSocialAd = app.user.apartment.entrance.residence.hasSocialAd %}
  146.     {% set batiConnect = false %}
  147.   {% elseif  app.user.hasGroup('GROUP_ADMIN') %}
  148.     {% set hasPrivateMessage = false %}
  149.     {% set hasIncident = false %}
  150.     {% set hasSocialAd = false %}
  151.     {% set isManager = app.user.isManager %}
  152.     {% set batiConnect = false %}
  153.   {% endif %}
  154.   <div id="navbar-container">
  155.     <div id="navbar">
  156.       <header>
  157.         <svg xmlns="http://www.w3.org/2000/svg"
  158.           width="50"
  159.           height="50"
  160.           viewBox="0 0 100 100"
  161.           role="presentation">
  162.           <title id="logo-oecko" lang="en">oecko icon</title>
  163.           <g>
  164.             <path d="M49.52,45.77a3,3,0,1,0,4.29.34,3.05,3.05,0,0,0-4.29-.34Z"/>
  165.             <path d="M74.11,32.28,60.72,73.53a3.48,3.48,0,0,1-6.62,0L47.84,54a3.44,3.44,0,0,0-1.94-2.13L26.66,43.5a3.48,3.48,0,0,1,.66-6.6l42.75-9.1a3.49,3.49,0,0,1,4,4.48ZM40.41,54.36a3,3,0,1,1-.34,4.29,3,3,0,0,1,.34-4.29Zm5.41,13.77L27,72.68a1.55,1.55,0,0,1-1.85-1.94l5.44-18.43a1.54,1.54,0,0,1,2.93-.07l3,8.59a1.54,1.54,0,0,0,.88.92L46,65.2a1.54,1.54,0,0,1-.22,2.93Zm3.44-64A46.5,46.5,0,1,0,95.92,50.45,46.49,46.49,0,0,0,49.26,4.12Z"/>
  166.           </g>
  167.         </svg>
  168.         <div id="header-title">
  169.           <span id="hello">OECKO</span>
  170.           <span id="app-version">βeta</span>
  171.         </div>
  172.       </header>
  173.       <div class="nav">
  174.         <ul>
  175.           <li>
  176.             <a href="{{ path('front_homepage', { _locale: app.request.locale }) }}" class="nav-link {{ current == 'front_homepage' ? "router-link-active" }}">
  177.               <span class="nav-link-content">
  178.                 <div class="icon-container">
  179.                   <span class="material-symbols-outlined nav-icon">home</span>
  180.                 </div>
  181.                 <span class="link-text">{{ 'navbar.home' | trans }}</span>
  182.               </span>
  183.             </a>
  184.             <div class="link-bottom"></div>
  185.           </li>
  186.           {% if (is_granted('ROLE_READ_MESSAGE')) and hasPrivateMessage %}
  187.             <li>
  188.               <a href="{{ path('app_privatemessage_showmessages', { _locale: app.request.locale }) }}" class="nav-link {{ current == 'app_privatemessage_showmessages' ? "router-link-active" }}">
  189.                 <span class="nav-link-content">
  190.                   <div class="icon-container">
  191.                     <span class="material-symbols-outlined nav-icon">message</span>
  192.                   </div>
  193.                   <span class="link-text">{{ 'navbar.messaging' | trans }}</span>
  194.                 </span>
  195.               </a>
  196.               <div class="link-bottom"></div>
  197.             </li>
  198.           {% endif %}
  199.           {% if (is_granted('ROLE_PUBLICMESSAGE')) %}
  200.             <li>
  201.               <a href="{{ path('app_publication_publicationsindex', { _locale: app.request.locale }) }}" class="nav-link {{ current == 'app_publication_publicationsindex' ? "router-link-active" }}">
  202.                 <span class="nav-link-content">
  203.                   <div class="icon-container">
  204.                     <span class="material-symbols-outlined nav-icon">document_scanner</span>
  205.                   </div>
  206.                   <span class="link-text">{{ 'navbar.publications' | trans }}</span>
  207.                 </span>
  208.               </a>
  209.               <div class="link-bottom"></div>
  210.             </li>
  211.           {% endif %}
  212.           {% if (is_granted('ROLE_MODERATOR')) %}
  213.             <li>
  214.               <a href="{{ path('app_moderation_moderation', { _locale: app.request.locale }) }}" class="nav-link {{ current == 'app_moderation_moderation' ? "router-link-active" }}">
  215.                 <span class="nav-link-content">
  216.                   <div class="icon-container">
  217.                     <span class="material-symbols-outlined nav-icon">remove_red_eye</span>
  218.                   </div>
  219.                   <span class="link-text">{{ 'navbar.moderation' | trans }}</span>
  220.                 </span>
  221.               </a>
  222.               <div class="link-bottom"></div>
  223.             </li>
  224.           {% endif %}
  225.           <li>
  226.             <a href="{{ nuxtAppUrl }}/{{ app.request.locale }}/surveys" class="nav-link">
  227.               <span class="nav-link-content">
  228.                 <div class="icon-container">
  229.                   <span class="material-symbols-outlined nav-icon">add_chart</span>
  230.                 </div>
  231.                 <span class="link-text">{{ 'navbar.surveys' | trans }}</span>
  232.               </span>
  233.             </a>
  234.             <div class="link-bottom"></div>
  235.           </li>
  236.           {% if (is_granted('ROLE_USEFULCONTACT_MANAGER')) %}
  237.             <li>
  238.               <a href="{{ path('app_contact_contactmanagement', { _locale: app.request.locale }) }}" class="nav-link {{ current == 'app_contact_contactmanagement' ? "router-link-active" }}">
  239.                 <span class="nav-link-content">
  240.                   <div class="icon-container">
  241.                     <span class="material-symbols-outlined nav-icon">phone_in_talk</span>
  242.                   </div>
  243.                   <span class="link-text">{{ 'navbar.contacts' | trans }}</span>
  244.                 </span>
  245.               </a>
  246.               <div class="link-bottom"></div>
  247.             </li>
  248.           {% endif %}
  249.           {% if is_granted('ROLE_EDIT_RESIDENCE') %}
  250.             <li>
  251.               <a href="{{ path('app_manageproperties_manageproperties', { _locale: app.request.locale }) }}" class="nav-link {{ current == 'app_manageproperties_manageproperties' ? "router-link-active" }}">
  252.                 <span class="nav-link-content">
  253.                   <div class="icon-container">
  254.                     <span class="material-symbols-outlined nav-icon">apartment</span>
  255.                   </div>
  256.                   <span class="link-text">{{ 'navbar.residences' | trans }}</span>
  257.                 </span>
  258.               </a>
  259.               <div class="link-bottom"></div>
  260.             </li>
  261.           {% endif %}
  262.           {% if isManager %}
  263.             <li>
  264.               <a href="{{ path('app_manageaccounts_manageaccounts', { _locale: app.request.locale }) }}" class="nav-link {{ current == 'app_manageaccounts_manageaccounts' ? "router-link-active" }}">
  265.                 <span class="nav-link-content">
  266.                   <div class="icon-container">
  267.                     <span class="material-symbols-outlined nav-icon">supervised_user_circle</span>
  268.                   </div>
  269.                   <span class="link-text">{{ 'navbar.accounts' | trans }}</span>
  270.                 </span>
  271.               </a>
  272.               <div class="link-bottom"></div>
  273.             </li>
  274.           {% endif %}
  275.           <li id="nav-item-end">
  276.             <a href="{{ path('app_logout', { _locale: app.request.locale }) }}" class="nav-link">
  277.               <span class="nav-link-content">
  278.                 <div class="icon-container">
  279.                   <span class="material-symbols-outlined nav-icon">logout</span>
  280.                 </div>
  281.                 <span class="link-text">{{ 'navbar.logout' | trans }}</span>
  282.               </span>
  283.             </a>
  284.             <div class="link-bottom"></div>
  285.           </li>
  286.         </ul>
  287.       </div>
  288.     </div>
  289.   </div>
  290. {% else %}
  291.   <a href="#" id="menu-slide-out-btn" data-activates="slide-out" class="button-collapse"><i class="fa fa-bars"></i></a>
  292.   <ul style="height: 100%" id="slide-out" class="side-nav fixed">
  293.     <div id="navbar-header">
  294.       {% set home_url = absolute_url(path('front_homepage')) %}
  295.       {% if app.user %}
  296.         {% if app.user.hasGroup('GROUP_ADMIN') or not app.user.organization.activeInterface or app.user.organization.corporateLogoName == null %}
  297.           <img
  298.             src="{{ asset('app/img/oecko-round-icon.png') }}"
  299.             onclick="document.location.href='{{ home_url }}'"
  300.             alt="Logo Oecko"
  301.           />
  302.           <div id="oecko-clock" class="hide-on-small-only"></div>
  303.         {% else %}
  304.           <img
  305.               id="orga-logo"
  306.               src="{{ medias.getServerUrl(app.user.organization.corporateLogoStorageName) }}"
  307.               onclick="document.location.href='{{ home_url }}'"
  308.               alt="Logo Oecko"/>
  309.           <div id="oecko-clock" class="hide-on-small-only"></div>
  310.         {% endif %}
  311.       {% endif %}
  312.     </div>
  313.     <div id="navbar-scroll-container">
  314.       {% if app.user %}
  315.         {% if app.user.hasGroup('GROUP_LANDLORD') %}
  316.           {% set hasAdministrativeInterface = app.user.organization.isAdminInterfaceVisible %}
  317.           {% set hasPrivateMessage = app.user.organization.hasPrivateMessage %}
  318.           {% set isManager = app.user.isManager %}
  319.           {% set hasIncident = false %}
  320.           {% set hasSocialAd = false %}
  321.           {% set batiConnect = app.user.organization.corporateName | lower == "noralsy" %}
  322.         {% elseif  app.user.hasGroup('GROUP_RESIDENT') %}
  323.           {% set isManager = false %}
  324.           {% set hasAdministrativeInterface = app.user.organization.isAdminInterfaceVisible %}
  325.           {% set hasPrivateMessage = app.user.apartment.entrance.residence.hasPrivateMessage %}
  326.           {% set hasIncident = app.user.apartment.entrance.residence.hasIncident %}
  327.           {% set hasSocialAd = app.user.apartment.entrance.residence.hasSocialAd %}
  328.           {% set batiConnect = false %}
  329.         {% elseif  app.user.hasGroup('GROUP_ADMIN') %}
  330.           {% set hasPrivateMessage = false %}
  331.           {% set hasIncident = false %}
  332.           {% set hasSocialAd = false %}
  333.           {% set isManager = app.user.isManager %}
  334.           {% set batiConnect = false %}
  335.         {% endif %}
  336.         {% if (is_granted('ROLE_READ_MESSAGE')) and hasPrivateMessage %}
  337.           <li>
  338.             {% if app.user.getUnreadMessageNumber() > 0  and app.user.getUnreadMessageNumber()<100 %}
  339.               <div class='pastille'>{{ app.user.getUnreadMessageNumber() }}</div>
  340.             {% elseif app.user.getUnreadMessageNumber()>=100 %}
  341.               <div class='pastille'>99+</div>
  342.             {% endif %}
  343.             <a class="waves-effect waves-light tooltipped {{ current == 'app_privatemessage_showmessages' ? "active" }}"
  344.               href="{{ path('app_privatemessage_showmessages', { _locale:  app.request.locale }) }}" data-position="right" data-delay="50" data-tooltip="Messages">
  345.               <i class="fa fa-envelope"></i>
  346.             </a>
  347.           </li>
  348.         {% endif %}
  349.         {% if (is_granted('ROLE_PUBLICMESSAGE')) %}
  350.           <li>
  351.             <a class="waves-effect waves-light tooltipped {{ current == 'app_publication_publicationsindex' ? "active" }}"
  352.               href="{{ path('app_publication_publicationsindex', { _locale:  app.request.locale }) }}" data-position="right" data-delay="50"
  353.               data-tooltip="Gérer les publications">
  354.               <i class="fa fa-pencil-square-o"></i>
  355.             </a>
  356.           </li>
  357.         {% endif %}
  358.         {% if (is_granted('ROLE_SURVEY')) %}
  359.           <li>
  360.             <a class="waves-effect waves-light tooltipped"
  361.               href="{{ nuxtAppUrl }}/{{ app.request.locale }}/surveys" data-position="right" data-delay="50"
  362.               data-tooltip="Gérer les enquêtes">
  363.               <i class="fa fa-question"></i>
  364.             </a>
  365.           </li>
  366.         {% endif %}
  367.         {% if (is_granted('ROLE_MODERATOR')) %}
  368.           <li>
  369.             <a class="waves-effect waves-light tooltipped {{ current == 'app_moderation_moderation' ? "active" }}"
  370.               href="{{ path('app_moderation_moderation', { _locale:  app.request.locale }) }}" data-position="right" data-delay="50"
  371.               data-tooltip="Espace de modération">
  372.               <i class="fa fa-eye-slash"></i>
  373.             </a>
  374.           </li>
  375.         {% endif %}
  376.         {% if isManager %}
  377.           <li>
  378.             <a class="waves-effect waves-light tooltipped {{ current == 'app_manageaccounts_manageaccounts' ? "active" }}"
  379.               href="{{ path('app_manageaccounts_manageaccounts', { _locale:  app.request.locale }) }}" data-position="right" data-delay="50"
  380.               data-tooltip="Gestion des comptes">
  381.               <i class="fa fa-users"></i>
  382.             </a>
  383.           </li>
  384.         {% endif %}
  385.         {% if is_granted('ROLE_EDIT_RESIDENCE') %}
  386.           <li>
  387.             <a class="waves-effect waves-light tooltipped {{ current == 'app_manageproperties_manageproperties' ? "active" }}"
  388.               href="{{ path('app_manageproperties_manageproperties', { _locale:  app.request.locale }) }}" data-position="right" data-delay="50"
  389.               data-tooltip="Gestion des résidences">
  390.               <i class="fa fa-building-o"></i>
  391.             </a>
  392.           </li>
  393.         {% endif %}
  394.         {% if is_granted('ROLE_USEFULCONTACT_MANAGER') %}
  395.           <li>
  396.             <a class="waves-effect waves-light tooltipped {{ current == 'app_contact_contactmanagement' ? "active" }}"
  397.               href="{{ path('app_contact_contactmanagement', { _locale:  app.request.locale }) }}" data-position="right" data-delay="50"
  398.               data-tooltip="Gestion des résidences">
  399.               <i class="fa fa-phone"></i>
  400.             </a>
  401.           </li>
  402.         {% endif %}
  403.         {% if is_granted('ROLE_MANAGE_THINCLIENT') %}
  404.           <li>
  405.             <a class="waves-effect waves-light tooltipped {{ current == 'app_defaultback_managethinclients' ? "active" }}"
  406.               href="{{ path('app_defaultback_managethinclients', { _locale:  app.request.locale }) }}" data-position="right" data-delay="50"
  407.               data-tooltip="Gestion des écrans">
  408.               <i class="fa fa-tablet"></i>
  409.             </a>
  410.           </li>
  411.         {% endif %}
  412.         {% if is_granted('ROLE_MANAGE_THINCLIENT') %}
  413.           <li>
  414.             <a class="waves-effect waves-light tooltipped {{ current == 'app_defaultback_managethinclients_v2' ? "active" }}"
  415.               href="{{ nuxtAppUrl }}/{{ app.request.locale }}/park" data-position="right" data-delay="50"
  416.               data-tooltip="Gestion des écrans V2">
  417.               V2
  418.             </a>
  419.           </li>
  420.         {% endif %}
  421.         {% if is_granted('ROLE_REPORT_INCIDENT') and hasIncident %}
  422.           <li>
  423.             <a class="waves-effect waves-light tooltipped {{ current == 'app_incident_reportincident' ? "active" }}"
  424.               href="{{ path('app_incident_reportincident', { _locale:  app.request.locale }) }}" data-position="right" data-delay="50"
  425.               data-tooltip="Déclarer un incident">
  426.               <i class="fa fa-bullhorn"></i>
  427.             </a>
  428.           </li>
  429.         {% endif %}
  430.         {% if is_granted('ROLE_SOCIALAD') and hasSocialAd %}
  431.           <li>
  432.             <a class="waves-effect waves-light tooltipped {{ current == 'app_socialad_socialads' ? "active" }}"
  433.               href="{{ path('app_socialad_socialads', { _locale:  app.request.locale }) }}" data-position="right" data-delay="50" data-tooltip="Lien social">
  434.               <i class="fa fa-group"></i>
  435.             </a>
  436.           </li>
  437.         {% endif %}
  438.         {% if hasAdministrativeInterface is defined and hasAdministrativeInterface == true and app.user.hasGroup('GROUP_RESIDENT') %}
  439.           <li>
  440.             <a class="waves-effect waves-light tooltipped {{ current == 'app_documents_documents' ? "active" }}"
  441.               href="{{ path('app_documents_documents', { _locale:  app.request.locale }) }}" data-position="right" data-delay="50" data-tooltip="Lien social">
  442.               <i class="menu-icon material-icons">attach_file</i>
  443.             </a>
  444.           </li>
  445.         {% endif %}
  446.         {% if is_granted('ROLE_SOCIALAD') and hasSocialAd %}
  447.           <li>
  448.             <a class="waves-effect waves-light tooltipped {{ current == 'app_contact_contact' ? "active" }}"
  449.               href="{{ path('app_contact_contact', { _locale:  app.request.locale }) }}" data-position="right" data-delay="50" data-tooltip="Contact">
  450.               <i class="menu-icon material-icons">local_phone </i>
  451.             </a>
  452.           </li>
  453.         {% endif %}
  454.         {% if (is_granted('ROLE_ADD_ADMIN')) %}
  455.           <li>
  456.             <a class="waves-effect waves-light tooltipped {{ current == 'app_managefeatures_managefeaturesindex' ? "active" }}"
  457.               href="{{ path('app_managefeatures_managefeaturesindex', { _locale:  app.request.locale }) }}" data-position="right" data-delay="50"
  458.               data-tooltip="Gestion des fonctionnalités Oecko">
  459.               <i class="fa fa-sliders"></i>
  460.             </a>
  461.           </li>
  462.           <li>
  463.             <a class="waves-effect waves-light tooltipped {{ current == 'app_appsettings_appsettings' ? "active" }}"
  464.               href="{{ path('app_appsettings_appsettings', { _locale:  app.request.locale }) }}" data-position="right" data-delay="50"
  465.               data-tooltip="Paramètres généraux">
  466.               <i class="fa fa-cogs"></i>
  467.             </a>
  468.           </li>
  469.         {% endif %}
  470.     {% if (batiConnect) %}
  471.       <li>
  472.         <a class="baticonnect"
  473.            href="https://www.baticonnect.com/index.php" data-position="right" data-delay="50"
  474.            data-tooltip="Gestion administrative">
  475.            <img
  476.             src="{{ asset('app/img/baticonnect.png') }}"
  477.             alt="Logo Baticonnect"
  478.           />
  479.         </a>
  480.       </li>
  481.     {% endif %}
  482.         <li>
  483.           <a class="waves-effect waves-light tooltipped"
  484.             href="{{ path('app_logout', { _locale:  app.request.locale }) }}" data-position="right" data-delay="50"
  485.             data-tooltip="Se déconnecter">
  486.             <i class="fa fa-sign-out"></i>
  487.           </a>
  488.         </li>
  489.       {% else %}
  490.         <li>
  491.           <a class="waves-effect waves-light tooltipped {{ current == 'app_login' ? "active" }}"
  492.             href="#" data-position="right" data-delay="50"
  493.             data-tooltip="S'identifier">
  494.             <i class="fa fa-lock"></i>
  495.           </a>
  496.         </li>
  497.         <li>
  498.           <a class="waves-effect waves-light tooltipped {{ current == '#' ? "active" }}"
  499.             href="https://oecko.com" data-position="right" data-delay="50" data-tooltip="Découvrez l'application OECKO">
  500.             <i class="fa fa-info-circle"></i>
  501.           </a>
  502.         </li>
  503.       {% endif %}
  504.       <div class="clearer"></div>
  505.     </div>
  506.   </ul>
  507. {% endif %}