summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--python/tbc_www/models.py27
-rw-r--r--python/tbc_www/urls.py1
-rw-r--r--python/tbc_www/views.py40
-rw-r--r--python/templates/includes/frontpage/new_logs8
-rw-r--r--python/templates/pages/packages/category/index.html6
-rw-r--r--python/templates/pages/packages/ebuilds/ebuild/index.html47
-rw-r--r--python/templates/pages/packages/index.html6
7 files changed, 112 insertions, 23 deletions
diff --git a/python/tbc_www/models.py b/python/tbc_www/models.py
index 621a7dc..2cb327a 100644
--- a/python/tbc_www/models.py
+++ b/python/tbc_www/models.py
@@ -175,6 +175,14 @@ class Keywords(models.Model):
def __str__(self):
return '%s %s' % (self.KeywordId, self.Keyword)
+class Restrictions(models.Model):
+ RestrictionId = models.IntegerField(primary_key=True, db_column='restriction_id')
+ Restriction = models.CharField(max_length=150, db_column='restriction')
+ class Meta:
+ db_table = 'restrictions'
+ def __str__(self):
+ return '%s %s' % (self.RestrictionId, self.Restriction)
+
class EbuildsKeywords(models.Model):
Id = models.IntegerField(primary_key=True, db_column='id')
EbuildId = models.ForeignKey(Ebuilds, db_column='ebuild_id')
@@ -184,3 +192,22 @@ class EbuildsKeywords(models.Model):
db_table = 'ebuilds_keywords'
def __str__(self):
return '%s %s %s' % (self.EbuildId, self.KeywordId, self.Status)
+
+class EbuildsIuse(models.Model):
+ Id = models.IntegerField(primary_key=True, db_column='id')
+ EbuildId = models.ForeignKey(Ebuilds, db_column='ebuild_id')
+ UseId = models.ForeignKey(Uses, db_column='use_id')
+ Status =models.BooleanField(db_column='status')
+ class Meta:
+ db_table = 'ebuilds_iuse'
+ def __str__(self):
+ return '%s %s %s %s' % (self.Id, self.EbuildId, self.UseId, self.Status)
+
+class EbuildsRestrictions(models.Model):
+ Id = models.IntegerField(primary_key=True, db_column='id')
+ EbuildId = models.ForeignKey(Ebuilds, db_column='ebuild_id')
+ RestrictionId = models.ForeignKey(Restrictions, db_column='restriction_id')
+ class Meta:
+ db_table = 'ebuilds_restrictions'
+ def __str__(self):
+ return '%s %s' % (self.EbuildId, self.RestrictionId)
diff --git a/python/tbc_www/urls.py b/python/tbc_www/urls.py
index 193443f..4d50f40 100644
--- a/python/tbc_www/urls.py
+++ b/python/tbc_www/urls.py
@@ -5,5 +5,6 @@ urlpatterns = patterns('tbc_www.views',
url(r'^packages/$', 'categories'),
url(r'^categories/(?P<category_id>\d+)/$', 'packages'),
url(r'^package/(?P<package_id>\d+)/$', 'ebuilds'),
+ url(r'^ebuild/(?P<ebuild_id>\d+)/$', 'ebuild'),
url(r'^new/$', 'new_main'),
)
diff --git a/python/tbc_www/views.py b/python/tbc_www/views.py
index f68a706..5b719aa 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, BuildLogsErrors
+ Repos, EbuildsKeywords, BuildLogsErrors, EbuildsRestrictions, EbuildsIuse
import re
def default_TmpDict(pagerequest):
@@ -32,9 +32,10 @@ def home(request):
Lines = 5
TmpDict = default_TmpDict(pagerequest)
TmpDict['EM'] = EbuildsMetadata.objects.filter(Revision = '1.1').order_by('-Id')[:Lines]
- adict = {}
+ alist = []
for BL in BuildLogs.objects.order_by('-TimeStamp')[:Lines]:
adict2 = {}
+ adict2['BuildLogId'] = BL.BuildLogId
adict2['C'] = BL.EbuildId.PackageId.CategoryId.Category
adict2['P'] = BL.EbuildId.PackageId.Package
adict2['V'] = BL.EbuildId.Version
@@ -43,8 +44,8 @@ def home(request):
adict2['SummeryText'] = BL.SummeryText
if BL.Fail:
adict2['BE_tmp'] = BuildLogsErrors.objects.filter(BuildLogId = BL.BuildLogId)
- adict[BL.BuildLogId] = adict2
- TmpDict['BL'] = adict
+ alist.append(adict2)
+ TmpDict['BL'] = alist
adict = {}
BJ_Tmp = BuildJobs.objects.order_by('-TimeStamp')[:Lines]
for BJ in BJ_Tmp:
@@ -82,7 +83,7 @@ def home(request):
def categories(request):
pagerequest = 'packages'
TmpDict = default_TmpDict(pagerequest)
- adict2 = {}
+ alist = []
for CM in CategoriesMetadata.objects.filter(CategoryId__Active = True).order_by('CategoryId__Category'):
adict = {}
adict['CategoryId'] = CM.CategoryId.CategoryId
@@ -92,14 +93,14 @@ def categories(request):
for P in Packages.objects.filter(Active = True).filter(CategoryId_id = CM.CategoryId.CategoryId).order_by('Package'):
packages.append(P.Package + '\n')
adict['Packages'] = packages
- adict2[CM.CategoryId.Category] = adict
- TmpDict['CM_tmp'] = adict2
+ alist.append(adict)
+ TmpDict['CM_tmp'] = alist
return render(request, 'pages/' + pagerequest + '/index.html', TmpDict)
def packages(request, category_id):
pagerequest = 'packages'
TmpDict = default_TmpDict(pagerequest)
- adict2 = {}
+ alist = []
for PM in PackagesMetadata.objects.filter(PackageId__CategoryId_id = category_id).filter(PackageId__Active = True):
adict = {}
adict['PackageId'] = PM.PackageId.PackageId
@@ -110,8 +111,8 @@ def packages(request, category_id):
for E in Ebuilds.objects.filter(Active = True).filter(PackageId__Package = PM.PackageId.Package):
ebuilds.append(E.Version + '::' + E.PackageId.RepoId.Repo + '\n')
adict['Ebuilds'] = ebuilds
- adict2[PM.PackageId.Package] = adict
- TmpDict['PM_tmp'] = adict2
+ alist.append(adict)
+ TmpDict['PM_tmp'] = alist
TmpDict['C'] = get_object_or_404(Categories, CategoryId = category_id)
return render(request, 'pages/' + pagerequest + '/category/index.html', TmpDict)
@@ -122,16 +123,29 @@ def ebuilds(request, 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)
+
return render(request, 'pages/' + pagerequest + '/ebuilds/index.html', TmpDict)
+def ebuild(request, ebuild_id):
+ pagerequest = 'packages'
+ TmpDict = default_TmpDict(pagerequest)
+ TmpDict['E'] = get_object_or_404(Ebuilds, EbuildId = ebuild_id)
+ TmpDict['EM_tmp'] = EbuildsMetadata.objects.filter(EbuildId__EbuildId = ebuild_id)
+ TmpDict['EK_tmp'] = EbuildsKeywords.objects.filter(EbuildId__EbuildId = ebuild_id)
+ TmpDict['BL_tmp'] = BuildLogs.objects.filter(EbuildId__EbuildId = ebuild_id)
+ TmpDict['EU_tmp'] = EbuildsIuse.objects.filter(EbuildId__EbuildId = ebuild_id)
+ TmpDict['ER_tmp'] = EbuildsRestrictions.objects.filter(EbuildId__EbuildId = ebuild_id)
+ return render(request, 'pages/' + pagerequest + '/ebuilds/ebuild/index.html', TmpDict)
+
def new_main(request):
pagerequest = 'new'
Lines = 30
TmpDict = default_TmpDict(pagerequest)
TmpDict['EM'] = EbuildsMetadata.objects.filter(Revision = '1.1').order_by('-Id')[:Lines]
- adict = {}
+ alist = []
for BL in BuildLogs.objects.order_by('-TimeStamp')[:Lines]:
adict2 = {}
+ adict2['BuildLogId'] = BL.BuildLogId
adict2['C'] = BL.EbuildId.PackageId.CategoryId.Category
adict2['P'] = BL.EbuildId.PackageId.Package
adict2['V'] = BL.EbuildId.Version
@@ -140,8 +154,8 @@ def new_main(request):
adict2['SummeryText'] = BL.SummeryText
if BL.Fail:
adict2['BE_tmp'] = BuildLogsErrors.objects.filter(BuildLogId = BL.BuildLogId)
- adict[BL.BuildLogId] = adict2
- TmpDict['BL'] = adict
+ alist.append(adict2)
+ TmpDict['BL'] = alist
adict = {}
BJ_Tmp = BuildJobs.objects.order_by('-TimeStamp')[:Lines]
for BJ in BJ_Tmp:
diff --git a/python/templates/includes/frontpage/new_logs b/python/templates/includes/frontpage/new_logs
index afe190c..3074c4d 100644
--- a/python/templates/includes/frontpage/new_logs
+++ b/python/templates/includes/frontpage/new_logs
@@ -1,19 +1,19 @@
<table class="table table-striped frontpage-table">
- {% for BuildLogId, B in BL.items %}
+ {% for B in BL%}
<tr>
- <td class="frontpage-table-package-atom"><a href="/new_logs/{{ BuildLogId }}/" title="{{ B.C }}/{{ B.P }}-{{ B.V }}::{{ B.R }}">
+ <td class="frontpage-table-package-atom"><a href="/new_logs/{{ B.BuildLogId }}/" title="{{ B.C }}/{{ B.P }}-{{ B.V }}::{{ B.R }}">
{{ B.C }}/{{ B.P }}-{{ B.V }}::{{ B.R }}</a></td>
<td><p title="{{ B.SummeryText }}">{{ B.SummeryText|truncatewords:3 }}</p>
<td class="text-right">
{% if B.Fail %}
{% for BE in B.BE_tmp %}
- {% if BE.BuildLogId.BuildLogId == BuildLogId %}
+ {% if BE.BuildLogId.BuildLogId == B.BuildLogId %}
{% if BE.ErrorId.ErrorId == 1 or BE.ErrorId.ErrorId == 2 %}
<span class="label label-warning">{{ BE.ErrorId.ErrorName|upper }}</span>
{% elif BE.ErrorId.ErrorId == 3 %}
<span class="label label-info">OTHERS</span>
{% else %}
- <span class="label label-danger">{{ BE.ErrorId.ErrorName|upper}}</span>
+ <span class="label label-danger">{{ BE.ErrorId.ErrorName|upper }}</span>
{% endif %}
{% endif %}
{% endfor %}
diff --git a/python/templates/pages/packages/category/index.html b/python/templates/pages/packages/category/index.html
index edc7cc9..2f2b6f2 100644
--- a/python/templates/pages/packages/category/index.html
+++ b/python/templates/pages/packages/category/index.html
@@ -3,16 +3,16 @@
<div class="row">
<h2>Packages in {{ C.Category }}</h2>
<div class="col-xs-12 col-md-5">
- {% for key, PM in PM_tmp.items %}
+ {% for PM in PM_tmp %}
<table class="table table-striped frontpage-table">
<tr>
<td class="frontpage-table-package-atom">
- <a href="/package/{{ PM.PackageId }}/" title="{{ C.Category }}/{{ key }}">{{ C.Category }}/{{ key }}</a>
+ <a href="/package/{{ PM.PackageId }}/" title="{{ C.Category }}/{{ PM.Package }}">{{ C.Category }}/{{ PM.Package }}</a>
<p title="{{ PM.Changlog }}">Changlog</p>
</td>
<td>
<p title="{{ PM.Descriptions }}">{{ PM.Descriptions }}</p>
- <p title="{% for P in PM.Ebuilds %}{{ key }}/{{ P }}{% endfor %}">Versions</p>
+ <p title="{% for P in PM.Ebuilds %}{{ PM.Package }}/{{ P }}{% endfor %}">Versions</p>
</td>
</tr>
</table>
diff --git a/python/templates/pages/packages/ebuilds/ebuild/index.html b/python/templates/pages/packages/ebuilds/ebuild/index.html
new file mode 100644
index 0000000..e000a53
--- /dev/null
+++ b/python/templates/pages/packages/ebuilds/ebuild/index.html
@@ -0,0 +1,47 @@
+{% extends "layout/base.html" %}
+{% block content %}
+<div class="row">
+ <div class="col-xs-12 col-md-9">
+ <h2>{{ E.PackageId.CategoryId.Category }}/{{ E.PackageId.Package }}</h2>
+ <table class="table table-striped frontpage-table">
+ {% for EM in EM_tmp %}
+ <tr>
+ <td class="frontpage-table-package-atom">
+ <p" title="{{ E.PackageId.CategoryId.Category }}/{{ E.PackageId.Package }}-{{ E.EbuildId.Version }}::{{ E.PackageId.RepoId.Repo }}">{{ E.PackageId.Package }}-{{ E.Version }}::{{ E.PackageId.RepoId.Repo }}</p>
+ <a class="btn btn-default btn-xs" href="/buildpackage/{{ E.EbuildId.EbuildId }}/">Build</a>
+ {% for BL in BL_tmp %}
+ {% if BL.Fail %}
+ <a class="btn btn-danger btn-xs" href="/buildlog/{{ BL.BuildLogId }}/">Fail</a>
+ {% else %}
+ <a class="btn btn-success btn-xs" href="/buildlog/{{ BL.BuildLogId }}/">Success</a>
+ {% endif %}
+ {% endfor %}
+ </td>
+ <td>
+ {% for K in EK_tmp %}
+ {% if K.EbuildId.EbuildId == E.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 label-warning">{{ K.KeywordId.Keyword }}</span>{% endif %}
+ {% if K.Status == 'Negative' %}{{ K.KeywordId.Keyword }}{% endif %}
+ {% endif %}
+ {% endfor %}
+ <p>
+ {% for U in EU_tmp %}
+ {% if U.Status %}
+ <span class="label label-info">{{ U.UseId.Flag }}</span>
+ {% else %}
+ <span class="label label-default">{{ U.UseId.Flag }}</span>
+ {% endif %}
+ {% endfor %}
+ </p><p>
+ {% for R in ER_tmp %}
+ <span class="label label-warning">{{ R.RestrictionId.Restriction }}</span>
+ {% endfor %}
+ </p>
+ </td>
+ </tr>
+ {% endfor %}
+ </table>
+ </div>
+</div>
+{% endblock %} \ No newline at end of file
diff --git a/python/templates/pages/packages/index.html b/python/templates/pages/packages/index.html
index 5e02552..7139c87 100644
--- a/python/templates/pages/packages/index.html
+++ b/python/templates/pages/packages/index.html
@@ -3,15 +3,15 @@
<div class="row">
<h2>Categories</h2>
<div class="col-xs-8 col-md-4">
- {% for key, CM in CM_tmp.items %}
+ {% for CM in CM_tmp %}
<table class="table table-striped frontpage-table">
<tr>
<td class="frontpage-table-package-atom">
- <a href="/categories/{{ CM.CategoryId }}/" title="{{ key }}">{{ key }}</a>
+ <a href="/categories/{{ CM.CategoryId }}/" title="{{ CM.Category }}">{{CM.Category }}</a>
</td>
<td>
<p title="{{ CM.Descriptions }}">{{ CM.Descriptions }}</p>
- <p title="{% for P in CM.Packages %}{{ key }}/{{ P }}{% endfor %}">Packages</p>
+ <p title="{% for P in CM.Packages %}{{ CM.Category}}/{{ P }}{% endfor %}">Packages</p>
</td>
</tr>
</table>