diff --git a/bitbake/lib/toaster/toastergui/static/js/recipedetails.js b/bitbake/lib/toaster/toastergui/static/js/recipedetails.js new file mode 100644 index 0000000000..2bfd0a4b2c --- /dev/null +++ b/bitbake/lib/toaster/toastergui/static/js/recipedetails.js @@ -0,0 +1,52 @@ +"use strict"; + +function recipeDetailsPageInit(ctx){ + + $(".customise-btn").click(function(e){ + e.preventDefault(); + var imgCustomModal = $("#new-custom-image-modal"); + + if (imgCustomModal.length === 0) + throw("Modal new-custom-image not found"); + + imgCustomModal.data('recipe', $(this).data('recipe')); + imgCustomModal.modal('show'); + }); + + $("#add-layer-btn").click(function(){ + var btn = $(this); + + libtoaster.addRmLayer(ctx.recipe.layer_version, + true, + function (layersList){ + var msg = libtoaster.makeLayerAddRmAlertMsg(ctx.recipe.layer_version, + layersList, + true); + + libtoaster.showChangeNotification(msg); + + var toShow = $("#customise-build-btns"); + + /* If we have no packages built yet also fade in the build packages + * hint message + */ + if (ctx.recipe.totalPackages === 0){ + toShow = toShow.add("#build-to-get-packages-msg"); + } + + $("#packages-alert").add(btn).fadeOut(function(){ + toShow.fadeIn(); + }); + }); + }); + + /* Trigger a build of your custom image */ + $(".build-recipe-btn").click(function(){ + libtoaster.startABuild(libtoaster.ctx.projectBuildsUrl, + libtoaster.ctx.projectId, + ctx.recipe.name, + function(){ + window.location.replace(libtoaster.ctx.projectBuildsUrl); + }); + }); +} diff --git a/bitbake/lib/toaster/toastergui/templates/recipedetails.html b/bitbake/lib/toaster/toastergui/templates/recipedetails.html new file mode 100644 index 0000000000..aed0492aeb --- /dev/null +++ b/bitbake/lib/toaster/toastergui/templates/recipedetails.html @@ -0,0 +1,180 @@ +{% extends "base.html" %} +{% load projecttags %} +{% load humanize %} +{% load static %} +{% block pagecontent %} + +
+ +
+ + + + +{% include 'newcustomimage_modal.html' %} + +
+ + +
+ +
+
+
+ + {% if recipe.is_image %} + + {% endif %} +
+
+ +
+ +
+ {% if packages.count %} + {% url 'recipepackages' project.id recipe.id as xhr_table_url %} +

{{title}} (0)

+ {% include "toastertable.html" %} + {% else %} +

{{title}}

+ {% endif %} + + + + +
+
+
+

About {{recipe.name}}

+
+
+ Approx. packages included + +
+
{{packages.count}}
+
+ Approx. package size + +
+
{{approx_pkg_size.size__sum|filtered_filesizeformat}}
+ {% if last_build %} +
Last build
+
+ + {{last_build.completed_on|date:"d/m/y H:i"}} +
+ {% endif %} +
Recipe file
+
+ {{recipe.file_path|cut_path_prefix:recipe.layer_version.local_path}} + +
+
Layer
+
{{recipe.layer_version.layer.name}}
+
+ Summary +
+
+ {{recipe.summary}} +
+
+ Description +
+
+ {{recipe.description}} +
+
Version
+
+ {{recipe.version}} +
+
Section
+
+ {{recipe.section}} +
+
License
+
+ {{recipe.license}} +
+
+
+
+ +{% endblock %}