Skip to content

Commit

Permalink
Merge pull request #287 from acdh-oeaw/remove-action-columns
Browse files Browse the repository at this point in the history
feat: remove action columns from listview
  • Loading branch information
gythaogg authored Feb 10, 2025
2 parents 55d388a + 743a815 commit 979de6e
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions apis_ontology/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,13 @@ def preview_text(text, n=50):
return truncated_text + "…"


class TibscholEntityMixinTable(GenericTable):
class Meta(GenericTable.Meta):
exclude = ["id", "desc"]
sequence = ("name", "...", "view", "edit", "delete")
class TibscholEntityMixinTable(AbstractEntityTable):
class Meta(AbstractEntityTable.Meta):
exclude = ["id", "desc", "view", "edit", "delete", "noduplicate"]
sequence = (
"name",
"...",
)

export_filename = f"tibschol_export_{datetime.now().strftime('%Y%m%d_%H%M')}"

Expand Down Expand Up @@ -168,8 +171,13 @@ class PlaceTable(TibscholEntityMixinTable):
class Meta(TibscholEntityMixinTable.Meta):
model = Place
fields = ["label", "longitude", "latitude"]
exclude = ("name",)
sequence = ("label", "longitude", "latitude", "...", "view", "edit", "delete")
exclude = ["name"]
sequence = (
"label",
"longitude",
"latitude",
"...",
)

label = tables.Column(
linkify=lambda record: record.get_absolute_url(),
Expand Down Expand Up @@ -217,7 +225,6 @@ class WorkTable(TibscholEntityMixinTable):
class Meta(TibscholEntityMixinTable.Meta):
model = Work
fields = ["name", "author"]
exclude = ["id", "desc"]
row_attrs = {
"style": lambda record: (
"background-color: lightgray;" if not record.isExtant else None
Expand Down

0 comments on commit 979de6e

Please sign in to comment.