Repository :
http://git.fedorahosted.org/cgit/copr.git
On branch : master
---------------------------------------------------------------
commit 31eea7673159feb0ae044ff3961bddd792654a3d
Author: Valentin Gologuzov <vgologuz(a)redhat.com>
Date: Wed Aug 19 12:23:54 2015 +0200
[frontend] comps.xml support: created handler to serve stored comps.xml
---------------------------------------------------------------
.../coprs/templates/coprs/detail/edit_chroot.html | 11 ++++++++++-
.../coprs/views/coprs_ns/coprs_chroots.py | 17 +++++++++++++++++
2 files changed, 27 insertions(+), 1 deletions(-)
diff --git a/frontend/coprs_frontend/coprs/templates/coprs/detail/edit_chroot.html
b/frontend/coprs_frontend/coprs/templates/coprs/detail/edit_chroot.html
index dd9988b..55168aa 100644
--- a/frontend/coprs_frontend/coprs/templates/coprs/detail/edit_chroot.html
+++ b/frontend/coprs_frontend/coprs/templates/coprs/detail/edit_chroot.html
@@ -35,7 +35,16 @@
<div class="col-sm-10">
{{ form.comps }}
{% if chroot.comps_name %}
- Stored comps file: <code>{{ chroot.comps_name}}</code>
+ Stored comps file: <code>
+ <a href="{{ url_for('coprs_ns.chroot_view_comps',
+ username = copr.owner.name,
+ coprname = copr.name,
+ chrootname = chroot.name) }}">
+ {{ chroot.comps_name}}
+ </a>
+
+
+ </code>
<button class="btn btn-default" type="submit"
value="delete_comps" name="submit">
<span class="pficon pficon-delete">Delete</span>
</button>
diff --git a/frontend/coprs_frontend/coprs/views/coprs_ns/coprs_chroots.py
b/frontend/coprs_frontend/coprs/views/coprs_ns/coprs_chroots.py
index 1363fce..ad74907 100644
--- a/frontend/coprs_frontend/coprs/views/coprs_ns/coprs_chroots.py
+++ b/frontend/coprs_frontend/coprs/views/coprs_ns/coprs_chroots.py
@@ -2,6 +2,7 @@ from io import BytesIO
from zlib import compress, decompress
import flask
+from flask import Response
from coprs import db
from coprs import forms
@@ -88,3 +89,19 @@ def chroot_update(username, coprname, chrootname):
flask.flash("You are not allowed to modify chroots.")
else:
return chroot_edit(username, coprname, chrootname)
+
+
+@coprs_ns.route("/<username>/<coprname>/chroot/<chrootname>/comps/")
+def chroot_view_comps(username, coprname, chrootname):
+ copr = coprs_logic.CoprsLogic.get(username, coprname).first()
+ if not copr:
+ return page_not_found(
+ "Projec with name {0} does not exist.".format(coprname))
+
+ try:
+ chroot = CoprChrootsLogic.get_by_name_safe(copr, chrootname)
+ except ValueError as e:
+ return page_not_found(str(e))
+
+ result = chroot.comps or ""
+ return Response(result, mimetype="text/plain; charset=utf-8")