bitbake: toaster: tables move template logic into the pkg_add_rm_btn

Instead of defining this as a string it's sufficiently large enough to
warrant its own file.

(Bitbake rev: 6b39423fe5a3ed30289a8b303329a5725f7d273b)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Michael Wood
2016-01-28 18:05:14 +00:00
committed by Richard Purdie
parent d77c247230
commit 9976e4f169
2 changed files with 16 additions and 14 deletions

View File

@@ -765,20 +765,7 @@ class SelectPackagesTable(PackagesTable):
def setup_columns(self, *args, **kwargs):
super(SelectPackagesTable, self).setup_columns(*args, **kwargs)
add_remove_template = '''
{% if data.is_locale_package %}
<p class="text-center">
<span class="muted">Locale package</span>
<i class="icon-question-sign get-help hover-help" title=""
data-original-title="This package is included in your image
because the locale is specified in the IMAGE_LINGUAS variable"
style="visibility: hidden;">
</i>
</p>
{% else %}
{% include "pkg_add_rm_btn.html" %}
{% endif %}
'''
add_remove_template = '{% include "pkg_add_rm_btn.html" %}'
self.add_column(title="Add | Remove",
hideable=False,

View File

@@ -1,3 +1,16 @@
{# TODO move to snippets dir #}
{% if data.is_locale_package %}
<p class="text-center">
<span class="muted">Locale package</span>
<i class="icon-question-sign get-help hover-help" title=""
data-original-title="This package is included in your image
based on the locale specified in the IMAGE_LINGUAS variable"
style="visibility: hidden;">
</i>
</p>
{% else %}
<div id="package-btn-cell-{{data.pk}}">
<div style="display: none; font-size: 11px; line-height: 1.3;" class="tooltip-inner inline-notification"></div>
<button class="btn btn-block btn-danger add-rm-package-btn" data-directive="remove" data-package="{{data.pk}}" data-package-url="{% url 'xhr_customrecipe_packages' extra.recipe_id data.pk %}" data-name="{{data.name}}" style="
@@ -17,3 +30,5 @@
Add package
</button>
</div>
{% endif %}