From: "Magnus Granberg" <zorry@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/tinderbox-cluster-www:master commit in: python/tbc_www/, python/templates/pages/packages/ebuilds/
Date: Wed, 22 Jul 2015 21:25:28 +0000 (UTC) [thread overview]
Message-ID: <1437600284.f66e4386ffe1b5f48a8f7986d6cc4371d7862b85.zorry@gentoo> (raw)
commit: f66e4386ffe1b5f48a8f7986d6cc4371d7862b85
Author: Magnus Granberg <zorry <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 22 21:24:44 2015 +0000
Commit: Magnus Granberg <zorry <AT> gentoo <DOT> org>
CommitDate: Wed Jul 22 21:24:44 2015 +0000
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>
+ <p>Changlog</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>
- <td><p></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 label-warning">{{ K.KeywordId.Keyword }}</span>{% endif %}
+ {% if K.Status == 'Negative' %}{{ K.KeywordId.Keyword }}{% endif %}
+ {% endif %}
+ {% endfor %}
+ </td>
+ </td>
</tr>
{% endfor %}
</table>
reply other threads:[~2015-07-22 21:25 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=1437600284.f66e4386ffe1b5f48a8f7986d6cc4371d7862b85.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