templates/service/detail.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block title %}
  3. {% endblock %}
  4. {% block stylesheets %}
  5.   <link rel="stylesheet" href="{{ asset('css/detail-formation.css') }}" />
  6.   <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
  7. {% endblock %}
  8. {% block body %}
  9.   <div class="section-about" id="section-about">
  10.     <div class="section-gallery">
  11.       <div class="container position">
  12.         <div class="depo-formation position-relative">
  13.           <div class="alert note-position note-size">
  14.             <p class="card-text note-color text-center">
  15.               {% if averageStars[service.id][0]['averageStars'] is not null %}
  16.                 <span class="size-rated">{{ averageStars[service.id][0]['averageStars']|number_format(1) }}</span>/5
  17.               {% else %}
  18.                 <span>{% trans %}rating.not_rated{% endtrans %}</span>
  19.               {% endif %}
  20.             </p>
  21.             <p class="card-text note-color text-center  {{ app.request.locale == 'ar_TN' ? 'form_direction_rtl' : 'form_direction_ltr' }}">
  22.               {% if averageStars[service.id][0]['demandeCount'] and averageStars[service.id][0]['demandeCount'] == 1 %}
  23.                 {{ averageStars[service.id][0]['demandeCount'] }} {% trans %}rating.avissingle{% endtrans %}
  24.               {% elseif averageStars[service.id][0]['demandeCount'] and averageStars[service.id][0]['demandeCount'] != 1 %}
  25.                 {{ averageStars[service.id][0]['demandeCount'] }} {% trans %}rating.avismultiple{% endtrans %}
  26.               {% endif %}
  27.             </p>
  28.           </div>
  29.           <div class="row pb-5">
  30.             <div class="col-md-12 text-center p-5">
  31.               <b><h5 class="card-title">{{ service.axe }}</h5></b>
  32.             </div>
  33.           </div>
  34.           <div class="box"></div>
  35.           <div class="card-body {{ app.request.locale == 'ar_TN' ? 'form_direction_rtl' : 'form_direction_ltr' }}">
  36.             <p class="card-text">{{ service.description|raw }}</p>
  37.             <p class="card-text">
  38.               {% for rubrique in service.rubriques %}
  39.                 {% if rubrique.isShowable %}
  40.                   <h4>
  41.                     {{ rubrique.libelle }}
  42.                     :
  43.                   </h4>
  44.                 {% endif %}
  45.                 <ul>
  46.                   <b id="offre">{% trans %}services.details.offre{% endtrans %}:</b>
  47.                   {% for prestation in rubrique.prestations %}
  48.                     <li id="base-formation">
  49.                       {{ prestation.libelle }}
  50.                       {% if prestation.modules %}
  51.                         <ul id="formation">
  52.                           {% for module in prestation.modules %}
  53.                             {% if module.isShowable %}
  54.                               <li>
  55.                                 <details onload>
  56.                                   <summary>
  57.                                     {{ module.label }}
  58.                                     {% if module.file %}
  59.                                       <p style="margin-top: -23px;">
  60.                                         <a href="/upload/modules/{{ module.file }}"><i class="fa-solid fa-file-arrow-down"></i></a>
  61.                                       </p>
  62.                                     {% endif %}
  63.                                   </summary>
  64.                                   {% if module.description %}
  65.                                     <div class="content">
  66.                                       <p>{{ (module.description ? '   ' ~ module.description : '')|raw }}</p>
  67.                                     </div>
  68.                                   {% endif %}
  69.                                 </details>
  70.                               </li>
  71.                             {% endif %}
  72.                           {% endfor %}
  73.                         </ul>
  74.                       {% endif %}
  75.                     </li>
  76.                   {% endfor %}
  77.                 </ul>
  78.               {% endfor %}
  79.             </p>
  80.           </div>
  81.           {% if true == isAllowed %}
  82.             <div class="col-md-4 text-right">
  83.               <a href="{{ path('new_demande', { serviceId: service.id, demandeId: 0 }) }}"><button class="btn-slider-text">{% trans %}services.details.deposer{% endtrans %}</button></a>
  84.             </div>
  85.           {% elseif true == isShowable %}
  86.             <div class="col-md-4 text-right">
  87.               <a href="javascript:void(0)" id="btn-demande-service"><button class="btn-slider-text">{% trans %}services.details.deposer{% endtrans %}</button></a>
  88.             </div>
  89.           {% endif %}
  90.         </div>
  91.       </div>
  92.     </div>
  93.   </div>
  94. {% endblock %}
  95. {% block javascripts %}
  96.   <script>
  97.       $(document).ready(function () {
  98.       $.ajax({
  99.         url: "{{ path('count_command_article_by_user') }}",
  100.         type: 'GET',
  101.         dataType: 'json',
  102.         success: function (response) {
  103.           if (response.count > 0) {
  104.             $('#notifCartSpan').html(`<i id="notifCart" aria-hidden="true" 
  105.                                                                                                                                                                                                                                                 style=" padding-left: -70px !important; font-size: 12px;"><strong style="color:white !important">${response.count}</strong></i>`)
  106.           } else {
  107.             $('#notifCartSpan').html('')
  108.           }
  109.         }
  110.       })
  111.     })
  112.     
  113.     $(document).ready(function () {
  114.       $.ajax({
  115.         url: "{{ path('count_notification_by_user') }}",
  116.         type: 'GET',
  117.         dataType: 'json',
  118.         success: function (response) {
  119.           if (response.count > 0) {
  120.             $('.notification_count').html(`<strong class="notification-dot" >${response.count}</strong>`)
  121.           } else {
  122.             $('.notification_count').html('')
  123.           }
  124.         }
  125.       })
  126.     })
  127.         window.onload = (event) => {
  128.             if (module.description) {
  129.                 console.log('La page est complètement chargĂ©e');
  130.             }
  131.         };
  132.     </script>
  133.   <script>
  134.         {% if app.user %}
  135.             $('#btn-demande-service').click(function () {
  136.                 Swal.fire({icon: 'warning', title: '{{ 'attention.title'|trans }}', text: '{{ isNotAllowedMessage }}'});
  137.             });
  138.         {% else %}
  139.             $('#btn-demande-service').click(function () {
  140.                 Swal.fire( {
  141.                     icon: 'warning',
  142.                     title: '{{ 'attention.title'|trans }}...',
  143.                     text: '{{ isNotAllowedMessage }}',
  144.                 }).then((result) => {
  145.                     if (result.isConfirmed) {
  146.                         location.href = "{{ path( 'login', { 'prevRoute' : 'show_service_detail', 'id' :  service.id  } ) }}";
  147.                     }
  148.                 });
  149.             });
  150.         {% endif %}
  151.     </script>
  152. {% endblock %}