diff options
Diffstat (limited to 'bitbake/lib/toaster/toastergui/templates/editcustomimage_modal.html')
-rw-r--r-- | bitbake/lib/toaster/toastergui/templates/editcustomimage_modal.html | 67 |
1 files changed, 42 insertions, 25 deletions
diff --git a/bitbake/lib/toaster/toastergui/templates/editcustomimage_modal.html b/bitbake/lib/toaster/toastergui/templates/editcustomimage_modal.html index 8046c08fb5..baa36c0e1b 100644 --- a/bitbake/lib/toaster/toastergui/templates/editcustomimage_modal.html +++ b/bitbake/lib/toaster/toastergui/templates/editcustomimage_modal.html | |||
@@ -6,32 +6,36 @@ choose which one to edit | |||
6 | required context: | 6 | required context: |
7 | build - a Build object | 7 | build - a Build object |
8 | --> | 8 | --> |
9 | <div class="modal hide fade in" aria-hidden="false" id="edit-custom-image-modal"> | 9 | <div class="modal fade" aria-hidden="false" id="edit-custom-image-modal"> |
10 | <div class="modal-header"> | 10 | <div class="modal-dialog"> |
11 | <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> | 11 | <div class="modal-content"> |
12 | <h3>Which image do you want to edit?</h3> | 12 | <div class="modal-header"> |
13 | </div> | 13 | <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> |
14 | <h3>Which image do you want to edit?</h3> | ||
15 | </div> | ||
14 | 16 | ||
15 | <div class="modal-body"> | 17 | <div class="modal-body"> |
16 | <div class="row-fluid"> | 18 | {% for recipe in build.get_custom_image_recipes %} |
17 | {% for recipe in build.get_custom_image_recipes %} | 19 | <div class="radio"> |
18 | <label class="radio"> | 20 | <label> |
19 | {{recipe.name}} | 21 | <input type="radio" name="select-custom-image" |
20 | <input type="radio" class="form-control" name="select-custom-image" | 22 | data-url="{% url 'customrecipe' build.project.id recipe.id %}"> |
21 | data-url="{% url 'customrecipe' build.project.id recipe.id %}"> | 23 | {{recipe.name}} |
22 | </label> | 24 | </label> |
23 | {% endfor %} | 25 | </div> |
24 | </div> | 26 | {% endfor %} |
25 | <span class="help-block error" id="invalid-custom-image-help" style="display:none"> | 27 | <span class="help-block text-danger" id="invalid-custom-image-help" style="display:none"> |
26 | Please select a custom image to edit. | 28 | Please select a custom image to edit. |
27 | </span> | 29 | </span> |
28 | </div> | 30 | </div> |
29 | 31 | ||
30 | <div class="modal-footer"> | 32 | <div class="modal-footer"> |
31 | <button class="btn btn-primary btn-large" data-url="#" | 33 | <button class="btn btn-primary btn-lg" data-url="#" |
32 | data-action="edit-custom-image" disabled> | 34 | data-action="edit-custom-image" disabled> |
33 | Edit custom image | 35 | Edit custom image |
34 | </button> | 36 | </button> |
37 | </div> | ||
38 | </div> | ||
35 | </div> | 39 | </div> |
36 | </div> | 40 | </div> |
37 | 41 | ||
@@ -46,7 +50,7 @@ $(document).ready(function () { | |||
46 | return $('[name="select-custom-image"]:checked'); | 50 | return $('[name="select-custom-image"]:checked'); |
47 | }; | 51 | }; |
48 | 52 | ||
49 | radios.change(function () { | 53 | function enableSubmit() { |
50 | if (getSelectedRadios().length === 1) { | 54 | if (getSelectedRadios().length === 1) { |
51 | editCustomImageButton.removeAttr('disabled'); | 55 | editCustomImageButton.removeAttr('disabled'); |
52 | error.hide(); | 56 | error.hide(); |
@@ -55,6 +59,14 @@ $(document).ready(function () { | |||
55 | editCustomImageButton.attr('disabled', 'disabled'); | 59 | editCustomImageButton.attr('disabled', 'disabled'); |
56 | error.show(); | 60 | error.show(); |
57 | } | 61 | } |
62 | }; | ||
63 | |||
64 | $("#edit-custom-image-modal").on("shown.bs.modal", function() { | ||
65 | enableSubmit(); | ||
66 | }); | ||
67 | |||
68 | radios.change(function () { | ||
69 | enableSubmit(); | ||
58 | }); | 70 | }); |
59 | 71 | ||
60 | editCustomImageButton.click(function () { | 72 | editCustomImageButton.click(function () { |
@@ -67,5 +79,10 @@ $(document).ready(function () { | |||
67 | error.show(); | 79 | error.show(); |
68 | } | 80 | } |
69 | }); | 81 | }); |
82 | |||
83 | // Select the first custom image listed. Radio button groups | ||
84 | // should always have an option selected by default | ||
85 | $("input:radio:first").attr("checked", "checked"); | ||
86 | |||
70 | }); | 87 | }); |
71 | </script> | 88 | </script> |