public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Magnus Granberg" <zorry@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/tinderbox-cluster-www:master commit in: python/templates/includes/frontpage/, python/tbc_www/
Date: Thu, 16 Jul 2015 22:49:16 +0000 (UTC)	[thread overview]
Message-ID: <1437086517.b064d9675554a6ea3d518a2891b4c1495f26011c.zorry@gentoo> (raw)

commit:     b064d9675554a6ea3d518a2891b4c1495f26011c
Author:     Magnus Granberg <zorry <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 16 22:41:57 2015 +0000
Commit:     Magnus Granberg <zorry <AT> gentoo <DOT> org>
CommitDate: Thu Jul 16 22:41:57 2015 +0000
URL:        https://gitweb.gentoo.org/proj/tinderbox-cluster-www.git/commit/?id=b064d967

add more info for new build request and new build logs on home

 python/tbc_www/models.py                          | 18 +++++++++++
 python/tbc_www/views.py                           | 37 +++++++++++++++++++++--
 python/templates/includes/frontpage/new_build_req |  6 ++--
 python/templates/includes/frontpage/new_logs      |  2 +-
 4 files changed, 57 insertions(+), 6 deletions(-)

diff --git a/python/tbc_www/models.py b/python/tbc_www/models.py
index b51e154..fc91a8b 100644
--- a/python/tbc_www/models.py
+++ b/python/tbc_www/models.py
@@ -109,3 +109,21 @@ class BuildJobs(models.Model):
 		db_table = 'build_jobs'
 	def __str__(self):
 		return '%s %s %s %s %s %s %s' % (self.BuildJobId, self.EbuildId, self.ConfigId, self.Status, self.BuildNow, self.RemoveBin, self.TimeStamp)
+
+class Uses(models.Model):
+	UseId = models.IntegerField(primary_key=True, db_column='use_id')
+	Flag = models.CharField(max_length=150, db_column='flag')
+	class Meta:
+		db_table = 'uses'
+	def __str__(self):
+		return '%s %s' % (self.UseId, self.Flag)
+
+class BuildJobsUse(models.Model):
+	Id = models.IntegerField(primary_key=True, db_column='id')
+	BuildJobId = models.ForeignKey(BuildJobs, db_column='build_job_id')
+	UseId = models.ForeignKey(Uses, db_column='use_id')
+	Status = models.BooleanField(db_column='status')
+	class Meta:
+		db_table = 'build_jobs_use'
+	def __str__(self):
+		return '%s %s %s %s' % (self.Id, self.BuildJobId, self.UseId, self.Status)

diff --git a/python/tbc_www/views.py b/python/tbc_www/views.py
index 58f186e..108a653 100644
--- a/python/tbc_www/views.py
+++ b/python/tbc_www/views.py
@@ -5,7 +5,8 @@ from django.shortcuts import render, get_object_or_404, HttpResponseRedirect
 from django.conf import settings
 
 from gentoo_www.models import SiteSettings, Layout, Pages, SubPages, Sponsors, Posts
-from tbc_www.models import EbuildsMetadata, BuildLogs, BuildJobs, BuildLogsRepomanQa
+from tbc_www.models import EbuildsMetadata, BuildLogs, BuildJobs, BuildLogsRepomanQa,  \
+	BuildJobsUse
 
 import re
 
@@ -29,9 +30,41 @@ def default_TmpDict(pagerequest):
 def home(request):
 	pagerequest = 'home'
 	Lines = 10
+	adict = {}
 	TmpDict = default_TmpDict(pagerequest)
 	TmpDict['EM'] = EbuildsMetadata.objects.filter(Revision = '1.1').order_by('-Id')[:Lines]
 	TmpDict['BL'] = BuildLogs.objects.order_by('-TimeStamp')[:Lines]
-	TmpDict['BJ'] = BuildJobs.objects.order_by('-TimeStamp')[:Lines]
+	BJ_Tmp = BuildJobs.objects.order_by('-TimeStamp')[:Lines]
+	for BJ in BJ_Tmp:
+		adict2 = {}
+		adict2['EbuildId'] = BJ.EbuildId.EbuildId
+		adict2['C'] = BJ.EbuildId.PackageId.CategoryId.Category
+		adict2['P'] = BJ.EbuildId.PackageId.Package
+		adict2['V'] = BJ.EbuildId.Version
+		adict2['R'] = BJ.EbuildId.PackageId.RepoId.Repo
+		adict2['Profile'] = BJ.ConfigId.SetupId.Profile
+		adict2['Setup'] = BJ.ConfigId.SetupId.Setup
+		adict2['title'] = "Setup: " + BJ.ConfigId.SetupId.Setup + "\n" + "Profile: " + BJ.ConfigId.SetupId.Profile + "\n"
+		BJU = BuildJobsUse.objects.filter(BuildJobId = BJ.BuildJobId)
+		if not BJU == []:
+			use_enable = []
+			use_disable = []
+			for BU in BJU:
+				if BU.Status:
+					use_enable.append(BU.UseId.Flag)
+				else:
+					use_disable.append(BU.UseId.Flag)
+		if not use_enable == []:
+			adict2['title'] = adict2['title'] + "Enable: "
+			for use in use_enable:
+				adict2['title'] = adict2['title'] + use + " "
+			adict2['title'] = adict2['title'] + "\n"
+		if not use_disable == []:
+			adict2['title'] = adict2['title'] + "Disable: "
+			for use in use_disable:
+				adict2['title'] = adict2['title'] + use + " "
+			adict2['title'] = adict2['title'] + "\n"
+		adict[BJ.BuildJobId] = adict2
+	TmpDict['BJ'] = adict
 	TmpDict['RM'] = BuildLogsRepomanQa.objects.order_by('-Id')[:Lines]
 	return render(request, 'pages/' + pagerequest + '/index.html', TmpDict)

diff --git a/python/templates/includes/frontpage/new_build_req b/python/templates/includes/frontpage/new_build_req
index 23b6f2d..53a3fcb 100644
--- a/python/templates/includes/frontpage/new_build_req
+++ b/python/templates/includes/frontpage/new_build_req
@@ -1,8 +1,8 @@
 <table class="table table-striped frontpage-table">
-  {% for J in BJ %}
+  {% for k, v in BJ.items %}
     <tr>
-      <td class="frontpage-table-package-atom"><a href="/new_build_req/{{ J.EbuildId.EbuildId }}" title="{{ J.EbuildId.PackageId.CategoryId.Category }}/{{ J.EbuildId.PackageId.Package }}-{{ J.EbuildId.Version }}::{{ J.EbuildId.PackageId.RepoId.Repo }}">{{ J.EbuildId.PackageId.CategoryId.Category }}/{{ J.EbuildId.PackageId.Package }}-{{ J.EbuildId.Version }}::{{ J.EbuildId.PackageId.RepoId.Repo }}</a></td>
-      <td></td>
+      <td class="frontpage-table-package-atom"><a href="/new_build_req/{{ k }}" title="{{ v.C }}/{{ v.P }}-{{ v.V }}::{{ v.R }}">{{ v.C }}/{{ v.P }}-{{ v.V }}::{{ v.R }}</a></td>
+      <td><p title="{{ v.title }}">{{ v.title|truncatewords:2}}</p></td>
     </tr>
   {% endfor %}
 </table>
\ No newline at end of file

diff --git a/python/templates/includes/frontpage/new_logs b/python/templates/includes/frontpage/new_logs
index 9480155..6534201 100644
--- a/python/templates/includes/frontpage/new_logs
+++ b/python/templates/includes/frontpage/new_logs
@@ -3,7 +3,7 @@
     <tr>
       <td class="frontpage-table-package-atom"><a href="/new_logs/{{ B.BuildLogId }}/" title="{{ B.EbuildId.PackageId.CategoryId.Category }}/{{ B.EbuildId.PackageId.Package }}-{{ B.EbuildId.Version }}::{{ B.EbuildId.PackageId.RepoId.Repo }}">
       {{ B.EbuildId.PackageId.CategoryId.Category }}/{{ B.EbuildId.PackageId.Package }}-{{ B.EbuildId.Version }}::{{ B.EbuildId.PackageId.RepoId.Repo }}</a></td>
-      <td><p title="{{ B.SummeryText }}">{{ B.SummeryText|truncatewords:3 }}</p></td>
+      <td><p title="{{ B.SummeryText }}">{{ B.SummeryText|truncatewords:3 }}</p><td class="text-right">{% if B.Fail %}<span class="label label-danger">Fail</span>{% endif %}</td></td>
     </tr>
   {% endfor %}
 </table>
\ No newline at end of file


             reply	other threads:[~2015-07-16 22:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-16 22:49 Magnus Granberg [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-02-04 22:53 [gentoo-commits] proj/tinderbox-cluster-www:master commit in: python/templates/includes/frontpage/, python/tbc_www/ Magnus Granberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1437086517.b064d9675554a6ea3d518a2891b4c1495f26011c.zorry@gentoo \
    --to=zorry@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox