templates/vote/vote.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block title %}Vote Machine - {{ event.Name }}{% endblock %}
  3. {% block header %}
  4.     {% include 'header.html.twig' with user %}
  5. {% endblock %}
  6. {% block sidebar %}
  7.     {% include 'sidebar.html.twig' with user %}
  8. {% endblock %}
  9. {% block body %}
  10.     {% set imageURLS = [] %}
  11.     {% set websites = [] %}
  12.     {% if voteItem.Vendor.imageURLS|length > 0 %}
  13.         {% set imageURLS = voteItem.Vendor.imageURLS|split("\n") %}
  14.     {% endif %}
  15.     {% if voteItem.Vendor.website|length > 0 %}
  16.         {% set websites = voteItem.Vendor.website|split(",")  %}
  17.     {% endif %}
  18.     <div class="row col-12 d-flex align-items-center justify-content-center pt-5">
  19.         <div class="card col-12" id="register-staff-screen">
  20.             <div class="card-header row">
  21.                     <div class="col-11">
  22.                         <h1 class="h3 mb-3 font-weight-normal">Vote Machine - {{ event.Name }} [{{ event.TableCategory }}]</h1>
  23.                     </div>
  24.                     <div class="col-1">
  25.                         <span class="fa-layers fa-fw fa-3x">
  26.                             <i class="fas fa-circle {% if remainingVotes <= 10 %}text-danger{% elseif remainingVotes <= 35 %}text-warning{% else %}text-success{%endif %}"></i>
  27.                             <i class="fas fa-box-ballot" data-fa-transform="shrink-6"></i>
  28.                             <span class="fa-layers-text fa-inverse" data-fa-transform="shrink-8" title="Votes Remaining">{{ remainingVotes }}</span>
  29.                             <input type="hidden" id="total-votes-remaining" value="{{ remainingVotes }}">
  30.                             <input type="hidden" id="current-vote-value" value="{{ voteForm.Votes.vars.value }}">
  31.                         </span>
  32.                     </div>
  33.             </div>
  34.             <div class="card-body">
  35.                 <div class="row">
  36.                     <h1>{{ voteItem.Vendor.Name }}</h1>
  37.                 </div>
  38.                 <div class="row">
  39.                     <div class="col-4">
  40.                         <div class="row">
  41.                             <table class="table table-striped col-12">
  42.                                 <tr>
  43.                                     <td class="text-bold">Contact</td>
  44.                                     <td>{{ voteItem.Vendor.vendorContact.firstName }} {{ voteItem.Vendor.vendorContact.lastName }} [{{ voteItem.Vendor.vendorContact.badgeName }}]</td>
  45.                                 </tr>
  46.                                 <tr>
  47.                                     <td class="text-bold">Products/Services</td>
  48.                                     <td>{{ voteItem.Vendor.productsAndServices }}</td>
  49.                                 </tr>
  50.                                 <tr>
  51.                                     <td class="text-bold">Rating</td>
  52.                                     <td>{{ voteItem.Vendor.rating }}
  53.                                         {% if voteItem.Vendor.isMature %}
  54.                                             <i class="fad fa-siren text-danger" title="Adult Content"></i>
  55.                                         {% endif %}
  56.                                     </td>
  57.                                 </tr>
  58.                                 <tr>
  59.                                     <td class="text-bold">Table Type</td>
  60.                                     <td>{{ voteItem.Vendor.tableRequestType }}</td>
  61.                                 </tr>
  62.                                 <tr>
  63.                                     <td class="text-bold">Website</td>
  64.                                     <td>
  65.                                         <ul>
  66.                                             {% for web in websites %}
  67.                                                 {% if 'http' not in web|trim %}
  68.                                                     {% set web = 'https://' ~ web|trim %}
  69.                                                 {% endif %}
  70.                                                 {% set disp = web %}
  71.                                                 {% if web|length > 30 %}
  72.                                                     {% set disp = 'Website' %}
  73.                                                 {% endif %}
  74.                                                 <li><a href="{{ web|trim }}" target="_blank">{{ disp }}</a></li>
  75.                                             {% endfor %}
  76.                                         </ul>
  77.                                     </td>
  78.                                 </tr>
  79.                                 {% if imageURLS|length > 0 %}
  80.                                 <tr>
  81.                                     <td class="text-bold">Other Links</td>
  82.                                     <td>
  83.                                         <ul>
  84.                                             {% set imgcnt = 1 %}
  85.                                             {% for iu in imageURLS %}
  86.                                                 {% if 'http' not in iu|trim %}
  87.                                                     {% set iu = 'https://' ~ iu|trim %}
  88.                                                 {% endif %}
  89.                                                 {% set disp = iu|trim %}
  90.                                                 {% if disp|length > 30 %}
  91.                                                     {% set disp = 'Image ' ~ imgcnt %}
  92.                                                     {% set imgcnt = imgcnt + 1 %}
  93.                                                 {% endif %}
  94.                                                 <li><a href="{{ iu|trim }}" target="_blank">{{ disp }}</a></li>
  95.                                             {% endfor %}
  96.                                         </ul>
  97.                                     </td>
  98.                                 </tr>
  99.                                 {% endif %}
  100.                                 <tr>
  101.                                     <td class="text-bold">Categories</td>
  102.                                     <td>
  103.                                         {% for cat in voteItem.Vendor.vendorCategories %}
  104.                                             {{ cat.category }}{% if cat.isPrimary %}<i class="fas fa-star text-warning"></i>{% endif %}<br/>
  105.                                         {% endfor %}
  106.                                     </td>
  107.                                 </tr>
  108.                                 <tr>
  109.                                     <td class="text-bold">Notes</td>
  110.                                     <td>
  111.                                         {% for note in voteItem.Vendor.vendorNotes %}
  112.                                             <div class="row p-2 mb-1 me-3 note-{{ note.type }}">{{ note.message }}</div>
  113.                                         {% endfor %}
  114.                                     </td>
  115.                                 </tr>
  116.                             </table>
  117.                         </div>
  118.                         <div>
  119.                             {{ form_start(voteForm) }}
  120.                             {{ form_widget(voteForm.isSkip) }}
  121.                             <div class="row vote-row">
  122.                                 <div class="col-2"><a class="btn btn-secondary btn-block {% if prevID is empty %}disabled{% endif %}" href="/vote/{{ event.id }}/{{ prevID }}"><i class="fas fa-backward fa-2x" title="Previous"></i></a></div>
  123.                                 <div class="col-4">
  124.                                     <div class="row">
  125.                                         {{ form_widget(voteForm.Votes) }}
  126.                                     </div>
  127.                                     <div class="row text-center">
  128.                                        # Votes
  129.                                     </div>
  130.                                 </div>
  131.                                 <div class="col-2"><button type="submit" class="btn btn-primary btn-block" id="vote-submit-button"><i class="fas fa-vote-yea fa-2x" title="Submit Votes"></i></button></div>
  132.                                 <div class="col-2"><button type="button" class="btn btn-warning btn-block" id="vote-skip-button"><i class="far fa-comment fa-2x" title="Skip Vendor"></i></button></div>
  133.                                 <div class="col-2"><a class="btn btn-secondary btn-block {% if nextID is empty %}disabled{% endif %}" href="/vote/{{ event.id }}/{{ nextID }}"><i class="fas fa-forward fa-2x" title="Next"></i></a></div>
  134.                             </div>
  135.                             <div id="vote-alert" class="row"></div>
  136.                             {{ form_end(voteForm) }}
  137.                         </div>
  138.                     </div>
  139.                     <div class="col offset-1">
  140.                         {% set slideID = 0 %}
  141.                         <div id="vendor-image-carousel" class="carousel">
  142.                             {% set slideID = 0 %}
  143.                             <div class="carousel-inner">
  144.                                 {% if voteItem.Vendor.vendorImages|length > 0 %}
  145.                                     <div class="carousel-item {% if slideID == 0 %} active{% endif %}" aria-current="{% if slideID == 0 %}true{% else %}false{% endif %}">
  146.                                         <div class="row">
  147.                                             {% for vi in voteItem.Vendor.vendorImages %}
  148.                                                 {% set imgs = vi.imagePath|split('/') %}
  149.                                                 {% set img = imgs|slice(-1)|join('/') %}
  150.                                                 {% set imgPath = imgs|slice(-2)|join('/') %}
  151.                                                 <div class="col-3">
  152.                                                     <img src="/vendorImages/{{ imgPath }}" class="img-fluid" alt="{{ img }}"/>
  153.                                                 </div>
  154.                                             {% endfor %}
  155.                                         </div>
  156.                                     </div>
  157.                                     {% set slideID = slideID+1 %}
  158.                                 {% endif %}
  159.                                 {% if websites|length > 0 %}
  160.                                     {% for web in websites %}
  161.                                         <div class="carousel-item {% if slideID == 0 %}active{% endif %}" aria-current="{% if slideID == 0 %}true{% else %}false{% endif %}">
  162.                                             <iframe sandbox="allow-same-origin" width="100%" height="500" src="{% if 'http' not in web|trim %}https://{% endif %}{{ web|trim }}"></iframe>
  163.                                         </div>
  164.                                         {% set slideID = slideID+1 %}
  165.                                     {% endfor %}
  166.                                 {% endif %}
  167.                                 {% if imageURLS|length > 0 %}
  168.                                     {% for iu in imageURLS %}
  169.                                         <div class="carousel-item {% if slideID == 0 %}active{% endif %}" aria-current="{% if slideID == 0 %}true{% else %}false{% endif %}">
  170.                                             <embed width="100%" height="500" src="{% if 'http' not in iu %}https://{% endif %}{{ iu }}"></embed>
  171.                                         </div>
  172.                                         {% set slideID = slideID+1 %}
  173.                                     {% endfor %}
  174.                                 {% endif %}
  175.                             </div>
  176.                             <div class="carousel-indicators" style="background-color: rgba(0,0,0,.25);">
  177.                                 {% for si in 0..slideID-1 %}
  178.                                     <button type="button" data-bs-target="#vendor-image-carousel" data-bs-slide-to="{{ si }}" {% if si == 0 %}class='active'{% endif %} aria-current="{% if si == 0 %}true{% else %}false{% endif %}" aria-label="" class="btn btn-sm btn-secondary"></button>
  179.                                 {% endfor %}
  180.                             </div>
  181.                             <button class="carousel-control-prev" type="button" data-bs-target="#vendor-image-carousel" data-bs-slide="prev">
  182.                                 <i class="fas fa-caret-left fa-4x" aria-hidden="true"></i>
  183.                                 <span class="visually-hidden">Previous</span>
  184.                             </button>
  185.                             <button class="carousel-control-next" type="button" data-bs-target="#vendor-image-carousel" data-bs-slide="next">
  186.                                 <i class="fas fa-caret-right fa-4x" aria-hidden="true"></i>
  187.                                 <span class="visually-hidden">Next</span>
  188.                             </button>
  189.                         </div>
  190.                     </div>
  191.                 </div>
  192.             </div>
  193.             <div class="card-footer row">
  194.                 <div class="col-12">
  195.                     {% for item in items %}
  196.                         <a class="item-bubble small m-1 {%  if item.Votes > 0 %}item-voted{% elseif item.isSkip == true %}item-skip{% elseif voteItem.Vendor.id == item.Vendor.id %}item-current{% endif %}" href="/vote/{{ event.id }}/{{ item.Vendor.id }}">{{ item.Vendor.Name|slice(0,1) }}</a>
  197.                     {% endfor %}
  198.                 </div>
  199.             </div>
  200.         </div>
  201.     </div>
  202. {% endblock %}