Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 49f52f511ddebeeadf604ea07ec9ff663bb3082b
Author: Richard Marko <rmarko(a)fedoraproject.org>
Date: Thu Jan 30 11:19:23 2014 +0100
[frontend] move 'you agree' text to dd
So it is indented as the rest of the form elements.
Remove spaces from line ends.
Signed-off-by: Richard Marko <rmarko(a)fedoraproject.org>
>---------------------------------------------------------------
.../templates/coprs/detail/_builds_forms.html | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/coprs_frontend/coprs/templates/coprs/detail/_builds_forms.html b/coprs_frontend/coprs/templates/coprs/detail/_builds_forms.html
index dd5d592..e918ade 100644
--- a/coprs_frontend/coprs/templates/coprs/detail/_builds_forms.html
+++ b/coprs_frontend/coprs/templates/coprs/detail/_builds_forms.html
@@ -12,9 +12,12 @@
{{ render_field(form.memory_reqs, hidden = True) }}
{{ render_field(form.timeout, hidden = True) }}
{% endif %}
- <br />
- You agree to build only <a href="https://fedorahosted.org/copr/wiki/UserDocs#WhatIcanbuildinCopr">allowed content</a> in Copr. Check if your <a href="https://fedoraproject.org/wiki/Licensing:Main?rd=Licensing#Good_Licenses">license</a> is allowed.
- <br />
+ <dd>
+ <p>
+ You agree to build only <a href="https://fedorahosted.org/copr/wiki/UserDocs#WhatIcanbuildinCopr">allowed content</a> in Copr.
+ Check if your <a href="https://fedoraproject.org/wiki/Licensing:Main?rd=Licensing#Good_Licenses">license</a> is allowed.
+ </p>
+ </dd>
<dd><input type="submit" value="Build"></dd>
</dl>
</form>
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 122063955bf34581c82a827f5c73f28d9ac738b0
Author: Richard Marko <rmarko(a)fedoraproject.org>
Date: Wed Jan 29 16:24:06 2014 +0100
[frontend] add margin to chroots-set
So it is indented as the rest of the form elements.
Signed-off-by: Richard Marko <rmarko(a)fedoraproject.org>
>---------------------------------------------------------------
coprs_frontend/coprs/static/copr.css | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/coprs_frontend/coprs/static/copr.css b/coprs_frontend/coprs/static/copr.css
index ae38bda..c5bee68 100644
--- a/coprs_frontend/coprs/static/copr.css
+++ b/coprs_frontend/coprs/static/copr.css
@@ -251,6 +251,7 @@ table.releases {
table.chroots-set {
display: inline;
+ margin-left: 40px;
}
table.builds-table {
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 715df12194db895ecaa3e4f875bcf2142143fc3b
Author: Richard Marko <rmarko(a)fedoraproject.org>
Date: Wed Jan 29 16:21:29 2014 +0100
[frontend] put disclaimer to paragraph tags
So it is indented as the rest of the text.
Signed-off-by: Richard Marko <rmarko(a)fedoraproject.org>
>---------------------------------------------------------------
.../coprs/templates/coprs/detail/overview.html | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/coprs_frontend/coprs/templates/coprs/detail/overview.html b/coprs_frontend/coprs/templates/coprs/detail/overview.html
index dadb3ac..d88cb12 100644
--- a/coprs_frontend/coprs/templates/coprs/detail/overview.html
+++ b/coprs_frontend/coprs/templates/coprs/detail/overview.html
@@ -11,8 +11,10 @@
<div class="shift-right">{{ copr.instructions|markdown|default('Instructions not filled in by author. Author knows what to do. Everybody else should avoid this repo.', true) }}</div>
<h2>Active Releases</h2>
<div class="disclaimer">
- The following unofficial repositories are provided as-is by owner of this project.
- Contact the owner directly for bugs or issues (IE: not bugzilla).
+ <p>
+ The following unofficial repositories are provided as-is by owner of this project.
+ Contact the owner directly for bugs or issues (IE: not bugzilla).
+ </p>
</div>
<table class="releases">
<tr>
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit d0da47d779269086fca877cd4a57915ffd60e785
Author: Richard Marko <rmarko(a)fedoraproject.org>
Date: Mon Jan 27 15:18:49 2014 +0100
[frontend] use default filter instead of *_not_filled
Signed-off-by: Richard Marko <rmarko(a)fedoraproject.org>
>---------------------------------------------------------------
coprs_frontend/coprs/models.py | 8 --------
.../coprs/templates/coprs/detail/overview.html | 4 ++--
coprs_frontend/coprs/templates/coprs/show.html | 2 +-
3 files changed, 3 insertions(+), 11 deletions(-)
diff --git a/coprs_frontend/coprs/models.py b/coprs_frontend/coprs/models.py
index a299518..b4ac6ed 100644
--- a/coprs_frontend/coprs/models.py
+++ b/coprs_frontend/coprs/models.py
@@ -161,14 +161,6 @@ class Copr(db.Model, helpers.Serializer):
return self.repos.split()
@property
- def description_or_not_filled(self):
- return self.description or "Description not filled in by author. Very likely personal repository for testing purpose, which you should not use."
-
- @property
- def instructions_or_not_filled(self):
- return self.instructions or "Instructions not filled in by author. Author knows what to do. Everybody else should avoid this repo."
-
- @property
def active_chroots(self):
"""
Return list of active mock_chroots of this copr
diff --git a/coprs_frontend/coprs/templates/coprs/detail/overview.html b/coprs_frontend/coprs/templates/coprs/detail/overview.html
index 7bebca0..dadb3ac 100644
--- a/coprs_frontend/coprs/templates/coprs/detail/overview.html
+++ b/coprs_frontend/coprs/templates/coprs/detail/overview.html
@@ -6,9 +6,9 @@
{% block detail_body %}
<h2>Description</h2>
- <div class="shift-right">{{ copr.description_or_not_filled|markdown }}</div>
+ <div class="shift-right">{{ copr.description|markdown|default('Description not filled in by author. Very likely personal repository for testing purpose, which you should not use.', true) }}</div>
<h2>Installation Instructions</h2>
- <div class="shift-right">{{ copr.instructions_or_not_filled|markdown }}</div>
+ <div class="shift-right">{{ copr.instructions|markdown|default('Instructions not filled in by author. Author knows what to do. Everybody else should avoid this repo.', true) }}</div>
<h2>Active Releases</h2>
<div class="disclaimer">
The following unofficial repositories are provided as-is by owner of this project.
diff --git a/coprs_frontend/coprs/templates/coprs/show.html b/coprs_frontend/coprs/templates/coprs/show.html
index 4a25617..0971b0a 100644
--- a/coprs_frontend/coprs/templates/coprs/show.html
+++ b/coprs_frontend/coprs/templates/coprs/show.html
@@ -29,7 +29,7 @@
{% for copr in coprs %}
<div class="copr">
<a class="coprs-list" 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|markdown }}</p>
+ <p>{{ copr.description|markdown|default('Description not filled in by author. Very likely personal repository for testing purpose, which you should not use.', true) }}</p>
<p class="repos">
{% for mock_chroot in copr.active_chroots %}
{{ mock_chroot.os_release|os_name_short(mock_chroot.os_version) }}.{{ mock_chroot.arch }}{% if not loop.last %}, {% endif %}
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 867311101d10b27b06ffb301b79123f6881710a0
Author: Richard Marko <rmarko(a)fedoraproject.org>
Date: Mon Jan 27 13:53:43 2014 +0100
[frontend] move Serializer to helpers
Signed-off-by: Richard Marko <rmarko(a)fedoraproject.org>
>---------------------------------------------------------------
coprs_frontend/coprs/helpers.py | 70 ++++++++++++++++++++++++++++
coprs_frontend/coprs/models.py | 95 +++++---------------------------------
2 files changed, 83 insertions(+), 82 deletions(-)
diff --git a/coprs_frontend/coprs/helpers.py b/coprs_frontend/coprs/helpers.py
index ce91ae7..048042a 100644
--- a/coprs_frontend/coprs/helpers.py
+++ b/coprs_frontend/coprs/helpers.py
@@ -164,3 +164,73 @@ def is_int(s):
return True
except ValueError:
return False
+
+
+class Serializer(object):
+
+ def to_dict(self, options={}):
+ """
+ Usage:
+
+ SQLAlchObject.to_dict() => returns a flat dict of the object
+ SQLAlchObject.to_dict({"foo": {}}) => returns a dict of the object
+ and will include a flat dict of object foo inside of that
+ SQLAlchObject.to_dict({"foo": {"bar": {}}, "spam": {}}) => returns
+ a dict of the object, which will include dict of foo
+ (which will include dict of bar) and dict of spam.
+
+ Options can also contain two special values: __columns_only__
+ and __columns_except__
+
+ If present, the first makes only specified fiels appear,
+ the second removes specified fields. Both of these fields
+ must be either strings (only works for one field) or lists
+ (for one and more fields).
+
+ SQLAlchObject.to_dict({"foo": {"__columns_except__": ["id"]},
+ "__columns_only__": "name"}) =>
+
+ The SQLAlchObject will only put its "name" into the resulting dict,
+ while "foo" all of its fields except "id".
+
+ Options can also specify whether to include foo_id when displaying
+ related foo object (__included_ids__, defaults to True).
+ This doesn"t apply when __columns_only__ is specified.
+ """
+
+ result = {}
+ columns = self.serializable_attributes
+
+ if "__columns_only__" in options:
+ columns = options["__columns_only__"]
+ else:
+ columns = set(columns)
+ if "__columns_except__" in options:
+ columns_except = options["__columns_except__"]
+ if not isinstance(options["__columns_except__"], list):
+ columns_except = [options["__columns_except__"]]
+
+ columns -= set(columns_except)
+
+ if ("__included_ids__" in options and
+ options["__included_ids__"] is False):
+
+ related_objs_ids = [
+ r + "_id" for r, o in options.items()
+ if not r.startswith("__")]
+
+ columns -= set(related_objs_ids)
+
+ columns = list(columns)
+
+ for column in columns:
+ result[column] = getattr(self, column)
+
+ for related, values in options.items():
+ if hasattr(self, related):
+ result[related] = getattr(self, related).to_dict(values)
+ return result
+
+ @property
+ def serializable_attributes(self):
+ return map(lambda x: x.name, self.__table__.columns)
diff --git a/coprs_frontend/coprs/models.py b/coprs_frontend/coprs/models.py
index 97dc899..a342c20 100644
--- a/coprs_frontend/coprs/models.py
+++ b/coprs_frontend/coprs/models.py
@@ -9,77 +9,7 @@ from coprs import db
from coprs import helpers
-class Serializer(object):
-
- def to_dict(self, options={}):
- """
- Usage:
-
- SQLAlchObject.to_dict() => returns a flat dict of the object
- SQLAlchObject.to_dict({"foo": {}}) => returns a dict of the object
- and will include a flat dict of object foo inside of that
- SQLAlchObject.to_dict({"foo": {"bar": {}}, "spam": {}}) => returns
- a dict of the object, which will include dict of foo
- (which will include dict of bar) and dict of spam.
-
- Options can also contain two special values: __columns_only__
- and __columns_except__
-
- If present, the first makes only specified fiels appear,
- the second removes specified fields. Both of these fields
- must be either strings (only works for one field) or lists
- (for one and more fields).
-
- SQLAlchObject.to_dict({"foo": {"__columns_except__": ["id"]},
- "__columns_only__": "name"}) =>
-
- The SQLAlchObject will only put its "name" into the resulting dict,
- while "foo" all of its fields except "id".
-
- Options can also specify whether to include foo_id when displaying
- related foo object (__included_ids__, defaults to True).
- This doesn"t apply when __columns_only__ is specified.
- """
-
- result = {}
- columns = self.serializable_attributes
-
- if "__columns_only__" in options:
- columns = options["__columns_only__"]
- else:
- columns = set(columns)
- if "__columns_except__" in options:
- columns_except = options["__columns_except__"]
- if not isinstance(options["__columns_except__"], list):
- columns_except = [options["__columns_except__"]]
-
- columns -= set(columns_except)
-
- if ("__included_ids__" in options and
- options["__included_ids__"] is False):
-
- related_objs_ids = [
- r + "_id" for r, o in options.items()
- if not r.startswith("__")]
-
- columns -= set(related_objs_ids)
-
- columns = list(columns)
-
- for column in columns:
- result[column] = getattr(self, column)
-
- for related, values in options.items():
- if hasattr(self, related):
- result[related] = getattr(self, related).to_dict(values)
- return result
-
- @property
- def serializable_attributes(self):
- return map(lambda x: x.name, self.__table__.columns)
-
-
-class User(db.Model, Serializer):
+class User(db.Model, helpers.Serializer):
"""
Represents user of the copr frontend
@@ -89,12 +19,12 @@ class User(db.Model, Serializer):
# openid_name for fas, e.g. http://bkabrda.id.fedoraproject.org/
openid_name = db.Column(db.String(100), nullable=False)
# just mail :)
- mail = db.Column(db.String(150), nullable = False)
+ mail = db.Column(db.String(150), nullable=False)
# just timezone ;)
- timezone = db.Column(db.String(50), nullable = True)
+ timezone = db.Column(db.String(50), nullable=True)
# is this user proven? proven users can modify builder memory and
# timeout for single builds
- proven = db.Column(db.Boolean, default = False)
+ proven = db.Column(db.Boolean, default=False)
# is this user admin of the system?
admin = db.Column(db.Boolean, default=False)
# stuff for the cli interface
@@ -195,7 +125,8 @@ class User(db.Model, Serializer):
except IOError:
return ""
-class Copr(db.Model, Serializer):
+
+class Copr(db.Model, helpers.Serializer):
"""
Represents a single copr (private repo with builds, mock chroots, etc.).
@@ -290,7 +221,7 @@ class Copr(db.Model, Serializer):
return result
-class CoprPermission(db.Model, Serializer):
+class CoprPermission(db.Model, helpers.Serializer):
"""
Association class for Copr<->Permission relation
@@ -309,7 +240,7 @@ class CoprPermission(db.Model, Serializer):
copr = db.relationship("Copr", backref=db.backref("copr_permissions"))
-class Build(db.Model, Serializer):
+class Build(db.Model, helpers.Serializer):
"""
Representation of one build in one copr
@@ -385,7 +316,7 @@ class Build(db.Model, Serializer):
return self.status == helpers.StatusEnum("pending")
-class MockChroot(db.Model, Serializer):
+class MockChroot(db.Model, helpers.Serializer):
"""
Representation of mock chroot
@@ -415,7 +346,7 @@ class MockChroot(db.Model, Serializer):
arch=self.arch)
-class CoprChroot(db.Model, Serializer):
+class CoprChroot(db.Model, helpers.Serializer):
"""
Representation of Copr<->MockChroot relation
@@ -434,7 +365,7 @@ class CoprChroot(db.Model, Serializer):
cascade="all,delete,delete-orphan"))
-class BuildChroot(db.Model, Serializer):
+class BuildChroot(db.Model, helpers.Serializer):
"""
Representation of Build<->MockChroot relation
@@ -468,7 +399,7 @@ class BuildChroot(db.Model, Serializer):
return "unknown"
-class LegalFlag(db.Model, Serializer):
+class LegalFlag(db.Model, helpers.Serializer):
id = db.Column(db.Integer, primary_key=True)
# message from user who raised the flag (what he thinks is wrong)
raise_message = db.Column(db.Text)
@@ -497,7 +428,7 @@ class LegalFlag(db.Model, Serializer):
primaryjoin="LegalFlag.resolver_id==User.id")
-class Action(db.Model, Serializer):
+class Action(db.Model, helpers.Serializer):
"""
Representation of a custom action that needs
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 42bd283f64b593d0ee857936ac398054cc62404e
Author: Richard Marko <rmarko(a)fedoraproject.org>
Date: Mon Jan 27 13:38:14 2014 +0100
[frontend] fix coding style and py3 compatibility
Signed-off-by: Richard Marko <rmarko(a)fedoraproject.org>
>---------------------------------------------------------------
Diff suppressed because of size. To see it, use:
git diff --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol ^42bd283f64b593d0ee857936ac398054cc62404e~1 42bd283f64b593d0ee857936ac398054cc62404e