diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py index 1cf997cfe5..b70fa18feb 100644 --- a/bitbake/lib/toaster/orm/models.py +++ b/bitbake/lib/toaster/orm/models.py @@ -749,6 +749,20 @@ class Package(models.Model): section = models.CharField(max_length=80, blank=True) license = models.CharField(max_length=80, blank=True) + @property + def is_locale_package(self): + """ Returns True if this package is identifiable as a locale package """ + if self.name.find('locale') != -1: + return True + return False + + @property + def is_packagegroup(self): + """ Returns True is this package is identifiable as a packagegroup """ + if self.name.find('packagegroup') != -1: + return True + return False + class CustomImagePackage(Package): # CustomImageRecipe fields to track pacakges appended, # included and excluded from a CustomImageRecipe diff --git a/bitbake/lib/toaster/toastergui/static/css/default.css b/bitbake/lib/toaster/toastergui/static/css/default.css index bc8a97bedc..b674a9de8e 100644 --- a/bitbake/lib/toaster/toastergui/static/css/default.css +++ b/bitbake/lib/toaster/toastergui/static/css/default.css @@ -153,6 +153,9 @@ select { width: auto; } /* make tables Chrome-happy (me, not so much) */ table { table-layout: fixed; word-wrap: break-word; } +table p { margin-bottom: 0 } +.table td { vertical-align: middle; } + /* styles for the new build button */ .new-build .btn-primary { padding: 4px 30px; } .new-build .alert { margin-top: 10px; } diff --git a/bitbake/lib/toaster/toastergui/tables.py b/bitbake/lib/toaster/toastergui/tables.py index b73f459b2c..b906718b66 100644 --- a/bitbake/lib/toaster/toastergui/tables.py +++ b/bitbake/lib/toaster/toastergui/tables.py @@ -765,12 +765,27 @@ class SelectPackagesTable(PackagesTable): def setup_columns(self, *args, **kwargs): super(SelectPackagesTable, self).setup_columns(*args, **kwargs) + add_remove_template = ''' + {% if data.is_locale_package %} +
+ Locale package + + +
+ {% else %} + {% include "pkg_add_rm_btn.html" %} + {% endif %} + ''' + self.add_column(title="Add | Remove", hideable=False, help_text="Use the add and remove buttons to modify " "the package content of your custom image", static_data_name="add_rm_pkg_btn", - static_data_template='{% include "pkg_add_rm_btn.html" %}', + static_data_template=add_remove_template, filter_name='in_current_image_filter') def setup_filters(self, *args, **kwargs): diff --git a/bitbake/lib/toaster/toastergui/templates/pkg_add_rm_btn.html b/bitbake/lib/toaster/toastergui/templates/pkg_add_rm_btn.html index 493456f855..0d4429962e 100644 --- a/bitbake/lib/toaster/toastergui/templates/pkg_add_rm_btn.html +++ b/bitbake/lib/toaster/toastergui/templates/pkg_add_rm_btn.html @@ -7,7 +7,7 @@ "> Remove package - +