Use custom CSS class for context row
authorThierry Florac <thierry.florac@onf.fr>
Wed, 27 Jun 2018 15:01:45 +0200
changeset 757 72e2df59af62
parent 756 328866bc10ba
child 758 6aca2a06cbe3
Use custom CSS class for context row
src/pyams_content/shared/site/zmi/container.py
--- a/src/pyams_content/shared/site/zmi/container.py	Wed Jun 27 12:26:04 2018 +0200
+++ b/src/pyams_content/shared/site/zmi/container.py	Wed Jun 27 15:01:45 2018 +0200
@@ -203,7 +203,10 @@
         permission = self.permission
         if self.can_sort and ((not permission) or self.request.has_permission(permission, self.context)):
             classes.append('table-dnd')
-        return {'table': ' '.join(classes)}
+        return {
+            'table': ' '.join(classes),
+            'tr.selected': lambda item, col, row: 'current' if item is self.context else ''
+        }
 
     @property
     def data_attributes(self):