Browse files

Merge "Branding: Detail Actions need Context"

  • Loading branch information...
2 parents c5cc56d + c1ff33a commit 5943123b6998a33f021a362dfa8c833f43c493b7 Jenkins committed with openstack-gerrit Jul 30, 2016
View
7 horizon/tables/base.py
@@ -711,7 +711,7 @@ def get_data(self, datum, column, row):
form_field_attributes)
table._data_cache[column][table.get_object_id(datum)] = data
elif column.auto == "actions":
- data = table.render_row_actions(datum, pull_right=False)
+ data = table.render_row_actions(datum)
table._data_cache[column][table.get_object_id(datum)] = data
else:
data = column.get_data(datum)
@@ -1454,7 +1454,7 @@ def render_table_actions(self):
self.set_multiselect_column_visibility(len(bound_actions) > 0)
return table_actions_template.render(context)
- def render_row_actions(self, datum, pull_right=True, row=False):
+ def render_row_actions(self, datum, row=False):
"""Renders the actions specified in ``Meta.row_actions`` using the
current row data. If `row` is True, the actions are rendered in a row
of buttons. Otherwise they are rendered in a dropdown box.
@@ -1467,8 +1467,7 @@ def render_row_actions(self, datum, pull_right=True, row=False):
row_actions_template = template.loader.get_template(template_path)
bound_actions = self.get_row_actions(datum)
extra_context = {"row_actions": bound_actions,
- "row_id": self.get_object_id(datum),
- "pull_right": pull_right}
+ "row_id": self.get_object_id(datum)}
context = template.RequestContext(self.request, extra_context)
return row_actions_template.render(context)
View
2 horizon/templates/horizon/common/_data_table_row_actions_dropdown.html
@@ -5,7 +5,7 @@
{% if row_actions|length == 1 %}
{% include "horizon/common/_data_table_action.html" with action=row_actions.0 is_single=1 %}
{% elif row_actions|length > 1 %}
- <div class="btn-group {% if pull_right %}pull-right{% endif %}">
+ <div class="btn-group">
{% for action in row_actions %}
{% if forloop.first %}
{% include "horizon/common/_data_table_action.html" with is_small=1 is_single=1 %}
View
8 horizon/templates/horizon/common/_detail_header.html
@@ -1,12 +1,12 @@
-<div class='page-header'>
+<div class='page-header detail-header'>
<div class="row">
- <div class="col-xs-12 col-sm-9 text-left">
+ <div class="detail-title col-xs-12 col-sm-9">
<span class="h1">{{ page_title }}</span>
</div>
- <div class="col-xs-12 col-sm-3 text-right">
+ <div class="detail-actions col-xs-12 col-sm-3 text-right">
{% if actions %}
- <form class='actions_column' action='{{ url }}' method="POST">
+ <form class='detail-actions-form actions_column' action='{{ url }}' method="POST">
{% csrf_token %}
{{ actions }}
</form>

0 comments on commit 5943123

Please sign in to comment.