# Path: src/ctf_gameserver/web/registration/views.py
# class TeamList(ListView):
# def register(request):
# def edit_team(request):
# def delete_team(request):
# def confirm_email(request):
# def mail_teams(request):
# 
# Path: src/ctf_gameserver/web/scoring/views.py
# def scoreboard(request):
# def scoreboard_json(_):
# def scoreboard_json_ctftime(_):
# def service_status(request):
# def service_status_json(_):
# def teams_json(_):
# def service_history(request):
# def service_history_json(request):
#     def append_result(next_team_id):
# def _get_status_descriptions():
# 
# Path: src/ctf_gameserver/web/flatpages/views.py
# def flatpage(request, category=None, slug=''):
# 
# Path: src/ctf_gameserver/web/admin.py
# class CTFAdminSite(admin.AdminSite):
# class CTFUserAdmin(UserAdmin):
#     class TeamListFilter(admin.SimpleListFilter):
#     def site_header(cls):    # pylint: disable=no-self-argument
#     def site_title(cls):    # pylint: disable=no-self-argument
#     def __init__(self, *args, **kwargs):
#         def lookups(self, request, model_admin):
#         def queryset(self, request, queryset):
#     def user_has_team(self, user):
# 
# Path: src/ctf_gameserver/web/forms.py
# class TeamAuthenticationForm(AuthenticationForm):
#     """
#     Custom variant of the login form that replaces "Username" with "Team name".
#     """
# 
#     username = forms.CharField(max_length=254, label=_('Team name'))
# 
# class FormalPasswordResetForm(PasswordResetForm):
#     """
#     Custom variant of the password reset form that replaces "Email" with "Formal email", adds a help text
#     and adds the CTF's title to the email rendering context.
#     """
# 
#     email = forms.EmailField(max_length=254, label=_('Formal email'), help_text='The address you stated '
#                              'as authorative for sensitive requests.')
# 
#     def send_mail(self, subject_template_name, email_template_name, context, from_email, to_email,
#                   html_email_template_name=None):
#         context['competition_name'] = GameControl.get_instance().competition_name
# 
#         return super().send_mail(subject_template_name, email_template_name, context, from_email, to_email,
#                                  html_email_template_name)


from django.conf import settings
from django.conf.urls.static import static
from django.contrib.auth import views as auth_views
from django.urls import re_path as url, reverse_lazy
from .registration import views as registration_views
from .scoring import views as scoring_views
from .flatpages import views as flatpages_views
from .admin import admin_site
from .forms import TeamAuthenticationForm, FormalPasswordResetForm
    ),
    url(r'^auth/reset-password/$',
        auth_views.PasswordResetView.as_view(template_name='password_reset.html',
                                             email_template_name='password_reset_mail.txt',
                                             subject_template_name='password_reset_subject.txt',
                                             form_class=FormalPasswordResetForm),
        name='password_reset'
    ),
    url(r'^auth/reset-password/done/$',
        auth_views.PasswordResetDoneView.as_view(template_name='password_reset_done.html'),
        name='password_reset_done'
    ),
    url(r'^auth/reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
        auth_views.PasswordResetConfirmView.as_view(template_name='password_reset_confirm.html'),
        name='password_reset_confirm'
    ),
    url(r'^auth/reset/complete/$',
        auth_views.PasswordResetCompleteView.as_view(template_name='password_reset_complete.html'),
        name='password_reset_complete'
    ),

    url(r'^competition/teams/$',
        registration_views.TeamList.as_view(),
        name='team_list'
    ),
    url(r'^competition/teams\.json$',
        scoring_views.teams_json,
        name='team_json'
    ),
    url(r'^competition/scoreboard/$',

# Path: src/ctf_gameserver/web/registration/views.py
# class TeamList(ListView):
# def register(request):
# def edit_team(request):
# def delete_team(request):
# def confirm_email(request):
# def mail_teams(request):
# 
# Path: src/ctf_gameserver/web/scoring/views.py
# def scoreboard(request):
# def scoreboard_json(_):
# def scoreboard_json_ctftime(_):
# def service_status(request):
# def service_status_json(_):
# def teams_json(_):
# def service_history(request):
# def service_history_json(request):
#     def append_result(next_team_id):
# def _get_status_descriptions():
# 
# Path: src/ctf_gameserver/web/flatpages/views.py
# def flatpage(request, category=None, slug=''):
# 
# Path: src/ctf_gameserver/web/admin.py
# class CTFAdminSite(admin.AdminSite):
# class CTFUserAdmin(UserAdmin):
#     class TeamListFilter(admin.SimpleListFilter):
#     def site_header(cls):    # pylint: disable=no-self-argument
#     def site_title(cls):    # pylint: disable=no-self-argument
#     def __init__(self, *args, **kwargs):
#         def lookups(self, request, model_admin):
#         def queryset(self, request, queryset):
#     def user_has_team(self, user):
# 
# Path: src/ctf_gameserver/web/forms.py
# class TeamAuthenticationForm(AuthenticationForm):
#     """
#     Custom variant of the login form that replaces "Username" with "Team name".
#     """
# 
#     username = forms.CharField(max_length=254, label=_('Team name'))
# 
# class FormalPasswordResetForm(PasswordResetForm):
#     """
#     Custom variant of the password reset form that replaces "Email" with "Formal email", adds a help text
#     and adds the CTF's title to the email rendering context.
#     """
# 
#     email = forms.EmailField(max_length=254, label=_('Formal email'), help_text='The address you stated '
#                              'as authorative for sensitive requests.')
# 
#     def send_mail(self, subject_template_name, email_template_name, context, from_email, to_email,
#                   html_email_template_name=None):
#         context['competition_name'] = GameControl.get_instance().competition_name
# 
#         return super().send_mail(subject_template_name, email_template_name, context, from_email, to_email,
#                                  html_email_template_name)


# Path: src/ctf_gameserver/web/urls.py
from django.conf import settings
from django.conf.urls.static import static
from django.contrib.auth import views as auth_views
from django.urls import re_path as url, reverse_lazy
from .registration import views as registration_views
from .scoring import views as scoring_views
from .flatpages import views as flatpages_views
from .admin import admin_site
from .forms import TeamAuthenticationForm, FormalPasswordResetForm

    ),
    url(r'^auth/reset-password/$',
        auth_views.PasswordResetView.as_view(template_name='password_reset.html',
                                             email_template_name='password_reset_mail.txt',
                                             subject_template_name='password_reset_subject.txt',
                                             form_class=FormalPasswordResetForm),
        name='password_reset'
    ),
    url(r'^auth/reset-password/done/$',
        auth_views.PasswordResetDoneView.as_view(template_name='password_reset_done.html'),
        name='password_reset_done'
    ),
    url(r'^auth/reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
        auth_views.PasswordResetConfirmView.as_view(template_name='password_reset_confirm.html'),
        name='password_reset_confirm'
    ),
    url(r'^auth/reset/complete/$',
        auth_views.PasswordResetCompleteView.as_view(template_name='password_reset_complete.html'),
        name='password_reset_complete'
    ),

    url(r'^competition/teams/$',
        registration_views.TeamList.as_view(),
        name='team_list'
    ),
    url(r'^competition/teams\.json$',
        scoring_views.teams_json,
        name='team_json'
    ),
    url(r'^competition/scoreboard/$',

        scoring_views.scoreboard,