Skip to content

Commit

Permalink
Merge pull request mbari-org#242 from MBARIMike/main
Browse files Browse the repository at this point in the history
Fixes for missions: admin interface fix, filtering widget improvements
  • Loading branch information
MBARIMike authored May 30, 2024
2 parents d7274f2 + b5e83ca commit ff302c1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
4 changes: 2 additions & 2 deletions smdb/smdb/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class MissionAdmin(GeoModelAdmin):
"start_depth",
"comment",
"quality_comment",
"patch_test",
"repeat_survey",
"directory",
"notes_filename",
Expand All @@ -91,8 +92,7 @@ class MissionAdmin(GeoModelAdmin):
"thumbnail_filename",
"thumbnail_image",
"kml_filename",
"compilation",
"update_status",
"quality_categories",
]
readonly_fields = ["image_tag"]
prepopulated_fields = {"slug": ("name",)}
Expand Down
24 changes: 18 additions & 6 deletions smdb/smdb/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ class MissionFilter(FilterSet):
label="",
empty_label="- region -",
widget=forms.Select(
attrs={"class": "form-control", "style": "font-weight: 300;"}
attrs={
"class": "form-control",
"style": "font-weight: 300; font-size: smaller;",
}
),
)
quality_categories = ModelMultipleChoiceFilter(
Expand All @@ -40,20 +43,26 @@ class MissionFilter(FilterSet):
)
patch_test = ChoiceFilter(
field_name="patch_test",
choices=[(None, "-"), (True, "Yes"), (False, "No")],
choices=[(None, "-"), (True, "")],
label="",
empty_label="- Patch Test -",
widget=forms.Select(
attrs={"class": "form-control", "style": "font-weight: 300;"}
attrs={
"class": "form-control",
"style": "font-weight: 300; font-size: smaller;",
}
),
)
repeat_survey = ChoiceFilter(
field_name="repeat_survey",
choices=[(None, "-"), (True, "Yes"), (False, "No")],
choices=[(None, "-"), (True, "")],
label="",
empty_label="- Repeat Survey -",
widget=forms.Select(
attrs={"class": "form-control", "style": "font-weight: 300;"}
attrs={
"class": "form-control",
"style": "font-weight: 300; font-size: smaller;",
}
),
)
mgds_compilation = ChoiceFilter(
Expand All @@ -67,7 +76,10 @@ class MissionFilter(FilterSet):
label="",
empty_label="- MGDS_compilation -",
widget=forms.Select(
attrs={"class": "form-control", "style": "font-weight: 300;"}
attrs={
"class": "form-control",
"style": "font-weight: 300; font-size: smaller;",
}
),
)
expedition__name = CharFilter(
Expand Down

0 comments on commit ff302c1

Please sign in to comment.