[copr] master: Redirect to builds list after creating build (cba34cd)
by bkabrda@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit cba34cdf6ef3c0548af20d9d30299470e2221688
Author: Bohuslav Kabrda <bkabrda(a)redhat.com>
Date: Mon Jan 21 09:19:51 2013 +0100
Redirect to builds list after creating build
>---------------------------------------------------------------
.../coprs/views/coprs_ns/coprs_builds.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/coprs_frontend/coprs/views/coprs_ns/coprs_builds.py b/coprs_frontend/coprs/views/coprs_ns/coprs_builds.py
index c2fcccc..646da72 100644
--- a/coprs_frontend/coprs/views/coprs_ns/coprs_builds.py
+++ b/coprs_frontend/coprs/views/coprs_ns/coprs_builds.py
@@ -64,7 +64,7 @@ def copr_new_build(username, coprname):
db.session.commit()
flask.flash("Build was added")
- return flask.redirect(flask.url_for('coprs_ns.copr_detail', username=username, coprname=copr.name))
+ return flask.redirect(flask.url_for('coprs_ns.copr_builds', username=username, coprname=copr.name))
else:
return copr_add_build(username=username, coprname=coprname, form=form)
11 years, 4 months
[copr] master: Move the builds table file to detail directory (bd019eb)
by bkabrda@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit bd019eb86d70c3e3d527d6eae0a2318be3ee60fb
Author: Bohuslav Kabrda <bkabrda(a)redhat.com>
Date: Mon Jan 21 09:10:02 2013 +0100
Move the builds table file to detail directory
>---------------------------------------------------------------
.../coprs/{ => detail}/_builds_table.html | 0
.../coprs/templates/coprs/detail/builds.html | 2 +-
2 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/coprs_frontend/coprs/templates/coprs/_builds_table.html b/coprs_frontend/coprs/templates/coprs/detail/_builds_table.html
similarity index 100%
rename from coprs_frontend/coprs/templates/coprs/_builds_table.html
rename to coprs_frontend/coprs/templates/coprs/detail/_builds_table.html
diff --git a/coprs_frontend/coprs/templates/coprs/detail/builds.html b/coprs_frontend/coprs/templates/coprs/detail/builds.html
index c2882b8..117a82d 100644
--- a/coprs_frontend/coprs/templates/coprs/detail/builds.html
+++ b/coprs_frontend/coprs/templates/coprs/detail/builds.html
@@ -1,5 +1,5 @@
{% extends "coprs/detail.html" %}
-{% from "coprs/_builds_table.html" import builds_table with context %}
+{% from "coprs/detail/_builds_table.html" import builds_table with context %}
{% block detail_body %}
{% if copr.builds %}
11 years, 4 months
[copr] master: Allow building again, refactor it to simple views (2fb40dd)
by bkabrda@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 2fb40ddd66bd54f44a5a3bb8b975a8dd21ec28bb
Author: Bohuslav Kabrda <bkabrda(a)redhat.com>
Date: Mon Jan 21 09:04:59 2013 +0100
Allow building again, refactor it to simple views
>---------------------------------------------------------------
coprs_frontend/coprs/templates/coprs/detail.html | 5 +++++
.../coprs/templates/coprs/detail/_build_forms.html | 8 +++++---
.../coprs/views/coprs_ns/coprs_builds.py | 20 ++++++++++++++++----
.../coprs/views/coprs_ns/coprs_general.py | 2 +-
4 files changed, 27 insertions(+), 8 deletions(-)
diff --git a/coprs_frontend/coprs/templates/coprs/detail.html b/coprs_frontend/coprs/templates/coprs/detail.html
index e12e5f1..b851500 100644
--- a/coprs_frontend/coprs/templates/coprs/detail.html
+++ b/coprs_frontend/coprs/templates/coprs/detail.html
@@ -17,6 +17,11 @@
<div class="unselected">
<a href="{{ url_for('coprs_ns.copr_builds', username = copr.owner.name, coprname = copr.name) }}">Builds</a>
</div>
+ {% if g.user and g.user.can_build_in(copr) %}
+ <div class="unselected">
+ <a href="{{ url_for('coprs_ns.copr_add_build', username = copr.owner.name, coprname = copr.name) }}">New Build</a>
+ </div>
+ {% endif %}
{% if g.user and g.user.can_edit(copr) %}
<div class="unselected">
<a href="{{ url_for('coprs_ns.copr_edit', username = copr.owner.name, coprname = copr.name) }}">Edit</a>
diff --git a/coprs_frontend/coprs/templates/coprs/detail/_build_forms.html b/coprs_frontend/coprs/templates/coprs/detail/_build_forms.html
index a5d6c4e..f5a761e 100644
--- a/coprs_frontend/coprs/templates/coprs/detail/_build_forms.html
+++ b/coprs_frontend/coprs/templates/coprs/detail/_build_forms.html
@@ -1,8 +1,10 @@
+{% from "_helpers.html" import render_field %}
+
{% macro copr_build_form(form, view, copr) %}
- <form action="{{ url_for(view, username = copr.owner.name, coprname = copr.name) }}" method=post class=add-entry>
+ <form action="{{ url_for(view, username=copr.owner.name, coprname=copr.name) }}" method="post">
<dl>
{{ form.csrf_token }}
- {{ render_field(form.pkgs, rows = 10, cols = 50) }}
+ {{ render_field(form.pkgs, label='URLs of packages to build', rows = 10, cols = 50) }}
{% if g.user.proven %}
{{ render_field(form.memory_reqs) }}
{{ render_field(form.timeout) }}
@@ -10,7 +12,7 @@
{{ render_field(form.memory_reqs, hidden = True) }}
{{ render_field(form.timeout, hidden = True) }}
{% endif %}
- <dd><input type=submit value=Submit></dd>
+ <dd><input type="submit" value="Build"></dd>
</dl>
</form>
{% endmacro %}
diff --git a/coprs_frontend/coprs/views/coprs_ns/coprs_builds.py b/coprs_frontend/coprs/views/coprs_ns/coprs_builds.py
index 0027b3b..c2fcccc 100644
--- a/coprs_frontend/coprs/views/coprs_ns/coprs_builds.py
+++ b/coprs_frontend/coprs/views/coprs_ns/coprs_builds.py
@@ -29,9 +29,21 @@ def copr_show_builds(username, coprname, page = 1):
return flask.render_template('coprs/show_builds.html', builds = paginator.sliced_query, paginator = paginator)
-(a)coprs_ns.route('/detail/<username>/<coprname>/add_build/', methods = ["POST"])
+(a)coprs_ns.route('/detail/<username>/<coprname>/add_build/')
+def copr_add_build(username, coprname, form=None):
+ copr = coprs_logic.CoprsLogic.get(flask.g.user, username, coprname).first()
+
+ if not copr: # hey, this Copr doesn't exist
+ return page_not_found('Copr with name {0} does not exist.'.format(coprname))
+
+ if not form:
+ form = forms.BuildForm()
+
+ return flask.render_template('coprs/detail/add_build.html', copr=copr, form=form)
+
+(a)coprs_ns.route('/detail/<username>/<coprname>/new_build/', methods = ["POST"])
@login_required
-def copr_add_build(username, coprname):
+def copr_new_build(username, coprname):
form = forms.BuildForm()
copr = coprs_logic.CoprsLogic.get(flask.g.user, username, coprname).first()
if not copr: # hey, this Copr doesn't exist
@@ -52,9 +64,9 @@ def copr_add_build(username, coprname):
db.session.commit()
flask.flash("Build was added")
- return flask.redirect(flask.url_for('coprs_ns.copr_detail', username = username, coprname = copr.name))
+ return flask.redirect(flask.url_for('coprs_ns.copr_detail', username=username, coprname=copr.name))
else:
- return flask.current_app.view_functions['coprs_ns.copr_detail'](username = username, coprname = coprname, build_form = form)
+ return copr_add_build(username=username, coprname=coprname, form=form)
@coprs_ns.route('/detail/<username>/<coprname>/cancel_build/<int:build_id>/', methods = ['POST'])
@login_required
diff --git a/coprs_frontend/coprs/views/coprs_ns/coprs_general.py b/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
index 4459528..2b1eff6 100644
--- a/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
+++ b/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
@@ -128,7 +128,7 @@ def copr_permissions(username, coprname):
current_user_permissions = user_perm)
@coprs_ns.route('/detail/<username>/<coprname>/builds/')
-def copr_builds(username, coprname, build_form = None):
+def copr_builds(username, coprname):
try: # query[0:10][0] will raise an index error, if Copr doesn't exist
query = coprs_logic.CoprsLogic.get(flask.g.user, username, coprname, with_builds = True)
copr = query[0:10][0]# we retrieved all builds, but we got one copr in a list...
11 years, 4 months
[copr] master: Creating new copr should redirect to copr detail, not list of coprs (467a063)
by bkabrda@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 467a0632d2e75ac629777cc8bf86c6dcd25da92f
Author: Bohuslav Kabrda <bkabrda(a)redhat.com>
Date: Mon Jan 21 08:42:34 2013 +0100
Creating new copr should redirect to copr detail, not list of coprs
>---------------------------------------------------------------
.../coprs/views/coprs_ns/coprs_general.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/coprs_frontend/coprs/views/coprs_ns/coprs_general.py b/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
index c9c3838..4459528 100644
--- a/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
+++ b/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
@@ -82,7 +82,7 @@ def copr_new():
db.session.commit()
flask.flash('Initial packages were successfully submitted for building.')
- return flask.redirect(flask.url_for('coprs_ns.coprs_show'))
+ return flask.redirect(flask.url_for('coprs_ns.copr_detail', username=flask.g.user.name, coprname=copr.name))
else:
return flask.render_template('coprs/add.html', form = form)
11 years, 4 months
[copr] master: Style editing, make it use the detail template as a parent (924c673)
by bkabrda@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 924c673217de8cffe11650e661f5b01e7db0ef09
Author: Bohuslav Kabrda <bkabrda(a)redhat.com>
Date: Mon Jan 21 08:38:44 2013 +0100
Style editing, make it use the detail template as a parent
>---------------------------------------------------------------
.../coprs/templates/coprs/{ => detail}/edit.html | 5 ++---
.../coprs/views/coprs_ns/coprs_general.py | 9 +++++----
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/coprs_frontend/coprs/templates/coprs/edit.html b/coprs_frontend/coprs/templates/coprs/detail/edit.html
similarity index 80%
rename from coprs_frontend/coprs/templates/coprs/edit.html
rename to coprs_frontend/coprs/templates/coprs/detail/edit.html
index 0eff4c9..8068435 100644
--- a/coprs_frontend/coprs/templates/coprs/edit.html
+++ b/coprs_frontend/coprs/templates/coprs/detail/edit.html
@@ -1,11 +1,10 @@
-{% extends "layout.html" %}
+{% extends "coprs/detail.html" %}
{% block title %}Editing {{ copr.name }}{% endblock %}
{% block header %}Editing {{ copr.name }} Copr{% endblock %}
{% from "coprs/_coprs_forms.html" import copr_form, copr_permissions_form with context %}
-{% block body %}
+{% block detail_body %}
- <h2>{{ copr.name }}</h2>
{{ copr_form(form, view = 'coprs_ns.copr_update', copr = copr) }}
{% endblock %}
diff --git a/coprs_frontend/coprs/views/coprs_ns/coprs_general.py b/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
index 027845b..c9c3838 100644
--- a/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
+++ b/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
@@ -140,15 +140,16 @@ def copr_builds(username, coprname, build_form = None):
@coprs_ns.route('/detail/<username>/<coprname>/edit/')
@login_required
-def copr_edit(username, coprname):
+def copr_edit(username, coprname, form=None):
query = coprs_logic.CoprsLogic.get(flask.g.user, username, coprname)
copr = query.first()
if not copr:
return page_not_found('Copr with name {0} does not exist.'.format(coprname))
- form = forms.CoprFormFactory.create_form_cls(copr.mock_chroots)(obj=copr)
+ if not form:
+ form = forms.CoprFormFactory.create_form_cls(copr.mock_chroots)(obj=copr)
- return flask.render_template('coprs/edit.html',
+ return flask.render_template('coprs/detail/edit.html',
copr=copr,
form=form)
@@ -174,7 +175,7 @@ def copr_update(username, coprname):
flask.flash('Copr was updated successfully.')
return flask.redirect(flask.url_for('coprs_ns.copr_detail', username = username, coprname = form.name.data))
else:
- return flask.render_template('coprs/edit.html', copr = copr, form = form)
+ return copr_edit(username, coprname, form)
@coprs_ns.route('/detail/<username>/<coprname>/permissions_applier_change/', methods = ['POST'])
11 years, 4 months
[copr] master: Display the distro name properly even if there is only one distro chosen (fe1200e)
by bkabrda@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit fe1200e90d3c953b90cab77f7509964b5d36fd7a
Author: Bohuslav Kabrda <bkabrda(a)redhat.com>
Date: Mon Jan 21 08:26:52 2013 +0100
Display the distro name properly even if there is only one distro chosen
>---------------------------------------------------------------
.../coprs/templates/coprs/detail/overview.html | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/coprs_frontend/coprs/templates/coprs/detail/overview.html b/coprs_frontend/coprs/templates/coprs/detail/overview.html
index 82cb8d5..455d314 100644
--- a/coprs_frontend/coprs/templates/coprs/detail/overview.html
+++ b/coprs_frontend/coprs/templates/coprs/detail/overview.html
@@ -23,7 +23,9 @@
<tr class="release-end">
{% endif %}
{% if mock_chroot.os_release != copr.mock_chroots[loop.index0 - 1].os_release or
- mock_chroot.os_version != copr.mock_chroots[loop.index0 - 1].os_version %}
+ mock_chroot.os_version != copr.mock_chroots[loop.index0 - 1].os_version or
+ loop.index0 == 0 %}
+ {# previous os_release-os_version were different or this is the first one #}
<td>{{ mock_chroot.os_release|capitalize }} {{ mock_chroot.os_version }}</td>
{% else %}
<td></td>
11 years, 4 months
[copr] master: Style adding new coprs (still needs more work though) (6fbfd01)
by bkabrda@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 6fbfd014d59a8cd925a6eb2c8aeaba0d295056f0
Author: Bohuslav Kabrda <bkabrda(a)redhat.com>
Date: Mon Jan 21 08:21:39 2013 +0100
Style adding new coprs (still needs more work though)
>---------------------------------------------------------------
.../coprs/templates/coprs/_coprs_forms.html | 16 +++++++---------
coprs_frontend/coprs/templates/coprs/add.html | 1 +
2 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/coprs_frontend/coprs/templates/coprs/_coprs_forms.html b/coprs_frontend/coprs/templates/coprs/_coprs_forms.html
index 4d6341a..a7b11ec 100644
--- a/coprs_frontend/coprs/templates/coprs/_coprs_forms.html
+++ b/coprs_frontend/coprs/templates/coprs/_coprs_forms.html
@@ -4,17 +4,15 @@
{# if using for updating, we need to pass name to url_for, but otherwise we need to pass nothing #}
<form action="{% if copr %}{{ url_for(view, username = copr.owner.name, coprname = copr.name) }}{% else %}{{ url_for(view) }}{% endif %}" method=post class=add-entry>
<dl>
- {% if form._mock_chroots_error %}
- <p style="color:red;">{{ form._mock_chroots_error }}</p>
- {% endif %}
{{ form.csrf_token }}
{{ render_field(form.id, hidden = True) }}
- {{ render_field(form.name) }}
+ {{ render_field(form.name, label='Copr Name') }}
+ <dt class="field-label">Chroots</dt>
+ {% if form._mock_chroots_error %}
+ <p class="form-error">{{ form._mock_chroots_error }}</p>
+ {% endif %}
{% for group_set, chs in form.chroots_sets.items() %}
- <table style="display:inline;">
- <tr>
- <th colspan=2>Chroots to use</th>
- </tr>
+ <table>
{% for ch in chs %}
<tr>
<td>{{ form|attr(ch)|attr('label') }}</td><td>{{ form|attr(ch) }}</td>
@@ -26,7 +24,7 @@
{% if copr is none %}{# we're creating the copr, so display initial builds area #}
{{ render_field(form.initial_pkgs, rows = 10, cols = 50) }}
{% endif %}
- <dd><input type=submit value=Submit></dd>
+ <dt><input type="submit" value="{% if copr %}Update{% else %}Create{% endif %}"></dt>
</dl>
</form>
{% endmacro %}
diff --git a/coprs_frontend/coprs/templates/coprs/add.html b/coprs_frontend/coprs/templates/coprs/add.html
index b4492e2..d8a351b 100644
--- a/coprs_frontend/coprs/templates/coprs/add.html
+++ b/coprs_frontend/coprs/templates/coprs/add.html
@@ -5,6 +5,7 @@
{% block body %}
+ <h1>Add a new Copr</h1>
{{ copr_form(form, view = 'coprs_ns.copr_new') }}
{% endblock %}
11 years, 4 months
[copr] master: Style displaying of errors (5357284)
by bkabrda@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 5357284c7ac90d874586bdfb81e6d17934983f05
Author: Bohuslav Kabrda <bkabrda(a)redhat.com>
Date: Mon Jan 21 08:20:44 2013 +0100
Style displaying of errors
>---------------------------------------------------------------
coprs_frontend/coprs/static/style-new.css | 4 ++++
coprs_frontend/coprs/templates/_helpers.html | 8 +++-----
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/coprs_frontend/coprs/static/style-new.css b/coprs_frontend/coprs/static/style-new.css
index 097714d..527b1f5 100644
--- a/coprs_frontend/coprs/static/style-new.css
+++ b/coprs_frontend/coprs/static/style-new.css
@@ -189,6 +189,10 @@ input.rounded {
-webkit-border-radius: 10px;
}
+p.form-error {
+ color: red;
+}
+
table.releases {
width: 100%;
border-collapse:collapse;
diff --git a/coprs_frontend/coprs/templates/_helpers.html b/coprs_frontend/coprs/templates/_helpers.html
index 660c477..38d3aa4 100644
--- a/coprs_frontend/coprs/templates/_helpers.html
+++ b/coprs_frontend/coprs/templates/_helpers.html
@@ -3,11 +3,9 @@
<dt class="field-label">{{ label or field.label }}</dt>
<dd>
{% if field.errors %}
- <ul class=form-errors>
- {% for error in field.errors %}
- <li>{{ error }}</li>
- {% endfor %}
- </ul>
+ {% for error in field.errors %}
+ <p class="form-error">{{ error }}</p>
+ {% endfor %}
{% endif %}
{{ field(**kwargs)|safe }}
</dd>
11 years, 4 months
[copr] master: Allow overriding field label, also give it some style (4383bc4)
by bkabrda@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 4383bc418784b0cc82abc9f9bf7020a92ef875f4
Author: Bohuslav Kabrda <bkabrda(a)redhat.com>
Date: Mon Jan 21 08:12:23 2013 +0100
Allow overriding field label, also give it some style
>---------------------------------------------------------------
coprs_frontend/coprs/static/style-new.css | 4 ++++
coprs_frontend/coprs/templates/_helpers.html | 4 ++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/coprs_frontend/coprs/static/style-new.css b/coprs_frontend/coprs/static/style-new.css
index cf69fd6..097714d 100644
--- a/coprs_frontend/coprs/static/style-new.css
+++ b/coprs_frontend/coprs/static/style-new.css
@@ -178,6 +178,10 @@ div.shift-right {
margin-left: 1em;
}
+dt.field-label {
+ font-weight: bold;
+}
+
input.rounded {
padding-left: 4px;
border-radius: 10px;
diff --git a/coprs_frontend/coprs/templates/_helpers.html b/coprs_frontend/coprs/templates/_helpers.html
index e732679..660c477 100644
--- a/coprs_frontend/coprs/templates/_helpers.html
+++ b/coprs_frontend/coprs/templates/_helpers.html
@@ -1,6 +1,6 @@
-{% macro render_field(field) %}
+{% macro render_field(field, label=None) %}
{% if not kwargs['hidden'] %}
- <dt>{{ field.label }}</dt>
+ <dt class="field-label">{{ label or field.label }}</dt>
<dd>
{% if field.errors %}
<ul class=form-errors>
11 years, 4 months
[copr] master: the build detail page needed to change the import to the detail forms (7411916)
by Seth Vidal
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 74119168d6cf804d74db2b75f56fccd2272b6aef
Author: Seth Vidal <skvidal(a)fedoraproject.org>
Date: Sun Jan 20 17:33:10 2013 -0500
the build detail page needed to change the import to the detail forms
>---------------------------------------------------------------
.../coprs/templates/coprs/_builds_table.html | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/coprs_frontend/coprs/templates/coprs/_builds_table.html b/coprs_frontend/coprs/templates/coprs/_builds_table.html
index 072a7e3..ac44dc4 100644
--- a/coprs_frontend/coprs/templates/coprs/_builds_table.html
+++ b/coprs_frontend/coprs/templates/coprs/_builds_table.html
@@ -1,4 +1,4 @@
-{% from "coprs/_coprs_forms.html" import copr_build_cancel_form %}
+{% from "coprs/detail/_build_forms.html" import copr_build_cancel_form %}
{% macro builds_table(builds) %}
{% if builds %}
11 years, 4 months