templates/componentes/nota_corte/componente.html.twig line 1

Open in your IDE?
  1. <div class="button-group button-label right" id="box-avaliados">
  2.     <label class="bg-white"> <i class="fal fa-tally mr-2 text-color"></i> Nota de Corte </label>
  3.     <a href="#" class="bg-white dropdown">
  4.         <span class="text-default">{{ nota_corte }}</span>
  5.         <i class="fa fa-fw fa-angle-down ml-2"></i>
  6.     </a>
  7.     <form action="{{ path('nota-corte_processa') }}" class="js-prevent-close dropdown-list" method="POST">
  8.         <div class="p-2" style="min-width:200px;">
  9.             <div class="pb-2 mb-2 border-bottom">
  10.                 <input type="number" class="input js-nota-corte" placeholder="0 - {{ evs ? 5 : 100 }}" data-from="{{ nota_corte }}" value="{{ nota_corte }}" data-min="0" data-max="{{ evs ? 5 : 100 }}" data-step="{{ evs ? 0.01 : 1 }}" data-postfix="{{ evs ? '' : '%' }}" name="nota_corte">
  11.             </div>
  12.             <div class="text-right">
  13.                 <button type="submit" class="button sm"> Aplicar </button>
  14.             </div>
  15.         </div>
  16.     </form>
  17. </div>    
  18. <script>
  19.     $(document).on({
  20.         "click": function(e){
  21.             e.stopPropagation();
  22.         },
  23.         "submit": function(e){
  24.             e.preventDefault();
  25.             loading(true);
  26.             var path = $(this).attr("action");
  27.             var nota_corte = $(this).find(".js-nota-corte").val();
  28.             $.post(path, {'nota_corte': nota_corte }, function (response) {
  29.                 if ( response.sucesso === true ) {
  30.                     window.location.reload();
  31.                 } else {
  32.                     loading(false);
  33.                     $.alert({
  34.                         // icon: 'fa fa-warning',
  35.                         title: "Erro",
  36.                         content: response.mensagem,
  37.                         type: "red",
  38.                         buttons: {
  39.                             ok: {
  40.                                 text: 'OK',
  41.                                 btnClass: 'button red',
  42.                                 keys: ['enter', 'esc']
  43.                             }
  44.                         }
  45.                     });    
  46.                 }
  47.             });
  48.         }
  49.     },".js-prevent-close");
  50.     $(".js-nota-corte").ionRangeSlider();
  51. </script>