Planning.html.twig 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. {# Template pour les plannings #}
  2. {% set cols = event.getSpaces()|length +1 %}
  3. {# début du block de grille #}
  4. <div class="block">
  5. {# Nombre de colonnes = nombre d'espaces + colonne d'intro #}
  6. <div class="fixed-grid has-{{ cols }}-cols">
  7. <div class="grid is-gap-0">
  8. {# en-tête avec les noms des espaces #}
  9. <div class="cell is-coll-start planning-cell planning-cell-heading">
  10. Espaces
  11. </div>
  12. {% for space in event.getSpaces() %}
  13. <div class="cell planning-cell planning-cell-heading">
  14. {{ space.name }}
  15. </div>
  16. {% endfor %}
  17. {# On ajoute les horaires période par période #}
  18. {% for period in event.getPeriods() %}
  19. <div class="cell planning-cell planning-cell-wide is-col-span-{{ cols }}">
  20. Période du {{ period.startOn|date('d/m/Y H:i', app_timezone) }} à {{ period.endOn|date('H:i', app_timezone) }}
  21. </div>
  22. {# On affiche tous les slots de la période, space par space #}
  23. {% for dateRef in this.getDateOrdered(period) %}
  24. <div class="cell planning-cell planning-cell-heading">
  25. {{ dateRef|date('H:i', app_timezone) }}
  26. </div>
  27. {% for space in event.getSpaces() %}
  28. {# extraction du slot de cet espace, ce moment et cette période #}
  29. {# set thisSlot = this.getThisSlot(dateRef, space, period) #}
  30. {% set thisSlot = this.getThisSlotInfo(dateRef, space, period) %}
  31. {# si le slot est Indisponible #}
  32. {% if thisSlot.unavailable %}
  33. {% if displayLocked %}
  34. <div class="cell planning-cell planning-cell-locked has-text-centered" data-id="{{ thisSlot.id }}">
  35. <div class="icon"><twig:ux:icon name="bi:lock-fill" /></div>
  36. </div>
  37. {% else %}
  38. <div class="cell planning-cell planning-cell-locked">
  39. </div>
  40. {% endif %}
  41. {% endif %}
  42. {# si une partie est sur le slot #}
  43. {% if thisSlot.party %}
  44. {% if thisSlot.party.isValidated or displayUnvalidates %}
  45. {% if thisSlot == thisSlot.party.slots[0] %}
  46. {# Premier slot d'une partie ou partie non validée #}
  47. <div class="cell planning-cell planning-cell-game-parent">
  48. <div class="planning-cell-game {% if thisSlot.party.getSeatsLeft < 1 %}planning-cell-game-isfull {% endif %}{% if pathFullSlot %} open-modal" href="{{ path(pathFullSlot, {id: thisSlot.id}) }}"{% else %}"{% endif %} style="height: {{ thisSlot.party.slots|length * 4 * app_hmult }}rem !important">
  49. {# Carte "jeu" DEBUT #}
  50. <div class="card has-background-primary-45 has-text-primary-45-invert" style="{% if thisSlot.party.game.picture %}background-image: url('/images/games/{{ thisSlot.party.game.picture }}');{% endif %} height: {{ thisSlot.party.slots|length * 4 * app_hmult - 0.7 }}rem !important; {% if not thisSlot.party.isValidated %}filter:grayscale(1) opacity(0.3);{% endif %};">
  51. <div class="card-header">
  52. <div class="media">
  53. <div class="media-left">
  54. <figure class="image is-48x48">
  55. {% if thisSlot.party.gamemaster.picture %}
  56. <img class="is-rounded" src="/images/gamemasters/{{ thisSlot.party.gamemaster.picture }}" />
  57. {% else %}
  58. <twig:ux:icon name="bi:person-fill"/>
  59. {% endif %}
  60. </figure>
  61. </div>
  62. </div>
  63. <div class="media-content">
  64. <small class="hax-text-grey-light">{{ thisSlot.party.gamemaster.preferedName }}</small><br/>
  65. <span class="title is-6 has-text-primary-45-invert">{{ thisSlot.party.game.name }}</span>
  66. </div>
  67. </div>
  68. <div class="card-content">
  69. <p><span class="tag is-dark m-1">Places : {{ thisSlot.party.getSeatsLeft }}/{{ thisSlot.party.getMaxParticipants }}</span></p>
  70. {% if thisSlot.party.gamemasterIsAuthor %}<p><span class="tag is-warning m-1">partie animée par l'auteur</span></p>{% endif %}
  71. <p>{% for genre in thisSlot.party.game.genre %}<span class="tag is-info m-1">{{ genre.genre }}</span>{% endfor %}</p>
  72. </div>
  73. {% if pathFullSlot %}</a>{% endif %}
  74. </div>
  75. {# Carte "jeu" FIN #}
  76. </div>
  77. </div>
  78. {% else %}
  79. {# Slot suivant d'une partie #}
  80. <div class="cell planning-cell planning-cell-game-parent">
  81. </div>
  82. {% endif %}
  83. {% else %}
  84. {# Partie non validée masquée #}
  85. <div class="cell planning-cell planning-cell-free">
  86. </div>
  87. {% endif %}
  88. {% endif %}
  89. {# si le slot est disponible et sans partie #}
  90. {% if not thisSlot.unavailable and not thisSlot.party %}
  91. {% if pathEmptySlot %}
  92. <a href="{{ path(pathEmptySlot, {id: thisSlot.id}) }}" class="open-modal">
  93. <div class="cell planning-cell planning-cell-free has-text-centered" data-id="{{ thisSlot.id }}">
  94. <div class="icon"><twig:ux:icon name="bi:plus-circle" /></div>
  95. </div>
  96. </a>
  97. {% elseif displayLocked %}
  98. <div class="cell planning-cell planning-cell-free has-text-centered" data-id="{{ thisSlot.id }}">
  99. <div class="icon"><twig:ux:icon name="bi:unlock-fill" /></div>
  100. </div>
  101. {% else %}
  102. <div class="cell planning-cell planning-cell-free" data-id="{{ thisSlot.id }}">
  103. </div>
  104. {% endif %}
  105. {% endif %}
  106. {% endfor %}
  107. {% endfor %}
  108. {% endfor %}
  109. {# fin du block de grille #}
  110. </div>
  111. </div>
  112. </div>