form.html.twig 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. {% set classLi = "list-group-item mb-3" %}
  2. {{ form_start(form, {'attr': {'class': ''} }) }}
  3. <div class="container-fluid">
  4. <div class="row">
  5. <div class="col-md">
  6. {% form_theme form 'bootstrap_5_horizontal_layout.html.twig' %}
  7. <div class="form-group">
  8. {{ form_row(form.titre) }}
  9. {{ form_row(form.annee) }}
  10. {{ form_row(form.lien) }}
  11. {{ form_row(form.dateSortie) }}
  12. {% form_theme form 'bootstrap_5_layout.html.twig' %}
  13. {{ form_row(form.information) }}
  14. {#
  15. {{ form_label(form.mediaVideo, 'Bande annonce') }}
  16. {{ form_errors(form.mediaVideo) }}
  17. {{ form_widget(form.mediaVideo) }}
  18. #}
  19. </div>
  20. <div class="">
  21. <div class="card mb-3">
  22. <div class="card-header">
  23. {{ form_label(form.mediaVideos, 'Bandes annonces') }}
  24. </div>
  25. <div class="card-body">
  26. <button type="button" id="add_media-video" class="btn btn-link add_item_link mb-3" data-collection-holder-id="media-video">Ajouter une bande annonce</button>
  27. <ul id="media-video" class="collection-form ps-0"
  28. data-index="{{ form.mediaVideos|length > 0 ? form.mediaVideos|last.vars.name + 1 : 0 }}"
  29. data-class-li="{{ classLi }}"
  30. data-prototype="{{ form_widget(form.mediaVideos.vars.prototype)|e('html_attr') }}">
  31. {% for mediaVideoField in form.mediaVideos %}
  32. <li class="{{ classLi }}">
  33. {{ form_widget(mediaVideoField) }}
  34. {{ form_errors(mediaVideoField) }}
  35. </li>
  36. {% else %}
  37. {{ form_widget(form.mediaVideos) }}
  38. {{ form_errors(form.mediaVideos) }}
  39. {% endfor %}
  40. </ul>
  41. </div>
  42. </div>
  43. </div>
  44. </div>
  45. <div class="col-md">
  46. <div class="card mb-3">
  47. <div class="card-header">
  48. {{ form_label(form.genres, 'Genres') }}
  49. </div>
  50. <div class="card-body">
  51. <button type="button" id="add_genre" class="btn btn-link add_item_link mb-3" data-path="{{ path('videotheque_ajax_genres') }}" data-collection-holder-id="genre-fields-list">Ajouter un genre</button>
  52. <ul id="genre-fields-list" class="collection-form ps-0"
  53. data-index="{{ form.genres|length > 0 ? form.genres|last.vars.name + 1 : 0 }}"
  54. data-prototype="{{ form_widget(form.genres.vars.prototype)|e('html_attr') }}"
  55. data-class-li="{{ classLi }}"
  56. >
  57. {% for genreField in form.genres %}
  58. <li class="{{ classLi }}">
  59. {{ form_widget(genreField) }}
  60. {{ form_errors(genreField) }}
  61. </li>
  62. {% else %}
  63. {{ form_widget(form.genres) }}
  64. {{ form_errors(form.genres) }}
  65. {% endfor %}
  66. </ul>
  67. </div>
  68. </div>
  69. </div>
  70. <div class="col-md">
  71. <div class="card mb-3">
  72. <div class="card-header">
  73. {{ form_label(form.realisateurs, 'Réalisateurs') }}
  74. </div>
  75. <div class="card-body">
  76. <button type="button" id="add_realisateur" class="btn btn-link add_item_link mb-3" data-path="{{ path('videotheque_ajax_realisateurs') }}" data-collection-holder-id="realisateur-fields-list">Ajouter un réalisateur</button>
  77. <ul id="realisateur-fields-list" class="collection-form ps-0"
  78. data-index="{{ form.realisateurs|length > 0 ? form.realisateurs|last.vars.name + 1 : 0 }}"
  79. data-prototype="{{ form_widget(form.realisateurs.vars.prototype)|e('html_attr') }}"
  80. data-class-li="{{ classLi }}"
  81. >
  82. {% for realisateurField in form.realisateurs %}
  83. <li class="{{ classLi }}">
  84. {{ form_widget(realisateurField) }}
  85. {{ form_errors(realisateurField) }}
  86. </li>
  87. {% else %}
  88. {{ form_widget(form.realisateurs) }}
  89. {{ form_errors(form.realisateurs) }}
  90. {% endfor %}
  91. </ul>
  92. </div>
  93. </div>
  94. </div>
  95. </div>
  96. </div>
  97. {{ form_rest(form) }}
  98. {{ form_end(form) }}