from django import forms

from .models import Announcement


class AnnouncementForm(forms.ModelForm):
    class Meta:
        model = Announcement
        fields = ['title', 'body', 'published']
        widgets = {
            'title': forms.TextInput(attrs={'class': 'form-input', 'placeholder': 'Announcement title'}),
            'body': forms.Textarea(attrs={'class': 'form-textarea', 'rows': 12, 'placeholder': 'Write in Markdown…'}),
        }
