Konova Codelist enhancements
* adds proper boolean mapping to update_codelist * differs between id and atom_id for KonovaCode since atomIds are not unique (could change in the future) * adds is_selectable and is_archived to KonovaCode * scales width of DAL form fields to 100% width * adds table-responsive wrapping container for table forms to prevent unwanted rendering artifacts in case of table resizing due to long content * adds autocomplete routes for law, registration offices and conservation offices
This commit is contained in:
@@ -16,7 +16,7 @@ from django.utils.translation import gettext_lazy as _
|
||||
from django.utils.translation import pgettext_lazy as _con
|
||||
|
||||
from codelist.models import KonovaCode
|
||||
from codelist.settings import CODELIST_BIOTOPES_ID
|
||||
from codelist.settings import CODELIST_BIOTOPES_ID, CODELIST_COMPENSATION_ACTION_ID
|
||||
from compensation.models import Payment, CompensationState, CompensationAction, UnitChoices
|
||||
from konova.contexts import BaseContext
|
||||
from konova.forms import BaseForm, BaseModalForm
|
||||
@@ -106,7 +106,7 @@ class NewStateModalForm(BaseModalForm):
|
||||
required=True,
|
||||
help_text=_("Select the biotope type"),
|
||||
queryset=KonovaCode.objects.filter(
|
||||
is_active=True,
|
||||
is_archived=False,
|
||||
is_leaf=True,
|
||||
code_lists__in=[CODELIST_BIOTOPES_ID],
|
||||
),
|
||||
@@ -278,13 +278,14 @@ class NewActionModalForm(BaseModalForm):
|
||||
required=True,
|
||||
help_text=_("Select the action type"),
|
||||
queryset=KonovaCode.objects.filter(
|
||||
is_active=True,
|
||||
is_archived=False,
|
||||
is_leaf=True,
|
||||
code_lists__in=[CODELIST_COMPENSATION_ACTION_ID],
|
||||
),
|
||||
widget=autocomplete.ModelSelect2(
|
||||
url="codes-compensation-action-autocomplete",
|
||||
attrs={
|
||||
"data-placeholder": _("Action"),
|
||||
"data-class": "w-100",
|
||||
}
|
||||
),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user