from django import forms
from .models import Entry, Meaning, Noun

class EntryForm(forms.ModelForm):
    class Meta:
        model = Entry
        fields = "__all__"

        widgets = {
            'Gaeilge': forms.TextInput(attrs={'class': 'entry-form'}),
            'PoS': forms.TextInput(attrs={'class': 'entry-form'}),
            'Pronoun': forms.TextInput(attrs={'class': 'entry-form'}),
            'PreScript': forms.TextInput(attrs={'class': 'entry-form'}),
            'PostScript' : forms.TextInput(attrs={'class': 'entry-form'}),
        }

        labels = {
            'Gaeilge': '愛爾蘭語',
            'PoS': '詞性',
            'Pronoun': '發音',
            'PreScript': '前註',
            'PostScript': '後註'
        }

class NounForm(forms.ModelForm):
    class Meta:
        model = Meaning
        fields = '__all__'
    
    widgets = {
            'Entry': forms.TextInput(attrs={'class': 'noun-form'}),
            'Gender': forms.NumberInput(attrs={'class': 'noun-form'}),
            'Decl_no': forms.NumberInput(attrs={'class': 'noun-form'}),
            'Gsg': forms.TextInput(attrs={'class': 'noun-form'}),
            'Npl': forms.TextInput(attrs={'class': 'noun-form'}),
            'Gpl': forms.TextInput(attrs={'class': 'noun-form'}),
            'Dsg': forms.TextInput(attrs={'class': 'noun-form'}),           
        }

    labels = {
            'Entry': '條目',
            'Gender': '性（0 代表質詞）',
            'Decl_no': '變格號碼',
            'Gsg': '單屬',
            'Npl': '複主',
            'Gpl': '複屬',
            'Dsg': '單與',    
        }
    
class MeaningForm(forms.ModelForm):
    class Meta:
        model = Meaning
        fields = ('Entry' ,'Meaning_content', 'Exam_Sentence1', 'Exam_Sentence1_zh', 'Exam_Sentence2',
        'Exam_Sentence2_zh', 'Exam_Sentence3', 'Exam_Sentence3_zh')

        widgets = {
            'Meaning_content': forms.TextInput(attrs={'class': 'meaning-form'}),
            'Exam_Sentence1': forms.TextInput(attrs={'class': 'meaning-form'}),
            'Exam_Sentence1_zh': forms.TextInput(attrs={'class': 'meaning-form'}),
            'Exam_Sentence2': forms.TextInput(attrs={'class': 'meaning-form'}),
            'Exam_Sentence2_zh': forms.TextInput(attrs={'class': 'meaning-form'}),
            'Exam_Sentence3': forms.TextInput(attrs={'class': 'meaning-form'}),
            'Exam_Sentence3_zh': forms.TextInput(attrs={'class': 'meaning-form'}),           
        }

        labels = {
            'Meaning_content': '釋義',
            'Exam_Sentence1': '例句1',
            'Exam_Sentence1_zh': '例句1漢譯',
            'Exam_Sentence2': '例句2',
            'Exam_Sentence2_zh': '例句2漢譯',
            'Exam_Sentence3': '例句3',
            'Exam_Sentence3_zh': '例句3漢譯',    
        }


