6c0381b9e2
Add routes for player profile, schedule, and authentication endpoints. Changes: - Add /players/:id/schedule route - Add /login route (GET) - Add /auth/login route (POST) - Add /logout route - Update navigation to support new routes
63 lines
2.8 KiB
Ruby
63 lines
2.8 KiB
Ruby
# frozen_string_literal: true
|
|
|
|
module EuchreCamp
|
|
class Routes < Hanami::Routes
|
|
# Add your routes here. See https://guides.hanamirb.org/routing/overview/ for details.
|
|
root to: "players.rankings"
|
|
|
|
# Authentication routes
|
|
get "/login", to: "auth.login.show"
|
|
post "/auth/login", to: "auth.login.create"
|
|
get "/logout", to: "auth.logout"
|
|
|
|
get "/players/:id", to: "players.show"
|
|
get "/players/:id/profile", to: "players.profile"
|
|
get "/players/:id/schedule", to: "players.schedule"
|
|
get "/rankings", to: "players.rankings"
|
|
|
|
get "/admin/players/new", to: "admin.players.new"
|
|
post "/admin/players", to: "admin.players.create"
|
|
get "/admin/players", to: "admin.players.index"
|
|
get "/admin/players/:id/edit", to: "admin.players.edit"
|
|
patch "/admin/players/:id", to: "admin.players.update"
|
|
delete "/admin/players/:id", to: "admin.players.destroy"
|
|
|
|
# Match routes
|
|
get "/admin/matches/new", to: "admin.matches.new"
|
|
post "/admin/matches", to: "admin.matches.create"
|
|
get "/admin/matches", to: "admin.matches.index"
|
|
|
|
# CSV Upload routes
|
|
get "/admin/matches/upload", to: "admin.matches.upload"
|
|
post "/admin/matches/process_upload", to: "admin.matches.process_upload"
|
|
|
|
# Tournament routes
|
|
get "/admin/tournaments", to: "admin.tournaments.index"
|
|
get "/admin/tournaments/new", to: "admin.tournaments.new"
|
|
post "/admin/tournaments", to: "admin.tournaments.create"
|
|
get "/admin/tournaments/:id", to: "admin.tournaments.show"
|
|
get "/admin/tournaments/:id/edit", to: "admin.tournaments.edit"
|
|
patch "/admin/tournaments/:id", to: "admin.tournaments.update"
|
|
delete "/admin/tournaments/:id", to: "admin.tournaments.destroy"
|
|
|
|
# Tournament participant management
|
|
post "/admin/tournaments/:id/participants", to: "admin.tournaments.participants.create"
|
|
delete "/admin/tournaments/:id/participants/:player_id", to: "admin.tournaments.participants.destroy"
|
|
|
|
# Tournament team management
|
|
post "/admin/tournaments/:id/teams", to: "admin.tournaments.teams.create"
|
|
get "/admin/tournaments/:id/teams/:team_id/edit", to: "admin.tournaments.teams.edit"
|
|
patch "/admin/tournaments/:id/teams/:team_id", to: "admin.tournaments.teams.update"
|
|
delete "/admin/tournaments/:id/teams/:team_id", to: "admin.tournaments.teams.destroy"
|
|
|
|
# Tournament scheduling
|
|
post "/admin/tournaments/:id/schedule", to: "admin.tournaments.schedule"
|
|
get "/admin/tournaments/:id/rounds/:round_id", to: "admin.tournaments.rounds.show"
|
|
|
|
# Tournament results
|
|
get "/admin/tournaments/:id/results", to: "admin.tournaments.results"
|
|
post "/admin/tournaments/:id/results", to: "admin.tournaments.save_results"
|
|
post "/admin/tournaments/:id/complete", to: "admin.tournaments.complete"
|
|
end
|
|
end
|