From 4b2922312a3aa58d9c63e5b95577e8fd841b4a45 Mon Sep 17 00:00:00 2001 From: kkthxbye-code Date: Sun, 23 Jul 2023 23:08:08 +0200 Subject: [PATCH] Allow the align property on th and td and add CSS rules for overriding text-alignment --- netbox/project-static/dist/netbox-dark.css | Bin 375390 -> 375591 bytes netbox/project-static/dist/netbox-light.css | Bin 232699 -> 232798 bytes netbox/project-static/dist/netbox-print.css | Bin 727424 -> 727883 bytes netbox/project-static/styles/netbox.scss | 12 ++++++++++++ netbox/utilities/utils.py | 2 ++ 5 files changed, 14 insertions(+) diff --git a/netbox/project-static/dist/netbox-dark.css b/netbox/project-static/dist/netbox-dark.css index 11110069e11515e95b985a5bb8cf2eb818eb395d..2aa24b72c1b05dc2fdcadd498f5c2a8817b85ee2 100644 GIT binary patch delta 111 zcmccjMQr&uv4$4L7N!>F7M3lng4_5@GNKc6GSl;Hb5hevVyma`o55lv2p3FF%_~VQ u0t(BEGMUK3g^M!NGk}UqQY%Vy!Md$LBGU^)nAN5yY-5$!uDy-bm<0e}V<~I^ delta 30 mcmZ4fP3+zmv4$4L7N!>F7M3lng4?F|Z)X+T{$U%dIST;J5DZHI diff --git a/netbox/project-static/dist/netbox-light.css b/netbox/project-static/dist/netbox-light.css index 8a3c83af9b64aa1f2bd4a5ffab0b40139bf9dc80..ffdd83285e235e4f723f8f46937a2c0ab5033570 100644 GIT binary patch delta 120 zcmex8lkeUvzJ?aY7N#xCOkGJO8PSP3ndy19IjLzSvDGE16(zc00V|L|EnGS|HLoPK Z2t@%z2%)4XGd%;<2(ZX@#xCYxOaNOOFVX-2 delta 26 icmcaNi|_YLzJ?aY7N#xCOkL9_bTLb9ukT{M&jbLLUJ7Xd diff --git a/netbox/project-static/dist/netbox-print.css b/netbox/project-static/dist/netbox-print.css index ef2682e0a33fc5e0ede356d8f29c499cb48e87b2..b492e4d1dbd0bfe6538e68d291f6d78972bb52ea 100644 GIT binary patch delta 217 zcmZqJtaEysPD2Z03sVbo3rh=Y3tJ0&3r7oQ3)dFzxBMI>8PSP3ndy1c@10}SMByn< z7x=)%!3UMM%}GrwiLIVot*y!p(P5jMnpZNt@E)@oFU$~#(8agR>VhajsYS8X(_h=N ws3I(wbAnY1g{K0xP7Y>WQD%Au(7uw?iV|J01Fb+J(?2d^6W{)xpL-%F0K48&(*OVf delta 37 tcmX@TO{ZbAPD2Z03sVbo3rh=Y3tJ0&3r7oQ3)dFzxBT082y##61ONit49)-m diff --git a/netbox/project-static/styles/netbox.scss b/netbox/project-static/styles/netbox.scss index b294d67bd..94fddc32c 100644 --- a/netbox/project-static/styles/netbox.scss +++ b/netbox/project-static/styles/netbox.scss @@ -1002,6 +1002,18 @@ div.card-overlay { padding: 8px; } +th[align="left"] { + text-align: left; +} + +th[align="center"] { + text-align: center; +} + +th[align="right"] { + text-align: right; +} + /* Markdown widget */ .markdown-widget { .nav-link { diff --git a/netbox/utilities/utils.py b/netbox/utilities/utils.py index 114397dae..9524e242c 100644 --- a/netbox/utilities/utils.py +++ b/netbox/utilities/utils.py @@ -519,6 +519,8 @@ def clean_html(html, schemes): "h1": ["id"], "h2": ["id"], "h3": ["id"], "h4": ["id"], "h5": ["id"], "h6": ["id"], "a": ["href", "title"], "img": ["src", "title", "alt"], + "th": ["align"], + "td": ["align"], } return bleach.clean(