from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns
from django.urls import include, path

from .provider import TeamsnapProvider
from .views import (
    OpponentFormView,
    Opponents,
    PreferencesFormView,
    schedule_view,
    view_event,
)

urlpatterns = default_urlpatterns(TeamsnapProvider)

urlpatterns += [
    path("preferences/", PreferencesFormView.as_view(), name="teamsnap_preferences"),
    path("<int:team_id>/schedule/", schedule_view, name="teamsnap_schedule"),
    path("schedule/", schedule_view, name="teamsnap_schedule"),
    path(
        "<int:team_id>/schedule/view_event/<int:event_id>",
        view_event,
        name="teamsnap_view_event",
    ),
    path("", include("teamsnap.lineup.urls")),
    path("", include("teamsnap.dashboard.urls")),
    path(
        "<int:team_id>/opponent/<int:opponent_id>/",
        OpponentFormView.as_view(),
        name="teamsnap_opponent",
    ),
    path("<int:team_id>/opponents", Opponents.as_view(), name="teamsnap_opponents"),
]
