from django.urls import path
from django.conf.urls import url
from django.contrib.auth.decorators import login_required
from django.contrib.auth import views as auth_views
from .views import *

app_name = 'resume'
urlpatterns = [
    path(
        '',
        login_required(ResumeListView.as_view()),
        name="resumes"
    ),
    path(
        'html/<int:pk>',
        HTMLView.as_view(),
        name="html"
    ),
    path(
        'json/<int:pk>',
        JSONView.as_view(),
        name="json"
    ),
    path(
        'docx/<int:pk>',
        build_resume_from_docx_template,
        name="docx"
    ),
    path(
        'new/',
        login_required(new_resume),
        name="newResume"
    ),
    path(
        'wizard/',
        login_required(ResumeWizardView.as_view()),
        name="resumeWizard"
    ),
    path(
        'edit/<int:pk>',
        login_required(ResumeUpdateView.as_view()),
        name='updateResume'
    ),
    path(
        'delete/<int:pk>',
        login_required(ResumeDeleteView.as_view()),
        name='deleteResume'
    ),
    path(
        'applicant/',
        login_required(ApplicantListView.as_view()),
        name="applicants"
    ),
    path(
        'applicant/new',
        login_required(new_applicant),
        name="newApplicant"
    ),
    path(
        'applicant/edit/<int:pk>',
        login_required(ApplicantUpdateView.as_view()),
        name='updateApplicant'
    ),
    path(
        'applicant/delete/<int:pk>',
        login_required(ApplicantDeleteView.as_view()),
        name='deleteApplicant'
    ),
    path(
        'domain/',
        login_required(DomainListView.as_view()),
        name="domain"
    ),
    path(
        'domain/new',
        login_required(new_domain),
        name="newDomain"
    ),
    path(
        'domain/edit/<int:pk>',
        login_required(DomainUpdateView.as_view()),
        name='updateDomain'
    ),
    path(
        'domain/delete/<int:pk>',
        login_required(DomainDeleteView.as_view()),
        name='deleteDomain'
    ),
    path(
        'experience/',
        login_required(ExperienceListView.as_view()),
        name='xp'
    ),
    path(
        'experience/new',
        login_required(new_experience),
        name='newXP'
    ),
    path(
        'experience/edit/<int:pk>',
        login_required(ExperienceUpdateView.as_view()),
        name='updateXP'
    ),
    path(
        'experience/delete/<int:pk>',
        login_required(ExperienceDeleteView.as_view()),
        name='deleteXP'
    ),
    path(
        'education/',
        login_required(EducationListView.as_view()),
        name='edus'
    ),
    path(
        'education/new',
        login_required(new_education),
        name='newEDU'
    ),
    path(
        'education/edit/<int:pk>',
        login_required(EducationUpdateView.as_view()),
        name='updateEDU'
    ),
    path(
        'education/delete/<int:pk>',
        login_required(EducationDeleteView.as_view()),
        name='deleteEDU'
    ),
    path(
        'reference/',
        login_required(ReferenceListView.as_view()),
        name='refs'
    ),
    path(
        'reference/new',
        login_required(new_reference),
        name='newRef'
    ),
    path(
        'reference/edit/<int:pk>',
        login_required(ReferenceUpdateView.as_view()),
        name='updateRef'
    ),
    path(
        'reference/delete/<int:pk>',
        login_required(ReferenceDeleteView.as_view()),
        name='deleteRef'
    ),
    path(
        'employment/',
        login_required(EmploymentListView.as_view()),
        name='employments'
    ),
    path(
        'employment/new',
        login_required(new_employment),
        name='newEmploy'
    ),
    path(
        'employment/edit/<int:pk>',
        login_required(EmploymentUpdateView.as_view()),
        name='updateEmploy'
    ),
    path(
        'employment/delete/<int:pk>',
        login_required(EmploymentDeleteView.as_view()),
        name='deleteEmploy'
    ),
    path(
        'duty/',
        login_required(DutyListView.as_view()),
        name='duties'
    ),
    path(
        'duty/new',
        login_required(new_duty),
        name='newDuty'
    ),
    path(
        'duty/edit/<int:pk>',
        login_required(DutyUpdateView.as_view()),
        name='updateDuty'
    ),
    path(
        'duty/delete/<int:pk>',
        login_required(DutyDeleteView.as_view()),
        name='deleteDuty'
    ),
    path(
        'project/',
        login_required(ProjectListView.as_view()),
        name='projects'
    ),
    path(
        'project/new',
        login_required(new_project),
        name='newProject'
    ),
    path(
        'project/edit/<int:pk>',
        login_required(ProjectUpdateView.as_view()),
        name='updateProject'
    ),
    path(
        'project/delete/<int:pk>',
        login_required(ProjectDeleteView.as_view()),
        name='deleteProject'
    ),
    path(
        'template/',
        login_required(TemplateListView.as_view()),
        name='templates'
    ),
    path(
        'template/new',
        login_required(new_template),
        name='newTemplate'
    ),
    path(
        'template/edit/<int:pk>',
        login_required(TemplateUpdateView.as_view()),
        name='updateTemplate'
    ),
    path(
        'template/delete/<int:pk>',
        login_required(TemplateDeleteView.as_view()),
        name='deleteTemplate'
    ),
    path(
        'template/view/<int:pk>',
        login_required(view_template),
        name='previewTemplate'
    ),
        path(
        'cover/',
        login_required(CoverLetterView.as_view()),
        name='covers'
    ),
    path(
        'cover/new',
        login_required(new_cover_letter),
        name='newCoverLetter'
    ),
    path(
        'cover/edit/<int:pk>',
        login_required(CoverLetterUpdateView.as_view()),
        name='updateCoverLetter'
    ),
    path(
        'cover/delete/<int:pk>',
        login_required(CoverLetterDeleteView.as_view()),
        name='deleteCoverLetter'
    ),
    url(
        r'^signup/$',
        signup,
        name='signup'
    ),
    url(
        r'^activate/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
        activate,
        name='activate'
    ),
]
