Forráskód Böngészése

correctifs mineurs (position heures sur planning)

garthh 2 hete
szülő
commit
388f641fca

+ 4 - 0
assets/styles/app.css

@@ -113,6 +113,10 @@ html[data-theme="dark"] .navbar-item svg {
   z-index: 0;
 }
 
+.planning-cell-first-col {
+	align-items: flex-end;
+}
+
 /* Header cells (e.g., "Espaces") */
 .planning-cell-heading {
   font-weight: 600;

+ 12 - 0
src/Controller/MainController.php

@@ -190,6 +190,18 @@ final class MainController extends AbstractController
         return $this->render('main/mailinglist.template.html.twig', ['events' => $events]);
     }
     
+    // Génération de la newsletter d'un événement /newsletter/detail/(uuid)
+    #[Route('/newsletter/detail/{id}', name: 'app_newsletter_detail', requirements: ['id' => Requirement::UUID_V7], methods: ['GET'])]
+    public function newsletterDetail(?Event $event, EventRepository $repository): Response
+    {
+        // Contrôle qu'un événement est bien transmis
+        if (!$event) {
+            $this->addFlash('danger', 'Événement inconnu !');
+            $this->redirectToRoute('app_main_booking_main');
+        }
+        return $this->render('main/mailingdetail.template.html.twig', ['event' => $event]);
+    }
+    
     // Génération des ICS pour la newsletter et l'affiche des événements
     #[Route('/ics/{id}.ics', name: 'app_main_ics', requirements: ['id' => Requirement::UUID_V7], methods: ['GET'])]
     public function ics(?Event $event, EventRepository $repository): Response

+ 1 - 1
templates/bulma.html.twig

@@ -7,7 +7,7 @@
         
         {# gestion de OpenGraph #}
         {# si c'est une page d'événement -> OG pour l'événement, sinon, juste le site lui même #}
-        {%  if event is defined %}
+        {%  if event is defined and app.request.attributes.get('_route') != 'app_admin_event_add' %}
           <meta property="og:title" content="{{ event.name }}">
           <meta property="og:description" content="{{ event.description }}">
           <meta property="og:type" content="website">

+ 6 - 3
templates/components/Planning.html.twig

@@ -37,7 +37,10 @@
     {% for period in event.getPeriods() %}
     <div class="fixed-grid has-{{ cols }}-cols period-panel{% if period.id != first_period %} is-hidden{% endif %}" id="#period-{{ period.id }}">
         <div class="grid is-gap-0">
-            <div class="cell planning-cell planning-cell-period is-col-span-{{ cols }} has-text-centered">
+            <div class="cell planning-cell planning-cell-heading planning-cell-first-col">
+                {{ period.startOn|date('H:i', app_timezone) }}
+            </div>
+            <div class="cell planning-cell planning-cell-period is-col-span-{{ cols - 1 }} has-text-centered">
                 {% if i > 0 %}
                     <span class="icon period-controller" data-id="#period-{{ event.getPeriods()[i-1].id }}"><twig:ux:icon name='bi:arrow-left-circle'/></span>
                 {% endif %}
@@ -50,8 +53,8 @@
 
             {# On affiche tous les slots de la période, space par space #}
             {% for dateRef in this.getDateOrdered(period) %}
-            <div class="cell planning-cell planning-cell-heading">
-                {{ dateRef|date('H:i', app_timezone) }}
+            <div class="cell planning-cell planning-cell-heading planning-cell-first-col">
+                {{ dateRef|date_modify('+30 minutes')|date('H:i', app_timezone) }}
             </div>
                 {% for space in event.getSpaces() %}
                 {# extraction du slot de cet espace, ce moment et cette période #}

+ 13 - 8
templates/main/_modal.game.html.twig

@@ -25,15 +25,20 @@
 			<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 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>
+  			{% if is_granted('ROLE_MANAGER') %}
+  			{# TODO: limiter aux MJ présents #}
+  			<div class="block">
+  				<p><em>Meneur(euse)s :</em><br/> {{ game.getGamemasters|map(gm => gm.preferedName)|join(', ') }}</p>
+  			</div>
+  			{%  endif %}
   		</div>
     </div>
 

+ 3 - 3
templates/main/_modal.gamemaster.html.twig

@@ -25,17 +25,17 @@
 
       </p>
       {% endif %}
+      {%  if is_granted('ROLE_MANAGER') %}
       <hr/>
       <p>
         <em>Je peux animer des parties des jeux suivants : </em><br/>
-       {# { gamemaster.gamesCanMaster|map(game => game.name)|join(', ') } #}
+       {# TODO: limiter aux jeux dispo dans l'événement #}
        {{ gamemaster.gamesCanMaster
             |map(game => game.name)
             |join(', ')
         }}
-
       </p>
-
+		  {%  endif  %}
     </div>
   </div>
 </article>

+ 137 - 0
templates/main/mailingdetail.template.html.twig

@@ -0,0 +1,137 @@
+<!DOCTYPE html>
+<html lang="fr">
+<head>
+  <meta charset="UTF-8">
+  <title>{{ event.name }}</title>
+</head>
+<body style="margin:0; padding:0; background-color:#f0f4f8;">
+  <center style="width:100%; background-color:#f0f4f8;">
+    <table role="presentation" border="0" cellpadding="0" cellspacing="0" width="100%">  
+      <tr>
+        <td align="center">
+          <table role="presentation" border="0" cellpadding="0" cellspacing="0" width="600" style="background-color:#ffffff;">
+            
+            <!-- HEADER -->
+            <tr>
+              <td style="padding:20px; text-align:center; background-color:#0066cc; color:#ffffff; font-family:Arial, Helvetica, sans-serif;">
+                <h1 style="margin:0; font-size:24px;">✨ {{ event.name }} ✨</h1>
+              </td>
+            </tr>
+
+            <!-- INTRO -->
+            <tr>
+              <td style="padding:20px; font-family:Arial, Helvetica, sans-serif; font-size:15px; color:#333333; line-height:1.6;">
+                <p>
+                  {{ event.description }}
+                </p>
+              </td>
+            </tr>
+
+						{% for event in events %}
+            <!-- ÉVÉNEMENT -->
+            <tr>
+              <td style="border-bottom:1px solid #e0e0e0;">
+                <!-- Image -->
+                <img src="{{ ('/events/' ~ (event.picture ?: 'placeholder.webp'))|base64img }}" alt="{{ event.name }}" width="600" height="200"
+                     style="display:block; border:0; margin:0; padding:0;">
+                <!-- Contenu -->
+                <table role="presentation" border="0" cellpadding="0" cellspacing="0" width="100%">
+                  <tr>
+                    <td style="padding:20px;">
+                      
+                      <!-- Panneau infos -->
+                      <table role="presentation" border="0" cellpadding="0" cellspacing="0" width="100%">
+                        <tr>
+                          <td style="background:#e6f2ff; padding:15px; border-radius:6px;">
+                            <h2 style="margin:0; font-size:18px; font-family:Arial, Helvetica, sans-serif; color:#004080;">
+                              {{ event.name }}
+                            </h2>
+                            <p style="margin:8px 0 4px 0; font-size:14px; color:#004080; font-family:Arial, Helvetica, sans-serif;">
+                              <strong>Lieu :</strong> A COMPLETER
+                            </p>
+                            <p style="margin:4px 0; font-size:14px; color:#004080; font-family:Arial, Helvetica, sans-serif;">
+                              <strong>Date :</strong> du {{ event.startOn|date('d/m/Y \\à H:i') }} au {{ event.endOn|date('d/m/Y \\à H:i') }}
+                            </p>
+                          </td>
+                        </tr>
+                      </table>
+
+                      <!-- Texte -->
+                      <p style="margin:12px 0 16px 0; font-size:14px; color:#555555; line-height:1.5; font-family:Arial, Helvetica, sans-serif;">
+                        {{ event.description }}
+                      </p>
+                      
+                    	{% set authors = [] %}
+                    	{% for party in event.parties %}
+                          {% if party.gamemasterIsAuthor and party.gamemaster not in authors %}
+                              {% set authors = authors|merge([party.gamemaster]) %}
+                        	{% endif %}
+                    	{% endfor %}
+											{% if authors|length > 0 %}
+											<p style="margin:12px 0 16px 0; font-size:16px; color:#333333; line-height:1.5; font-family:Arial, Helvetica, sans-serif;"><strong>Les auteur(rice)s présent(e)s</strong></p>
+											{% for gamemaster in authors %}
+											<table role="presentation" cellpadding="0" cellspacing="0" border="0" width="100%" 
+                             style="background:#f5f5f5; border-radius:6px; margin-bottom:16px;">
+                     		
+                        <tr>
+                          <td valign="top" style="padding:12px;vertical-align: top;" width="128">
+                            <img src="{{ ('/gamemasters/' ~ (gamemaster.picture ?: 'placeholder.webp'))|base64img }}" alt="{{ gamemaster.preferedName }}" width="128" style="display:block; border-radius:6px;">
+                          </td>
+                          <td style="padding:12px; vertical-align:top;">
+                            <p style="margin:0; font-size:16px; color:#004080; font-family:Arial, Helvetica, sans-serif;">
+                              <strong>{{ gamemaster.preferedName }}</strong>
+                            </p>
+                            <p style="margin:6px 0 0 0; font-size:13px; color:#555555; line-height:1.4; font-family:Arial, Helvetica, sans-serif;">
+                              {{ gamemaster.description }}
+                            </p>
+                            <p style="margin:6px 0 0 0; font-size:13px; color:#555555; line-height:1.4; font-family:Arial, Helvetica, sans-serif;">
+                              Auteur(rice) de : {{ gamemaster.authorOfGames|map(game => game.name)|join(', ') }}
+                            </p>
+                          </td>
+                        </tr>
+                      </table>
+											{% endfor %}
+                      {% endif %}
+
+                      <p style="margin:12px 0 16px 0; font-size:14px; color:#555555; line-height:1.5; font-family:Arial, Helvetica, sans-serif;">
+                        Vous pouvez vous inscrire dès à présent à nos animations !
+                      </p>
+
+                      <!-- Boutons -->
+                      <table role="presentation" cellpadding="0" cellspacing="0" border="0" align="center">
+                        <tr>
+                          <td align="center" style="border-radius:4px; background:#0066cc; padding:10px 18px;">
+                            <a href="{{ app_url ~ path('app_main_booking', {'id': event.id, 'view': 'pictures'})}}" style="font-size:14px; color:#ffffff; text-decoration:none; display:inline-block; font-family:Arial, Helvetica, sans-serif;">
+                              Voir le détail et m'inscrire
+                            </a>
+                          </td>
+                          <td style="width:10px;"></td>
+                          <td align="center" style="border-radius:4px; background:#0099cc; padding:10px 18px;">
+                 						<a href="{{ app_url|replace({'https://' : 'webcal://'}) ~ path('app_main_ics', {'id': event.id})  }}" style="font-size:14px; color:#ffffff; text-decoration:none; display:inline-block; font-family:Arial, Helvetica, sans-serif;">Ajouter à mon agenda</a>
+                          </td>
+                        </tr>
+                      </table>
+                      
+                      {%  endfor %}
+
+                    </td>
+                  </tr>
+                </table>
+              </td>
+            </tr>
+
+            <!-- FOOTER -->
+            <tr>
+              <td style="padding:20px; text-align:center; font-size:12px; font-family:Arial, Helvetica, sans-serif; color:#888888;">
+                Réalisé à partir de ORGASSO : une application pour tous vos événements rôlistiques !
+              </td>
+            </tr>
+
+          </table>
+        </td>
+      </tr>
+    </table>
+  </center>
+
+</body>
+</html>