diff options
author | Michael Wood <michael.g.wood@intel.com> | 2015-10-09 10:32:42 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-10-11 08:11:29 +0100 |
commit | ab896df63ba058f535cb303611574f293c7c680b (patch) | |
tree | cacd7c759774a8578e532a41c5ce0e26226040a0 /bitbake/lib/toaster/toastergui/templates | |
parent | 41a5f82b4ac0c689df4cfc673ce574c2d70f413c (diff) | |
download | poky-ab896df63ba058f535cb303611574f293c7c680b.tar.gz |
bitbake: toaster: Fix stale layer state buttons
Move the "is available to the project" state computation to the template
for the Layer add/remove buttons, Recipe build/Add layer as done for the
Package add/remove. This is more reliable as we can get an inconsistent
state on the front end JS as there are many opportunities for hitting
out of date project information.
[YOCTO #8294]
(Bitbake rev: 43469c3360566ad4897785f14f8717a9bc8b6078)
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/templates')
3 files changed, 20 insertions, 5 deletions
diff --git a/bitbake/lib/toaster/toastergui/templates/layer_btn.html b/bitbake/lib/toaster/toastergui/templates/layer_btn.html index a2e93934de..314eec7cf2 100644 --- a/bitbake/lib/toaster/toastergui/templates/layer_btn.html +++ b/bitbake/lib/toaster/toastergui/templates/layer_btn.html | |||
@@ -1,8 +1,16 @@ | |||
1 | <button class="btn btn-danger btn-block layer-exists-{{data.pk}} layerbtn" style="display:none;" data-layer='{ "id": {{data.pk}}, "name": "{{data.layer.name}}", "layerdetailurl": "{%url 'layerdetails' extra.pid data.pk%}"}' data-directive="remove" > | 1 | <button class="btn btn-danger btn-block layer-exists-{{data.pk}} layerbtn" data-layer='{ "id": {{data.pk}}, "name": "{{data.layer.name}}", "layerdetailurl": "{%url 'layerdetails' extra.pid data.pk%}"}' data-directive="remove" |
2 | {% if data.pk not in extra.current_layers %} | ||
3 | style="display:none;" | ||
4 | {% endif %} | ||
5 | > | ||
2 | <i class="icon-trash"></i> | 6 | <i class="icon-trash"></i> |
3 | Delete layer | 7 | Delete layer |
4 | </button> | 8 | </button> |
5 | <button class="btn btn-block layer-add-{{data.pk}} layerbtn" data-layer='{ "id": {{data.pk}}, "name": "{{data.layer.name}}", "layerdetailurl": "{%url 'layerdetails' extra.pid data.pk%}"}' data-directive="add"> | 9 | <button class="btn btn-block layer-add-{{data.pk}} layerbtn" data-layer='{ "id": {{data.pk}}, "name": "{{data.layer.name}}", "layerdetailurl": "{%url 'layerdetails' extra.pid data.pk%}"}' data-directive="add" |
10 | {% if data.pk in extra.current_layers %} | ||
11 | style="display:none;" | ||
12 | {% endif %} | ||
13 | > | ||
6 | <i class="icon-plus"></i> | 14 | <i class="icon-plus"></i> |
7 | Add layer | 15 | Add layer |
8 | </button> | 16 | </button> |
diff --git a/bitbake/lib/toaster/toastergui/templates/recipe_btn.html b/bitbake/lib/toaster/toastergui/templates/recipe_btn.html index 77c1b235b9..baab06eb52 100644 --- a/bitbake/lib/toaster/toastergui/templates/recipe_btn.html +++ b/bitbake/lib/toaster/toastergui/templates/recipe_btn.html | |||
@@ -1,7 +1,15 @@ | |||
1 | <button data-recipe-name="{{data.name}}" class="btn btn-block layer-exists-{{data.layer_version.pk}} build-recipe-btn" style="display:none; margin-top: 5px;" > | 1 | <button data-recipe-name="{{data.name}}" class="btn btn-block layer-exists-{{data.layer_version.pk}} build-recipe-btn" style="margin-top: 5px; |
2 | {% if data.layer_version.pk not in extra.current_layers %} | ||
3 | display:none; | ||
4 | {% endif %}" | ||
5 | > | ||
2 | Build recipe | 6 | Build recipe |
3 | </button> | 7 | </button> |
4 | <button class="btn btn-block layerbtn layer-add-{{data.layer_version.pk}}" data-layer='{ "id": {{data.layer_version.pk}}, "name": "{{data.layer_version.layer.name}}", "layerdetailurl": "{%url 'layerdetails' extra.pid data.layer_version.pk%}"}' data-directive="add"> | 8 | <button class="btn btn-block layerbtn layer-add-{{data.layer_version.pk}}" data-layer='{ "id": {{data.layer_version.pk}}, "name": "{{data.layer_version.layer.name}}", "layerdetailurl": "{%url 'layerdetails' extra.pid data.layer_version.pk%}"}' data-directive="add" |
9 | {% if data.layer_version.pk in extra.current_layers %} | ||
10 | style="display:none;" | ||
11 | {% endif %} | ||
12 | > | ||
5 | <i class="icon-plus"></i> | 13 | <i class="icon-plus"></i> |
6 | Add layer | 14 | Add layer |
7 | <i title="" class="icon-question-sign get-help" data-original-title="To build this target, you must first add the {{data.layer_version.layer.name}} layer to your project"></i> | 15 | <i title="" class="icon-question-sign get-help" data-original-title="To build this target, you must first add the {{data.layer_version.layer.name}} layer to your project"></i> |
diff --git a/bitbake/lib/toaster/toastergui/templates/toastertable.html b/bitbake/lib/toaster/toastergui/templates/toastertable.html index 9ef4c6ffee..98a715f27d 100644 --- a/bitbake/lib/toaster/toastergui/templates/toastertable.html +++ b/bitbake/lib/toaster/toastergui/templates/toastertable.html | |||
@@ -12,7 +12,6 @@ | |||
12 | tableName : "{{table_name}}", | 12 | tableName : "{{table_name}}", |
13 | url : "{{ xhr_table_url }}?format=json", | 13 | url : "{{ xhr_table_url }}?format=json", |
14 | title : "{{title}}", | 14 | title : "{{title}}", |
15 | projectLayers : {{projectlayers|json}}, | ||
16 | }; | 15 | }; |
17 | 16 | ||
18 | try { | 17 | try { |