From a21b51e34ae9679d1d1ef2db0982392f8a081cc8 Mon Sep 17 00:00:00 2001 From: Ying Zuo Date: Mon, 19 Sep 2016 14:32:53 -0700 Subject: Fix alignment issues for nav-tabs and ul on details panels Added space between the nav-tabs and tab content on details panels. Removed the bullet points in front of instance IP addresses and security groups. Change-Id: I426e73eca0ef8ac57434631da75cb602674be893 Closes-bug: #1625310 --- horizon/tabs/__init__.py | 1 + horizon/tabs/base.py | 4 ++++ horizon/templates/horizon/common/_detail_tab_group.html | 2 ++ horizon/templates/horizon/common/_tab_group.html | 2 +- openstack_dashboard/dashboards/admin/metadata_defs/tabs.py | 2 +- openstack_dashboard/dashboards/admin/networks/views.py | 2 +- openstack_dashboard/dashboards/admin/routers/ports/tabs.py | 2 +- openstack_dashboard/dashboards/identity/identity_providers/tabs.py | 2 +- openstack_dashboard/dashboards/project/instances/tabs.py | 2 +- .../project/instances/templates/instances/_detail_overview.html | 2 +- .../project/instances/templates/instances/_instance_ips.html | 4 ++-- openstack_dashboard/dashboards/project/networks/ports/tabs.py | 2 +- openstack_dashboard/dashboards/project/networks/tabs.py | 2 +- .../project/networks/templates/networks/_detail_overview.html | 2 -- openstack_dashboard/dashboards/project/routers/tabs.py | 2 +- openstack_dashboard/static/dashboard/scss/components/_tab.scss | 3 +++ openstack_dashboard/static/dashboard/scss/horizon.scss | 1 + 17 files changed, 23 insertions(+), 14 deletions(-) create mode 100644 horizon/templates/horizon/common/_detail_tab_group.html create mode 100644 openstack_dashboard/static/dashboard/scss/components/_tab.scss diff --git a/horizon/tabs/__init__.py b/horizon/tabs/__init__.py index e7d57b9b7..ffc03c284 100644 --- a/horizon/tabs/__init__.py +++ b/horizon/tabs/__init__.py @@ -14,6 +14,7 @@ # 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 TabGroup # noqa from horizon.tabs.base import TableTab # noqa diff --git a/horizon/tabs/base.py b/horizon/tabs/base.py index d0a7ec42a..e06915716 100644 --- a/horizon/tabs/base.py +++ b/horizon/tabs/base.py @@ -478,3 +478,7 @@ class TableTab(Tab): def has_more_data(self, table): return False + + +class DetailTabsGroup(TabGroup): + template_name = "horizon/common/_detail_tab_group.html" diff --git a/horizon/templates/horizon/common/_detail_tab_group.html b/horizon/templates/horizon/common/_detail_tab_group.html new file mode 100644 index 000000000..71805d1a5 --- /dev/null +++ b/horizon/templates/horizon/common/_detail_tab_group.html @@ -0,0 +1,2 @@ +{% extends "horizon/common/_tab_group.html" %} +{% block additional_classes %}detail-tabs{% endblock %} \ No newline at end of file diff --git a/horizon/templates/horizon/common/_tab_group.html b/horizon/templates/horizon/common/_tab_group.html index f09a66e8b..8f3aa47fe 100644 --- a/horizon/templates/horizon/common/_tab_group.html +++ b/horizon/templates/horizon/common/_tab_group.html @@ -15,7 +15,7 @@ {# Tab Content #}
{% for tab in tabs %} -
+
{{ tab.render }}
{% endfor %} diff --git a/openstack_dashboard/dashboards/admin/metadata_defs/tabs.py b/openstack_dashboard/dashboards/admin/metadata_defs/tabs.py index cb168de29..d51e7c5ca 100644 --- a/openstack_dashboard/dashboards/admin/metadata_defs/tabs.py +++ b/openstack_dashboard/dashboards/admin/metadata_defs/tabs.py @@ -63,6 +63,6 @@ class ContentsTab(tabs.Tab): "namespace_contents": namespace.as_json()} -class NamespaceDetailTabs(tabs.TabGroup): +class NamespaceDetailTabs(tabs.DetailTabsGroup): slug = "namespace_details" tabs = (OverviewTab, ContentsTab) diff --git a/openstack_dashboard/dashboards/admin/networks/views.py b/openstack_dashboard/dashboards/admin/networks/views.py index 16ff433ba..7b35a84f3 100644 --- a/openstack_dashboard/dashboards/admin/networks/views.py +++ b/openstack_dashboard/dashboards/admin/networks/views.py @@ -146,7 +146,7 @@ class UpdateView(user_views.UpdateView): 'external': network['router__external']} -class NetworkDetailsTabs(tabs.TabGroup): +class NetworkDetailsTabs(tabs.DetailTabsGroup): slug = "network_tabs" tabs = (OverviewTab, subnets_tables.SubnetsTab, ports_tables.PortsTab, agents_tabs.DHCPAgentsTab, ) diff --git a/openstack_dashboard/dashboards/admin/routers/ports/tabs.py b/openstack_dashboard/dashboards/admin/routers/ports/tabs.py index 60f8098f6..4c4749aaa 100644 --- a/openstack_dashboard/dashboards/admin/routers/ports/tabs.py +++ b/openstack_dashboard/dashboards/admin/routers/ports/tabs.py @@ -21,6 +21,6 @@ class OverviewTab(r_tabs.OverviewTab): failure_url = "horizon:admin:routers:index" -class PortDetailTabs(tabs.TabGroup): +class PortDetailTabs(tabs.DetailTabsGroup): slug = "port_details" tabs = (OverviewTab,) diff --git a/openstack_dashboard/dashboards/identity/identity_providers/tabs.py b/openstack_dashboard/dashboards/identity/identity_providers/tabs.py index bd59733ae..e57f7cf7d 100644 --- a/openstack_dashboard/dashboards/identity/identity_providers/tabs.py +++ b/openstack_dashboard/dashboards/identity/identity_providers/tabs.py @@ -42,7 +42,7 @@ class ProtocolsTab(tabs.TableTab): return self.tab_group.kwargs['protocols'] -class IdPDetailTabs(tabs.TabGroup): +class IdPDetailTabs(tabs.DetailTabsGroup): slug = "idp_details" tabs = (OverviewTab, ProtocolsTab) sticky = True diff --git a/openstack_dashboard/dashboards/project/instances/tabs.py b/openstack_dashboard/dashboards/project/instances/tabs.py index deae73395..d6004b129 100644 --- a/openstack_dashboard/dashboards/project/instances/tabs.py +++ b/openstack_dashboard/dashboards/project/instances/tabs.py @@ -108,7 +108,7 @@ class AuditTab(tabs.TableTab): return sorted(actions, reverse=True, key=lambda y: y.start_time) -class InstanceDetailTabs(tabs.TabGroup): +class InstanceDetailTabs(tabs.DetailTabsGroup): slug = "instance_details" tabs = (OverviewTab, LogTab, ConsoleTab, AuditTab) sticky = True diff --git a/openstack_dashboard/dashboards/project/instances/templates/instances/_detail_overview.html b/openstack_dashboard/dashboards/project/instances/templates/instances/_detail_overview.html index 5b3ce74e0..933080b06 100644 --- a/openstack_dashboard/dashboards/project/instances/templates/instances/_detail_overview.html +++ b/openstack_dashboard/dashboards/project/instances/templates/instances/_detail_overview.html @@ -78,7 +78,7 @@ {% for group in instance.security_groups %}
{{ group.name }}
-
    +
      {% for rule in group.rules %}
    • {{ rule }}
    • {% empty %} diff --git a/openstack_dashboard/dashboards/project/instances/templates/instances/_instance_ips.html b/openstack_dashboard/dashboards/project/instances/templates/instances/_instance_ips.html index 5c2a0167c..7b4226b90 100644 --- a/openstack_dashboard/dashboards/project/instances/templates/instances/_instance_ips.html +++ b/openstack_dashboard/dashboards/project/instances/templates/instances/_instance_ips.html @@ -3,14 +3,14 @@ {% if ip_groups.keys|length > 1 %}

      {{ ip_group }}

      {% endif %} -
        +
          {% for address in ips.non_floating %}
        • {{ address.addr }}
        • {% endfor %}
        {% if ips.floating|length > 0 %}
        {% trans 'Floating IPs:' %}
        -
          +
            {% for address in ips.floating %}
          • {{ address.addr }}
          • {% endfor %} diff --git a/openstack_dashboard/dashboards/project/networks/ports/tabs.py b/openstack_dashboard/dashboards/project/networks/ports/tabs.py index 005abef01..7f2e94664 100644 --- a/openstack_dashboard/dashboards/project/networks/ports/tabs.py +++ b/openstack_dashboard/dashboards/project/networks/ports/tabs.py @@ -34,7 +34,7 @@ class OverviewTab(tabs.Tab): return {'port': port} -class PortDetailTabs(tabs.TabGroup): +class PortDetailTabs(tabs.DetailTabsGroup): slug = "port_details" tabs = (OverviewTab, addr_pairs_tabs.AllowedAddressPairsTab) sticky = True diff --git a/openstack_dashboard/dashboards/project/networks/tabs.py b/openstack_dashboard/dashboards/project/networks/tabs.py index c9278e1d5..e48378ae6 100644 --- a/openstack_dashboard/dashboards/project/networks/tabs.py +++ b/openstack_dashboard/dashboards/project/networks/tabs.py @@ -64,7 +64,7 @@ class OverviewTab(tabs.Tab): return context -class NetworkDetailsTabs(tabs.TabGroup): +class NetworkDetailsTabs(tabs.DetailTabsGroup): slug = "network_tabs" tabs = (OverviewTab, subnets_tabs.SubnetsTab, ports_tabs.PortsTab, ) sticky = True diff --git a/openstack_dashboard/dashboards/project/networks/templates/networks/_detail_overview.html b/openstack_dashboard/dashboards/project/networks/templates/networks/_detail_overview.html index 6740dae37..1bdceddbe 100644 --- a/openstack_dashboard/dashboards/project/networks/templates/networks/_detail_overview.html +++ b/openstack_dashboard/dashboards/project/networks/templates/networks/_detail_overview.html @@ -1,7 +1,5 @@ {% load i18n sizeformat %} -

            {% trans "Network Overview" %}

            -
            {% trans "Name" %}
            diff --git a/openstack_dashboard/dashboards/project/routers/tabs.py b/openstack_dashboard/dashboards/project/routers/tabs.py index 0e6fc4e89..3ef73db87 100644 --- a/openstack_dashboard/dashboards/project/routers/tabs.py +++ b/openstack_dashboard/dashboards/project/routers/tabs.py @@ -44,7 +44,7 @@ class InterfacesTab(tabs.TableTab): return self.tab_group.kwargs['ports'] -class RouterDetailTabs(tabs.TabGroup): +class RouterDetailTabs(tabs.DetailTabsGroup): slug = "router_details" tabs = (OverviewTab, InterfacesTab, er_tabs.ExtraRoutesTab) sticky = True diff --git a/openstack_dashboard/static/dashboard/scss/components/_tab.scss b/openstack_dashboard/static/dashboard/scss/components/_tab.scss new file mode 100644 index 000000000..d74e613ec --- /dev/null +++ b/openstack_dashboard/static/dashboard/scss/components/_tab.scss @@ -0,0 +1,3 @@ +.detail-tabs { + margin-top: $padding-large-vertical; +} diff --git a/openstack_dashboard/static/dashboard/scss/horizon.scss b/openstack_dashboard/static/dashboard/scss/horizon.scss index c87d1e73c..64bca0cbb 100644 --- a/openstack_dashboard/static/dashboard/scss/horizon.scss +++ b/openstack_dashboard/static/dashboard/scss/horizon.scss @@ -43,6 +43,7 @@ @import "components/selection_menu"; @import "components/selects"; @import "components/sidebar"; +@import "components/tab"; @import "components/tables"; @import "components/transfer_tables"; @import "components/wizard"; -- cgit v1.2.1