from django import forms

from .models import Claim, CounterArgument, EvidenceFile, Source


class ClaimAdminForm(forms.ModelForm):
    class Meta:
        model = Claim
        fields = '__all__'
        widgets = {
            'title': forms.TextInput(attrs={'class': 'fk-admin-wide'}),
            'short_answer': forms.Textarea(attrs={'rows': 5, 'class': 'fk-admin-textarea'}),
            'detailed_explanation': forms.Textarea(attrs={'rows': 12, 'class': 'fk-admin-textarea'}),
        }


class SourceInlineForm(forms.ModelForm):
    class Meta:
        model = Source
        fields = '__all__'
        widgets = {
            'title': forms.TextInput(attrs={'class': 'fk-admin-wide'}),
            'organization': forms.TextInput(attrs={'class': 'fk-admin-wide'}),
            'url': forms.URLInput(attrs={'class': 'fk-admin-wide'}),
            'description': forms.Textarea(attrs={'rows': 3, 'class': 'fk-admin-textarea'}),
        }


class CounterArgumentInlineForm(forms.ModelForm):
    class Meta:
        model = CounterArgument
        fields = '__all__'
        widgets = {
            'argument': forms.Textarea(attrs={'rows': 3, 'class': 'fk-admin-textarea'}),
            'response': forms.Textarea(attrs={'rows': 4, 'class': 'fk-admin-textarea'}),
        }


class EvidenceFileInlineForm(forms.ModelForm):
    class Meta:
        model = EvidenceFile
        fields = '__all__'
        widgets = {
            'title': forms.TextInput(attrs={'class': 'fk-admin-wide'}),
            'caption': forms.Textarea(attrs={'rows': 2, 'class': 'fk-admin-textarea'}),
        }
