# @Author  : lightXu
# @File    : form.py
from django import forms

SUBJECT_ID = ((0, '未知学科'),
              (3, '数学'),
              (6, '数学（知心慧学）'),
              (8, '英语'),
              (9, '语文'),
              (12, '物理'),
              (13, '化学'),
              (14, '生物'),
              (15, '政治'),
              (16, '历史'),
              (17, '地理'),
              (18, '理综'),
              (19, '文综'),
              (98, '英语-B'),
              (99, '英语-T'),
              )


class UploadImageForm(forms.Form):
    subject_id_dict = SUBJECT_ID

    subject = forms.ChoiceField(label='科目', label_suffix=':', widget=forms.Select(),
                                choices=subject_id_dict, initial=3, required=True, )
    img_data = forms.ImageField(label='试卷图片', label_suffix=':',
                                widget=forms.ClearableFileInput(attrs={'multiple': True}))


class UploadImageWithPaperIdForm(forms.Form):
    subject_id_dict = SUBJECT_ID

    subject = forms.ChoiceField(label='科目', label_suffix=':', widget=forms.Select(),
                                choices=subject_id_dict, initial=3, required=True, )
    paper_id = forms.CharField(label='PaperID', label_suffix=':',)
    img_data = forms.ImageField(label='试卷图片', label_suffix=':',
                                widget=forms.ClearableFileInput(attrs={'multiple': True}))


class FormulaUrlForm(forms.Form):
    img_url = forms.CharField(label='试卷URL', label_suffix=':')


# class UploadFileForm(forms.Form):
#     # xml_file = forms.FileField(label='XML', label_suffix=':',
#     #                            widget=forms.ClearableFileInput(attrs={'multiple': True}))
#     xml_file = forms.FileField(label='XML', label_suffix=':',
#                                widget=forms.ClearableFileInput(attrs={'multiple': True}))


class SubmitSeriesNumberForm(forms.Form):
    series_number = forms.CharField(label='series_number', label_suffix=':', max_length=100)


class DownloadImage(forms.Form):
    paper_id = forms.CharField(label='paper_id', label_suffix=':', max_length=100)


class UploadFileForm(forms.Form):
    subject_id_dict = SUBJECT_ID

    subject = forms.ChoiceField(label='科目', label_suffix=':', widget=forms.Select(),
                                choices=subject_id_dict, initial=3, required=True, )
    img_data = forms.FileField(label='试卷PDF', label_suffix=':',
                               widget=forms.ClearableFileInput(attrs={'multiple': True}))


