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>
31 lines
940 B
JavaScript
Executable File
31 lines
940 B
JavaScript
Executable File
// This file is auto-generated by ./bin/rails stimulus:manifest:update
|
|
// Run that command whenever you add a new controller or create them with
|
|
// ./bin/rails generate stimulus controllerName
|
|
|
|
import { application } from "./application"
|
|
|
|
import LogoutController from "./logout_controller";
|
|
application.register("logout", LogoutController);
|
|
|
|
import CounterController from "./counter_controller"
|
|
application.register("counter", CounterController);
|
|
|
|
import FlashMessageController from "./flash_message_controller"
|
|
application.register("flash-message", FlashMessageController);
|
|
|
|
import TicketSelectionController from "./ticket_selection_controller"
|
|
application.register("ticket-selection", TicketSelectionController);
|
|
|
|
import HeaderController from "./header_controller"
|
|
application.register("header", HeaderController);
|
|
|
|
import EventFormController from "./event_form_controller"
|
|
application.register("event-form", EventFormController);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|