Repository :
http://git.fedorahosted.org/cgit/copr.git
On branch : master
---------------------------------------------------------------
commit 97519f6fc948c1b277a1d752348309f038306237
Author: Adam Samalik <asamalik(a)redhat.com>
Date: Mon Jul 21 14:50:06 2014 +0200
[frontend] modified chroots in overview
---------------------------------------------------------------
frontend/coprs_frontend/coprs/models.py | 11 +++++++++
frontend/coprs_frontend/coprs/static/copr.css | 15 +++++++++++++
.../coprs/templates/coprs/detail/overview.html | 23 +++++++++++++++++++-
.../coprs_frontend/coprs/templates/layout.html | 4 ++-
4 files changed, 51 insertions(+), 2 deletions(-)
diff --git a/frontend/coprs_frontend/coprs/models.py
b/frontend/coprs_frontend/coprs/models.py
index d9538a3..e30b819 100644
--- a/frontend/coprs_frontend/coprs/models.py
+++ b/frontend/coprs_frontend/coprs/models.py
@@ -204,6 +204,17 @@ class Copr(db.Model, helpers.Serializer):
result = copr_chroot.buildroot_pkgs
return result
+ @property
+ def modified_chroots(self):
+ """
+ Return list of chroots which has been modified
+ """
+ modified_chroots=[]
+ for chroot in self.active_chroots:
+ if self.buildroot_pkgs(chroot):
+ modified_chroots.append(chroot)
+ return modified_chroots
+
class CoprPermission(db.Model, helpers.Serializer):
diff --git a/frontend/coprs_frontend/coprs/static/copr.css
b/frontend/coprs_frontend/coprs/static/copr.css
index e140730..552c4b9 100644
--- a/frontend/coprs_frontend/coprs/static/copr.css
+++ b/frontend/coprs_frontend/coprs/static/copr.css
@@ -483,3 +483,18 @@ textarea {
.centered {
text-align: center;
}
+
+.hidden {
+ display: none;
+}
+
+.chroot-dialog {
+ font-size: 1em;
+ font-family: Cantarell, "Droid Sans", Verdana, sans-serif;
+}
+
+.chroot-dialog div.ui-dialog-titlebar {
+ background: #1F4B89 none;
+ border: none;
+ color: white;
+
diff --git a/frontend/coprs_frontend/coprs/templates/coprs/detail/overview.html
b/frontend/coprs_frontend/coprs/templates/coprs/detail/overview.html
index 5dd2c41..7dab91c 100644
--- a/frontend/coprs_frontend/coprs/templates/coprs/detail/overview.html
+++ b/frontend/coprs_frontend/coprs/templates/coprs/detail/overview.html
@@ -42,7 +42,12 @@
{% else %}
<td></td>
{% endif %}
- <td>{{ mock_chroot.arch }}</td>
+ <td>
+ {{ mock_chroot.arch }}
+ {% if copr.buildroot_pkgs(mock_chroot): %}
+ <a
id="modified-chroot-{{mock_chroot.name}}">[modified]</a>
+ {% endif %}
+ </td>
{% if mock_chroot.os_release != copr.active_chroots[loop.index0 - 1].os_release
or
mock_chroot.os_version != copr.active_chroots[loop.index0 - 1].os_version or
loop.index0 == 0 %}
@@ -72,6 +77,22 @@
</ul>
{% endif %}
+{% for chroot in copr.modified_chroots %}
+<div id="dialog-{{chroot.name}}" class="hidden"
title="{{chroot.name}} minimal buildroot">
+ <ul>
+ {% for pkg in copr.buildroot_pkgs(chroot).split(" "): %}
+ <li>{{ pkg }}</li>
+ {% endfor %}
+ </ul>
+</div>
+<script>
+ $("#modified-chroot-{{chroot.name}}").click(function(){
+
$("#dialog-{{chroot.name}}").dialog({dialogClass:'chroot-dialog'});
+ });
+</script>
+{% endfor %}
+
+
<hr>
{{ copr_legal_flag_form(form, copr) }}
{% endblock %}
diff --git a/frontend/coprs_frontend/coprs/templates/layout.html
b/frontend/coprs_frontend/coprs/templates/layout.html
index 5a607bc..66823e4 100644
--- a/frontend/coprs_frontend/coprs/templates/layout.html
+++ b/frontend/coprs_frontend/coprs/templates/layout.html
@@ -2,10 +2,12 @@
<html>
<head>
<title>{% block title %}Coprs Build System{% endblock %}</title>
- <link rel=stylesheet type=text/css href="{{ url_for('static',
filename='copr.css') }}">
<script
src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js&quo...
+ <script
src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.0/jquery-ui.min.j...
+ <link rel="stylesheet"
href="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.0/themes/smoothn...
/>
<link rel="shortcut icon" href="{{ url_for('static',
filename='favicon.ico') }}" type="image/vnd.microsoft.icon">
<link rel="shortcut icon" href="{{ url_for('static',
filename='favicon.ico') }}" type="image/x-icon">
+ <link rel=stylesheet type=text/css href="{{ url_for('static',
filename='copr.css') }}">
<script src="{{ url_for('static', filename='copr.js')
}}"></script>
</head>
<body>