templates/pages/sheet.html.twig line 1

Open in your IDE?
  1. {% extends "base.html.twig" %}
  2. {% block title %}{{ 'sheet.title'|trans }}{% endblock %}
  3. {% set meta_description = 'sheet.description'|trans %}
  4. {% block styles %}{{ encore_entry_link_tags('css/sheet') }}{% endblock %}
  5. {% set body_class = 'body-sheet' %}
  6. {% block body %}
  7. {% if name is defined and name|length %}
  8. <header>
  9.     <h1 id="title" class="title">{{ name }}</h1>
  10. </header>
  11. {% endif %}
  12. {% for data in groups %}
  13.     {% set team = data.team %}
  14.     {% set teamId = team.identifier %}
  15.     {% embed 'includes/details.html.twig' with {
  16.         open: teamId not in ['traveller', 'fabled'],
  17.         id: 'wrapper-' ~ teamId,
  18.         class: 'edition' ~ (data.characters|length ? '' : ' is-empty')
  19.     } %}
  20.         {% block summary %}
  21.         <span class="edition__heading-text">{{ team.name }}</span>
  22.         {% endblock %}
  23.         {% block body %}
  24.         <div id="team-{{ teamId }}" class="edition__team">
  25.             {% for character in data.characters %}
  26.                 <div class="edition__role">
  27.                     <p class="edition__name">{{ character.name }}</p>
  28.                     <div class="edition__icon">
  29.                         <img src="{{ character.image }}" alt="" class="edition__image" width="177" height="124" aria-hidden="true" loading="lazy">
  30.                     </div>
  31.                     <div class="edition__ability">{{ character.ability }}</div>
  32.                     <div class="edition__jinxes">
  33.                         {% for jinx in character.jinxes|default([]) %}
  34.                             {% if jinx.active|default(false) %}
  35.                                 <div class="edition__jinx">
  36.                                     <img src="{{ jinx.trick.image }}" alt="{{ 'sheet.jinx'|trans }}: {{ jinx.trick.name }}" title="{{ jinx.reason }}" width="177" height="124" loading="lazy">
  37.                                 </div>
  38.                             {% endif %}
  39.                         {% endfor %}
  40.                     </div>
  41.                 </div>
  42.             {% endfor %}
  43.         </div>
  44.         {% endblock %}
  45.     {% endembed %}
  46. {% endfor %}
  47. {% if jinxes|length %}
  48.     {% embed 'includes/details.html.twig' with {
  49.         open: true,
  50.         id: 'wrapper-jinx',
  51.         class: 'edition edition--jinx'
  52.     } %}
  53.         {% block summary %}
  54.         <span class="edition__heading-text">{{ 'jinxes.title'|trans }}</span>
  55.         {% endblock %}
  56.         {% block body %}
  57.             <div id="team-jinx" class="edition__team">
  58.                 {% for jinx in jinxes %}
  59.                     <div class="edition__role edition__role--jinx">
  60.                         <div class="edition__icon edition__icon--target">
  61.                             <img src="{{ jinx.target.image }}" alt="{{ jinx.target.name }}" width="177" height="124" loading="lazy">
  62.                         </div>
  63.                         <div class="edition__icon edition__icon--trick">
  64.                             <img src="{{ jinx.trick.image }}" alt="{{ jinx.trick.name }}" width="177" height="124" loading="lazy">
  65.                         </div>
  66.                         <div class="edition__ability">{{ jinx.reason }}</div>
  67.                     </div>
  68.                 {% endfor %}
  69.             </div>
  70.         {% endblock %}
  71.     {% endembed %}
  72. {% endif %}
  73. {% if nights is defined %}
  74.     {% embed 'includes/details.html.twig' with {
  75.         open: false,
  76.         id: 'wrapper-nights',
  77.         class: 'edition edition--nights'
  78.     } %}
  79.         {% block summary %}
  80.         <span class="edition__heading-text">{{ 'night_order.title'|trans }}</span>
  81.         {% endblock %}
  82.         {% block body %}
  83.             <div id="team-nights" class="edition__team">
  84.                 <div class="edition__row--nights">
  85.                     <h4>First Night:</h4>
  86.                     <div>
  87.                         {% for character in nights['first'] %}
  88.                             <div class="edition__role--nights">
  89.                                 <img src="{{ character.image }}" alt="{{ character.name }}" width="177" height="124" aria-hidden="true" loading="lazy">
  90.                                 <p>{{ character.name }}</p>
  91.                             </div>
  92.                         {% endfor %}
  93.                     </div>
  94.                 </div>
  95.                 <div class="edition__row--nights">
  96.                     <h4>Other Nights:</h4>
  97.                     <div>
  98.                         {% for character in nights['other'] %}
  99.                             <div class="edition__role--nights">
  100.                                 <img src="{{ character.image }}" alt="{{ character.name }}" width="177" height="124" aria-hidden="true" loading="lazy">
  101.                                 <p>{{ character.name }}</p>
  102.                             </div>
  103.                         {% endfor %}
  104.                     </div>
  105.                 </div>
  106.             </div>
  107.         {% endblock %}
  108.     {% endembed %}
  109. {% endif %}
  110. <p><small>{{ 'sheet.each_night'|trans }}</small></p>
  111. <div class="breakdown no-print">
  112.     <table class="breakdown__table">
  113.         <caption class="sr-only">{{ 'sheet.breakdown'|trans }}</caption>
  114.         <tbody>
  115.             {% for group, count in breakdown %}
  116.                 {% set isPlayers = loop.first %}
  117.                 <tr class="breakdown__row breakdown__row--{{ group }}">
  118.                     <th scope="row" class="breakdown__heading">{{ ('groups.' ~ group)|trans }}</th>
  119.                     {% for count in count %}
  120.                         {% if isPlayers %}
  121.                             <th scope="col" class="breakdown__cell">{{ loop.last ? 'sheet.count_plus'|trans({ '%count%': count }) : count }}</th>
  122.                         {% else %}
  123.                             <td class="breakdown__cell">{{ count }}</td>
  124.                         {% endif %}
  125.                     {% endfor %}
  126.                 </tr>
  127.             {% endfor %}
  128.         </tbody>
  129.     </table>
  130. </div>
  131. <footer>
  132.     <p><button type="button" class="button" data-dialog="#qr-code-dialog">{{ 'sheet.get_qr_code'|trans }}</button></p>
  133.     <form id="locale-form" class="locale-form locale-form--sheet">
  134.         <label for="select-locale" class="locale-form__label">
  135.             <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512" aria-labelledby="language-icon" class="locale-form__label-icon"><!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><title id="language-icon">{{ 'setup.buttons.language'|trans }}</title><path style="fill: currentColor;" d="M0 128C0 92.7 28.7 64 64 64H256h48 16H576c35.3 0 64 28.7 64 64V384c0 35.3-28.7 64-64 64H320 304 256 64c-35.3 0-64-28.7-64-64V128zm320 0V384H576V128H320zM178.3 175.9c-3.2-7.2-10.4-11.9-18.3-11.9s-15.1 4.7-18.3 11.9l-64 144c-4.5 10.1 .1 21.9 10.2 26.4s21.9-.1 26.4-10.2l8.9-20.1h73.6l8.9 20.1c4.5 10.1 16.3 14.6 26.4 10.2s14.6-16.3 10.2-26.4l-64-144zM160 233.2L179 276H141l19-42.8zM448 164c11 0 20 9 20 20v4h44 16c11 0 20 9 20 20s-9 20-20 20h-2l-1.6 4.5c-8.9 24.4-22.4 46.6-39.6 65.4c.9 .6 1.8 1.1 2.7 1.6l18.9 11.3c9.5 5.7 12.5 18 6.9 27.4s-18 12.5-27.4 6.9l-18.9-11.3c-4.5-2.7-8.8-5.5-13.1-8.5c-10.6 7.5-21.9 14-34 19.4l-3.6 1.6c-10.1 4.5-21.9-.1-26.4-10.2s.1-21.9 10.2-26.4l3.6-1.6c6.4-2.9 12.6-6.1 18.5-9.8l-12.2-12.2c-7.8-7.8-7.8-20.5 0-28.3s20.5-7.8 28.3 0l14.6 14.6 .5 .5c12.4-13.1 22.5-28.3 29.8-45H448 376c-11 0-20-9-20-20s9-20 20-20h52v-4c0-11 9-20 20-20z"/></svg>
  136.         </label>
  137.         <select name="select-locale" id="select-locale" class="locale-form__dropdown" data-no-store>
  138.             {% set params = { characters: app.request.get('characters') } %}
  139.             {% if app.request.get('name') is not empty %}
  140.                 {% set params = params|merge({ name: app.request.get('name') }) %}
  141.             {% endif %}
  142.             {% if app.request.get('game') is not empty %}
  143.                 {% set params = params|merge({ game: app.request.get('game') }) %}
  144.             {% endif %}
  145.             {% if app.request.get('traveller') is not empty %}
  146.                 {% set params = params|merge({ traveller: app.request.get('traveller') }) %}
  147.             {% endif %}
  148.             {% if app.request.get('fabled') is not empty %}
  149.                 {% set params = params|merge({ fabled: app.request.get('fabled') }) %}
  150.             {% endif %}
  151.             {% for locale in locales() %}
  152.                 <option value="{{ path('sheet', params|merge({ '_locale': locale[0] })) }}" lang="{{ locale[0]|replace({ '_': '-' }) }}" dir="{{ locale[0] in ['he_IL'] ? 'rtl' : 'ltr' }}" {{ app.request.locale == locale[0] ? 'selected' }}>{{ locale[1] }}</option>
  153.             {% endfor %}
  154.         </select>
  155.         <button type="submit" class="button locale-form__action">
  156.             <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" aria-labelledby="tick-icon" class="locale-form__icon"><!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><title id="tick-icon">{{ 'setup.buttons.set_language'|trans }}</title><path style="fill: currentColor;" d="M438.6 105.4C451.1 117.9 451.1 138.1 438.6 150.6L182.6 406.6C170.1 419.1 149.9 419.1 137.4 406.6L9.372 278.6C-3.124 266.1-3.124 245.9 9.372 233.4C21.87 220.9 42.13 220.9 54.63 233.4L159.1 338.7L393.4 105.4C405.9 92.88 426.1 92.88 438.6 105.4H438.6z"/></svg>
  157.         </button>
  158.     </form>
  159.     <p><small>{{ 'sheet.credit'|trans|raw }}</small></p>
  160. </footer>
  161. {% embed 'includes/dialog.html.twig' with {
  162.     id: 'qr-code-dialog',
  163.     background: 'blur',
  164.     title: 'sheet.get_sheet'|trans
  165. } %}
  166.     {% block body %}
  167.         <div id="qr-code" class="qr"></div>
  168.     {% endblock %}
  169. {% endembed %}
  170. {% endblock %}
  171. {% block javascript %}
  172. {{ encore_entry_script_tags('js/sheet') }}
  173. {% endblock %}