diff options
author | Dave Cobbley <david.j.cobbley@linux.intel.com> | 2018-08-14 20:05:37 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-08-23 04:26:31 +0300 |
commit | eb8dc40360f0cfef56fb6947cc817a547d6d9bc6 (patch) | |
tree | de291a73dc37168da6370e2cf16c347d1eba9df8 /poky/bitbake/lib/toaster/toastergui/templates/editcustomimage_modal.html | |
parent | 9c3cf826d853102535ead04cebc2d6023eff3032 (diff) | |
download | openbmc-eb8dc40360f0cfef56fb6947cc817a547d6d9bc6.tar.xz |
[Subtree] Removing import-layers directory
As part of the move to subtrees, need to bring all the import layers
content to the top level.
Change-Id: I4a163d10898cbc6e11c27f776f60e1a470049d8f
Signed-off-by: Dave Cobbley <david.j.cobbley@linux.intel.com>
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'poky/bitbake/lib/toaster/toastergui/templates/editcustomimage_modal.html')
-rw-r--r-- | poky/bitbake/lib/toaster/toastergui/templates/editcustomimage_modal.html | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/editcustomimage_modal.html b/poky/bitbake/lib/toaster/toastergui/templates/editcustomimage_modal.html new file mode 100644 index 000000000..baa36c0e1 --- /dev/null +++ b/poky/bitbake/lib/toaster/toastergui/templates/editcustomimage_modal.html @@ -0,0 +1,88 @@ +<!-- +modal dialog shown on the build dashboard, for editing an existing custom image; +only shown if more than one custom image was built, so the user needs to +choose which one to edit + +required context: + build - a Build object +--> +<div class="modal fade" aria-hidden="false" id="edit-custom-image-modal"> + <div class="modal-dialog"> + <div class="modal-content"> + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> + <h3>Which image do you want to edit?</h3> + </div> + + <div class="modal-body"> + {% for recipe in build.get_custom_image_recipes %} + <div class="radio"> + <label> + <input type="radio" name="select-custom-image" + data-url="{% url 'customrecipe' build.project.id recipe.id %}"> + {{recipe.name}} + </label> + </div> + {% endfor %} + <span class="help-block text-danger" id="invalid-custom-image-help" style="display:none"> + Please select a custom image to edit. + </span> + </div> + + <div class="modal-footer"> + <button class="btn btn-primary btn-lg" data-url="#" + data-action="edit-custom-image" disabled> + Edit custom image + </button> + </div> + </div> + </div> +</div> + +<script> +$(document).ready(function () { + var editCustomImageButton = $('[data-action="edit-custom-image"]'); + var error = $('#invalid-custom-image-help'); + var radios = $('[name="select-custom-image"]'); + + // return custom image radio buttons which are selected + var getSelectedRadios = function () { + return $('[name="select-custom-image"]:checked'); + }; + + function enableSubmit() { + if (getSelectedRadios().length === 1) { + editCustomImageButton.removeAttr('disabled'); + error.hide(); + } + else { + editCustomImageButton.attr('disabled', 'disabled'); + error.show(); + } + }; + + $("#edit-custom-image-modal").on("shown.bs.modal", function() { + enableSubmit(); + }); + + radios.change(function () { + enableSubmit(); + }); + + editCustomImageButton.click(function () { + var selectedRadios = getSelectedRadios(); + + if (selectedRadios.length === 1) { + document.location.href = selectedRadios.first().attr('data-url'); + } + else { + error.show(); + } + }); + + // Select the first custom image listed. Radio button groups + // should always have an option selected by default + $("input:radio:first").attr("checked", "checked"); + +}); +</script> |