Browse Source

onglet info

garthh 1 month ago
parent
commit
8c946976f2
2 changed files with 157 additions and 5 deletions
  1. 27 4
      templates/main/_modal.game.html.twig
  2. 130 1
      templates/main/booking.info.html.twig

+ 27 - 4
templates/main/_modal.game.html.twig

@@ -2,8 +2,6 @@
 
 {% block title %}{{ game.name }}{% endblock %}
 
-{% block content %}
-
 {% block header %}
 {% if game.getPicture %}
   <section class="modal-card-image">
@@ -18,8 +16,33 @@
 {% endblock %}
 
 {% block content %}
- 	<div>
-      <p>{{ game.getDescription }}</p>
+ <div id="tabs-content">
+    <div class="container" id="tab-1">
+    	<div class="block">
+    		<p>{{ game.getDescription }}</p>
+      	</div>
+		<div class="block">
+			<div class="message is-info">
+				<div class="message-header">
+					<p>À propos du jeu</p>
+				</div>
+				<div class="message-body">
+				<ul>
+                   
+					<li><strong>Âge recommandé : </strong>{{ game.getAgeRecommendationLabel }}</li>
+					<li><strong>Genres : </strong>{{game.getGenre|map(g => g.genre)|join(', ') }}</li>
+				</ul>
+	  			</div>
+  			</div>
+  		</div>
     </div>
+
+ </div>
+
+
 {% endblock %}
 
+
+
+
+

+ 130 - 1
templates/main/booking.info.html.twig

@@ -81,8 +81,137 @@
 </div>
 {%  endif %}
 
+	{% set authors = [] %}
+	{% set gamemasters = [] %}
+	{% set games = [] %}
+	{% for party in event.parties %}
+	{% if party.gamemasterIsAuthor and (party.gamemaster not in authors) %}
+    {% set authors = authors|merge([party.gamemaster]) %}
+	{% endif %}
+	{% if party.gamemaster not in gamemasters %}
+	  {% set gamemasters = gamemasters|merge([party.gamemaster]) %}
+	 {% endif %}
+	 {% if party.game not in games %}
+	  {% set games = games|merge([party.game]) %}
+	 {% endif %}
+	 
+	{% endfor %}
+
+<section class="block">
+{% if authors|length > 0 %}
+<div class="content">
+	<h2 class="title">Les auteur(rice)s présent(e)s</h2>
+	
+
+
+  {% for gamemaster in authors %}
+<article class="media">
+  <figure class="media-left">
+    <p class="image is-128x128">
+        {% if gamemaster.picture %}
+        <img class="is-rounded" src="/images/gamemasters/{{ gamemaster.picture }}" />
+        {% else %}
+        <twig:ux:icon name="bi:person-fill"/>
+        {% endif %}
+    </p>
+  </figure>
+  <div class="media-content">
+    <div class="content">
+    <h3>{{  gamemaster.preferedName }}</h3>
+      <p>
+       {{ gamemaster.description }}
+      </p>
+      {% if gamemaster.isAuthor %}
+      <p>
+        <em>Je suis auteur(rice) des jeux suivants : </em><br/>
+       {{ gamemaster.authorOfGames|map(game => game.name)|join(', ') }}
+
+      </p>
+      {% endif %}
+
+    </div>
+  </div>
+</article>
+		{% endfor %}
+</div>
+{% endif %}
+
+<div class="content">
+	<h2 class="title">Les meneur(euse)s de jeu présent(e)s</h2>
+	<p><em>Cliquez sur la vignette pour lire sa biographie et découvrir les jeux qui vous seront proposés.</em></p>
+	<div class="fixed-grid has-6-cols-fullhd has-4-cols-widescreen has-4-cols-desktop has-4-cols-tablet has-2-cols-mobile">
+	     <div class="grid is-col-min-12">
+        {% for gamemaster in gamemasters %}
+
+        <div class="cell">
+        <a href="{{ path('app_gamemaster_public_profile', {id: gamemaster.id}) }}" class="open-modal">
+          <div class="box">
+          <article class="media">
+            <figure class="media-left">
+              <p class="image is-64x64">
+                {% if gamemaster.picture %}
+                <img src="/images/gamemasters/{{ gamemaster.picture }}"  />
+                {% else %}
+                <twig:ux:icon name="bi:person-fill"/>
+                {% endif %}
+              </p>
+            </figure>
+            <div class="media-content">
+              <div class="content">
+                <p>
+                  <strong>{{ gamemaster.preferedName }}</strong>
+                  <br/>
+                  {{ gamemaster.description }}
+                </p>
+              </div>
+            </div>
+          </article>
+          </div>
+          </a>
+        </div>
+        {% endfor %}
+      </div>
+      </div>
+</div>
+
+<div class="content">
+	<h2 class="title">Les jeux proposés</h2>
+	<p><em>Cliquez sur la vignette pour consulter la description complète du jeu.</em></p>
+	<div class="fixed-grid has-6-cols-fullhd has-4-cols-widescreen has-4-cols-desktop has-4-cols-tablet has-2-cols-mobile">
+        <div class="grid is-col-min-12">
+          {% for game in games %}
+
+          <div class="cell" >
+          <a href="{{ path('app_game_public', {id: game.id}) }}" class="open-modal">
+            
+            <div class="card">
+              <div class="card-image">
+              <figure class="image is-3by1">
+
+                  {% if game.picture %}
+                  <img src="/images/games/{{ game.picture }}"  />
+                  {% else %}
+                  <img src="/images/games/placeholder.webp"  />
+                  {% endif %}
+
+              </figure>
+              </div>
+              <div class="card-content">
+                <div class="content">
+                  <p>
+                    <strong>{{ game.name }}</strong>
+               
+                  </p>
+                </div>
+              </div>
+            </div>
+            </a>
+          </div>
+          {% endfor %}
+        </div>
+      </div>
+</div>
 
-<section class="container">
 </section>