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/templates/pages/packages/ebuilds/, ...
Date: Sat,  1 Aug 2015 23:03:33 +0000 (UTC)	[thread overview]
Message-ID: <1438470142.96969fe37a3f589bbd0a9688979c7cd332cf5c1d.zorry@gentoo> (raw)

commit:     96969fe37a3f589bbd0a9688979c7cd332cf5c1d
Author:     Magnus Granberg <zorry <AT> gentoo <DOT> org>
AuthorDate: Sat Aug  1 23:02:22 2015 +0000
Commit:     Magnus Granberg <zorry <AT> gentoo <DOT> org>
CommitDate: Sat Aug  1 23:02:22 2015 +0000
URL:        https://gitweb.gentoo.org/proj/tinderbox-cluster-www.git/commit/?id=96969fe3

add repoman full support

 python/tbc_www/models.py                           | 13 +++++++++-
 python/tbc_www/views.py                            | 30 ++++++++++++++++------
 python/templates/includes/frontpage/new_repoman_qa | 16 +++++++++---
 .../templates/pages/packages/category/index.html   |  6 ++++-
 python/templates/pages/packages/ebuilds/index.html |  3 +++
 5 files changed, 54 insertions(+), 14 deletions(-)

diff --git a/python/tbc_www/models.py b/python/tbc_www/models.py
index 2cb327a..efdc13a 100644
--- a/python/tbc_www/models.py
+++ b/python/tbc_www/models.py
@@ -89,7 +89,7 @@ class BuildLogs(models.Model):
 	def __str__(self):
 		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):
+class BuildLogsQa(models.Model):
 	Id = models.IntegerField(primary_key=True, db_column='id')
 	BuildLogId = models.ForeignKey(BuildLogs, db_column='build_log_id')
 	SummeryText = models.TextField(db_column='summery_text')
@@ -98,6 +98,17 @@ class BuildLogsRepomanQa(models.Model):
 	def __str__(self):
 		return '%s %s %s' % (self.Id, self.BuildLogId, self.SummeryText)
 
+class PackagesRepoman(models.Model):
+	Id =  models.IntegerField(primary_key=True, db_column='id')
+	PackageId = models.ForeignKey(Packages, db_column='package_id')
+	RepomanText = models.TextField(db_column='repoman_text')
+	RepomanHash = models.CharField(max_length=100, db_column='repoman_hash')
+	TimeStamp = models.DateTimeField(db_column='time_stamp')
+	class Meta:
+		db_table = 'packages_repoman'
+	def __str__(self):
+		return '%s %s %s %s %s' % (self.Id, self.PackageId, self.RepomanText, self.RepomanHash, self.TimeStamp)
+
 class ErrorsInfo(models.Model):
 	ErrorId = models.IntegerField(primary_key=True, db_column='error_id')
 	ErrorName = models.CharField(max_length=20, db_column='error_name')

diff --git a/python/tbc_www/views.py b/python/tbc_www/views.py
index 7e99671..ff9a201 100644
--- a/python/tbc_www/views.py
+++ b/python/tbc_www/views.py
@@ -5,9 +5,9 @@ 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, BuildLogsQa, \
 	BuildJobsUse, Categories, CategoriesMetadata, Packages, PackagesMetadata, Ebuilds, \
-	Repos, EbuildsKeywords, BuildLogsErrors, EbuildsRestrictions, EbuildsIuse
+	Repos, EbuildsKeywords, BuildLogsErrors, EbuildsRestrictions, EbuildsIuse, PackagesRepoman
 import re
 
 def default_TmpDict(pagerequest):
@@ -29,7 +29,7 @@ def default_TmpDict(pagerequest):
 
 def home(request):
 	pagerequest = 'home'
-	Lines = 5
+	Lines = 10
 	TmpDict = default_TmpDict(pagerequest)
 	TmpDict['EM'] = EbuildsMetadata.objects.filter(Revision = '1.1').order_by('-Id')[:Lines]
 	alist = []
@@ -77,7 +77,8 @@ def home(request):
 			adict2['title'] = adict2['title'] + "\n"
 		adict[BJ.BuildJobId] = adict2
 	TmpDict['BJ'] = adict
-	TmpDict['RM'] = BuildLogsRepomanQa.objects.order_by('-Id')[:Lines]
+	TmpDict['QA_tmp'] = BuildLogsQa.objects.order_by('-Id')[:Lines/2]
+	TmpDict['PR_tmp'] = PackagesRepoman.objects.order_by('-Id')[:Lines/2]
 	return render(request, 'pages/' + pagerequest + '/index.html', TmpDict)
 
 def categories(request):
@@ -107,6 +108,12 @@ def packages(request, category_id):
 		adict['Package'] = PM.PackageId.Package
 		adict['Descriptions'] = PM.Descriptions
 		adict['Changlog'] =PM.Changlog
+		try:
+			PackagesRepoman.objects.get(PackageId__PackageId = PM.PackageId.PackageId)
+		except PackagesRepoman.DoesNotExist as e:
+			adict['Repoman'] = False
+		else:
+			adict['Repoman'] = True
 		ebuilds = []
 		for E in Ebuilds.objects.filter(Active = True).filter(PackageId__Package = PM.PackageId.Package):
 			ebuilds.append(E.Version + '::' +  E.PackageId.RepoId.Repo + '\n')
@@ -119,11 +126,16 @@ def packages(request, category_id):
 def ebuilds(request, package_id):
 	pagerequest = 'packages'
 	TmpDict = default_TmpDict(pagerequest)
-	P = get_object_or_404(PackagesMetadata,  PackageId__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.PackageId.Package)
 	TmpDict['EK_tmp'] = EbuildsKeywords.objects.filter(EbuildId__Active = True).filter(EbuildId__PackageId__Package = P.PackageId.Package)
-	
+	try:
+		PackagesRepoman.objects.get(PackageId__PackageId = package_id)
+	except PackagesRepoman.DoesNotExist as e:
+		TmpDict['PR'] = False
+	else:
+		TmpDict['PR'] = True
 	return render(request, 'pages/' + pagerequest + '/ebuilds/index.html', TmpDict)
 
 def ebuild(request, ebuild_id):
@@ -188,12 +200,14 @@ def new_main(request):
 			adict2['title'] = adict2['title'] + "\n"
 		adict[BJ.BuildJobId] = adict2
 	TmpDict['BJ'] = adict
-	TmpDict['RM'] = BuildLogsRepomanQa.objects.order_by('-Id')[:Lines]
+	TmpDict['QA_tmp'] = BuildLogsQa.objects.order_by('-Id')[:Lines/2] 
+	TmpDict['PR_tmp'] = PackagesRepoman.objects.order_by('-Id')[:Lines/2]
 	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]
+	TmpDict['QA_tmp'] = BuildLogsQa.objects.order_by('-Id')[:Lines/2] 
+	TmpDict['PR_tmp'] = PackagesRepoman.objects.order_by('-Id')[:Lines/2]
 	return render(request, 'pages/' + pagerequest + '/repomanqa/index.html', TmpDict)

diff --git a/python/templates/includes/frontpage/new_repoman_qa b/python/templates/includes/frontpage/new_repoman_qa
index 1999362..61ac691 100644
--- a/python/templates/includes/frontpage/new_repoman_qa
+++ b/python/templates/includes/frontpage/new_repoman_qa
@@ -1,10 +1,18 @@
 <table class="table table-striped frontpage-table">
-  {% for R in RM %}
+  {% for QA in QA_tmp %}
     <tr>
-      <td class="frontpage-table-package-atom"><a href="/repoman_qa/{{ R.BuildLogId.BuildLogId }}/"  title="{{ R.BuildLogId.EbuildId.PackageId.CategoryId.Category }}/{{ R.BuildLogId.EbuildId.PackageId.Package }}-{{ R.BuildLogId.EbuildId.Version }}::{{ R.BuildLogId.EbuildId.PackageId.RepoId.Repo }}">
-      {{ R.BuildLogId.EbuildId.PackageId.CategoryId.Category }}/{{ R.BuildLogId.EbuildId.PackageId.Package }}-{{ R.BuildLogId.EbuildId.Version }}::{{ R.BuildLogId.EbuildId.PackageId.RepoId.Repo }}</a>
+      <td class="frontpage-table-package-atom"><a href="/repoman_qa/{{ QA.BuildLogId.BuildLogId }}/"  title="{{ QA.BuildLogId.EbuildId.PackageId.CategoryId.Category }}/{{ QA.BuildLogId.EbuildId.PackageId.Package }}-{{ QA.BuildLogId.EbuildId.Version }}::{{ QA.BuildLogId.EbuildId.PackageId.RepoId.Repo }}">
+      {{ QA.BuildLogId.EbuildId.PackageId.CategoryId.Category }}/{{ QA.BuildLogId.EbuildId.PackageId.Package }}-{{ QA.BuildLogId.EbuildId.Version }}::{{ QA.BuildLogId.EbuildId.PackageId.RepoId.Repo }}</a>
       </td>
-      <td><p title="{{ R.SummeryText }}">{{ R.SummeryText|truncatewords:3 }}</p></td>
+      <td><p title="{{ QA.SummeryText }}">{{ QA.SummeryText|truncatewords:3 }}</p></td>
+    </tr>
+  {% endfor %}
+  {% for PR in PR_tmp %}
+    <tr>
+      <td class="frontpage-table-package-atom"><a href="/repoman/{{ PR.PackageId.PackageId }}/"  title="{{ PR.PackageId.CategoryId.Category }}/{{ PR.PackageId.Package }}::{{ PR.PackageId.RepoId.Repo }}">
+      {{ PR.PackageId.CategoryId.Category }}/{{ PR.PackageId.Package }}::{{ PR.PackageId.RepoId.Repo }}</a>
+      </td>
+      <td><p title="{{ PR.RepomanText }}">{{ PR.RepomanText|truncatewords:3 }}</p></td>
     </tr>
   {% endfor %}
 </table>
\ No newline at end of file

diff --git a/python/templates/pages/packages/category/index.html b/python/templates/pages/packages/category/index.html
index 2f2b6f2..8cc402d 100644
--- a/python/templates/pages/packages/category/index.html
+++ b/python/templates/pages/packages/category/index.html
@@ -12,7 +12,11 @@
           </td>
           <td>
             <p title="{{ PM.Descriptions }}">{{ PM.Descriptions }}</p>
-            <p title="{% for P in PM.Ebuilds %}{{ PM.Package }}/{{ P }}{% endfor %}">Versions</p>
+            <p title="{% for P in PM.Ebuilds %}{{ PM.Package }}/{{ P }}{% endfor %}">Versions
+            {% if PM.Repoman %}
+              <a class="btn btn-warning btn-xs" href="/repoman/{{PM.PackageId }}/">Repoman</a>
+            {% endif %}
+            </p>
           </td>
         </tr>
       </table>

diff --git a/python/templates/pages/packages/ebuilds/index.html b/python/templates/pages/packages/ebuilds/index.html
index f8e1b4e..10cca76 100644
--- a/python/templates/pages/packages/ebuilds/index.html
+++ b/python/templates/pages/packages/ebuilds/index.html
@@ -23,5 +23,8 @@
       {% endfor %}
     </table>
   </div>
+  {% if PR %}
+    <a class="btn btn-warning btn-xs" href="/repoman/{{P.PackageId.PackageId }}/">Repoman</a>
+  {% endif %}
 </div>
 {% endblock %}
\ No newline at end of file


                 reply	other threads:[~2015-08-01 23:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1438470142.96969fe37a3f589bbd0a9688979c7cd332cf5c1d.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