from ckeditor_uploader.widgets import CKEditorUploadingWidget

from django import forms
from django.utils.translation import gettext_lazy as _

from .models import CustomFlatPage


class FlatPageForm(forms.ModelForm):
    __choices = [
        ("flatpages/default.html", _("default.html")),
        ("flatpages/social_media.html", _("social_media.html")),
    ]
    template_name = forms.ChoiceField(choices=__choices)

    class Meta:
        model = CustomFlatPage
        fields = "__all__"

        widgets = {"content": CKEditorUploadingWidget(config_name="default")}
