feat: Implement comprehensive event management system for promoters
This commit adds a complete event management interface allowing promoters to create, edit, and manage their events with full CRUD operations. ## Backend Features - New Promoter::EventsController with full CRUD operations - Event state management (draft, published, canceled, sold_out) - User authorization system with can_manage_events? method - Proper scoping to ensure users only see their own events ## Frontend Features - Modern responsive UI with Tailwind CSS styling - Event listing with status indicators and quick actions - Comprehensive event creation and editing forms - Detailed event show page with metrics and management options - Integration with main dashboard via promoter action buttons ## JavaScript Improvements - Refactored inline JavaScript to dedicated Stimulus controller - Auto-slug generation from event names with proper sanitization - Improved code organization following Rails conventions ## Routes & Navigation - Namespaced promoter routes under /promoter/ - RESTful endpoints with state management actions - Proper breadcrumb navigation and user flow ## Files Added/Modified - app/controllers/promoter/events_controller.rb (new) - app/javascript/controllers/event_form_controller.js (new) - app/views/promoter/events/*.html.erb (4 new view files) - app/models/user.rb (added authorization methods) - app/views/pages/dashboard.html.erb (added promoter buttons) - config/routes.rb (added promoter namespace) - app/javascript/controllers/index.js (registered new controller) 🎯 Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
@@ -34,6 +34,18 @@ Rails.application.routes.draw do
|
||||
# === Pages ===
|
||||
get "dashboard", to: "pages#dashboard", as: "dashboard"
|
||||
|
||||
# === Promoter Routes ===
|
||||
namespace :promoter do
|
||||
resources :events do
|
||||
member do
|
||||
patch :publish
|
||||
patch :unpublish
|
||||
patch :cancel
|
||||
patch :mark_sold_out
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# === Events ===
|
||||
get "events", to: "events#index", as: "events"
|
||||
get "events/:slug.:id", to: "events#show", as: "event"
|
||||
|
||||
Reference in New Issue
Block a user