Skip to content

Commit

Permalink
Merge pull request #391 from salopensource/fix_duplicated_md_managed_…
Browse files Browse the repository at this point in the history
…items

Fix duplication of managed items from one source "over" another.
  • Loading branch information
sheagcraig authored May 19, 2020
2 parents 88edfac + 52a0343 commit d6d1a97
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions server/templates/server/machine_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -216,17 +216,19 @@ <h2 style="text-align:center">{{ machine.hostname }}</h2>
{% if managed_items %}
{% for management_source, items in managed_items.items %}
{% if items|length == 1 %}
<!-- This type has no subtypes, so don't do a dropdown menu -->
<li {% if management_source == initial_source %}class="active" {% endif %}role="presentation">
{% for item_type in items %}
<a aria-expanded="true" data-toggle="tab" href="#{{ item_type|slugify }}">{{ management_source }}</a>
<a aria-expanded="true" data-toggle="tab" href="#{{ management_source|slugify }}-{{ item_type|slugify }}">{{ management_source }}</a>
{% endfor %}
</li>
{% else %}
<!-- This type has subtypes, so do a dropdown menu -->
<li class="dropdown{% if management_source == initial_source %} active{% endif %}" role="presentation">
<a class="dropdown-toggle" role="button" aria-haspopup="true" data-toggle="dropdown" href="#">{{ management_source }} <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
{% for item_type in items %}
<li><a data-toggle="tab" href="#{{ item_type|slugify }}"><i class="fa fa-info-circle color-green"></i> {{ item_type }}</a></li>
<li><a data-toggle="tab" href="#{{ management_source|slugify }}-{{ item_type|slugify }}"><i class="fa fa-info-circle color-green"></i> {{ item_type }}</a></li>
{% endfor %}
</ul>
</li>
Expand All @@ -238,7 +240,7 @@ <h2 style="text-align:center">{{ machine.hostname }}</h2>
<div class="tab-content">
{% for management_source, items in managed_items.items %}
{% for key, values in items.items %}
<div class="tab-pane {% if active_table == key %}in active{% endif %} fade" id="{{ key|slugify }}">
<div class="tab-pane {% if active_table == key %}in active{% endif %} fade" id="{{ management_source|slugify }}-{{ key|slugify }}">
{% with title=management_source items=values type=key %}
{% include 'server/managed_item_table.html' %}
{% endwith %}
Expand Down

0 comments on commit d6d1a97

Please sign in to comment.