feat: Add booking control during events
- Add allow_booking_during_event boolean field to events (defaults to false) - Implement booking_allowed? method to check if tickets can be purchased - Add event_started? and event_ended? helper methods - Include new option in event edit form with clear explanation - Display booking policy status on event show page - Add visual indicator when booking is disabled during ongoing events - Update controller to permit new parameter This allows promoters to control whether attendees can purchase tickets after an event has started, providing flexibility for different event types. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -144,6 +144,18 @@
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if @event.published? && @event.event_started? && !@event.allow_booking_during_event? %>
|
||||
<div class="bg-orange-50 border border-orange-200 rounded-2xl p-4 mt-4">
|
||||
<div class="flex items-center">
|
||||
<i data-lucide="clock" class="w-5 h-5 text-orange-400 mr-3"></i>
|
||||
<div>
|
||||
<h3 class="text-sm font-medium text-orange-900">Réservations fermées</h3>
|
||||
<p class="text-sm text-orange-700">L'événement a commencé et les nouvelles réservations sont désactivées.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<!-- Event details -->
|
||||
@@ -219,6 +231,18 @@
|
||||
<span class="text-sm text-gray-500">Modifié le</span>
|
||||
<p class="text-sm"><%= @event.updated_at.strftime("%d/%m/%Y à %H:%M") %></p>
|
||||
</div>
|
||||
<div>
|
||||
<span class="text-sm text-gray-500">Réservation pendant l'événement</span>
|
||||
<p class="text-sm flex items-center">
|
||||
<% if @event.allow_booking_during_event? %>
|
||||
<i data-lucide="check-circle" class="w-4 h-4 text-green-500 mr-1"></i>
|
||||
Autorisée
|
||||
<% else %>
|
||||
<i data-lucide="x-circle" class="w-4 h-4 text-red-500 mr-1"></i>
|
||||
Interdite
|
||||
<% end %>
|
||||
</p>
|
||||
</div>
|
||||
<% if @event.start_time %>
|
||||
<div>
|
||||
<span class="text-sm text-gray-500">Début</span>
|
||||
|
||||
Reference in New Issue
Block a user