From 52a0343ff995c3a13043b08e811bf04fdbfa54ae Mon Sep 17 00:00:00 2001 From: Shea Craig Date: Mon, 11 May 2020 07:27:58 -0400 Subject: [PATCH] Fix duplication of managed items from one source "over" another. For the machine detail page, the ManagedItems display creates a dropdown menu for sources that optionally provide multiple subtypes of items (e.g. Munki with ManagedInstalls, ManagedUninstalls). Sources that don't have these were having their items hidden due to the way the template code was constructing intra-page anchor names. Specifically, the items passed to the template used the key 'none' for the link href, and so if you had more than one, they would get squashed. This change adds the management source (slugified) as a prefix to the item type to create unique targets for these links and solve this issue. --- server/templates/server/machine_detail.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/server/templates/server/machine_detail.html b/server/templates/server/machine_detail.html index 585cda11..8114b55d 100644 --- a/server/templates/server/machine_detail.html +++ b/server/templates/server/machine_detail.html @@ -216,17 +216,19 @@

{{ machine.hostname }}

{% if managed_items %} {% for management_source, items in managed_items.items %} {% if items|length == 1 %} +
  • {% for item_type in items %} - {{ management_source }} + {{ management_source }} {% endfor %}
  • {% else %} + @@ -238,7 +240,7 @@

    {{ machine.hostname }}

    {% for management_source, items in managed_items.items %} {% for key, values in items.items %} -
    +
    {% with title=management_source items=values type=key %} {% include 'server/managed_item_table.html' %} {% endwith %}