[copr] master: Actually display the chroots in copr list (a157e3a)
bkabrda at fedoraproject.org
bkabrda at fedoraproject.org
Tue Jan 22 14:06:35 UTC 2013
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit a157e3a2968f11a4486fdf3ec32b5276d992b803
Author: Bohuslav Kabrda <bkabrda at redhat.com>
Date: Tue Jan 22 15:06:06 2013 +0100
Actually display the chroots in copr list
>---------------------------------------------------------------
coprs_frontend/coprs/filters.py | 9 +++++++++
coprs_frontend/coprs/templates/coprs/show.html | 6 +++++-
2 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/coprs_frontend/coprs/filters.py b/coprs_frontend/coprs/filters.py
index b166bde..cfcdcfe 100644
--- a/coprs_frontend/coprs/filters.py
+++ b/coprs_frontend/coprs/filters.py
@@ -10,3 +10,12 @@ def date_from_secs(secs):
@app.template_filter('perm_type_from_num')
def perm_type_from_num(num):
return helpers.PermissionEnum.key(num)
+
+# this should probably be stored in DB with the whole mock_chroot...
+ at app.template_filter('os_name_short')
+def os_name_short(os_name):
+ if os_name == 'fedora':
+ return 'fc'
+ elif os_name == 'epel':
+ return 'el'
+ return os_name
diff --git a/coprs_frontend/coprs/templates/coprs/show.html b/coprs_frontend/coprs/templates/coprs/show.html
index 7b4d3c9..b6f9737 100644
--- a/coprs_frontend/coprs/templates/coprs/show.html
+++ b/coprs_frontend/coprs/templates/coprs/show.html
@@ -21,7 +21,11 @@
<div class="copr">
<a href="{{ url_for('coprs_ns.copr_detail', username = copr.owner.name, coprname = copr.name) }}">{{ copr.owner.name }}/{{ copr.name }}</a>
<p>{{ copr.description_or_not_filled }}</p>
- <p class="repos">F18 blah blah</p>
+ <p class="repos">
+ {% for mock_chroot in copr.mock_chroots %}
+ {{ mock_chroot.os_release|os_name_short }}{{ mock_chroot.os_version }}.{{ mock_chroot.arch }}{% if not loop.last %}, {% endif %}
+ {% endfor %}
+ </p>
</div>
{% else %}
<p>No coprs...</p>
More information about the copr-devel
mailing list