Browse Source

limitation de l'affichage des boutons checkins aux tables avec joueurs

garthh 3 weeks ago
parent
commit
a557c4b13e

+ 0 - 1
src/Controller/ProfileController.php

@@ -205,7 +205,6 @@ final class ProfileController extends AbstractController
         // Retrouver le mail de l'utilisateur
         $email = $user->getEmail();
         $participations = $repository->findAllByEmail($email);
-        dump($participations);
         
         return $this->render('profile/participations.html.twig', [
             'participations' => $participations,

+ 5 - 1
templates/manage/list.html.twig

@@ -101,7 +101,11 @@
                         <button class="button is-primary" disabled>Inscrire</button>
                       {% endif %}
                       <a href="{{ path('app_party_modify', {id: party.slots.first.id}) }}" class="button is-primary open-modal">Éditer</a>
-                      <a href="{{ path('app_checkin_party', {id: party.id}) }}" class="button open-modal">Checkins</a> 
+                      {% if party.getSeatsOccuped > 0 %}
+                        <a href="{{ path('app_checkin_party', {id: party.id}) }}" class="button open-modal">Checkins</a> 
+                      {% else %}
+                        <button class="button" disabled>Checkins</button>
+                      {% endif %}
                     </td>
                 </tr>
             {% endfor %}

+ 4 - 0
templates/profile/gamemastering.html.twig

@@ -42,7 +42,11 @@
                     <td>{{ participation.startOn|date('d/m/y H:i', app_timezone) }}</td>
                     <td>{{ participation.getSeatsOccuped }} / {{ participation.getMaxParticipants }}</td>
                     <td>
+                        {% if participation.getSeatsOccuped > 0 %}
                       <a href="{{ path('app_checkin_party', {id: participation.id}) }}" class="button open-modal">Checkins</a> 
+                    {% else %}
+                        <button class="button" disabled>Checkins</button>
+                      {% endif %}
                     </td>
                 </tr>
             {% endfor %}