templates/front/faq.html.twig line 1

Open in your IDE?
  1. {% extends 'layout_website.html.twig' %}
  2. {% block title %}FAQ
  3. {% endblock %}
  4. {% block stylesheets %}
  5.     {{parent()}} 
  6.     <style>
  7.         .faq {
  8.             border-radius: 4px;
  9.             margin:2rem 0;
  10.         }
  11.         .faq .card {
  12.             border: none;
  13.             background: none;
  14.             border-bottom: 1px solid #DADADA;
  15.         }
  16.         .faq .card .card-header {
  17.             padding: 0px;
  18.             border: none;
  19.             background: none;
  20.             -webkit-transition: all 0.3s ease 0s;
  21.             -moz-transition: all 0.3s ease 0s;
  22.             -o-transition: all 0.3s ease 0s;
  23.             transition: all 0.3s ease 0s;
  24.         }
  25.         .faq .card .card-header:hover {
  26.             background: #fffd6a60;
  27.             padding-left: 10px;
  28.         }
  29.         .faq .card .card-header .faq-title {
  30.             width: 100%;
  31.             text-align: left;
  32.             padding: 0px;
  33.             padding-left: 5px;
  34.             padding-right: 5px;
  35.             font-weight: bold;
  36.             font-size: 1.2rem;
  37.             letter-spacing: 1px;
  38.             color: #000;
  39.             text-decoration: none !important;
  40.             -webkit-transition: all 0.3s ease 0s;
  41.             -moz-transition: all 0.3s ease 0s;
  42.             -o-transition: all 0.3s ease 0s;
  43.             transition: all 0.3s ease 0s;
  44.             cursor: pointer;
  45.             padding-top: 20px;
  46.             padding-bottom: 20px;
  47.             display: flex;
  48.             align-content: center;
  49.             align-items: center;
  50.             margin-top: 0;
  51.         }
  52.         .faq .card .card-header .faq-title .badge {
  53.             display: inline-block;
  54.             width: 20px;
  55.             height: 20px;
  56.             line-height: 14px;
  57.             float: left;
  58.             -webkit-border-radius: 100px;
  59.             -moz-border-radius: 100px;
  60.             border-radius: 100px;
  61.             text-align: center;
  62.             background: #337ab7;
  63.             color: #fff;
  64.             font-size: 12px;
  65.             margin-right: 20px;
  66.         }
  67.         .faq .card .card-body {
  68.             padding: 0;
  69.             font-weight: 400;
  70.             font-size: 16px;
  71.             color: #000;
  72.             line-height: 28px;
  73.             letter-spacing: 1px; 
  74.             text-align: left;
  75.             padding-left: 30px;
  76.             padding-right: 30px;
  77.         }
  78.         .faq .card .card-body p {
  79.             margin-top: 4px;
  80.             margin-bottom: 14px;
  81.             font-size: 1.1rem;
  82.         }
  83.         @media (max-width: 991px) {
  84.             .faq {
  85.                 margin-bottom: 30px;
  86.             }
  87.             .faq .card .card-header .faq-title {
  88.                 line-height: 26px;
  89.                 margin-top: 10px;
  90.             }
  91.         }
  92. .body-faq h2{
  93.     text-align:center;
  94.     color: #33e599;
  95. }
  96. .blockFaq{ 
  97.   margin-bottom: 2rem;
  98. }
  99. .titre{
  100. width: 100%;
  101. text-align: left;
  102.     color: #33e599;
  103.     font-size: 1.6rem; 
  104. }
  105. .faqdet{
  106. width: 100%;
  107. }
  108.     </style>
  109.     <link rel="stylesheet" type="text/css" media="all" href="{{ asset('css/style.css') }}">
  110. {% endblock %}
  111. {% block body_container %}
  112.     <div id="pages" class="body-faq">
  113.  
  114.         <div class="container">
  115.             <div class="faq col-md-12">
  116.                 <h2>FAQ</h2>
  117. {% for Faqm in Faqmod %}
  118. <div class="blockFaq">
  119.     <div class="titre">{{ Faqm.Titre }}</div>
  120.     <div class="faqdet">
  121.         {% for Faq in Faqm.Liste %}
  122.                             <div class="card">
  123.                                 <div class="card-header" id="faqHeading-{{ Faq.id }}">
  124.                                     <div class="mb-0">
  125.                                         <h5 class="faq-title" data-toggle="collapse" data-target="#faqCollapse-{{ Faq.id }}" data-aria-expanded="false" data-aria-controls="faqCollapse-{{ Faq.id }}" data-urltar="{{ Faq.Titre|slugify }}">{{ Faq.Titre | raw }}</h5>
  126.                                     </div>
  127.                                 </div>
  128.                                 <div id="faqCollapse-{{ Faq.id }}" class="collapse" aria-labelledby="faqHeading-{{ Faq.id }}" data-parent="#accordion">
  129.                                     <div class="card-body">
  130.                                         {{ Faq.Detail | raw }}
  131.                                     </div>
  132.                                 </div>
  133.                             </div>
  134.         {% endfor %}
  135.     </div>
  136. </div>
  137. {% endfor %}        
  138.             </div>
  139.         </div>
  140. </div>
  141. {% endblock %}
  142. {% block javascripts %}
  143.         
  144. <script>
  145. $("a[href$='#']").on('click', function () {
  146.     openreduc()
  147. })
  148. $('.faq-title').on('click', function () {
  149.     let trg = $(this).attr('data-target')
  150.     let text = $(this).attr('data-urltar')
  151.     if( $( trg ).hasClass( "collapse" ) ){
  152.         $( trg ).removeClass('collapse') 
  153.     window.location.hash = text
  154.     }else{
  155.         $( trg ).addClass('collapse') 
  156.         let nurl = window.location.href.replace(window.location.hash, ''); 
  157. //    window.location.hash = ''
  158.     window.history.pushState("", "", nurl);
  159.     }
  160. });
  161. $(document).ready(function () {
  162. var hash   = window.location.hash;
  163. hash = hash.substring(1)
  164.     $( ".faq-title" ).each(function( index ) {
  165.         if( hash == $( this ).attr('data-urltar') ){
  166.             // deplier l'élément
  167.             $( $(this).attr('data-target') ).removeClass('collapse') 
  168.             // scroll jusqu'a l'élément
  169.                 $('html,body').animate({
  170.                 scrollTop: $(this).offset().top - 50
  171.             }, 'slow');
  172.         } 
  173.     });
  174. });
  175. </script>
  176.        
  177. {% endblock %}