from django.contrib.auth import views as django_views
from django.urls import reverse_lazy

from newsreader.utils.views import NavListMixin


# PasswordResetView sends the mail
# PasswordResetDoneView shows a success message for the above
# PasswordResetConfirmView checks the link the user clicked and
# prompts for a new password
# PasswordResetCompleteView shows a success message for the above
class PasswordResetView(NavListMixin, django_views.PasswordResetView):
    template_name = "password-reset/password-reset.html"
    subject_template_name = "password-reset/password-reset-subject.txt"
    email_template_name = "password-reset/password-reset-email.html"
    success_url = reverse_lazy("accounts:password-reset-done")


class PasswordResetDoneView(NavListMixin, django_views.PasswordResetDoneView):
    template_name = "password-reset/password-reset-done.html"


class PasswordResetConfirmView(NavListMixin, django_views.PasswordResetConfirmView):
    template_name = "password-reset/password-reset-confirm.html"
    success_url = reverse_lazy("accounts:password-reset-complete")


class PasswordResetCompleteView(NavListMixin, django_views.PasswordResetCompleteView):
    template_name = "password-reset/password-reset-complete.html"


class PasswordChangeView(NavListMixin, django_views.PasswordChangeView):
    template_name = "accounts/views/password-change.html"
    success_url = reverse_lazy("accounts:settings")
