# textdocs/forms.py
from django import forms
from .models import DocumentVersion # Changed from Document
from tinymce.widgets import TinyMCE

# This form is now for creating a *version* of the content
class DocumentVersionForm(forms.ModelForm):
    class Meta:
        model = DocumentVersion
        fields = ['introduction', 'main_body', 'conclusion']
        widgets = {
            'introduction': TinyMCE(attrs={'cols': 80, 'rows': 10}),
            'main_body': TinyMCE(attrs={'cols': 80, 'rows': 20}),
            'conclusion': TinyMCE(attrs={'cols': 80, 'rows': 10}),
        }

# We also need a simple form for creating the parent document
class DocumentCreateForm(forms.Form):
    title = forms.CharField(
        max_length=255, 
        widget=forms.TextInput(attrs={'class': 'form-control'})
    )