Fix "_data_table_action.html" template usage

"_data_table_action.html" template required "is_small" variable.
Without explicit variable declaration this templates renders with
errors.

Partial-Bug: #1720893
Change-Id: I2c956f88a11ca6527c2e9ecf63d7ac34d2bcd971
This commit is contained in:
Ivan Kolodyazhny 2019-09-09 15:52:33 +03:00 committed by Akihiro Motoki
parent cd8fae0631
commit 8343014ece
3 changed files with 5 additions and 5 deletions

View File

@ -376,7 +376,7 @@ class LinkAction(BaseAction):
def render(self, **kwargs):
action_dict = copy.copy(kwargs)
action_dict.update({"action": self, "is_single": True})
action_dict.update({"action": self, "is_single": True, "is_small": 0})
return render_to_string("horizon/common/_data_table_action.html",
action_dict)

View File

@ -3,7 +3,7 @@
{% spaceless %} {# This makes sure whitespace doesn't affect positioning for dropdown. #}
{% if row_actions|length == 1 %}
{% include "horizon/common/_data_table_action.html" with action=row_actions.0 is_single=1 %}
{% include "horizon/common/_data_table_action.html" with action=row_actions.0 is_single=1 is_small=0 %}
{% elif row_actions|length > 1 %}
<div class="btn-group">
{% for action in row_actions %}
@ -15,7 +15,7 @@
<ul class="dropdown-menu dropdown-menu-right row_actions">
{% else %}
<li>
{% include "horizon/common/_data_table_action.html" %}
{% include "horizon/common/_data_table_action.html" with is_small=0 %}
</li>
{% endif %}
{% if forloop.last %}

View File

@ -39,7 +39,7 @@
For each single action in the Table Actions area
{% endcomment %}
{% for action in table_actions_buttons %}
{% include "horizon/common/_data_table_action.html" with is_table_action=1 is_single=1 %}
{% include "horizon/common/_data_table_action.html" with is_table_action=1 is_single=1 is_small=0 %}
{% endfor %}
{% comment %}
@ -58,7 +58,7 @@
<ul class="dropdown-menu dropdown-menu-right">
{% for action in table_actions_menu %}
<li>
{% include "horizon/common/_data_table_action.html" with is_table_action=1 %}
{% include "horizon/common/_data_table_action.html" with is_table_action=1 is_small=0 %}
</li>
{% endfor %}
</ul>