Ajout d'étoiles pour les champs obligatoires
This commit is contained in:
parent
bf5db35e57
commit
be62272487
@ -42,6 +42,8 @@ logger = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class TagForm(ModelForm):
|
class TagForm(ModelForm):
|
||||||
|
required_css_class = 'required'
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Tag
|
model = Tag
|
||||||
fields = ["name", "description", "in_included_suggestions", "in_excluded_suggestions", "principal", "category"]
|
fields = ["name", "description", "in_included_suggestions", "in_excluded_suggestions", "principal", "category"]
|
||||||
@ -50,6 +52,8 @@ class TagForm(ModelForm):
|
|||||||
}
|
}
|
||||||
|
|
||||||
class TagRenameForm(Form):
|
class TagRenameForm(Form):
|
||||||
|
required_css_class = 'required'
|
||||||
|
|
||||||
name = CharField(
|
name = CharField(
|
||||||
label=_('Name of new tag'),
|
label=_('Name of new tag'),
|
||||||
required=True
|
required=True
|
||||||
@ -77,6 +81,8 @@ class TagRenameForm(Form):
|
|||||||
return "force" in self.fields and self.cleaned_data["force"] == True
|
return "force" in self.fields and self.cleaned_data["force"] == True
|
||||||
|
|
||||||
class URLSubmissionForm(Form):
|
class URLSubmissionForm(Form):
|
||||||
|
required_css_class = 'required'
|
||||||
|
|
||||||
url = URLField(max_length=512)
|
url = URLField(max_length=512)
|
||||||
category = ModelChoiceField(
|
category = ModelChoiceField(
|
||||||
label=_("Category"),
|
label=_("Category"),
|
||||||
@ -109,6 +115,8 @@ class DynamicArrayWidgetTags(DynamicArrayWidget):
|
|||||||
|
|
||||||
|
|
||||||
class RecurrentImportForm(ModelForm):
|
class RecurrentImportForm(ModelForm):
|
||||||
|
required_css_class = 'required'
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = RecurrentImport
|
model = RecurrentImport
|
||||||
fields = "__all__"
|
fields = "__all__"
|
||||||
@ -118,12 +126,16 @@ class RecurrentImportForm(ModelForm):
|
|||||||
|
|
||||||
|
|
||||||
class CategorisationRuleImportForm(ModelForm):
|
class CategorisationRuleImportForm(ModelForm):
|
||||||
|
required_css_class = 'required'
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = CategorisationRule
|
model = CategorisationRule
|
||||||
fields = "__all__"
|
fields = "__all__"
|
||||||
|
|
||||||
|
|
||||||
class EventForm(ModelForm):
|
class EventForm(ModelForm):
|
||||||
|
required_css_class = 'required'
|
||||||
|
|
||||||
old_local_image = CharField(widget=HiddenInput(), required=False)
|
old_local_image = CharField(widget=HiddenInput(), required=False)
|
||||||
|
|
||||||
tags = MultipleChoiceField(
|
tags = MultipleChoiceField(
|
||||||
@ -225,6 +237,7 @@ class MultipleChoiceFieldAcceptAll(MultipleChoiceField):
|
|||||||
|
|
||||||
|
|
||||||
class EventModerateForm(ModelForm):
|
class EventModerateForm(ModelForm):
|
||||||
|
required_css_class = 'required'
|
||||||
|
|
||||||
tags = MultipleChoiceField(
|
tags = MultipleChoiceField(
|
||||||
label=_("Tags"),
|
label=_("Tags"),
|
||||||
@ -271,6 +284,8 @@ class EventModerateForm(ModelForm):
|
|||||||
|
|
||||||
|
|
||||||
class BatchImportationForm(Form):
|
class BatchImportationForm(Form):
|
||||||
|
required_css_class = 'required'
|
||||||
|
|
||||||
json = CharField(
|
json = CharField(
|
||||||
label="JSON",
|
label="JSON",
|
||||||
widget=Textarea(attrs={"rows": "10"}),
|
widget=Textarea(attrs={"rows": "10"}),
|
||||||
@ -280,6 +295,8 @@ class BatchImportationForm(Form):
|
|||||||
|
|
||||||
|
|
||||||
class FixDuplicates(Form):
|
class FixDuplicates(Form):
|
||||||
|
required_css_class = 'required'
|
||||||
|
|
||||||
action = ChoiceField()
|
action = ChoiceField()
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
@ -364,6 +381,8 @@ class FixDuplicates(Form):
|
|||||||
|
|
||||||
|
|
||||||
class SelectEventInList(Form):
|
class SelectEventInList(Form):
|
||||||
|
required_css_class = 'required'
|
||||||
|
|
||||||
event = ChoiceField()
|
event = ChoiceField()
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
@ -376,6 +395,8 @@ class SelectEventInList(Form):
|
|||||||
|
|
||||||
|
|
||||||
class MergeDuplicates(Form):
|
class MergeDuplicates(Form):
|
||||||
|
required_css_class = 'required'
|
||||||
|
|
||||||
checkboxes_fields = ["reference_urls", "description"]
|
checkboxes_fields = ["reference_urls", "description"]
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
@ -524,6 +545,8 @@ class MergeDuplicates(Form):
|
|||||||
|
|
||||||
|
|
||||||
class CategorisationForm(Form):
|
class CategorisationForm(Form):
|
||||||
|
required_css_class = 'required'
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
if "events" in kwargs:
|
if "events" in kwargs:
|
||||||
events = kwargs.pop("events", None)
|
events = kwargs.pop("events", None)
|
||||||
@ -554,6 +577,8 @@ class CategorisationForm(Form):
|
|||||||
|
|
||||||
|
|
||||||
class EventAddPlaceForm(Form):
|
class EventAddPlaceForm(Form):
|
||||||
|
required_css_class = 'required'
|
||||||
|
|
||||||
place = ModelChoiceField(
|
place = ModelChoiceField(
|
||||||
label=_("Place"),
|
label=_("Place"),
|
||||||
queryset=Place.objects.all().order_by("name"),
|
queryset=Place.objects.all().order_by("name"),
|
||||||
@ -591,6 +616,8 @@ class EventAddPlaceForm(Form):
|
|||||||
|
|
||||||
|
|
||||||
class PlaceForm(ModelForm):
|
class PlaceForm(ModelForm):
|
||||||
|
required_css_class = 'required'
|
||||||
|
|
||||||
apply_to_all = BooleanField(
|
apply_to_all = BooleanField(
|
||||||
initial=True,
|
initial=True,
|
||||||
label=_(
|
label=_(
|
||||||
|
@ -1443,3 +1443,8 @@ form.messages div, form.moderation-events {
|
|||||||
max-height: 400px;
|
max-height: 400px;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
label.required::after {
|
||||||
|
content: ' *';
|
||||||
|
color: red;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user