Planning.html.twig 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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 planning-cell planning-cell-heading has-background-primary-light">
  10. Espaces
  11. </div>
  12. {% for space in event.getSpaces() %}
  13. <div class="cell planning-cell planning-cell-heading has-background-primary-light">
  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 has-background-primary-light">
  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. {# si le slot est Indisponible #}
  31. {% if thisSlot.unavailable %}
  32. {% if displayLocked %}
  33. <div class="cell planning-cell planning-cell-locked" data-id="{{ thisSlot.id }}">
  34. <div class="icon"><twig:ux:icon name="bi:lock-fill" /></div>
  35. </div>
  36. {% else %}
  37. <div class="cell planning-cell planning-cell-hidden">
  38. </div>
  39. {% endif %}
  40. {% endif %}
  41. {# si une partie est sur le slot #}
  42. {% if thisSlot.party %}
  43. {% if thisSlot.party.isValidated or displayUnvalidates %}
  44. {% if thisSlot == thisSlot.party.slots[0] %}
  45. {# Premier slot d'une partie ou partie non validée #}
  46. <div class="cell planning-cell planning-cell-game-parent">
  47. <div class="planning-cell-game" style="height: {{ thisSlot.party.slots|length * 4 }}rem !important">
  48. {# Carte "jeu" DEBUT #}
  49. <div class="card" style="height: {{ thisSlot.party.slots|length * 4 - 0.7 }}rem !important {% if not thisSlot.party.isValidated %}; filter:grayscale(1) opacity(0.3);{% endif %}">
  50. <div class="card-header">
  51. <div class="media">
  52. <div class="media-left">
  53. <figure class="image is-48x48">
  54. {% if pathFullSlot %}<a href="{{ path(pathFullSlot, {id: thisSlot.id}) }}" class="open-modal">{% endif %}
  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. {% if pathFullSlot %}</a>{% endif %}
  61. </figure>
  62. </div>
  63. </div>
  64. <div class="media-content">
  65. {% if pathFullSlot %}<a href="{{ path(pathFullSlot, {id: thisSlot.id}) }}" class="open-modal">{% endif %}<span class="title is-6">{{ thisSlot.party.game.name }}</span>{% if pathFullSlot %}</a>{% endif %}<br/>
  66. <small class="hax-text-grey-light">@{{ thisSlot.party.gamemaster.preferedName }}{% if thisSlot.party.gamemasterIsAuthor %}<br/><span class="tag is-info">animée par l'auteur</span>{% endif %}</small>
  67. </div>
  68. </div>
  69. <div class="card-content">
  70. <small>Places : {{ thisSlot.party.getSeatsLeft }} / {{ thisSlot.party.getMaxParticipants }}</small>
  71. </div>
  72. </div>
  73. {# Carte "jeu" FIN #}
  74. </div>
  75. </div>
  76. {% else %}
  77. {# Slot suivant d'une partie #}
  78. <div class="cell planning-cell planning-cell-game-parent">
  79. </div>
  80. {% endif %}
  81. {% else %}
  82. {# Partie non validée masquée #}
  83. <div class="cell planning-cell planning-cell-free">
  84. </div>
  85. {% endif %}
  86. {% endif %}
  87. {# si le slot est disponible et sans partie #}
  88. {% if not thisSlot.unavailable and not thisSlot.party %}
  89. {% if pathEmptySlot %}
  90. <a href="{{ path(pathEmptySlot, {id: thisSlot.id}) }}" class="open-modal">
  91. <div class="cell planning-cell planning-cell-free" data-id="{{ thisSlot.id }}">
  92. <div class="icon"><twig:ux:icon name="bi:plus-circle" /></div>
  93. </div>
  94. </a>
  95. {% else %}
  96. <div class="cell planning-cell planning-cell-free" data-id="{{ thisSlot.id }}">
  97. </div>
  98. {% endif %}
  99. {% endif %}
  100. {% endfor %}
  101. {% endfor %}
  102. {% endfor %}
  103. {# fin du block de grille #}
  104. </div>
  105. </div>
  106. </div>