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:
@@ -71,23 +71,12 @@ class PagesController < ApplicationController
|
||||
@monthly_revenue = (0..5).map do |months_ago|
|
||||
start_date = months_ago.months.ago.beginning_of_month
|
||||
end_date = months_ago.months.ago.end_of_month
|
||||
<<<<<<< HEAD
|
||||
|
||||
revenue = current_user.events
|
||||
.joins(:orders)
|
||||
.where(orders: { status: ['paid', 'completed'] })
|
||||
.where(orders: { created_at: start_date..end_date })
|
||||
.sum('orders.total_amount_cents') / 100.0
|
||||
|
||||
=======
|
||||
|
||||
revenue = current_user.events
|
||||
.joins(:orders)
|
||||
.where(orders: { status: [ "paid", "completed" ] })
|
||||
.where(orders: { created_at: start_date..end_date })
|
||||
.sum("orders.total_amount_cents") / 100.0
|
||||
|
||||
>>>>>>> develop
|
||||
{
|
||||
month: start_date.strftime("%B %Y"),
|
||||
revenue: revenue
|
||||
|
||||
Reference in New Issue
Block a user