From: Michael Tremer Date: Mon, 3 Dec 2012 12:09:25 +0000 (+0100) Subject: Remove unused stuff from package detail list page. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e4d017205662d5c5e7537a52838ed2f10fcf6f38;p=people%2Fjschlag%2Fpbs.git Remove unused stuff from package detail list page. --- diff --git a/data/templates/package-detail-list.html b/data/templates/package-detail-list.html index 4d98933..7f65833 100644 --- a/data/templates/package-detail-list.html +++ b/data/templates/package-detail-list.html @@ -17,62 +17,31 @@ - {% module BuildHeadline(_("Package"), latest_build, shorter=True) %} - {% module PackageHeader(pkg) %} - -
-
-
-
+ -
-
- - -
- {% if release_builds %} -
-
-
- {% module BuildTable(release_builds, show_repo=True) %} -
-
-
- {% end %} - - {% if scratch_builds %} -
-
-
- {% module BuildTable(scratch_builds, show_user=True) %} -
-
-
- {% end %} -
-
-
+ {% module BuildHeadline(_("Package"), latest_build, shorter=True) %} + {% module PackageHeader(pkg) %} -
+
@@ -87,47 +56,27 @@
-

{{ _("Open bugs") }}

{% if bugs %} +

{{ _("Open bugs") }}

+ {% module BugsTable(pkg, bugs) %} - {% else %} -
- {{ _("There are currently no open bugs for %s.") % pkg.name }} -
{% end %} - - {% if build_times %} -
- -

{{ _("Build times") }}

+

{{ _("Average build time") }}

{% for arch, build_time in build_times %} - - + + {% end %}
{{ arch.name }}{{ friendly_time(build_time) }} + {{ arch.name }} + {{ friendly_time(build_time) }}
- -

- {{ _("These are the average build times of this package for every architecture.") }} -

{% end %}
diff --git a/web/handlers_packages.py b/web/handlers_packages.py index ee23b2b..a9321b0 100644 --- a/web/handlers_packages.py +++ b/web/handlers_packages.py @@ -51,45 +51,20 @@ class PackageNameHandler(BaseHandler): "scratch" : [], } - query = self.pakfire.builds.get_by_name(name, public=self.public, - user=self.current_user) + latest_build = self.pakfire.builds.get_latest_by_name(name, public=self.public) - if not query: + if not latest_build: raise tornado.web.HTTPError(404, "Package '%s' was not found" % name) - for build in query: - try: - builds[build.type].append(build) - except KeyError: - logging.warning("Unknown build type: %s" % build.type) - - latest_build = None - for type in builds.keys(): - # Take info from the most recent package. - if builds[type]: - latest_build = builds[type][-1] - break - - assert latest_build - - # Move the latest builds to the top. - for type in builds.keys(): - builds[type].reverse() - # Get the average build times of this package. build_times = self.pakfire.packages.get_avg_build_times(name) # Get the latest bugs from bugzilla. bugs = self.pakfire.bugzilla.get_bugs_from_component(name) - kwargs = { - "release_builds" : builds["release"], - "scratch_builds" : builds["scratch"], - } - self.render("package-detail-list.html", builds=builds, name=name, latest_build=latest_build, pkg=latest_build.pkg, - build_times=build_times, bugs=bugs, **kwargs) + build_times=build_times, bugs=bugs) class PackageChangelogHandler(BaseHandler):