from django.urls import include, path

from . import views

urlpatterns = [
    path("", views.index, name="index"),
    path("tournaments/", views.tournaments, name="tournaments"),
    path("clubs/", views.clubs, name="clubs"),
    path("clubs/<str:club_id>/", views.club, name="club"),
    path("c/<str:broadcast_code>", views.club_broadcast, name="club-broadcast"),
    path("c/<str:broadcast_code>/go", views.club_broadcast_auto, name="club-broadcast-auto"),
    path("tournament/<str:tournament_id>/",
        include([
            path('', views.tournament, name='tournament'),
            path('teams/', views.tournament_teams, name='tournament-teams'),
            path('info/', views.tournament_info, name='tournament-info'),
            path('summons/', views.tournament_summons, name='tournament-summons'),
            path('broadcast/summons/', views.tournament_broadcasted_summons, name='broadcasted-summons'),
            path('summons/json/', views.tournament_summons_json, name='tournament-summons-json'),
            path('broadcast/matches/', views.tournament_matches, name='broadcasted-matches'),
            path('broadcast/', views.tournament_broadcast_home, name='broadcast'),
            path('broadcast/auto/', views.automatic_broadcast, name='automatic-broadcast'),
            path('matches/json/', views.tournament_matches_json, name='tournament-matches-json'),
            path('broadcast/json/', views.broadcast_json, name='broadcast-json'),
            path('broadcast/group-stages/', views.tournament_broadcasted_group_stages, name='broadcasted-group-stages'),
            path('group-stages/', views.tournament_group_stages, name='group-stages'),
            path('group-stages/json/', views.tournament_live_group_stage_json, name='group-stages-json'),
            path('rankings/', views.tournament_rankings, name='tournament-rankings'),
            path('rankings/json/', views.tournament_rankings_json, name='tournament-rankings-json'),
            path('broadcast/rankings/', views.tournament_broadcast_rankings, name='broadcasted-rankings'),
            path('team/<str:team_id>/', views.team_details, name='team-details'),
        ])
    ),
    path("event/<str:event_id>/broadcast/auto/", views.automatic_broadcast_event, name='automatic-broadcast-event'),
    path('players/', views.players, name='players'),
    path('activate/<uidb64>/<token>/', views.activate, name='activate'),
    path('download/', views.download, name='download'),
    path('apns/', views.test_apns, name='test-apns'),
    path('terms-of-use/', views.terms_of_use, name='terms-of-use'),
    path('utils/xls-to-csv/', views.xls_to_csv, name='xls-to-csv'),
    path('mail-test/', views.simple_form_view, name='mail-test'),
    path('admin/tournament-import/', views.tournament_import_view, name='tournament_import'),

]
