fix: cleanup Group views to better match farmOS
This commit is contained in:
parent
5e4cd8978d
commit
aae01c010b
1 changed files with 17 additions and 5 deletions
|
|
@ -38,10 +38,13 @@ class GroupView(WuttaFarmMasterView):
|
|||
|
||||
farmos_refurl_path = "/assets/group"
|
||||
|
||||
labels = {
|
||||
"name": "Asset Name",
|
||||
}
|
||||
|
||||
grid_columns = [
|
||||
"drupal_id",
|
||||
"name",
|
||||
"is_location",
|
||||
"is_fixed",
|
||||
"archived",
|
||||
]
|
||||
|
||||
|
|
@ -54,10 +57,9 @@ class GroupView(WuttaFarmMasterView):
|
|||
|
||||
form_fields = [
|
||||
"name",
|
||||
"is_location",
|
||||
"is_fixed",
|
||||
"archived",
|
||||
"notes",
|
||||
"asset_type",
|
||||
"archived",
|
||||
"farmos_uuid",
|
||||
"drupal_id",
|
||||
]
|
||||
|
|
@ -66,6 +68,9 @@ class GroupView(WuttaFarmMasterView):
|
|||
g = grid
|
||||
super().configure_grid(g)
|
||||
|
||||
# drupal_id
|
||||
g.set_label("drupal_id", "ID", column_only=True)
|
||||
|
||||
# name
|
||||
g.set_link("name")
|
||||
|
||||
|
|
@ -82,6 +87,13 @@ class GroupView(WuttaFarmMasterView):
|
|||
# notes
|
||||
f.set_widget("notes", "notes")
|
||||
|
||||
# asset_type
|
||||
if self.creating:
|
||||
f.remove("asset_type")
|
||||
else:
|
||||
f.set_default("asset_type", "Group")
|
||||
f.set_readonly("asset_type")
|
||||
|
||||
def get_farmos_url(self, group):
|
||||
return self.app.get_farmos_url(f"/asset/{group.drupal_id}")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue