diff --git a/svjis/articles/forms.py b/svjis/articles/forms.py
index 0555cc8..b1d4922 100644
--- a/svjis/articles/forms.py
+++ b/svjis/articles/forms.py
@@ -245,7 +245,7 @@ def label_from_instance(self, obj):
class BoardForm(forms.ModelForm):
- member = MemberModelChoiceField(queryset=User.objects.filter(is_active=True).order_by('last_name'))
+ member = MemberModelChoiceField(queryset=User.objects.filter(is_active=True).order_by('last_name', 'first_name'))
class Meta:
model = models.Board
@@ -311,7 +311,7 @@ class Meta:
}
-class AssignedUserChoiceField(forms.ModelChoiceField):
+class UserChoiceField(forms.ModelChoiceField):
def label_from_instance(self, obj):
return f"{obj.last_name} {obj.first_name}"
@@ -323,24 +323,30 @@ class FaultReportForm(forms.ModelForm):
help_text=_(SELECT_ENTRANCE_TEXT),
label=_("Entrance"),
)
- assigned_to_user = AssignedUserChoiceField(
+ assigned_to_user = UserChoiceField(
queryset=User.objects.filter(groups__permissions__codename='svjis_fault_resolver')
.exclude(is_active=False)
.distinct()
- .order_by('last_name'),
+ .order_by('last_name', 'first_name'),
required=False,
label=_("Resolver"),
)
+ created_by_user = UserChoiceField(
+ queryset=User.objects.exclude(is_active=False).distinct().order_by('last_name', 'first_name'),
+ required=False,
+ label=_("On Behalf Of"),
+ )
class Meta:
model = models.FaultReport
- fields = ("subject", "entrance", "description", "assigned_to_user", "closed")
+ fields = ("subject", "entrance", "description", "created_by_user", "assigned_to_user", "closed")
widgets = {
'subject': forms.widgets.TextInput(attrs={'class': 'common-input', 'size': '80'}),
'entrance': forms.widgets.Select(attrs={'class': 'common-input'}),
'description': forms.widgets.Textarea(
attrs={'class': 'common-textarea', 'rows': '5', 'cols': '80', 'wrap': True}
),
+ 'created_by_user': forms.widgets.Select(attrs={'class': 'common-input'}),
'assigned_to_user': forms.widgets.Select(attrs={'class': 'common-input'}),
'closed': forms.widgets.CheckboxInput(attrs={'class': 'common-input', 'size': '50'}),
}
diff --git a/svjis/articles/locale/cs/LC_MESSAGES/django.po b/svjis/articles/locale/cs/LC_MESSAGES/django.po
index 9b25000..e413101 100644
--- a/svjis/articles/locale/cs/LC_MESSAGES/django.po
+++ b/svjis/articles/locale/cs/LC_MESSAGES/django.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-10-10 10:18+0200\n"
+"POT-Creation-Date: 2024-11-11 19:21+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME {% trans 'Fault report' %}
{{ form.description }}
+ {{ form.created_by_user.label }}
+ {{ form.created_by_user }}
+
{{ form.assigned_to_user.label }}
{{ form.assigned_to_user }}
diff --git a/svjis/articles/templates/faults_edit.html b/svjis/articles/templates/faults_edit.html
index e4832fc..3da19a0 100644
--- a/svjis/articles/templates/faults_edit.html
+++ b/svjis/articles/templates/faults_edit.html
@@ -9,6 +9,7 @@