From e4a162b054242242635c355b677c9570039568ad Mon Sep 17 00:00:00 2001 From: Matt Date: Wed, 18 Aug 2021 13:36:48 -0700 Subject: [PATCH] Improve prefix hierarchy/depth styling --- netbox/ipam/tables.py | 10 +++++++--- netbox/project-static/dist/netbox-dark.css | Bin 806097 -> 806356 bytes netbox/project-static/dist/netbox-light.css | Bin 501265 -> 501422 bytes netbox/project-static/dist/netbox.js.map | Bin 1128250 -> 1128315 bytes netbox/project-static/styles/netbox.scss | 16 +++++++++++++++- 5 files changed, 22 insertions(+), 4 deletions(-) diff --git a/netbox/ipam/tables.py b/netbox/ipam/tables.py index 18b147b75..96c2c892e 100644 --- a/netbox/ipam/tables.py +++ b/netbox/ipam/tables.py @@ -15,9 +15,13 @@ AVAILABLE_LABEL = mark_safe('Available') PREFIX_LINK = """ {% load helpers %} -{% for i in record.depth|as_range %} - -{% endfor %} +{% if record.depth %} +
+ {% for i in record.depth|as_range %} + + {% endfor %} +
+{% endif %} {{ record.prefix }} """ diff --git a/netbox/project-static/dist/netbox-dark.css b/netbox/project-static/dist/netbox-dark.css index ca3ff9ccd79e7cc25dd055b0df2fa84e093cfad5..91838758fa66d44789935a0d9ffbe78427917663 100644 GIT binary patch delta 170 zcmcaO)9}h{!-f{d7N!>F7M2#)7Pc1l7LFFq7OocVEj+DW+ImH)$@xVox+$pzB^lKz znZ*S;iIrBFc{!PRsn%)vc_q5VnN_J)hDE8l(+}KXlV&uYzA=$qRTf#BLUBQ2o>hKc sPNi;snr=yD!SsVxjH+^&N^%m5OQ1?pryJhp5SiQ_ro6q?i^qov0J!@;6#xJL delta 39 ucmcaI+wkH{!-f{d7N!>F7M2#)7Pc1l7LFFq7OocVEj+DW+dI5@e3$?qz6~7! diff --git a/netbox/project-static/dist/netbox-light.css b/netbox/project-static/dist/netbox-light.css index e2e969bbd9bcaf18927923cf6b6b6d4304949aaf..6f846911610b024ca1afe2b2c0d88d083f110b84 100644 GIT binary patch delta 165 zcmbPuMsD3%xrP?T7N!>F7M2#)7Pc+y`Af9*ic*vFi&At`QVU8ls#7wH3vv=Gtupg+ zGV@Zc)AI95bc-{qQmqV&Qgf$Qd9X-_85`H4=us#xNX)a!&&#RQ%}>)UsVqpF7M2#)7Pc+y`AfF*EM;HB2mq_o3Zei2 diff --git a/netbox/project-static/dist/netbox.js.map b/netbox/project-static/dist/netbox.js.map index 782ee338be47cd98a804297557b60beafe23fd3e..d5ef1dc212a4d5a3f669a7dfd4ec42444f8966da 100644 GIT binary patch delta 117 zcmdn>&gJ(zmxdO`7N!>F7M2#)7Pc1l7LFFqEnM~YrtiGVCBUVglbM@YqOPN0Fuj|L zTcLf@JuV>T24Wr{<^^ItAm-mb>7Kv_-su`|1o#=F7M2#)7Pc1l7LFFqEnM~YrtjzC7H;2pj|+&oftUw~d4ZS@ si21kgyeF`McYE_2fro;e#)VE*&N{x1CfjrW3AA!B=4}7WCfH#B0IX>!g#Z8m diff --git a/netbox/project-static/styles/netbox.scss b/netbox/project-static/styles/netbox.scss index ec4a7e752..d100e9111 100644 --- a/netbox/project-static/styles/netbox.scss +++ b/netbox/project-static/styles/netbox.scss @@ -422,7 +422,7 @@ main.login-container { padding: 0; .nav-link { - padding: .5rem; + padding: 0.5rem; } @include media-breakpoint-down(md) { @@ -866,6 +866,20 @@ div.card > div.card-header > div.table-controls { border-bottom: 1px solid $nav-tabs-border-color; } +// Object hierarchy indicators. +.record-depth { + display: inline; + font-size: $font-size-base; + user-select: none; + opacity: 0.33; + + // Add spacing to the last or only dot. + span:only-of-type, + span:last-of-type { + margin-right: map.get($spacers, 1); + } +} + #django-messages { position: fixed; right: $spacer;