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

from .models import JobPosting


class JobPostingForm(forms.ModelForm):
    class Meta:
        model = JobPosting
        fields = [
            "company_name",
            "job_name",
            "salary",
            "number_of_hours",
            "pdf_location",
            "publish_date",
        ]

        labels = {
            "company_name": _("Firmenname"),
            "job_name": _("Berufsbezeichnung"),
            "salary": _("monatliches Gehalt (brutto)/Stundenlohn"),
            "pdf_location": _("Stellenausschreibung"),
            "publish_date": _("Veröffentlichung"),
        }

        help_texts = {
            "pdf_location": _("Verwendbare Formate: PDF"),
            "salary": _(
                "in Euro angeben; monatliches Gehalt bei >1h, sonst Stundenlohn."
            ),
        }
