templates/school/roomList.html.twig line 1

Open in your IDE?
  1. {% extends 'layout/frontEndLayout.html.twig' %}
  2. {% block name %}
  3.     Classrooms of Bethesda 
  4.     
  5. {% endblock %}
  6. {% block body %}
  7.     <div id="overviews" class="section wb">
  8.         <div class="container">
  9.             <div class="section-title row text-center">
  10.                 <div class="col-md-8 offset-md-2">
  11.                     <h1 class="card-title text-center">
  12.                         Liste des classes  et resultats aux examens officiels 2022-2023  
  13.                     </h1>
  14.                 </div>
  15.             </div>
  16.             <!-- end title -->
  17.             <hr class="invis">
  18.                             {% if  rooms|length > 0 %}
  19.                                 <div id="teachers" class="section wb">
  20.                                 {% for row in rooms|batch(4) %}
  21.                                 <div class="row">
  22.                                     {% for room in row %}
  23.                                         <div class="col-lg-4 col-md-6 col-12">
  24.                                                     <div class="course-item">
  25.                                                             <div class="image-blog">
  26.                                                                     {% if room.id in mainTeachersMap|keys %}
  27.                                                                  <img
  28.                                                                     src="{{  mainTeachersMap[room.id].avatar(75) }}" alt="" class="img-fluid"/>
  29.                                                                
  30.                                                                 {% else %}
  31.                                                                 <img src="{{ asset('assets/images/teacher_default.png') }}" alt="" class="img-fluid">
  32.                                                                 {% endif %}
  33.                                                             </div>
  34.                                                             <div class="course-br">
  35.                                                                 <div class="course-title">
  36.                                                                     <h2>
  37.                                                                         <a href="#" title="">
  38.                                                                             {{ room.name }}
  39.                                                                         </a>
  40.                                                                     </h2>
  41.                                                                 </div>
  42.                                                             
  43.                                                                 {% if  room.apc %}
  44.                                                                     {% set success = 0 %}
  45.                                                                     {% set candidats = 0 %}
  46.                                                                     <ul class="list-group">
  47.                                                                     {% for subscription in subscriptions %}
  48.                                                                     
  49.                                                                         {% if(subscription.classRoom.id == room.id) %}
  50.                                                                             {% set candidats = candidats + 1 %}
  51.                                                                             {% if subscription.officialExamResult != "0" %}
  52.                                                                                 {% set success = success + 1 %}
  53.                                                                             {% endif %}
  54.                                                                             <li class="list-group-item d-flex justify-content-between align-items-center row m-1">
  55.                                                                                 <div class="col-3">
  56.                                                                                 <img src="{{ (subscription.student.imageName ? asset('assets/images/student/'~ subscription.student.imageName ) : (subscription.student.gender ? asset('assets/images/student/female-default-avatar.jpg') : asset('assets/images/student/male-default-avatar.jpg'))) }}" alt="{{ subscription.student.lastname }}" class="img-fluid rounded-start">
  57.                                                                                 </div>
  58.                                                                                 <div class="col-3 ">
  59.                                                                                 
  60.                                                                                     <h5> {{subscription.student.lastname|title ~ subscription.student.firstname|title}} </h5>
  61.                                                                                 
  62.                                                                                 </div>
  63.                                                                                 <div class="col-3 ">
  64.                                                                                 
  65.                                                                                         <h5 class="text-muted"><b>{{subscription.verbalOfficialExamResult|lower}}</b></h5>
  66.                                                                                 
  67.                                                                                 </div>
  68.                                                                             </li>                                                               
  69.                                                                         {% endif %}
  70.                                                                     {% endfor %}
  71.                                                                     </ul>
  72.                                                                 
  73.                                                                     <div class="course-rating text-center">
  74.                                                                         {{ (100 * success / candidats)|round(2, 'floor') ~ "%"}}
  75.                                                                                                                                                                                         
  76.                                                                                                                                     
  77.                                                                         {#<i class="fa fa-star"></i>
  78.                                                                         <i class="fa fa-star"></i>
  79.                                                                         <i class="fa fa-star"></i>
  80.                                                                         <i class="fa fa-star"></i>
  81.                                                                         {% if success == candidats %}
  82.                                                                                     <i class="fa fa-star"></i>
  83.                                                                                 {% else %}
  84.                                                                                     <i class="fa fa-star-half"></i>
  85.                                                                         {% endif %}#}
  86.                                                                     
  87.                                                                     </div>
  88.                                                                 {% endif %}
  89.                                                             </div>
  90.                                                             <div class="course-meta-bot">
  91.                                                                 <ul>
  92.                                                                     <li>
  93.                                                                         <i class="fa fa-book" aria-hidden="true"></i>
  94.                                                                         {{ pluralize(room.modules|length, 'Module' , 'Modules') }}
  95.                                                                     </li>
  96.                                                                 </ul>
  97.                                                             </div>
  98.                                                     </div>  
  99.                                         </div>
  100.                                     <!-- end row -->
  101.                                     {% endfor %}
  102.                                 </div>
  103.                                 {% endfor %}
  104.                                 <div class="navigation  text-center h3 m-5">
  105.                                     {{ knp_pagination_render(rooms) }}
  106.                                 </div>
  107.                                 <!-- end container -->
  108.                                 {% else %}
  109.                                     <p class="mt-5 h1 text-center">
  110.                                         No classroom yet.       
  111.                                                                         
  112.                                         {% if is_granted("IS_AUTHENTICATED_REMEMBERED") %}
  113.                                             <a href="{{ path('admin_classrooms_new') }}">
  114.                                                 Be the first! 
  115.                                                                                     
  116.                                             </a>
  117.                                         {% endif %}
  118.                                     </p>
  119.                                 {% endif %}
  120.                  
  121.                 </div>
  122.             </div>
  123.         {% endblock %}
  124.