Merge "Fix alignment issues for nav-tabs and ul on details panels"

This commit is contained in:
Jenkins 2017-01-30 05:52:18 +00:00 committed by Gerrit Code Review
commit 06651ab018
17 changed files with 23 additions and 14 deletions

View File

@ -14,6 +14,7 @@
# Importing non-modules that are not used explicitly # Importing non-modules that are not used explicitly
from horizon.tabs.base import DetailTabsGroup # noqa
from horizon.tabs.base import Tab # noqa from horizon.tabs.base import Tab # noqa
from horizon.tabs.base import TabGroup # noqa from horizon.tabs.base import TabGroup # noqa
from horizon.tabs.base import TableTab # noqa from horizon.tabs.base import TableTab # noqa

View File

@ -478,3 +478,7 @@ class TableTab(Tab):
def has_more_data(self, table): def has_more_data(self, table):
return False return False
class DetailTabsGroup(TabGroup):
template_name = "horizon/common/_detail_tab_group.html"

View File

@ -0,0 +1,2 @@
{% extends "horizon/common/_tab_group.html" %}
{% block additional_classes %}detail-tabs{% endblock %}

View File

@ -15,7 +15,7 @@
{# Tab Content #} {# Tab Content #}
<div class="tab-content"> <div class="tab-content">
{% for tab in tabs %} {% for tab in tabs %}
<div id="{{ tab.get_id }}" class="tab-pane{% if tab.is_active %} active{% endif %}"> <div id="{{ tab.get_id }}" class="tab-pane{% if tab.is_active %} active{% endif %} {% block additional_classes %}{% endblock %}">
{{ tab.render }} {{ tab.render }}
</div> </div>
{% endfor %} {% endfor %}

View File

@ -63,6 +63,6 @@ class ContentsTab(tabs.Tab):
"namespace_contents": namespace.as_json()} "namespace_contents": namespace.as_json()}
class NamespaceDetailTabs(tabs.TabGroup): class NamespaceDetailTabs(tabs.DetailTabsGroup):
slug = "namespace_details" slug = "namespace_details"
tabs = (OverviewTab, ContentsTab) tabs = (OverviewTab, ContentsTab)

View File

@ -145,7 +145,7 @@ class UpdateView(user_views.UpdateView):
'external': network['router__external']} 'external': network['router__external']}
class NetworkDetailsTabs(tabs.TabGroup): class NetworkDetailsTabs(tabs.DetailTabsGroup):
slug = "network_tabs" slug = "network_tabs"
tabs = (OverviewTab, subnets_tables.SubnetsTab, ports_tables.PortsTab, tabs = (OverviewTab, subnets_tables.SubnetsTab, ports_tables.PortsTab,
agents_tabs.DHCPAgentsTab, ) agents_tabs.DHCPAgentsTab, )

View File

@ -21,6 +21,6 @@ class OverviewTab(r_tabs.OverviewTab):
failure_url = "horizon:admin:routers:index" failure_url = "horizon:admin:routers:index"
class PortDetailTabs(tabs.TabGroup): class PortDetailTabs(tabs.DetailTabsGroup):
slug = "port_details" slug = "port_details"
tabs = (OverviewTab,) tabs = (OverviewTab,)

View File

@ -42,7 +42,7 @@ class ProtocolsTab(tabs.TableTab):
return self.tab_group.kwargs['protocols'] return self.tab_group.kwargs['protocols']
class IdPDetailTabs(tabs.TabGroup): class IdPDetailTabs(tabs.DetailTabsGroup):
slug = "idp_details" slug = "idp_details"
tabs = (OverviewTab, ProtocolsTab) tabs = (OverviewTab, ProtocolsTab)
sticky = True sticky = True

View File

@ -108,7 +108,7 @@ class AuditTab(tabs.TableTab):
return sorted(actions, reverse=True, key=lambda y: y.start_time) return sorted(actions, reverse=True, key=lambda y: y.start_time)
class InstanceDetailTabs(tabs.TabGroup): class InstanceDetailTabs(tabs.DetailTabsGroup):
slug = "instance_details" slug = "instance_details"
tabs = (OverviewTab, LogTab, ConsoleTab, AuditTab) tabs = (OverviewTab, LogTab, ConsoleTab, AuditTab)
sticky = True sticky = True

View File

@ -78,7 +78,7 @@
{% for group in instance.security_groups %} {% for group in instance.security_groups %}
<dt>{{ group.name }}</dt> <dt>{{ group.name }}</dt>
<dd> <dd>
<ul> <ul class="list-unstyled">
{% for rule in group.rules %} {% for rule in group.rules %}
<li>{{ rule }}</li> <li>{{ rule }}</li>
{% empty %} {% empty %}

View File

@ -3,14 +3,14 @@
{% if ip_groups.keys|length > 1 %} {% if ip_groups.keys|length > 1 %}
<h4>{{ ip_group }}</h4> <h4>{{ ip_group }}</h4>
{% endif %} {% endif %}
<ul> <ul class="list-unstyled">
{% for address in ips.non_floating %} {% for address in ips.non_floating %}
<li>{{ address.addr }}</li> <li>{{ address.addr }}</li>
{% endfor %} {% endfor %}
</ul> </ul>
{% if ips.floating|length > 0 %} {% if ips.floating|length > 0 %}
<h5>{% trans 'Floating IPs:' %}</h5> <h5>{% trans 'Floating IPs:' %}</h5>
<ul> <ul class="list-unstyled">
{% for address in ips.floating %} {% for address in ips.floating %}
<li>{{ address.addr }}</li> <li>{{ address.addr }}</li>
{% endfor %} {% endfor %}

View File

@ -34,7 +34,7 @@ class OverviewTab(tabs.Tab):
return {'port': port} return {'port': port}
class PortDetailTabs(tabs.TabGroup): class PortDetailTabs(tabs.DetailTabsGroup):
slug = "port_details" slug = "port_details"
tabs = (OverviewTab, addr_pairs_tabs.AllowedAddressPairsTab) tabs = (OverviewTab, addr_pairs_tabs.AllowedAddressPairsTab)
sticky = True sticky = True

View File

@ -64,7 +64,7 @@ class OverviewTab(tabs.Tab):
return context return context
class NetworkDetailsTabs(tabs.TabGroup): class NetworkDetailsTabs(tabs.DetailTabsGroup):
slug = "network_tabs" slug = "network_tabs"
tabs = (OverviewTab, subnets_tabs.SubnetsTab, ports_tabs.PortsTab, ) tabs = (OverviewTab, subnets_tabs.SubnetsTab, ports_tabs.PortsTab, )
sticky = True sticky = True

View File

@ -1,7 +1,5 @@
{% load i18n sizeformat %} {% load i18n sizeformat %}
<h3>{% trans "Network Overview" %}</h3>
<div class="info detail"> <div class="info detail">
<dl class="dl-horizontal"> <dl class="dl-horizontal">
<dt title="{% trans 'Name' %}">{% trans "Name" %}</dt> <dt title="{% trans 'Name' %}">{% trans "Name" %}</dt>

View File

@ -44,7 +44,7 @@ class InterfacesTab(tabs.TableTab):
return self.tab_group.kwargs['ports'] return self.tab_group.kwargs['ports']
class RouterDetailTabs(tabs.TabGroup): class RouterDetailTabs(tabs.DetailTabsGroup):
slug = "router_details" slug = "router_details"
tabs = (OverviewTab, InterfacesTab, er_tabs.ExtraRoutesTab) tabs = (OverviewTab, InterfacesTab, er_tabs.ExtraRoutesTab)
sticky = True sticky = True

View File

@ -0,0 +1,3 @@
.detail-tabs {
margin-top: $padding-large-vertical;
}

View File

@ -43,6 +43,7 @@
@import "components/selection_menu"; @import "components/selection_menu";
@import "components/selects"; @import "components/selects";
@import "components/sidebar"; @import "components/sidebar";
@import "components/tab";
@import "components/tables"; @import "components/tables";
@import "components/transfer_tables"; @import "components/transfer_tables";
@import "components/wizard"; @import "components/wizard";