.
This commit is contained in:
+13
-1
@@ -57,6 +57,15 @@ class LongTable(tables.Table):
|
||||
fields = ("examination", "created_date", "author")
|
||||
sequence = ("view", "series")
|
||||
|
||||
class PopupLinkColumn(tables.Column):
|
||||
def render(self, value):
|
||||
return format_html("<span>test: {}<span>", value)
|
||||
obj = value.first()
|
||||
|
||||
if obj is None:
|
||||
return format_html("<span>No image<span>")
|
||||
|
||||
return obj.get_thumbnail()[0]
|
||||
|
||||
class LongSeriesTable(tables.Table):
|
||||
edit = tables.LinkColumn(
|
||||
@@ -65,10 +74,13 @@ class LongSeriesTable(tables.Table):
|
||||
view = tables.LinkColumn(
|
||||
"longs:long_series_detail", text="View", args=[A("pk")], orderable=False
|
||||
)
|
||||
popup = PopupLinkColumn(
|
||||
"View in popup", orderable=False
|
||||
)
|
||||
images = LongSeriesImageColumn("Images", orderable=False)
|
||||
|
||||
class Meta:
|
||||
model = Long
|
||||
template_name = "django_tables2/bootstrap4.html"
|
||||
fields = ("modality", "examination", "long", "description", "author")
|
||||
sequence = ("view", "images")
|
||||
sequence = ("view", "popup", "images")
|
||||
Reference in New Issue
Block a user