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/layer_btn.html | |
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/layer_btn.html')
-rw-r--r-- | bitbake/lib/toaster/toastergui/templates/layer_btn.html | 12 |
1 files changed, 10 insertions, 2 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> |