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
This commit is contained in:
Jiri Tomasek 2014-11-14 16:19:14 +01:00
parent 75a5429dfd
commit bef0a07f4d
8 changed files with 13 additions and 17 deletions

View File

@ -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"

View File

@ -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 %}

View File

@ -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>

View File

@ -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>

View File

@ -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,

View File

@ -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>

View File

@ -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;

View File

@ -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 }}'>