templates/evaluation/edit.html.twig line 1

Open in your IDE?
  1. {% extends "layout/backEndLayout.html.twig" %}
  2. {% form_theme edit_form 'bootstrap_4_layout.html.twig' %}
  3. {% block content %}
  4.   
  5.   <div class="row mt-4">
  6.                    
  7.                     <div class="col-12 jumbotron  mx-auto">
  8.                     
  9.                         <article class="text-center">
  10.                             <br/>
  11.                                 <div class="card-header">
  12.                                                 <h4 class="my-0 font-weight-normal text-center text-justify text-uppercase">  Modifier evaluation {{ evaluation.id }}  </h4>
  13.                                     </div>
  14.                                 <div class="example-wrapper">
  15.                                     <h1 class="center">Edition évaluation N°
  16.                                         {{evaluation.id}}
  17.                                         Sequence
  18.                                         {{evaluation.sequence.code}}
  19.                                         Cours
  20.                                         {{evaluation.classRoom.name}}
  21.                                         Cours
  22.                                         {{evaluation.course.wording}}</h1>
  23.                                     <div class="row">
  24.                                         <div class="col-lg-4 mar-bot30"></div>
  25.                                         <div class="col-lg-4 mar-bot30">
  26.                                             {{ form_start(edit_form) }}
  27.                                             {{ form_widget(edit_form) }}
  28.                                             
  29.                                         </div>
  30.                                         <div class="col-lg-4 mar-bot30"></div>
  31.                                     </div>
  32.                                     <div class="row">
  33.                                         <div class="col-lg-1 mar-bot30"></div>
  34.                                         <div class="col-lg-10 mar-bot30">
  35.                                             {% if students is defined %}
  36.                                                 <table class="table table-bordered table-hover table-sortable" id="tab_logic">
  37.                                                     <thead>
  38.                                                         <tr>
  39.                                                             <th class="text-center" style="width:10%;">Matricule</th>
  40.                                                             <th class="text-center" style="width:35%;">Nom et prénom</th>
  41.                                                             <th class="text-center" style="width:15%;">Note</th>
  42.                                                             <th class="text-center" style="width:25%;">Appréciation</th>
  43.                                                             <th class="text-center" style="width:10%;">Poids</th>
  44.                                                         </tr>
  45.                                                     </thead>
  46.                                                     <tbody>
  47.                                                         {% for student in students  %}
  48.                                                             <tr class="hidden" data-id="0" id='addr0'>
  49.                                                                 <td data-name="name">
  50.                                                                     {{student.matricule}}
  51.                                                                 </td>
  52.                                                                 <td data-name="name">
  53.                                                                     {{student.lastname}}
  54.                                                                     {{student.firstname}}
  55.                                                                 </td>
  56.                                                                 {% if marks[student.matricule] is defined %}
  57.                                                                     <td data-name="desc">
  58.                                                                         <input type="float" id="{{ student.matricule }}" placeholder="0...20" value="{{ marks[student.matricule].value }}" min="0" max="20" class="form-control value" name="{{student.matricule}}note"/>
  59.                                                                     </td>
  60.                                                                     <td data-name="desc">
  61.                                                                         <input type="text" value="{{marks[student.matricule].appreciation}}" placeholder="Appréciation" class="form-control appreciation" name="{{student.matricule}}appr"/>
  62.                                                                     </td>
  63.                                                                     <td data-name="desc">
  64.                                                                         <input type="text" value="{{marks[student.matricule].weight}}" placeholder="Poids" class="form-control appreciation" name="{{student.matricule}}weight"/>
  65.                                                                     </td>
  66.                                                                 {% else %}
  67.                                                                     <td data-name="desc">
  68.                                                                         <input type="float" id="{{ student.matricule }}" placeholder="0...20" value="0" min="0" max="20" class="form-control value" name="{{student.matricule}}note"/>
  69.                                                                     </td>
  70.                                                                     <td data-name="desc">
  71.                                                                         <input type="text" value="ABSCENT" placeholder="Appréciation" class="form-control appreciation" name="{{student.matricule}}appr"/>
  72.                                                                     </td>
  73.                                                                     <td data-name="desc">
  74.                                                                         <input type="text" value="0" placeholder="Poids" class="form-control appreciation" name="{{student.matricule}}weight"/>
  75.                                                                     </td>
  76.                                                                 {% endif %}
  77.                                                             </tr>
  78.                                                         {% endfor %}
  79.                                                     </tbody>
  80.                                                 </table>
  81.                                             {% endif %}
  82.                                         </div>
  83.                                         <div class="col-lg-1 mar-bot30"></div>
  84.                                     </div>
  85.                                     <div class="btn-group center record_actions">
  86.                                         <a class="btn btn-info" href="{{ path('admin_evaluations') }}">
  87.                                             <i class="fa fa-list"></i>
  88.                                             {{ 'Back to the list'|trans({}, 'admin') }}
  89.                                         </a>
  90.                                         <button class="btn btn-warning" type="submit">
  91.                                             <i class="fa fa-edit"></i>
  92.                                             {{ 'Update'|trans({}, 'admin') }}</button>
  93.                                         
  94.                                         
  95.                                     </div>
  96.                                 </div>
  97.                             
  98.                         </article>
  99.                     </div>
  100.             </div>
  101. {% endblock %}
  102. {% block javascripts %}
  103.                  {{parent()}} 
  104.     <script type="text/javascript" src="{{ asset('assets/js/jquery.js') }}"></script>
  105.     <script type="text/javascript">
  106.         $(function () {
  107.                 $("td input.value").change(function () {
  108.                 var note = $(this).val();
  109.                 note = parseInt(note);
  110.                  if (note >= 0 && note < 11) {
  111.                     $(this).parent().next().children().val("NA");
  112.                 }
  113.                 if (note >= 11 && note < 14) {
  114.                     $(this).parent().next().children().val("EA/IA");
  115.                 }
  116.                 if (note >= 14 && note < 17) {
  117.                     $(this).parent().next().children().val("A");
  118.                 }
  119.                 if (note >= 17 && note <= 20) {
  120.                     $(this).parent().next().children().val("E");
  121.                 }
  122.             });
  123.     });
  124.     </script>
  125. {% endblock javascripts %}