_modal.edit.html.twig 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. {% extends 'modal.html.twig' %}
  2. {% block title %}{% if mod %}Modifier{%else%}Ajouter{% endif %} une partie{% endblock %}
  3. {% block content %}
  4. {% if not party.isValidated %}
  5. <article class="message is-info">
  6. <div class="message-header">
  7. <p>Partie nécessitant une validation</p>
  8. </div>
  9. <div class="message-body">
  10. Cette partie a été proposée par {{ party.getSubmitter.fullName }} le {{ party.getSubmittedDate|date('d/m/y h:i', app_timezone) }}
  11. </div>
  12. </article>
  13. {% endif %}
  14. {{ form_errors(form) }}
  15. {{ form_start(form, {action: path(pathController, {id: slotStart.getId}), attr: {'data-turbo-frame': 'modal-content'}}) }}
  16. <div id="gamemaster-controller" class="field" {{ stimulus_controller('party_selector') }}>
  17. <label class="label">Meneur(euse) de jeu</label>
  18. <select id="party_gamemaster" name="party_gamemaster" class="input">
  19. <option value=""></option>
  20. {% for gamemaster in gamemasters %}
  21. <option value="{{ gamemaster.id }}" data-games="{{ gamemaster.getGamesCanMaster|map(game => game.getId)|join('|') }}"{% if party.getGamemaster == gamemaster %}selected='selected'{% endif %}>{{ gamemaster.getPreferedName() }}</option>
  22. {% endfor %}
  23. </select>
  24. </div>
  25. <div id="game-controller" class="field">
  26. <label class="label">Jeu de rôle</label>
  27. <select id="party_game" name="party_game" class="input">
  28. <option value=""></option>
  29. {% for game in games %}
  30. <option value="{{ game.id }}" {% if party.getGame == game %}selected='selected'{% else %}disabled{% endif %}>{{ game.getName() }}</option>
  31. {% endfor %}
  32. </select>
  33. </div>
  34. <div class="field">
  35. {{ form_widget(form.gamemasterIsAuthor) }}
  36. {{ form_label(form.gamemasterIsAuthor) }}
  37. {{ form_help(form.gamemasterIsAuthor) }}
  38. </div>
  39. {{ form_row(form.description) }}
  40. <div class="box">
  41. <div class="columns">
  42. <div class="column">
  43. {{ form_row(form.minParticipants) }}
  44. </div>
  45. <div class="column">
  46. {{ form_row(form.maxParticipants) }}
  47. </div>
  48. </div>
  49. </div>
  50. <div class="box">
  51. <div class="columns">
  52. <div class="column">
  53. <div class="field">
  54. <label class="label">Horaire de début</label>
  55. <select id="party_start_slot" name="party_start_slot" class="input">
  56. <option value="{{ slotStart.id }}" selected="selected">{{ slotStart.startOn|date('d/m/Y H:i', app_timezone) }}</option>
  57. </select>
  58. </div>
  59. </div>
  60. <div class="column">
  61. <div class="field">
  62. <label class="label">Horaire de fin</label>
  63. <select id="party_slots" name="party_slots" class="input">
  64. {% set SlotC = [] %}
  65. {% for slot in slotsAvailables %}
  66. {% set SlotC = SlotC|merge([slot.id]) %}
  67. <option value="{{ SlotC|join("|") }}" {% if slot == party.getSlots.last %}selected="selected"{% endif %}>{{ slot.endOn|date('d/m/Y H:i', app_timezone) }}</option>
  68. {% endfor %}
  69. </select>
  70. </div>
  71. </div>
  72. </div>
  73. </div>
  74. {{ form_widget(form) }}
  75. <div class="control">
  76. <button class="button is-primary" type="submit">Envoyer</button>
  77. {% if mod %}
  78. <a href="#" class="button" data-turbo="false">Déplacer</a>
  79. <a href="#" data-id="{{ path('app_party_delete', {id: party.getId}) }}" class="button is-danger" data-turbo="false" {{ stimulus_controller('admin_confirm') }}>Supprimer</a>
  80. {% endif %}
  81. {% if not party.isValidated %}
  82. <a href="{{ path('app_party_validate', {id: party.getId}) }}" class="button is-info" data-turbo="false">Valider la partie</a>
  83. {% endif %}
  84. </div>
  85. {{ form_end(form) }}
  86. {% endblock %}