Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id C59C0E00DC8; Tue, 24 May 2016 04:55:59 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id ADCCAE00D13 for ; Tue, 24 May 2016 04:53:23 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP; 24 May 2016 04:53:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,359,1459839600"; d="scan'208,217";a="961194503" Received: from icarus.isw.intel.com ([10.237.224.37]) by orsmga001.jf.intel.com with ESMTP; 24 May 2016 04:53:22 -0700 From: Belen Barros Pena To: toaster@yoctoproject.org Date: Tue, 24 May 2016 12:39:41 +0100 Message-Id: <1464090003-23469-85-git-send-email-belen.barros.pena@linux.intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1464090003-23469-1-git-send-email-belen.barros.pena@linux.intel.com> References: <1464090003-23469-1-git-send-email-belen.barros.pena@linux.intel.com> Subject: [PATCH 084/106] toaster: toaster tables Enable complex empty states 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, 24 May 2016 11:55:59 -0000 Make sure we can create empty states for toaster tables that include actions for users to get out of the empty state. Allows a template to be used as an empty state. Signed-off-by: Michael Wood Signed-off-by: Belen Barros Pena --- bitbake/lib/toaster/toastergui/tables.py | 9 +++++++++ bitbake/lib/toaster/toastergui/templates/toastertable.html | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/bitbake/lib/toaster/toastergui/tables.py b/bitbake/lib/toaster/toastergui/tables.py index 479ba1e..d163e15 100644 --- a/bitbake/lib/toaster/toastergui/tables.py +++ b/bitbake/lib/toaster/toastergui/tables.py @@ -470,7 +470,16 @@ class CustomImagesTable(ToasterTable): def get_context_data(self, **kwargs): context = super(CustomImagesTable, self).get_context_data(**kwargs) + + empty_state_template = ''' + You have not created any custom images yet. + + Create your first custom image + ''' + context['empty_state'] = self.render_static_data(empty_state_template, + kwargs) project = Project.objects.get(pk=kwargs['pid']) + # TODO put project into the ToasterTable base class context['project'] = project return context diff --git a/bitbake/lib/toaster/toastergui/templates/toastertable.html b/bitbake/lib/toaster/toastergui/templates/toastertable.html index f391c12..6634c20 100644 --- a/bitbake/lib/toaster/toastergui/templates/toastertable.html +++ b/bitbake/lib/toaster/toastergui/templates/toastertable.html @@ -26,7 +26,7 @@ {% include 'toastertable-filter.html' %}