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

2017-01-06 Thread Magnus Granberg
commit: 11d166a0b90d591b1e18efac99d1b729c6d30678
Author: Magnus Granberg  gentoo  org>
AuthorDate: Fri Jan  6 18:04:01 2017 +
Commit: Magnus Granberg  gentoo  org>
CommitDate: Fri Jan  6 18:04:01 2017 +
URL:
https://gitweb.gentoo.org/proj/tinderbox-cluster-www.git/commit/?id=11d166a0

fix ame 'adict' is not defined line 273

 python/tbc_www/views.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/python/tbc_www/views.py b/python/tbc_www/views.py
index 305ed8c..c272c50 100644
--- a/python/tbc_www/views.py
+++ b/python/tbc_www/views.py
@@ -270,7 +270,7 @@ def new_logs(request):
adict2['Fail'] = BL.Fail
adict2['SummeryText'] = BL.SummeryText
if BL.Fail:
-   adict['FI'] = fail_status(BL.BuildLogId)
+   adict2['FI'] = fail_status(BL.BuildLogId)
alist.append(adict2)
TmpDict['BL_tmp'] = alist
TmpDict['QA_tmp'] = BuildLogsQa.objects.filter(BuildLogId__New = True)



[gentoo-commits] proj/tinderbox-cluster-www:master commit in: python/tbc_www/utils/

2017-01-06 Thread Magnus Granberg
commit: 9f7bd0adcc9d549f97f421a3d3b589e7ec39fd10
Author: Magnus Granberg  gentoo  org>
AuthorDate: Fri Jan  6 17:50:49 2017 +
Commit: Magnus Granberg  gentoo  org>
CommitDate: Fri Jan  6 17:50:49 2017 +
URL:
https://gitweb.gentoo.org/proj/tinderbox-cluster-www.git/commit/?id=9f7bd0ad

add utils

 python/tbc_www/utils/__init__.py   |  0
 python/tbc_www/utils/bugzillasubmit.py | 27 +++
 2 files changed, 27 insertions(+)

diff --git a/python/tbc_www/utils/__init__.py b/python/tbc_www/utils/__init__.py
new file mode 100644
index 000..e69de29

diff --git a/python/tbc_www/utils/bugzillasubmit.py 
b/python/tbc_www/utils/bugzillasubmit.py
new file mode 100644
index 000..d8160dc
--- /dev/null
+++ b/python/tbc_www/utils/bugzillasubmit.py
@@ -0,0 +1,27 @@
+from __future__ import print_function
+
+import bugzilla
+
+URL = "https://bugs.gentoo.org/xmlrpc.cgi;
+def addnewbug(args):
+   bzapi = bugzilla.Bugzilla(URL)
+   print(args['username'])
+   print(args['password'])
+   bzapi.login(user=args['username'], password=args['password'])
+   createinfo = bzapi.build_createbug(
+   product=args['product'],
+   version=args['version'],
+   component=args['component'],
+   summary=args['summary'],
+   description=args['description'],
+   assigned_to=args['assigned_to'])
+   newbug = bzapi.createbug(createinfo)
+   print("Created new bug id=%s url=%s" % (newbug.id, newbug.weburl))
+   update = bzapi.build_update(comment=args['comment'])
+   bzapi.update_bugs(newbug.id, update)
+   kwards = {
+   'contenttype': args['content_type'],
+   }
+   attchment_id = bzapi.attachfile(newbug.id, args['filename'], 
args['comment_attach'], **kwards)
+   bzapi.logout()
+   return newbug



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

2016-01-31 Thread Magnus Granberg
commit: a0a2a79a1d270562a219a0a3d2ff7c40df42ea44
Author: Magnus Granberg  gentoo  org>
AuthorDate: Sun Jan 31 15:02:20 2016 +
Commit: Magnus Granberg  gentoo  org>
CommitDate: Sun Jan 31 15:02:20 2016 +
URL:
https://gitweb.gentoo.org/proj/tinderbox-cluster-www.git/commit/?id=a0a2a79a

remove mtime in the package model

 python/tbc_www/models.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/python/tbc_www/models.py b/python/tbc_www/models.py
index dda8c3b..81f7c59 100644
--- a/python/tbc_www/models.py
+++ b/python/tbc_www/models.py
@@ -36,13 +36,12 @@ class Packages(models.Model):
CategoryId = models.ForeignKey(Categories, db_column='category_id')
Package = models.CharField(max_length=150, db_column='package')
RepoId = models.ForeignKey(Repos, db_column='repo_id')
-   Mtime = models.DateTimeField(db_column='mtime')
Active = models.BooleanField(db_column='active')
TimeStamp = models.DateTimeField(db_column='time_stamp')
class Meta:
db_table = 'packages'
def __str__(self):
-   return '%s %s %s %s %s %s %s' % (self.PackageId, 
self.CategoryId, self.Package, self.RepoId, self.Mtime, self.Active, 
self.TimeStamp)
+   return '%s %s %s %s %s %s %s' % (self.PackageId, 
self.CategoryId, self.Package, self.RepoId, self.Active, self.TimeStamp)
 
 class PackagesMetadata(models.Model):
Id =  models.IntegerField(primary_key=True, db_column='id')



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

2016-01-10 Thread Magnus Granberg
commit: cb322ccb29e1a6dd74c0381628f749ca7d5f9de6
Author: Magnus Granberg  gentoo  org>
AuthorDate: Sun Jan 10 16:35:44 2016 +
Commit: Magnus Granberg  gentoo  org>
CommitDate: Sun Jan 10 16:35:44 2016 +
URL:
https://gitweb.gentoo.org/proj/tinderbox-cluster-www.git/commit/?id=cb322ccb

change from checksum to mtime on Manifest

 python/tbc_www/models.py | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/python/tbc_www/models.py b/python/tbc_www/models.py
index e864cf8..dda8c3b 100644
--- a/python/tbc_www/models.py
+++ b/python/tbc_www/models.py
@@ -36,13 +36,13 @@ class Packages(models.Model):
CategoryId = models.ForeignKey(Categories, db_column='category_id')
Package = models.CharField(max_length=150, db_column='package')
RepoId = models.ForeignKey(Repos, db_column='repo_id')
-   Checksum = models.CharField(max_length=100, db_column='checksum')
+   Mtime = models.DateTimeField(db_column='mtime')
Active = models.BooleanField(db_column='active')
TimeStamp = models.DateTimeField(db_column='time_stamp')
class Meta:
db_table = 'packages'
def __str__(self):
-   return '%s %s %s %s %s %s %s' % (self.PackageId, 
self.CategoryId, self.Package, self.RepoId, self.Checksum, self.Active, 
self.TimeStamp)
+   return '%s %s %s %s %s %s %s' % (self.PackageId, 
self.CategoryId, self.Package, self.RepoId, self.Mtime, self.Active, 
self.TimeStamp)
 
 class PackagesMetadata(models.Model):
Id =  models.IntegerField(primary_key=True, db_column='id')
@@ -52,7 +52,7 @@ class PackagesMetadata(models.Model):
class Meta:
db_table = 'packages_metadata'
def __str__(self):
-   return '%s %s %s %s' % (self.Id, self.PackageId, self.Changlog, 
self.Descriptions)
+   return '%s %s %s %s' % (self.Id, self.PackageId, self.Gitlog, 
self.Descriptions)
 
 class Ebuilds(models.Model):
EbuildId = models.IntegerField(primary_key=True, db_column='ebuild_id')
@@ -75,7 +75,7 @@ class EbuildsMetadata(models.Model):
class Meta:
db_table = 'ebuilds_metadata'
def __str__(self):
-   return '%s %s %s %s' % (self.Id, self.EbuildId, self.Revision, 
self.Descriptions)
+   return '%s %s %s %s' % (self.Id, self.EbuildId, self,Commit, 
self.New, self.Descriptions)
 
 class BuildLogs(models.Model):
BuildLogId = models.IntegerField(primary_key=True, 
db_column='build_log_id')



[gentoo-commits] proj/tinderbox-cluster-www:master commit in: python/tbc_www/, python/templates/pages/home/, python/templates/pages/new/, ...

2015-07-26 Thread Magnus Granberg
commit: 2b49668f127b3be24be722ffdd00dd819b1f1acf
Author: Magnus Granberg zorry AT gentoo DOT org
AuthorDate: Mon Jul 27 00:41:09 2015 +
Commit: Magnus Granberg zorry AT gentoo DOT org
CommitDate: Mon Jul 27 00:41:09 2015 +
URL:
https://gitweb.gentoo.org/proj/tinderbox-cluster-www.git/commit/?id=2b49668f

add repoman and qa page on new

 python/tbc_www/urls.py  |  1 +
 python/tbc_www/views.py |  7 +++
 python/templates/pages/home/index.html  |  2 +-
 python/templates/pages/new/index.html   |  2 +-
 python/templates/pages/new/repomanqa/index.html | 26 +
 5 files changed, 36 insertions(+), 2 deletions(-)

diff --git a/python/tbc_www/urls.py b/python/tbc_www/urls.py
index 4d50f40..55fbca9 100644
--- a/python/tbc_www/urls.py
+++ b/python/tbc_www/urls.py
@@ -6,5 +6,6 @@ urlpatterns = patterns('tbc_www.views',
url(r'^categories/(?Pcategory_id\d+)/$', 'packages'),
url(r'^package/(?Ppackage_id\d+)/$', 'ebuilds'),
url(r'^ebuild/(?Pebuild_id\d+)/$', 'ebuild'),
+   url(r'^new/repomanqa/$', 'new_repomanqa'),
url(r'^new/$', 'new_main'),
 )

diff --git a/python/tbc_www/views.py b/python/tbc_www/views.py
index 5b719aa..7e99671 100644
--- a/python/tbc_www/views.py
+++ b/python/tbc_www/views.py
@@ -190,3 +190,10 @@ def new_main(request):
TmpDict['BJ'] = adict
TmpDict['RM'] = BuildLogsRepomanQa.objects.order_by('-Id')[:Lines]
return render(request, 'pages/' + pagerequest + '/index.html', TmpDict)
+
+def new_repomanqa(request):
+   pagerequest = 'new'
+   Lines = 30
+   TmpDict = default_TmpDict(pagerequest)
+   TmpDict['RM_tmp'] = BuildLogsRepomanQa.objects.order_by('-Id')[:Lines]
+   return render(request, 'pages/' + pagerequest + 
'/repomanqa/index.html', TmpDict)

diff --git a/python/templates/pages/home/index.html 
b/python/templates/pages/home/index.html
index d2b0ff7..9a75c4e 100644
--- a/python/templates/pages/home/index.html
+++ b/python/templates/pages/home/index.html
@@ -18,7 +18,7 @@
 {% include includes/frontpage/new_build_req %}
   /div
   div class=col-xs-12 col-md-6
-h2New Repoman or QA's smallon the a href=/new_repoman_qa/New 
Repoman or QA's/a/small/h2
+h2New Repoman or QA's smallon the a href=/new/repomanqa/New 
Repoman or QA's/a/small/h2
 {% include includes/frontpage/new_repoman_qa %}
   /div
 /div

diff --git a/python/templates/pages/new/index.html 
b/python/templates/pages/new/index.html
index 5195584..93cf42f 100644
--- a/python/templates/pages/new/index.html
+++ b/python/templates/pages/new/index.html
@@ -17,7 +17,7 @@
 {% include includes/frontpage/new_build_req %}
   /div
   div class=col-xs-12 col-md-6
-h2New Repoman or QA's smallon the a href=/new_repoman_qa/New 
Repoman or QA's/a/small/h2
+h2New Repoman or QA's smallon the a href=/new/repomanqa/New 
Repoman or QA's/a/small/h2
 {% include includes/frontpage/new_repoman_qa %}
   /div
 /div

diff --git a/python/templates/pages/new/repomanqa/index.html 
b/python/templates/pages/new/repomanqa/index.html
new file mode 100644
index 000..d634b67
--- /dev/null
+++ b/python/templates/pages/new/repomanqa/index.html
@@ -0,0 +1,26 @@
+{% extends layout/base.html %}
+{% block content %}
+div class=row
+  h2New Repoman and QA's/h2
+  div class=panel-group id=accordion role=tablist 
aria-multiselectable=true
+  {% for RM in RM_tmp %}
+  div class=panel panel-default
+div class=panel-heading role=tab id=heading{{ RM.Id }}
+  h4 class=panel-title
+a role=button data-toggle=collapse data-parent=#accordion 
href=#collapse{{ RM.Id }} aria-expanded=false aria-controls=collapse{{ 
RM.Id }}
+  {{ RM.BuildLogId.EbuildId.PackageId.CategoryId.Category }}/{{ 
RM.BuildLogId.EbuildId.PackageId.Package }}-{{ RM.BuildLogId.EbuildId.Version 
}}::{{ RM.BuildLogId.EbuildId.PackageId.RepoId.Repo }}
+  {{ RM.SummeryText|truncatewords:6 }}
+/a
+  /h4
+/div
+div id=collapse{{ RM.Id }} class=panel-collapse collapse in 
role=tabpanel aria-labelledby=heading{{ RM.Id }}
+  div class=panel-body
+{{ RM.SummeryText|linebreaksbr }}
+  /div
+/div
+  /div
+  {% endfor %}
+  /div
+/div
+
+{% endblock %}
\ No newline at end of file



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

2015-07-23 Thread Magnus Granberg
commit: f1d51cfa2fe8f8a781dc31e3f6ca7ad6436b8563
Author: Magnus Granberg zorry AT gentoo DOT org
AuthorDate: Fri Jul 24 00:17:26 2015 +
Commit: Magnus Granberg zorry AT gentoo DOT org
CommitDate: Fri Jul 24 00:17:26 2015 +
URL:
https://gitweb.gentoo.org/proj/tinderbox-cluster-www.git/commit/?id=f1d51cfa

fix error, repoman, qa view in new logs

 python/tbc_www/models.py | 22 +++---
 python/tbc_www/views.py  | 34 
 python/templates/includes/frontpage/new_logs | 26 +
 3 files changed, 70 insertions(+), 12 deletions(-)

diff --git a/python/tbc_www/models.py b/python/tbc_www/models.py
index 9827583..621a7dc 100644
--- a/python/tbc_www/models.py
+++ b/python/tbc_www/models.py
@@ -80,8 +80,6 @@ class BuildLogs(models.Model):
BuildLogId = models.IntegerField(primary_key=True, 
db_column='build_log_id')
EbuildId = models.ForeignKey(Ebuilds, db_column='ebuild_id')
Fail =  models.BooleanField(db_column='fail')
-   RmQa =  models.BooleanField(db_column='rmqa')
-   Others =  models.BooleanField(db_column='others')
SummeryText = models.TextField(db_column='summery_text')
LogHash = models.CharField(max_length=100, db_column='log_hash')
BugId = models.IntegerField( db_column='bug_id')
@@ -89,7 +87,7 @@ class BuildLogs(models.Model):
class Meta:
db_table = 'build_logs'
def __str__(self):
-   return '%s %s %s %s %s %s %s %s %s' % (self.BuildLogId, 
self.EbuildId, self.Fail, self.RmQa, self.Others, self.SummeryText, 
self.LogHash, self.BugId, self.TimeStamp)
+   return '%s %s %s %s %s %s %s' % (self.BuildLogId, 
self.EbuildId, self.Fail, self.SummeryText, self.LogHash, self.BugId, 
self.TimeStamp)
 
 class BuildLogsRepomanQa(models.Model):
Id = models.IntegerField(primary_key=True, db_column='id')
@@ -100,6 +98,24 @@ class BuildLogsRepomanQa(models.Model):
def __str__(self):
return '%s %s %s' % (self.Id, self.BuildLogId, self.SummeryText)
 
+class ErrorsInfo(models.Model):
+   ErrorId = models.IntegerField(primary_key=True, db_column='error_id')
+   ErrorName = models.CharField(max_length=20, db_column='error_name')
+   ErrorSearch = models.CharField(max_length=30, db_column='error_search')
+   class Meta:
+   db_table = 'errors_info'
+   def __str__(self):
+   return '%s %s %s' % (self.ErrorId, self.ErrorName, 
self.ErrorSearch)
+
+class BuildLogsErrors(models.Model):
+   Id =  models.IntegerField(primary_key=True, db_column='id')
+   BuildLogId = models.ForeignKey(BuildLogs, db_column='build_log_id')
+   ErrorId = models.ForeignKey(ErrorsInfo, db_column='error_id')
+   class Meta:
+   db_table = 'build_logs_errors'
+   def __str__(self):
+   return '%s %s %s' % (self.Id, self.BuildLogId, self.ErrorId)
+
 class Setups(models.Model):
SetupId = models.AutoField(primary_key=True, db_column='setup_id')
Setup = models.CharField(max_length=100, db_column='setup')

diff --git a/python/tbc_www/views.py b/python/tbc_www/views.py
index 2559f8d..f68a706 100644
--- a/python/tbc_www/views.py
+++ b/python/tbc_www/views.py
@@ -7,7 +7,7 @@ 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, \
BuildJobsUse, Categories, CategoriesMetadata, Packages, 
PackagesMetadata, Ebuilds, \
-   Repos, EbuildsKeywords
+   Repos, EbuildsKeywords, BuildLogsErrors
 import re
 
 def default_TmpDict(pagerequest):
@@ -30,10 +30,22 @@ def default_TmpDict(pagerequest):
 def home(request):
pagerequest = 'home'
Lines = 5
-   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]
+   adict = {}
+   for BL in BuildLogs.objects.order_by('-TimeStamp')[:Lines]:
+   adict2 = {}
+   adict2['C'] = BL.EbuildId.PackageId.CategoryId.Category
+   adict2['P'] = BL.EbuildId.PackageId.Package
+   adict2['V'] = BL.EbuildId.Version
+   adict2['R'] = BL.EbuildId.PackageId.RepoId.Repo
+   adict2['Fail'] = BL.Fail
+   adict2['SummeryText'] = BL.SummeryText
+   if BL.Fail:
+   adict2['BE_tmp'] = 
BuildLogsErrors.objects.filter(BuildLogId = BL.BuildLogId)
+   adict[BL.BuildLogId] = adict2
+   TmpDict['BL'] = adict
+   adict = {}
BJ_Tmp = BuildJobs.objects.order_by('-TimeStamp')[:Lines]
for BJ in BJ_Tmp:
adict2 = {}
@@ -115,10 +127,22 @@ def ebuilds(request, package_id):
 def 

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

2015-07-23 Thread Magnus Granberg
commit: 84e661c69c15decbcc40d56939361169100d9b1d
Author: Magnus Granberg zorry AT gentoo DOT org
AuthorDate: Thu Jul 23 14:56:39 2015 +
Commit: Magnus Granberg zorry AT gentoo DOT org
CommitDate: Thu Jul 23 14:56:39 2015 +
URL:
https://gitweb.gentoo.org/proj/tinderbox-cluster-www.git/commit/?id=84e661c6

add the main new page

 python/tbc_www/urls.py| 1 +
 python/tbc_www/views.py   | 5 +++--
 python/templates/includes/frontpage/new_build_req | 9 -
 python/templates/includes/frontpage/new_packages  | 2 +-
 4 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/python/tbc_www/urls.py b/python/tbc_www/urls.py
index 82e9336..193443f 100644
--- a/python/tbc_www/urls.py
+++ b/python/tbc_www/urls.py
@@ -5,4 +5,5 @@ urlpatterns = patterns('tbc_www.views',
url(r'^packages/$', 'categories'),
url(r'^categories/(?Pcategory_id\d+)/$', 'packages'),
url(r'^package/(?Ppackage_id\d+)/$', 'ebuilds'),
+   url(r'^new/$', 'new_main'),
 )

diff --git a/python/tbc_www/views.py b/python/tbc_www/views.py
index 84ff9e6..2559f8d 100644
--- a/python/tbc_www/views.py
+++ b/python/tbc_www/views.py
@@ -112,9 +112,9 @@ def ebuilds(request, package_id):
TmpDict['EK_tmp'] = EbuildsKeywords.objects.filter(EbuildId__Active = 
True).filter(EbuildId__PackageId__Package = P.PackageId.Package)
return render(request, 'pages/' + pagerequest + '/ebuilds/index.html', 
TmpDict)
 
-def new(request):
+def new_main(request):
pagerequest = 'new'
-   Lines = 20
+   Lines = 30
adict = {}
TmpDict = default_TmpDict(pagerequest)
TmpDict['EM'] = EbuildsMetadata.objects.filter(Revision = 
'1.1').order_by('-Id')[:Lines]
@@ -127,6 +127,7 @@ def new(request):
adict2['P'] = BJ.EbuildId.PackageId.Package
adict2['V'] = BJ.EbuildId.Version
adict2['R'] = BJ.EbuildId.PackageId.RepoId.Repo
+   adict2['Status'] = BJ.Status
adict2['title'] = Setup:  + BJ.SetupId.Setup + \n + 
Profile:  + BJ.SetupId.Profile + \n
BJU = BuildJobsUse.objects.filter(BuildJobId = BJ.BuildJobId)
if not BJU == []:

diff --git a/python/templates/includes/frontpage/new_build_req 
b/python/templates/includes/frontpage/new_build_req
index 53a3fcb..3a47530 100644
--- a/python/templates/includes/frontpage/new_build_req
+++ b/python/templates/includes/frontpage/new_build_req
@@ -2,7 +2,14 @@
   {% for k, v in BJ.items %}
 tr
   td class=frontpage-table-package-atoma href=/new_build_req/{{ k 
}} title={{ v.C }}/{{ v.P }}-{{ v.V }}::{{ v.R }}{{ v.C }}/{{ v.P }}-{{ v.V 
}}::{{ v.R }}/a/td
-  tdp title={{ v.title }}{{ v.title|truncatewords:2}}/p/td
+  tdp title={{ v.title }}{{ v.title|truncatewords:2}}/p
+  td class=text-right
+  {% if v.Status == 'Building' %}
+span class=label label-primary{{ v.Status }}/span
+  {% else %}
+span class=label label-default{{ v.Status }}/span
+  {% endif %}
+  /td/td
 /tr
   {% endfor %}
 /table
\ No newline at end of file

diff --git a/python/templates/includes/frontpage/new_packages 
b/python/templates/includes/frontpage/new_packages
index 7de11c0..6c845b7 100644
--- a/python/templates/includes/frontpage/new_packages
+++ b/python/templates/includes/frontpage/new_packages
@@ -4,7 +4,7 @@
   td class=frontpage-table-package-atom
   a href=/packages/{{ E.EbuildId.PackageId.PackageId }}/ title={{ 
E.EbuildId.PackageId.CategoryId.Category }}/{{ E.EbuildId.PackageId.Package 
}}-{{ E.EbuildId.Version }}::{{ E.EbuildId.PackageId.RepoId.Repo }}
   {{ E.EbuildId.PackageId.CategoryId.Category }}/{{ 
E.EbuildId.PackageId.Package }}-{{ E.EbuildId.Version }}::{{ 
E.EbuildId.PackageId.RepoId.Repo }}/a/td
-tdp{{ E.Descriptions }}/p/td
+tdp title={{ E.Descriptions }}{{ E.Descriptions }}/p/td
 /tr
   {% endfor %}
 /table
\ No newline at end of file



[gentoo-commits] proj/tinderbox-cluster-www:master commit in: python/tbc_www/, python/templates/pages/packages/ebuilds/

2015-07-22 Thread Magnus Granberg
commit: f66e4386ffe1b5f48a8f7986d6cc4371d7862b85
Author: Magnus Granberg zorry AT gentoo DOT org
AuthorDate: Wed Jul 22 21:24:44 2015 +
Commit: Magnus Granberg zorry AT gentoo DOT org
CommitDate: Wed Jul 22 21:24:44 2015 +
URL:
https://gitweb.gentoo.org/proj/tinderbox-cluster-www.git/commit/?id=f66e4386

add keywords to version view

 python/tbc_www/models.py   | 18 ++
 python/tbc_www/views.py|  8 
 python/templates/pages/packages/ebuilds/index.html | 20 
 3 files changed, 38 insertions(+), 8 deletions(-)

diff --git a/python/tbc_www/models.py b/python/tbc_www/models.py
index 3d284c2..9827583 100644
--- a/python/tbc_www/models.py
+++ b/python/tbc_www/models.py
@@ -150,3 +150,21 @@ class BuildJobsUse(models.Model):
db_table = 'build_jobs_use'
def __str__(self):
return '%s %s %s %s' % (self.Id, self.BuildJobId, self.UseId, 
self.Status)
+
+class Keywords(models.Model):
+   KeywordId = models.IntegerField(primary_key=True, 
db_column='keyword_id')
+   Keyword = models.CharField(max_length=45, db_column='keyword')
+   class Meta:
+   db_table = 'keywords'
+   def __str__(self):
+   return '%s %s' % (self.KeywordId, self.Keyword)
+
+class EbuildsKeywords(models.Model):
+   Id =  models.IntegerField(primary_key=True, db_column='id')
+   EbuildId = models.ForeignKey(Ebuilds, db_column='ebuild_id')
+   KeywordId = models.ForeignKey(Keywords, db_column='keyword_id')
+   Status = models.CharField(max_length=24, db_column='status')
+   class Meta:
+   db_table = 'ebuilds_keywords'
+   def __str__(self):
+   return '%s %s %s' % (self.EbuildId, self.KeywordId, self.Status)

diff --git a/python/tbc_www/views.py b/python/tbc_www/views.py
index a025cbf..84ff9e6 100644
--- a/python/tbc_www/views.py
+++ b/python/tbc_www/views.py
@@ -7,7 +7,7 @@ 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, \
BuildJobsUse, Categories, CategoriesMetadata, Packages, 
PackagesMetadata, Ebuilds, \
-   Repos
+   Repos, EbuildsKeywords
 import re
 
 def default_TmpDict(pagerequest):
@@ -106,10 +106,10 @@ def packages(request, category_id):
 def ebuilds(request, package_id):
pagerequest = 'packages'
TmpDict = default_TmpDict(pagerequest)
-   P = get_object_or_404(Packages,  PackageId = package_id)
+   P = get_object_or_404(PackagesMetadata,  PackageId__PackageId = 
package_id)
TmpDict['P'] = P
-   TmpDict['EM_tmp'] = EbuildsMetadata.objects.filter(EbuildId__Active = 
True).filter(EbuildId__PackageId__Package = P.Package)
-   print(TmpDict)
+   TmpDict['EM_tmp'] = EbuildsMetadata.objects.filter(EbuildId__Active = 
True).filter(EbuildId__PackageId__Package = P.PackageId.Package)
+   TmpDict['EK_tmp'] = EbuildsKeywords.objects.filter(EbuildId__Active = 
True).filter(EbuildId__PackageId__Package = P.PackageId.Package)
return render(request, 'pages/' + pagerequest + '/ebuilds/index.html', 
TmpDict)
 
 def new(request):

diff --git a/python/templates/pages/packages/ebuilds/index.html 
b/python/templates/pages/packages/ebuilds/index.html
index 73f45f2..1e034d4 100644
--- a/python/templates/pages/packages/ebuilds/index.html
+++ b/python/templates/pages/packages/ebuilds/index.html
@@ -1,14 +1,26 @@
 {% extends layout/base.html %}
 {% block content %}
 div class=row
-  div class=col-xs-12 col-md-6
-h2{{ P.CategoryId.Category }}/{{ P.Package }}/h2
+  div class=col-xs-12 col-md-9
+h2{{ P.PackageId.CategoryId.Category }}/{{ P.PackageId.Package }}/h2
+pChanglog/p
+p{{ P.Changlog|linebreaksbr }}/p
 table class=table table-striped frontpage-table
   {% for E in EM_tmp %}
 tr
   td class=frontpage-table-package-atom
-a href=/ebuild/{{ E.EbuildId.EbuildId }}/ title={{ 
P.CategoryId.Category }}/{{ P.Package }}-{{ E.EbuildId.Version }}::{{ 
E.EbuildId.PackageId.RepoId.Repo }}{{ P.Package }}-{{ E.EbuildId.Version 
}}::{{ E.EbuildId.PackageId.RepoId.Repo }}/a/td
-  tdp/p/td
+a href=/ebuild/{{ E.EbuildId.EbuildId }}/ title={{ 
P.PackageId.CategoryId.Category }}/{{ P.PackageId.Package }}-{{ 
E.EbuildId.Version }}::{{ E.EbuildId.PackageId.RepoId.Repo }}{{ 
P.PackageId.Package }}-{{ E.EbuildId.Version }}::{{ 
E.EbuildId.PackageId.RepoId.Repo }}/a/td
+  td
+ td class=text-right
+  {% for K in EK_tmp %}
+{% if K.EbuildId.EbuildId == E.EbuildId.EbuildId  and 
K.KeywordId.Keyword != '*' %}
+  {% if K.Status == 'Stable' %}span class=label 
label-success{{ K.KeywordId.Keyword }}/span{% endif %}
+  {% if K.Status == 'Unstable' %}span class=label 

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

2015-07-17 Thread Magnus Granberg
commit: 58736e935b2ece00e47cb380481c5a935f340c82
Author: Magnus Granberg zorry AT gentoo DOT org
AuthorDate: Fri Jul 17 06:20:12 2015 +
Commit: Magnus Granberg zorry AT gentoo DOT org
CommitDate: Fri Jul 17 06:20:12 2015 +
URL:
https://gitweb.gentoo.org/proj/tinderbox-cluster-www.git/commit/?id=58736e93

fix a error to display setup/profiles in new build requests in home

 python/tbc_www/models.py | 3 ++-
 python/tbc_www/views.py  | 6 ++
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/python/tbc_www/models.py b/python/tbc_www/models.py
index fc91a8b..04a3bb8 100644
--- a/python/tbc_www/models.py
+++ b/python/tbc_www/models.py
@@ -100,6 +100,7 @@ class Configs(models.Model):
 class BuildJobs(models.Model):
BuildJobId = models.AutoField(primary_key=True, 
db_column='build_job_id')
EbuildId = models.ForeignKey(Ebuilds, db_column='ebuild_id')
+   SetupId = models.ForeignKey(Setups, db_column='setup_id')
ConfigId = models.ForeignKey(Configs, db_column='config_id')
Status = models.CharField(max_length=21, db_column='status')
BuildNow = models.BooleanField(db_column='build_now')
@@ -108,7 +109,7 @@ class BuildJobs(models.Model):
class Meta:
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)
+   return '%s %s %s %s %s %s %s %s' % (self.BuildJobId, 
self.EbuildId, self.SetupId, self.ConfigId, self.Status, self.BuildNow, 
self.RemoveBin, self.TimeStamp)
 
 class Uses(models.Model):
UseId = models.IntegerField(primary_key=True, db_column='use_id')

diff --git a/python/tbc_www/views.py b/python/tbc_www/views.py
index 108a653..dcc89d4 100644
--- a/python/tbc_www/views.py
+++ b/python/tbc_www/views.py
@@ -5,7 +5,7 @@ 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
@@ -42,9 +42,7 @@ def home(request):
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
+   adict2['title'] = Setup:  + BJ.SetupId.Setup + \n + 
Profile:  + BJ.SetupId.Profile + \n
BJU = BuildJobsUse.objects.filter(BuildJobId = BJ.BuildJobId)
if not BJU == []:
use_enable = []