# coding: utf-8

from django.conf.urls import patterns, url

from .views import (
    HomePage,
    NoRightsPage,
    PartnerTplView,
    EditResume,
    EditTaskSetting,
    RecoTaskList,
    UploadResumeList,
    AcceptTaskList,
    AcceptTask,
    FollowTaskResume,
    TaskCoinRecordList,
    GrantTakingWork,
    GetHrContact,
    AcceptResumeTask,
    TaskInfo,
    CheckFollowMsg,
    PartnerRecoTaskCheck,
    CheckResumeInfo,
    CheckAcceptTask,
)
from .level_views import (
    LevelState,
)
from .partner_utils import (
    PartnerCoinUtils,
)

from pin_utils.xadmin_utils import XAdminOperationForm

urlpatterns = patterns(
    '',
    url(
        '^$',
        PartnerTplView.as_view(
            template_name='reco_task.html'
        ),
        name='partner-reco-task',
    ),
    url(
        '^home/$',
        HomePage.as_view(),
        name='partner-home-page',
    ),
    url(
        '^rule/$',
        PartnerTplView.as_view(
            template_name='partner_home_page.html'
        ),
        name='task-manage',
    ),
    url(
        '^partner_agreement/$',
        PartnerTplView.as_view(
            template_name='partner_agreement.html'
        ),
        name='partner_agreement',
    ),
    url(
        '^no_rights/$',
        NoRightsPage.as_view(),
        name='partner-no-right',
    ),
    url(
        '^reco_task/$',
        PartnerTplView.as_view(
            template_name='reco_task.html'
        ),
        name='partner-reco-task',
    ),
    url(
        '^edit_resume/$',
        EditResume.as_view(),
        name='partner-edit-resume',
    ),
    url(
        '^edit_resume/(?P<resume_id>\d+)/$',
        EditResume.as_view(),
        name='partner-update-resume',
    ),
    url(
        '^edit_task_setting/$',
        EditTaskSetting.as_view(),
        name='task-setting',
    ),
    url(
        '^reco_task_list/$',
        RecoTaskList.as_view(),
        name='partner-reco-task-list',
    ),
    url(
        '^resume_manage/$',
        PartnerTplView.as_view(
            template_name='resume_manage.html'
        ),
        name='partner-upload-resume',
    ),
    url(
        '^upload_resume_list/$',
        UploadResumeList.as_view(),
        name='partner-upload-resume-list',
    ),
    url(
        '^accept_task/(?P<task_id>\d+)/(?P<resume_id>\d+)/$',
        AcceptTask.as_view(),
        name='partner-accept-task',
    ),
    url(
        '^check_accept_task/(?P<task_id>\d+)/(?P<resume_id>\d+)/$',
        CheckAcceptTask.as_view(),
        name='partner-check-accept-task',
    ),
    url(
        '^accept_resume_task/(?P<task_id>\d+)/(?P<resume_id>\d+)/$',
        AcceptResumeTask.as_view(),
        name='partner-accept-resume-task',
    ),
    url(
        '^task_manage/$',
        PartnerTplView.as_view(
            template_name='reco_task_list.html'
        ),
        name='task-manage',
    ),
    url(
        '^accept_task_list/$',
        AcceptTaskList.as_view(),
        name='partner-accept-task-list',
    ),
    url(
        '^follow_task_resume/(?P<task_id>\d+)/(?P<resume_id>\d+)/$',
        FollowTaskResume.as_view(),
        name='partner-follow-task-resume',
    ),
    url(
        '^task_coin_record/(?P<task_id>\d+)/$',
        TaskCoinRecordList.as_view(),
        name='partner-task-coin-record',
    ),
    url(
        '^grant_taking_work/(?P<resume_task_id>\d+)/$',
        GrantTakingWork.as_view(),
        name='partner-grant-taking-work',
    ),
    url(
        '^grant_form/(?P<op_id>.+)/$',
        XAdminOperationForm.as_view(
            template='partner_grant_form.html',
        ),
        name='partner-grant-form',
    ),
    url(
        '^get_hr_contact/(?P<task_id>\d+)/(?P<resume_id>\d+)/$',
        GetHrContact.as_view(),
        name='partner-get-hr-contact',
    ),
    url(
        '^task_info/(?P<task_id>\d+)/$',
        TaskInfo.as_view(),
        name='partner-task-info',
    ),
    url(
        '^check_follow_msg/(?P<follow_id>\d+)/$',
        CheckFollowMsg.as_view(),
        name='partner-check-follow-msg',
    ),
    url(
        '^check_task/$',
        PartnerRecoTaskCheck.as_view(),
        name='partner-task-check',
    ),
    url(
        '^check_exist_phone/$',
        CheckResumeInfo.as_view(
            check_info='phone'
        ),
        name='partner-check-exist-phone',
    ),
    url(
        '^check_exist_email/$',
        CheckResumeInfo.as_view(
            check_info='email'
        ),
        name='partner-check-exist-email',
    ),
    url(
        '^level_state/$',
        LevelState.as_view(),
        name='partner-level-state',
    ),
    url(
        '^extra_grant_taking_work/(?P<resume_task_id>\d+)/$',
        GrantTakingWork.as_view(
            grant_method=PartnerCoinUtils.extra_taking_work,
            grant_type='extra',
        ),
        name='partner-extra-grant-taking-work',
    ),
    url(
        '^extra_grant_form/(?P<op_id>.+)/$',
        XAdminOperationForm.as_view(
            template='partner_extra_grant_form.html',
        ),
        name='partner-extra-grant-form',
    ),
)
