from django import forms
from .models import Page,Image
from django.utils.translation import gettext_lazy as _

class PageForm(forms.ModelForm):
    class Meta:
        model = Page
        fields = [
            'title',
            'slug',
            'status_data',
            'content_type_data',
            'content',
        ]


class PageDeleteForm(forms.Form):
    slug = forms.SlugField(allow_unicode=False,
                           required=False,
                           label=_("Slug"))


class PageAdminForm(forms.ModelForm):
    class Meta:
        model = Page
        fields = [
            'title',
            'author',
            'slug',
            'status_data',
            'content_type_data',
            'content',
        ]


class ImageUploadView(forms.ModelForm):
    class Meta:
        model = Image
        fields = [
            "image",
            "alt",
            "description",
        ]


class ImageEditView(forms.ModelForm):
    class Meta:
        model = Image
        fields = [
            "alt",
            "description",
        ]


class ImageDeleteView(forms.Form):
    slug = forms.SlugField(allow_unicode=False,
                           required=False)
