]> git.ipfire.org Git - people/jschlag/pbs.git/commitdiff
Remove unused stuff from package detail list page.
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 3 Dec 2012 12:09:25 +0000 (13:09 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 3 Dec 2012 12:09:25 +0000 (13:09 +0100)
data/templates/package-detail-list.html
web/handlers_packages.py

index 4d9893307b7edf3990d2f89905df30b80e85f4fd..7f658337818af118ebc818d84d9ae24ee6550989 100644 (file)
                </li>
        </ul>
 
-       {% module BuildHeadline(_("Package"), latest_build, shorter=True) %}
-       {% module PackageHeader(pkg) %}
-
-       <div class="row">
-               <div class="span12">
-                       <hr />
-               </div>
+       <div class="btn-group pull-right">
+               <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
+                       {{ _("Actions") }} <span class="caret"></span>
+               </a>
+               <ul class="dropdown-menu">
+                       <li class="nav-header">
+                               {{ _("Bugs") }}
+                       </li>
+                       <li>
+                               <a href="{{ bugtracker.buglist_url(pkg.name) }}" target="_blank">
+                                       {{ _("Show all bugs") }}
+                               </a>
+                       </li>
+                       <li>
+                               <a href="{{ bugtracker.enter_url(pkg.name) }}" target="_blank">
+                                       {{ _("File new bug") }}
+                               </a>
+                       </li>
+               </ul>
        </div>
 
-       <div class="row">
-               <div class="span12">
-                       <ul class="nav nav-pills">
-                               {% if release_builds %}
-                                       <li class="active">
-                                               <a href="#release" data-toggle="tab">
-                                                       {{ _("Release builds") }}
-                                                       <small>({{ len(release_builds) }})</small>
-                                               </a>
-                                       </li>
-                               {% end %}
-
-                               {% if scratch_builds %}
-                                       <li {% if not release_builds %}class="active"{% end %}>
-                                               <a href="#scratch" data-toggle="tab">
-                                                       {{ _("Scratch builds") }}
-                                                       <small>({{ len(scratch_builds) }})</small>
-                                               </a>
-                                       </li>
-                               {% end %}
-                       </ul>
-
-                       <div class="tab-content">
-                               {% if release_builds %}
-                                       <div class="tab-pane active" id="release">
-                                               <div class="row">
-                                                       <div class="span12">
-                                                               {% module BuildTable(release_builds, show_repo=True) %}
-                                                       </div>
-                                               </div>
-                                       </div>
-                               {% end %}
-
-                               {% if scratch_builds %}
-                                       <div class="tab-pane {% if not release_builds %}active{% end %}" id="scratch">
-                                               <div class="row">
-                                                       <div class="span12">
-                                                               {% module BuildTable(scratch_builds, show_user=True) %}
-                                                       </div>
-                                               </div>
-                                       </div>
-                               {% end %}
-                       </div>
-               </div>
-       </div>
+       {% module BuildHeadline(_("Package"), latest_build, shorter=True) %}
+       {% module PackageHeader(pkg) %}
 
-       <hr>
+       <hr class="clear">
 
        <div class="row">
                <div class="span8">
                </div>
 
                <div class="span4">
-                       <h3>{{ _("Open bugs") }}</h3>
                        {% if bugs %}
+                               <h4>{{ _("Open bugs") }}</h4>
+
                                {% module BugsTable(pkg, bugs) %}
-                       {% else %}
-                               <blockquote>
-                                       {{ _("There are currently no open bugs for %s.") % pkg.name }}
-                               </blockquote>
                        {% end %}
 
-                       <div class="ac">
-                               <div class="btn-toolbar">
-                                       <div class="btn-group">
-                                               <a class="btn" href="{{ bugtracker.enter_url(pkg.name) }}" target="_blank">
-                                                       {{ _("File new bug") }}
-                                               </a>
-                                               <a class="btn" href="{{ bugtracker.buglist_url(pkg.name) }}" target="_blank">
-                                                       {{ _("Show all bugs") }}
-                                               </a>
-                                       </div>
-                               </div>
-                       </div>
-
                        {% if build_times %}
-                               <hr>
-
-                               <h3>{{ _("Build times") }}</h3>
+                               <h4>{{ _("Average build time") }}</h4>
 
                                <table class="table table-striped table-hover">
                                        <tbody>
                                                {% for arch, build_time in build_times %}
                                                        <tr>
-                                                               <td class="arch">{{ arch.name }}</td>
-                                                               <td class="time">{{ friendly_time(build_time) }}</td>
+                                                               <td>
+                                                                       <a href="/arch/{{ arch.name }}">{{ arch.name }}</a>
+                                                               </td>
+                                                               <td>{{ friendly_time(build_time) }}</td>
                                                        </tr>
                                                {% end %}
                                        </tbody>
                                </table>
-
-                               <p>
-                                       {{ _("These are the average build times of this package for every architecture.") }}
-                               </p>
                        {% end %}
                </div>
        </div>
index ee23b2bc2869a67df1c797c1ef9bb69fc49dc07d..a9321b0c36b8653dc241bda487d2af90197faaca 100644 (file)
@@ -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):