summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Tomasek <jtomasek@redhat.com>2014-11-14 16:19:14 +0100
committerJiri Tomasek <jtomasek@redhat.com>2014-11-14 16:34:14 +0100
commitbef0a07f4d34b04d990a639e4bffb8147ec9f8a3 (patch)
tree76acc8304ca42eae34d430eb4119e88743c4e576
parent75a5429dfd373e7b6ab7adca60b777eed376cbf9 (diff)
downloadtuskar-ui-bef0a07f4d34b04d990a639e4bffb8147ec9f8a3.tar.gz
Define table header visibility using hidden_title meta
As Horizon now supports hidden_title meta in tables, we can replace stylesheet solution Change-Id: Ifed820fb4b5942b02f11124ee916d8cc7ea506a5
-rw-r--r--tuskar_ui/infrastructure/flavors/tables.py1
-rw-r--r--tuskar_ui/infrastructure/flavors/templates/flavors/index.html4
-rw-r--r--tuskar_ui/infrastructure/history/templates/history/index.html4
-rw-r--r--tuskar_ui/infrastructure/images/templates/images/index.html4
-rw-r--r--tuskar_ui/infrastructure/nodes/tables.py4
-rw-r--r--tuskar_ui/infrastructure/roles/templates/roles/index.html4
-rw-r--r--tuskar_ui/infrastructure/static/infrastructure/scss/_tables.scss5
-rw-r--r--tuskar_ui/infrastructure/templates/horizon/common/_enhanced_data_table.html4
8 files changed, 13 insertions, 17 deletions
diff --git a/tuskar_ui/infrastructure/flavors/tables.py b/tuskar_ui/infrastructure/flavors/tables.py
index b4e7282f..c9913a23 100644
--- a/tuskar_ui/infrastructure/flavors/tables.py
+++ b/tuskar_ui/infrastructure/flavors/tables.py
@@ -129,6 +129,7 @@ class FlavorRolesTable(horizon.tables.DataTable):
verbose_name = _("Overcloud Roles")
table_actions = ()
row_actions = ()
+ hidden_title = False
template = "horizon/common/_enhanced_data_table.html"
diff --git a/tuskar_ui/infrastructure/flavors/templates/flavors/index.html b/tuskar_ui/infrastructure/flavors/templates/flavors/index.html
index 90ec5cf6..88bbed6c 100644
--- a/tuskar_ui/infrastructure/flavors/templates/flavors/index.html
+++ b/tuskar_ui/infrastructure/flavors/templates/flavors/index.html
@@ -24,12 +24,12 @@
</thead>
</table>
-<div id="suggested-flavors" class="panel-collapse collapse no-table-title">
+<div id="suggested-flavors" class="panel-collapse collapse">
{{ suggested_flavors_table.render }}
</div>
{% endif %}
-<div id="flavors" class="no-table-title">
+<div id="flavors">
{{ flavors_table.render }}
</div>
{% endblock %}
diff --git a/tuskar_ui/infrastructure/history/templates/history/index.html b/tuskar_ui/infrastructure/history/templates/history/index.html
index 741336d4..a2ae7db6 100644
--- a/tuskar_ui/infrastructure/history/templates/history/index.html
+++ b/tuskar_ui/infrastructure/history/templates/history/index.html
@@ -9,9 +9,7 @@
{% block main %}
<div class="row">
<div class="col-xs-12">
- <div class="no-table-title"> {% comment %}This will likely move to the tables Meta in the future{% endcomment %}
- {{ table.render }}
- </div>
+ {{ table.render }}
</div>
</div>
diff --git a/tuskar_ui/infrastructure/images/templates/images/index.html b/tuskar_ui/infrastructure/images/templates/images/index.html
index a6ca5801..88e69c95 100644
--- a/tuskar_ui/infrastructure/images/templates/images/index.html
+++ b/tuskar_ui/infrastructure/images/templates/images/index.html
@@ -9,9 +9,7 @@
{% block main %}
<div class="row">
<div class="col-xs-12">
- <div class="no-table-title"> {% comment %}This will likely move to the tables Meta in the future{% endcomment %}
- {{ table.render }}
- </div>
+ {{ table.render }}
</div>
</div>
diff --git a/tuskar_ui/infrastructure/nodes/tables.py b/tuskar_ui/infrastructure/nodes/tables.py
index b32e0708..3452504e 100644
--- a/tuskar_ui/infrastructure/nodes/tables.py
+++ b/tuskar_ui/infrastructure/nodes/tables.py
@@ -188,6 +188,7 @@ class AllNodesTable(BaseNodesTable):
class Meta:
name = "all_nodes_table"
verbose_name = _("All")
+ hidden_title = False
columns = ('node', 'cpus', 'memory_mb', 'local_gb', 'power_status',
'state')
table_actions = (NodeFilterAction, SetPowerStateOn, SetPowerStateOff,
@@ -201,6 +202,7 @@ class ProvisionedNodesTable(BaseNodesTable):
class Meta:
name = "provisioned_nodes_table"
verbose_name = _("Provisioned")
+ hidden_title = False
table_actions = (NodeFilterAction, SetPowerStateOn, SetPowerStateOff,
DeleteNode)
row_actions = (SetPowerStateOn, SetPowerStateOff, DeleteNode)
@@ -212,6 +214,7 @@ class FreeNodesTable(BaseNodesTable):
class Meta:
name = "free_nodes_table"
verbose_name = _("Free")
+ hidden_title = False
columns = ('node', 'cpus', 'memory_mb', 'local_gb', 'power_status')
table_actions = (NodeFilterAction, SetPowerStateOn, SetPowerStateOff,
DeleteNode)
@@ -224,6 +227,7 @@ class MaintenanceNodesTable(BaseNodesTable):
class Meta:
name = "maintenance_nodes_table"
verbose_name = _("Maintenance")
+ hidden_title = False
columns = ('node', 'cpus', 'memory_mb', 'local_gb', 'power_status',
'state')
table_actions = (NodeFilterAction, ActivateNode, SetPowerStateOn,
diff --git a/tuskar_ui/infrastructure/roles/templates/roles/index.html b/tuskar_ui/infrastructure/roles/templates/roles/index.html
index 879cc695..b17ae230 100644
--- a/tuskar_ui/infrastructure/roles/templates/roles/index.html
+++ b/tuskar_ui/infrastructure/roles/templates/roles/index.html
@@ -9,9 +9,7 @@
{% block main %}
<div class="row">
<div class="col-xs-12">
- <div class="no-table-title"> {% comment %}This will likely move to the tables Meta in the future{% endcomment %}
- {{ table.render }}
- </div>
+ {{ table.render }}
</div>
</div>
diff --git a/tuskar_ui/infrastructure/static/infrastructure/scss/_tables.scss b/tuskar_ui/infrastructure/static/infrastructure/scss/_tables.scss
index 1c568cfb..21b07005 100644
--- a/tuskar_ui/infrastructure/static/infrastructure/scss/_tables.scss
+++ b/tuskar_ui/infrastructure/static/infrastructure/scss/_tables.scss
@@ -1,8 +1,3 @@
-// Some tables should not have a title because it just repeats the page title.
-.no-table-title tr.table_caption {
- display: none;
-}
-
tr.table_actions_row {
th.table_header {
background: #f9f9f9;
diff --git a/tuskar_ui/infrastructure/templates/horizon/common/_enhanced_data_table.html b/tuskar_ui/infrastructure/templates/horizon/common/_enhanced_data_table.html
index a76af5ee..9d7690a5 100644
--- a/tuskar_ui/infrastructure/templates/horizon/common/_enhanced_data_table.html
+++ b/tuskar_ui/infrastructure/templates/horizon/common/_enhanced_data_table.html
@@ -1,11 +1,13 @@
{% extends "horizon/common/_data_table.html" %}
{% block table_caption %}
+ {% if not hidden_title %}
<tr class='table_caption'>
<th class='table_header' colspan='{{ columns|length }}'>
- <h3 class='table_title'>{{ table }}</h3>
+ <h3 class='table_title'>{{ table }}</h3>
</th>
</tr>
+ {% endif %}
{% if table.get_table_actions %}
<tr class='table_actions_row'>
<th class='table_header' colspan='{{ columns|length }}'>