Add inline edit panel for claims
This commit is contained in:
@@ -73,14 +73,15 @@ class ClaimDecisionForm(forms.Form):
|
||||
label=_("Evenemang/Projekt"),
|
||||
)
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.fields["project"].queryset = Project.objects.filter(is_active=True).order_by("name")
|
||||
decision_note = forms.CharField(
|
||||
required=False,
|
||||
widget=forms.Textarea(attrs={"rows": 2, "placeholder": _("Kommentar")}),
|
||||
)
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.fields["project"].queryset = Project.objects.filter(is_active=True).order_by("name")
|
||||
|
||||
def clean(self):
|
||||
cleaned = super().clean()
|
||||
action = cleaned.get("action")
|
||||
@@ -90,6 +91,29 @@ class ClaimDecisionForm(forms.Form):
|
||||
return cleaned
|
||||
|
||||
|
||||
class ClaimEditForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Claim
|
||||
fields = [
|
||||
"full_name",
|
||||
"email",
|
||||
"account_number",
|
||||
"amount",
|
||||
"currency",
|
||||
"project",
|
||||
"description",
|
||||
]
|
||||
labels = {
|
||||
"full_name": _("Namn"),
|
||||
"email": _("E-post"),
|
||||
"account_number": _("Kontonummer"),
|
||||
"amount": _("Belopp"),
|
||||
"currency": _("Valuta"),
|
||||
"project": _("Evenemang/Projekt"),
|
||||
"description": _("Beskrivning"),
|
||||
}
|
||||
|
||||
|
||||
class UserManagementForm(forms.Form):
|
||||
username = forms.CharField(max_length=150, label=_("Användarnamn"))
|
||||
email = forms.EmailField(required=False, label=_("E-post"))
|
||||
|
||||
Reference in New Issue
Block a user