[gentoo-commits] proj/tinderbox-cluster-www:master commit in: python/templates/includes/frontpage/, python/tbc_www/

2016-02-04 Thread Magnus Granberg
commit: 42327597334a2350d1c3de4270790dfad984086d
Author: Magnus Granberg  gentoo  org>
AuthorDate: Thu Feb  4 22:54:33 2016 +
Commit: Magnus Granberg  gentoo  org>
CommitDate: Thu Feb  4 22:54:33 2016 +
URL:
https://gitweb.gentoo.org/proj/tinderbox-cluster-www.git/commit/?id=42327597

update buildinfo to packages typo fix

 python/tbc_www/views.py  | 2 +-
 python/templates/includes/frontpage/new_logs | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/python/tbc_www/views.py b/python/tbc_www/views.py
index e5b92a0..c1124ff 100644
--- a/python/tbc_www/views.py
+++ b/python/tbc_www/views.py
@@ -233,7 +233,7 @@ def new_main(request):
if BE.ErrorId.ErrorId == 3:
adict2['FailCode'] = 'OTHERS'
if BE.ErrorId.ErrorId >= 4:
-   adict2['FailCode'] = BE.ErrorId.Error
+   adict2['FailCode'] =  
BE.ErrorId.ErrorName
adict2['Repoman'] = False
BLRe = BuildLogsRepoman.objects.filter(BuildLogId = 
BL.BuildLogId)
if BLRe.exists():

diff --git a/python/templates/includes/frontpage/new_logs 
b/python/templates/includes/frontpage/new_logs
index 3b0310c..1acbbc2 100644
--- a/python/templates/includes/frontpage/new_logs
+++ b/python/templates/includes/frontpage/new_logs
@@ -9,7 +9,7 @@
   {% if B.FailCode == 'OTHERS' %}
 {{ B.FailCode }}
   {% else %}
-{{ B.FailCode }}
+{{ B.FailCode }}
   {% endif %}
 {% else %}
   Build



[gentoo-commits] proj/tinderbox-cluster-www:master commit in: python/templates/includes/frontpage/, python/tbc_www/

2015-07-16 Thread Magnus Granberg
commit: b064d9675554a6ea3d518a2891b4c1495f26011c
Author: Magnus Granberg zorry AT gentoo DOT org
AuthorDate: Thu Jul 16 22:41:57 2015 +
Commit: Magnus Granberg zorry AT gentoo DOT org
CommitDate: Thu Jul 16 22:41:57 2015 +
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