# communication/forms.py
from django import forms
from .models import Announcement, SMSMessage

class AnnouncementForm(forms.ModelForm):
    class Meta:
        model = Announcement
        fields = ['title', 'content', 'audience', 'priority', 'publish_date', 'is_published']
        widgets = {
            'title': forms.TextInput(attrs={'class': 'form-control'}),
            'content': forms.Textarea(attrs={'class': 'form-control', 'rows': 5}),
            'audience': forms.Select(attrs={'class': 'form-control'}),
            'priority': forms.Select(attrs={'class': 'form-control'}),
            'publish_date': forms.DateInput(attrs={'type': 'date', 'class': 'form-control'}),
        }

class SMSComposeForm(forms.Form):
    message_type = forms.ChoiceField(choices=SMSMessage.MESSAGE_TYPE_CHOICES, widget=forms.Select(attrs={'class': 'form-control'}))
    message = forms.CharField(widget=forms.Textarea(attrs={'class': 'form-control', 'rows': 3}))
    recipients = forms.MultipleChoiceField(widget=forms.CheckboxSelectMultiple)