diff options
-rw-r--r-- | bitbake/lib/toaster/toastergui/tables.py | 6 | ||||
-rw-r--r-- | bitbake/lib/toaster/toastergui/templates/machine_btn.html | 12 |
2 files changed, 14 insertions, 4 deletions
diff --git a/bitbake/lib/toaster/toastergui/tables.py b/bitbake/lib/toaster/toastergui/tables.py index 9c9cda4e95..be8916c468 100644 --- a/bitbake/lib/toaster/toastergui/tables.py +++ b/bitbake/lib/toaster/toastergui/tables.py | |||
@@ -217,12 +217,10 @@ class MachinesTable(ToasterTable, ProjectFiltersMixin): | |||
217 | def get_context_data(self, **kwargs): | 217 | def get_context_data(self, **kwargs): |
218 | context = super(MachinesTable, self).get_context_data(**kwargs) | 218 | context = super(MachinesTable, self).get_context_data(**kwargs) |
219 | context['project'] = Project.objects.get(pk=kwargs['pid']) | 219 | context['project'] = Project.objects.get(pk=kwargs['pid']) |
220 | context['projectlayers'] = map(lambda prjlayer: prjlayer.layercommit.id, ProjectLayer.objects.filter(project=context['project'])) | ||
221 | return context | 220 | return context |
222 | 221 | ||
223 | def setup_filters(self, *args, **kwargs): | 222 | def setup_filters(self, *args, **kwargs): |
224 | project = Project.objects.get(pk=kwargs['pid']) | 223 | project = Project.objects.get(pk=kwargs['pid']) |
225 | self.project_layers = project.get_project_layer_versions() | ||
226 | 224 | ||
227 | self.add_filter(title="Filter by project machines", | 225 | self.add_filter(title="Filter by project machines", |
228 | name="in_current_project", | 226 | name="in_current_project", |
@@ -236,6 +234,10 @@ class MachinesTable(ToasterTable, ProjectFiltersMixin): | |||
236 | self.queryset = prj.get_all_compatible_machines() | 234 | self.queryset = prj.get_all_compatible_machines() |
237 | self.queryset = self.queryset.order_by(self.default_orderby) | 235 | self.queryset = self.queryset.order_by(self.default_orderby) |
238 | 236 | ||
237 | self.static_context_extra['current_layers'] = \ | ||
238 | self.project_layers = \ | ||
239 | prj.get_project_layer_versions(pk=True) | ||
240 | |||
239 | def setup_columns(self, *args, **kwargs): | 241 | def setup_columns(self, *args, **kwargs): |
240 | 242 | ||
241 | self.add_column(title="Machine", | 243 | self.add_column(title="Machine", |
diff --git a/bitbake/lib/toaster/toastergui/templates/machine_btn.html b/bitbake/lib/toaster/toastergui/templates/machine_btn.html index d2cb55bab4..7b08f6a9a6 100644 --- a/bitbake/lib/toaster/toastergui/templates/machine_btn.html +++ b/bitbake/lib/toaster/toastergui/templates/machine_btn.html | |||
@@ -1,6 +1,14 @@ | |||
1 | <a href="{% url 'project' extra.pid %}?setMachine={{data.name}}" class="btn btn-block layer-exists-{{data.layer_version.id}}" style="margin-top: 5px; display:none"> | 1 | <a href="{% url 'project' extra.pid %}?setMachine={{data.name}}" class="btn btn-block layer-exists-{{data.layer_version.id}}" |
2 | {% if data.layer_version.pk not in extra.current_layers %} | ||
3 | style="display:none;" | ||
4 | {% endif %} | ||
5 | > | ||
2 | Select machine</a> | 6 | Select machine</a> |
3 | <button class="btn btn-block layerbtn layer-add-{{data.layer_version.id}}" data-layer='{ "id": {{data.layer_version.id}}, "name": "{{data.layer_version.layer.name}}", "layerdetailurl": "{%url 'layerdetails' extra.pid data.layer_version.id %}"}' data-directive="add"> | 7 | <button class="btn btn-block layerbtn layer-add-{{data.layer_version.id}}" data-layer='{ "id": {{data.layer_version.id}}, "name": "{{data.layer_version.layer.name}}", "layerdetailurl": "{%url 'layerdetails' extra.pid data.layer_version.id %}"}' data-directive="add" |
8 | {% if data.layer_version.pk in extra.current_layers %} | ||
9 | style="display:none;" | ||
10 | {% endif %} | ||
11 | > | ||
4 | <i class="icon-plus"></i> | 12 | <i class="icon-plus"></i> |
5 | Add layer | 13 | Add layer |
6 | <i title="" class="icon-question-sign get-help" data-original-title="To enable this machine, you must first add the {{data.layer_version.layer.name}} layer to your project"></i> | 14 | <i title="" class="icon-question-sign get-help" data-original-title="To enable this machine, you must first add the {{data.layer_version.layer.name}} layer to your project"></i> |