app/Resources/BaitPollBundle/views/Poll/fragments/radio.html.twig line 1

Open in your IDE?
  1. {% if question.randomAnswerOrder %}
  2.     {% set items = array_shuffle(question.answers.values) %}
  3. {% else %}
  4.     {% set items = question.answers %}
  5. {% endif %}
  6. <div class="mid-section-pb container">
  7.     <div class="visual-input flex flex-wrap justify-center gap-15 lg:gap-24">
  8.         {% for answer in items if answer.type == 'radio' %}
  9.             <div class="flex flex-col items-center">
  10.                 {% include 'BaitPollBundle:Poll:fragments/photo.html.twig' with {
  11.                     'photo': answer.photo,
  12.                     'source': answer.photoSource,
  13.                     'link': answer.photoSourceLink
  14.                 } %}
  15.                 {% if answer.embed %}
  16.                     <div class="embed-responsive embed-responsive-16by9 mb-15">
  17.                         <iframe class="embed-responsive__item" width="560" src="{{ answer.embed }}" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  18.                     </div>
  19.                 {% endif %}
  20.                 <div class="flex items-center gap-x-2 lg:gap-x-5 sm-text-card">
  21.                     <input
  22.                         type="radio"
  23.                         id="poll-{{poll.id}}-question-{{question.id}}-checkbox-{{loop.index}}"
  24.                         name="poll-{{poll.id}}-question-{{question.id}}-checkbox"
  25.                         value="{{answer.id}}"
  26.                         class="peer hidden"
  27.                         {% if answer.required %}required data-value-missing="Pred pokračovaním musíte zaškrtnúť toto pole."{% endif %}
  28.                     />
  29.                     <label
  30.                         for="poll-{{poll.id}}-question-{{question.id}}-checkbox-{{loop.index}}"
  31.                         class="flex items-center justify-center
  32.                                w-15 h-15 lg:w-25 lg:h-25
  33.                                border border-frDarkBlue
  34.                                rounded-full cursor-pointer bg-white
  35.                                peer-checked:border-frDarkBlue
  36.                                after:content-['']
  37.                                after:block
  38.                                after:w-9 after:h-9 lg:after:w-15 lg:after:h-15
  39.                                after:rounded-full after:bg-frMagenta
  40.                                after:scale-0 peer-checked:after:scale-100
  41.                                after:transition"
  42.                     ></label>
  43.                     <label
  44.                         for="poll-{{poll.id}}-question-{{question.id}}-checkbox-{{loop.index}}"
  45.                         class="cursor-pointer"
  46.                     >
  47.                         {{ answer.answer }}
  48.                     </label>
  49.                 </div>
  50.                 {% if answer.description %}
  51.                     <div class="mt-15 text-center sm-text-card">
  52.                         {{ answer.description|raw }}
  53.                     </div>
  54.                 {% endif %}
  55.             </div>
  56.         {% endfor %}
  57.     </div>
  58. </div>