Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 33208E0070F; Tue, 8 Dec 2015 13:17:56 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low * trust * [209.85.220.48 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily * valid * -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Received: from mail-pa0-f48.google.com (mail-pa0-f48.google.com [209.85.220.48]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 910ECE00BB5 for ; Tue, 8 Dec 2015 13:17:19 -0800 (PST) Received: by pacej9 with SMTP id ej9so17865436pac.2 for ; Tue, 08 Dec 2015 13:17:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=OFTrDY1FeIji+S+hh6WiZaMZnPG31ker3Dh3SUviHBk=; b=uRpdSyW+ph1aXZ0sVzbzJBqQZijTQf0yNckU+DriQC5Kg4in+bBV9r7gDNfPSWMeAu 4YyZYeHF2GaeI15lFwOCJPrzb+5Fg2prY0oUSOUZHGRN6NZqSAnrXdn+yY+cDY5WyheM dkGb5NogBU2gJMNHQM8Ii17QHJRw6/Axauok6nVfETmLdl2XSofUC7/OzOsS06MPVzOq 1KcEbjwv39KS9keteS+hdzsJRdshG41GPSNXP7rWqhA3s1E/LS/0+ScT+8sd4jWheVbV bLss3mOD74ATarRn6zOrhbi6/vmlIRSaFc2qlvd5rjcvUEavtuRt4daLzsCvsmhcRc1l do6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=OFTrDY1FeIji+S+hh6WiZaMZnPG31ker3Dh3SUviHBk=; b=kEjs0VM0y8c0QPkf/UzzOgEkueDJRLlz8/f6umfICro/VnM3CZyswv8xmn696fFLLo cUdkaP7PK0pVStCh03XQVilNzcyJWkcZZBOwxbBKrHMG0kSqJ6kZT5v3Ye/lx+c6hbY+ vYxS9XPpMcLRBurAhsMQ6JqUcS75DDXOpKKMhaXd7pzGHKmPa8S2X7iUb5eGpCbWb/3a rGoepYPb8aAJ9+N+ejKdEpyi3SVirF8l9XskW53TzFv9C44qf1EefPafdc8lDXumgbaY oz4Rc9ayQcpZprQK50wDoJjWGzzZqvccCax6lmXC0mCyq8cd9xty4HvRnXXNnK+fhQAb gvqw== X-Gm-Message-State: ALoCoQkZI9SMBGyiS7/MoKcq73xg7AlE6RiIA3esgbSgCh+Rl1Yw+HXSgPy257HVByfP1SEMcTyt/+WBmjPxlaixt+DP52coMg== X-Received: by 10.66.102.97 with SMTP id fn1mr2971498pab.131.1449609439037; Tue, 08 Dec 2015 13:17:19 -0800 (PST) Received: from draco.ger.corp.intel.com ([192.55.54.40]) by smtp.gmail.com with ESMTPSA id v64sm6675766pfi.50.2015.12.08.13.17.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 08 Dec 2015 13:17:18 -0800 (PST) From: Michael Wood To: toaster@yoctoproject.org Date: Tue, 8 Dec 2015 21:16:03 +0000 Message-Id: <1449609380-11073-18-git-send-email-michael.g.wood@intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1449609380-11073-1-git-send-email-michael.g.wood@intel.com> References: <1449609380-11073-1-git-send-email-michael.g.wood@intel.com> Subject: [PATCH 17/34] toaster: Add recipe details page X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2015 21:17:56 -0000 This page provides the details of recipes, showing their packages and additional metadata. It also allows you to build the recipe or customise the recipe if it is an image recipe. [YOCTO #8070] Signed-off-by: Michael Wood --- .../toaster/toastergui/static/js/recipedetails.js | 52 ++++++ .../toastergui/templates/recipedetails.html | 180 +++++++++++++++++++++ 2 files changed, 232 insertions(+) create mode 100644 bitbake/lib/toaster/toastergui/static/js/recipedetails.js create mode 100644 bitbake/lib/toaster/toastergui/templates/recipedetails.html 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 0000000..2bfd0a4 --- /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 0000000..aed0492 --- /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 %} -- 2.1.4