Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id C423FE00C41; Fri, 18 Dec 2015 01:24:18 -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=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high * trust * [134.134.136.24 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id C69E3E00C32 for ; Fri, 18 Dec 2015 01:24:13 -0800 (PST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP; 18 Dec 2015 01:24:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,445,1444719600"; d="scan'208";a="620057319" Received: from agusev-mobl2.ger.corp.intel.com (HELO lp.ger.corp.intel.com) ([10.252.27.121]) by FMSMGA003.fm.intel.com with ESMTP; 18 Dec 2015 01:24:12 -0800 From: Elliot Smith To: toaster@yoctoproject.org Date: Fri, 18 Dec 2015 09:23:46 +0000 Message-Id: <1450430639-14995-5-git-send-email-elliot.smith@intel.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1450430639-14995-1-git-send-email-elliot.smith@intel.com> References: <1450430639-14995-1-git-send-email-elliot.smith@intel.com> Subject: [review-request][PATCH 04/17] toaster: toastergui Switch projects/ view to ToasterTable 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: Fri, 18 Dec 2015 09:24:18 -0000 Remove the old projects page and replace with the new ToasterTable-based version. NB although the projects.html template is no longer required, it's been left in as there will be changes applied to it for the new theme. These changes will have to then be transferred from the projects.html template to projects-toastertable.html. Similarly, the code for the projects page in views.py has been retained. [YOCTO #8738] Signed-off-by: Elliot Smith --- bitbake/lib/toaster/toastergui/urls.py | 9 ++------- bitbake/lib/toaster/toastergui/views.py | 24 ++++++++++++++++++++---- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/bitbake/lib/toaster/toastergui/urls.py b/bitbake/lib/toaster/toastergui/urls.py index da97a31..b5e9a05 100644 --- a/bitbake/lib/toaster/toastergui/urls.py +++ b/bitbake/lib/toaster/toastergui/urls.py @@ -74,14 +74,9 @@ urlpatterns = patterns('toastergui.views', # project URLs url(r'^newproject/$', 'newproject', name='newproject'), - - # TODO remove when new toaster table is ready - url(r'^projects/$', 'projects', name='all-projects'), - - # TODO move to /projects/ when new toaster table is ready - url(r'^projects-new/$', + url(r'^projects/$', tables.ProjectsTable.as_view(template_name="projects-toastertable.html"), - name='all-projects-new'), + name='all-projects'), url(r'^project/(?P\d+)/$', 'project', name='project'), url(r'^project/(?P\d+)/configuration$', 'projectconf', name='projectconf'), diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index 8148623..a79261d 100755 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py @@ -2990,9 +2990,7 @@ if True: } return render(request, "unavailable_artifact.html", context) - - - + """ @_template_renderer("projects.html") def projects(request): (pagesize, orderby) = _get_parameters_values(request, 10, 'updated:-') @@ -3034,7 +3032,24 @@ if True: # translate the project's build target strings fstypes_map = {}; for project in project_info: - fstypes_map[project.id] = project.get_last_build_extensions() + try: + targets = Target.objects.filter( build_id = project.get_last_build_id() ) + comma = ""; + extensions = ""; + for t in targets: + if ( not t.is_image ): + continue + tif = Target_Image_File.objects.filter( target_id = t.id ) + for i in tif: + s=re.sub('.*tar.bz2', 'tar.bz2', i.file_name) + if s == i.file_name: + s=re.sub('.*\.', '', i.file_name) + if None == re.search(s,extensions): + extensions += comma + s + comma = ", " + fstypes_map[project.id]=extensions + except (Target.DoesNotExist,IndexError): + fstypes_map[project.id]=project.get_last_imgfiles context = { 'mru' : build_mru, @@ -3092,3 +3107,4 @@ if True: _set_parameters_values(pagesize, orderby, request) return context + """ -- Elliot Smith Software Engineer Intel OTC --------------------------------------------------------------------- Intel Corporation (UK) Limited Registered No. 1134945 (England) Registered Office: Pipers Way, Swindon SN3 1RJ VAT No: 860 2173 47 This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.