diff options
author | Tzu-Mainn Chen <tzumainn@redhat.com> | 2013-11-15 11:57:02 -0500 |
---|---|---|
committer | Tzu-Mainn Chen <tzumainn@redhat.com> | 2013-11-16 12:24:53 -0500 |
commit | e9c91b4f66b70efbd3947fdab40b4f9e6c630989 (patch) | |
tree | 1375e2a6dda4625ccf1d44fd163520a313a1cb45 | |
parent | cbecbbb656e49261faaf6cd618481e1a389af854 (diff) | |
download | tuskar-ui-e9c91b4f66b70efbd3947fdab40b4f9e6c630989.tar.gz |
Fix rack overview page when resource class is None
The rack overview page links to the rack's associated
resource class. However, this link is active even
if there is no associated resource class, resulting
in a dead link. This patch turns off the link if
there is no associated resource class
Change-Id: Ic0f4812a4bd325548a7965a44517569e656e26ff
-rw-r--r-- | tuskar_ui/infrastructure/resource_management/templates/resource_management/racks/_detail_overview.html | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tuskar_ui/infrastructure/resource_management/templates/resource_management/racks/_detail_overview.html b/tuskar_ui/infrastructure/resource_management/templates/resource_management/racks/_detail_overview.html index cb6f84f2..a60ec86b 100644 --- a/tuskar_ui/infrastructure/resource_management/templates/resource_management/racks/_detail_overview.html +++ b/tuskar_ui/infrastructure/resource_management/templates/resource_management/racks/_detail_overview.html @@ -51,9 +51,13 @@ </dd> <dt>{% trans "Class" %}</dt> <dd> - <a href="{% url 'horizon:infrastructure:resource_management:resource_classes:detail' rack.resource_class_id %}"> - {{ rack.resource_class.name|default:_("None") }} - </a> + {% if rack.resource_class %} + <a href="{% url 'horizon:infrastructure:resource_management:resource_classes:detail' rack.resource_class_id %}"> + {{ rack.resource_class.name }} + </a> + {% else %} + {% trans "None" %} + {% endif %} </dd> <dt>{% trans "Class Image" %}</dt> <dd>overcloud-compute</dd> {# FIXME It will eventually have to be not-hardcoded later #} |