ui2022/schoolnow/review__schedule.html.twig line 1

Open in your IDE?
  1. {% set form = _args.form %}
  2. {% set picker = _args.picker is defined ? _args.picker : null %}
  3. {% form_theme form 'form_div_layout.html.twig' %}
  4. <div class="send-msg-radio-grp">
  5.     <div class="send-msg-radio-grp__block container-md">
  6.         <ul class="inline__list radiolist">
  7.             {% for child in form.children %}
  8.                 <li class="msg-send-input-block">
  9.                     <span class="custom-control custom-radio">
  10.                         {{ form_widget(child, {
  11.                             attr: {
  12.                                 class: 'custom-control-input',
  13.                             },
  14.                         }) }}
  15.                         {{ form_label(child, null, {
  16.                             label_attr: {
  17.                                 class: 'custom-control-label',
  18.                             },
  19.                         }) }}
  20.                     </span>
  21.                 </li>
  22.             {% endfor %}
  23.             {% if picker %}
  24.                 <li class="schedule-msg-datepicker-block {% if form.vars.data is same as(true) %}is-checked{% endif %}">
  25.                     {{ form_widget(picker) }}
  26.                 </li>
  27.             {% endif %}
  28.         </ul>
  29.     </div>
  30. </div>
  31. <script>
  32.     $(function () {
  33.         $('body').on('change', 'input:radio[name="{{ form.vars.full_name }}"]', function (e) {
  34.             var $target = $(e.currentTarget);
  35.             $('#{{ picker.vars.id }}').closest('li').toggleClass('is-checked', $target.val());
  36.             const $btn = $('#modal__send .crmsg__btngroup');
  37.             const $title = $('#modal__send .crmsg__title')
  38.             if ($target.val() === '1') {
  39.                 $('a[data-target="#modal__send"]').text('Schedule');
  40.                 $btn.html($btn.html().replace('Send', 'Schedule'));
  41.                 $title.html($title.html().replace('send', 'schedule'));
  42.             } else {
  43.                 $('a[data-target="#modal__send"]').text('Send');
  44.                 $btn.html($btn.html().replace('Schedule', 'Send'));
  45.                 $title.html($title.html().replace('schedule', 'send'));
  46.             }
  47.         });
  48.     });
  49. </script>