from django import forms
from django.core import validators
from django.core.exceptions import ValidationError

from module_project import constants

from .models import FaqCategory, Faqs, Organization


class OrganizationForm(forms.ModelForm):
    class Meta:
        model = Organization
        fields = [
            "title",
            "contact_us_email",
            "instagram_handle",
            "facebook_handle",
            "linkedin_handle",
            "logo_image",
            "favicon_image",
            "website_url",
        ]

    labels = {
        "title": "Organization Title",
        "contact_us_email": "Contact Email",
        "instagram_handle": "Instagram URL",
        "facebook_handle": "Facebook URL",
        "linkedin_handle": "LinkedIn URL",
        "logo_image": "Organization Logo",
        "favicon_image": "Favicon",
        "website_url": "Website URL",
    }

class AboutUsForm(forms.ModelForm):
    class Meta:
        model = Organization
        fields = ["about_us"]
        labels = {"about_us": "Enter information about your organization:"}

class TermsAndConditionForm(forms.ModelForm):
    class Meta:
        model = Organization
        fields = ["terms_condition"]
        labels = {"terms_condition": "Enter Terms and Conditions:"}

class PrivacyPolicyForm(forms.ModelForm):
    class Meta:
        model = Organization
        fields = ["privacy_policy"]
        labels = {"privacy_policy": "Enter Privacy Police:"}


class FaqCategoryFrom(forms.ModelForm):
    class Meta:
        model = FaqCategory
        fields = ["name"]
        labels = {"name": "Category name"}


class FaqsForm(forms.ModelForm):
    class Meta:
        model = Faqs
        fields = [
            # "faq_category",
            "question",
            "answer",
        ]
