_modal.add.html.twig 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. {% extends 'modal.html.twig' %}
  2. {% block title %}{{ party.game.name }}{% endblock %}
  3. {% block header %}
  4. {% if party.getGame.getPicture %}
  5. <section class="modal-card-image">
  6. <figure class="image is-3by1">
  7. <img
  8. src="/images/games/{{ party.getGame.getPicture }}"
  9. alt="{{ party.getGame.getName }}"
  10. />
  11. </figure>
  12. </section>
  13. {% endif %}
  14. {% endblock %}
  15. {% block content %}
  16. <div class="content">
  17. <div class="block">
  18. <p class="has-text-centered">{{ party.getStartOn|date('d/m/Y \\d\\e H:i', app_timezone)}} à {{ party.getEndOn|date('H:i', app_timezone)}} • {{ party.getSlots.first.getSpace.getName }}</p>
  19. </div>
  20. </div>
  21. <div class="tabs is-boxed" {{ stimulus_controller('bulma_tabs') }}>
  22. <ul>
  23. <li class="is-active" data-id="tab-1"><a>Le jeu</a></li>
  24. <li data-id="tab-2"><a>Le(a) MJ</a></li>
  25. {% if party.getDescription %}<li data-id="tab-3"><a>Le scénario</a></li>{% endif %}
  26. {% if party.getSeatsLeft > 0 %}{% if party.getEndOn > date() or is_granted('ROLE_MANAGER') %}<li data-id="tab-4"><a>S'incrire</a></li>{% endif %}{% endif %}
  27. </ul>
  28. </div>
  29. <div id="tabs-content">
  30. <div class="container" id="tab-1">
  31. <div class="block">
  32. <p>{{ party.getGame.getDescription }}</p>
  33. </div>
  34. <div class="block">
  35. <div class="message is-info">
  36. <div class="message-header">
  37. <p>À propos du jeu</p>
  38. </div>
  39. <div class="message-body">
  40. <ul>
  41. {% if party.gamemasterIsAuthor %}<li class="has-text-danger"><strong>Partie animée par son auteur(rice)</strong></li>{% endif %}
  42. <li><strong>Âge recommandé : </strong>{{ party.getGame.getAgeRecommendationLabel }}</li>
  43. <li><strong>Genres : </strong>{{ party.getGame.getGenre|map(g => g.genre)|join(', ') }}</li>
  44. </ul>
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. <div class="container is-hidden" id="tab-2">
  50. <article class="media">
  51. <figure class="media-left">
  52. <p class="image is-128x128">
  53. {% if party.getGamemaster.picture %}
  54. <img class="is-rounded" src="/images/gamemasters/{{ party.getGamemaster.picture }}" />
  55. {% else %}
  56. <twig:ux:icon name="bi:person-fill"/>
  57. {% endif %}
  58. </p>
  59. </figure>
  60. <div class="media-content">
  61. <div class="content">
  62. <h4>{{ party.getGamemaster.getPreferedName }}{% if party.gamemasterIsAuthor %} / auteur(rice) du jeu{% endif %}</h4>
  63. <p>
  64. {{ party.getGamemaster.description }}
  65. </p>
  66. </div>
  67. </div>
  68. </article>
  69. </div>
  70. {% if party.getDescription %}
  71. <div class="container is-hidden" id="tab-3">
  72. <p>{{ party.getDescription }}</p>
  73. </div>
  74. {% endif %}
  75. {% if party.getSeatsLeft > 0 %}
  76. {% if party.getEndOn > date() or is_granted('ROLE_MANAGER') %}
  77. <div class="container is-hidden" id="tab-4">
  78. {{ form_errors(form) }}
  79. {{ form_start(form, {action: path(pathController, {id: party.slots.first.getId}), attr: {'data-turbo-frame': 'modal-content'}}) }}
  80. {{ form_row(form.participantName) }}
  81. {{ form_row(form.participantEmail) }}
  82. {{ form_row(form.participantPhone) }}
  83. <div class="field">
  84. {{ form_widget(form.consentMail) }}
  85. {{ form_label(form.consentMail) }}
  86. </div>
  87. <div class="field">
  88. {{ form_widget(form.consentImage) }}
  89. {{ form_label(form.consentImage) }}
  90. {{ form_help(form.consentImage) }}
  91. </div>
  92. {% if party.getSeatsLeft > 1 %}
  93. <div class="box">
  94. <div class="block">
  95. <h3 class="title is-6">Participation de groupe</h3>
  96. <p>Si des joueur(euse)s vous accompagnent sur cette partie, inscrivez simplement leurs noms ci-dessous.</p>
  97. </div>
  98. <div class="block">
  99. {% for i in 2..party.getSeatsLeft %}
  100. <div class="field">
  101. <label class="label">Accompagnant(e) {{ i-1 }}</label>
  102. <input id="party_more_{{ i-1 }}" name="party_more[{{ i-1 }}]" class="input" type="text" />
  103. </div>
  104. {% endfor %}
  105. </div>
  106. </div>
  107. {% endif %}
  108. {{ form_widget(form)}}
  109. <div class="control">
  110. <button class="button is-primary" type="submit">Envoyer</button>
  111. </div>
  112. {{ form_end(form) }}
  113. </div>
  114. {% endif %}
  115. {% endif %}
  116. </div>
  117. {% endblock %}