From d2239130c7fe6e2c78918b242b10f47f8b4fa7b6 Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Tue, 24 Feb 2015 14:55:31 +0100 Subject: [PATCH] Display flavorless nodes, hide the node counts Change-Id: I769e28ed6accfd03a2c56d8365bb8f0e70107aa2 --- tuskar_boxes/overview/views.py | 7 +- .../overview/role_nodes_edit.html | 82 +++++++++---------- 2 files changed, 43 insertions(+), 46 deletions(-) diff --git a/tuskar_boxes/overview/views.py b/tuskar_boxes/overview/views.py index c396fdc..7c97b30 100644 --- a/tuskar_boxes/overview/views.py +++ b/tuskar_boxes/overview/views.py @@ -149,8 +149,13 @@ class IndexView(views.IndexView): field.initial = 0 free_roles.append(role) data['free_roles'] = free_roles - data['flavors'] = list( + flavor_data = list( _flavor_data(self.request, flavors, flavor_roles)) + data['flavors'] = flavor_data + data['no_flavor_nodes'] = [ + node for node in nodes + if not any(node in d['nodes'] for d in flavor_data) + ] else: distribution = collections.Counter() diff --git a/tuskar_boxes/templates/tuskar_boxes/overview/role_nodes_edit.html b/tuskar_boxes/templates/tuskar_boxes/overview/role_nodes_edit.html index 283d5f4..b0d759c 100644 --- a/tuskar_boxes/templates/tuskar_boxes/overview/role_nodes_edit.html +++ b/tuskar_boxes/templates/tuskar_boxes/overview/role_nodes_edit.html @@ -12,57 +12,49 @@ {% endspaceless %}{% endfor %} -

{% trans "Available Flavors" %}

+

{% trans "Hardware" %}

{% for flavor in flavors %} -
-
-
- {% trans "Flavor:" %} - {{ flavor.name }} - {{ flavor.cpu_arch }}, - {{ flavor.vcpus }} CPU, - {{ flavor.ram }}MB RAM, - {{ flavor.disk }}GB Disk -
-
- - {% trans "Free Nodes:" %} - / {{ flavor.nodes|length }} - -
+
+
+ {% trans "Flavor:" %} + {{ flavor.name }} + {{ flavor.cpu_arch }}, + {{ flavor.vcpus }} CPU, + {{ flavor.ram }}MB RAM, + {{ flavor.disk }}GB Disk
-
-
-
-
-
-
-
-
- {% for role in flavor.roles %}{% spaceless %} - {% include "tuskar_boxes/overview/_role_info.html" with role=role %} - {% endspaceless %}{% endfor %} -
-
-
-

- {% trans "enroll a deployment role" %}
-
- -
+
+
+
+ {% for role in flavor.roles %}{% spaceless %} + {% include "tuskar_boxes/overview/_role_info.html" with role=role %} + {% endspaceless %}{% endfor %} +
+
+
+

+ {% trans "enroll a deployment role" %}
- {% include "tuskar_boxes/overview/_node_info.html" with nodes=flavor.nodes classes="col-xs-7" %} + +
+ {% include "tuskar_boxes/overview/_node_info.html" with nodes=flavor.nodes classes="col-xs-7" %} +
{% endfor %} - +
+
{% trans "No flavor" %}
+
+ {% include "tuskar_boxes/overview/_node_info.html" with nodes=no_flavor_nodes %} +
+