Explorar o código

Force checkbox table columns to narrow width

Jeremy Stretch %!s(int64=6) %!d(string=hai) anos
pai
achega
4c677e7fe6
Modificáronse 2 ficheiros con 9 adicións e 0 borrados
  1. 3 0
      netbox/project-static/css/base.css
  2. 6 0
      netbox/utilities/tables.py

+ 3 - 0
netbox/project-static/css/base.css

@@ -149,6 +149,9 @@ table.attr-table td:nth-child(1) {
 .table-headings th {
     background-color: #f5f5f5;
 }
+td.min-width {
+    width: 1%;
+}
 
 /* Paginator */
 div.paginator {

+ 6 - 0
netbox/utilities/tables.py

@@ -26,6 +26,12 @@ class ToggleColumn(tables.CheckBoxColumn):
     def __init__(self, *args, **kwargs):
         default = kwargs.pop('default', '')
         visible = kwargs.pop('visible', False)
+        if 'attrs' not in kwargs:
+            kwargs['attrs'] = {
+                'td': {
+                    'class': 'min-width'
+                }
+            }
         super().__init__(*args, default=default, visible=visible, **kwargs)
 
     @property