templates_buildsdir = $(templatesdir)/builds
+dist_templates_builds_groups_DATA = \
+ src/templates/builds/groups/show.html
+
templates_builds_groupsdir = $(templates_buildsdir)/groups
dist_templates_builds_groups_modules_DATA = \
""", id,
)
+ def get_by_uuid(self, uuid):
+ return self._get_group("""
+ SELECT
+ *
+ FROM
+ build_groups
+ WHERE
+ deleted_at IS NULL
+ AND
+ uuid = %s
+ """, uuid,
+ )
+
def create(self, owner=None):
"""
Creates a new Build Group
class Group(base.DataObject):
table = "build_groups"
+ def __str__(self):
+ return self.uuid
+
def __iter__(self):
return iter(self.builds)
+ def __bool__(self):
+ return True
+
def __len__(self):
return len(self.builds)
--- /dev/null
+{% extends "../../base.html" %}
+
+{% block title %}{{ _("Build Group %s") % group }}{% end block %}
+
+{% block body %}
+ <section class="section">
+ <div class="container">
+ <nav class="breadcrumb" aria-label="breadcrumbs">
+ <ul>
+ <li>
+ <a href="/builds">{{ _("Builds") }}</a>
+ </li>
+ <li>
+ <a href="#">{{ _("Group") }}</a>
+ </li>
+ <li class="is-active">
+ <a href="#" aria-current="page">{{ group }}</a>
+ </li>
+ </ul>
+ </nav>
+
+ <h1 class="title is-1">{{ _("Build Group %s") % group }}</h1>
+
+ {% if group.builds %}
+ {% module BuildsList(group.builds) %}
+ {% else %}
+ <div class="notification is-danger">
+ {{ _("This build group does not have any builds") }}
+ </div>
+ {% end %}
+ </div>
+ </section>
+{% end block %}
(r"/api/v1/builds", builds.APIv1IndexHandler),
+ # Build Groups
+ (r"/builds/groups/([\w]{8}-[\w]{4}-[\w]{4}-[\w]{4}-[\w]{12})", builds.GroupShowHandler),
+
# Queue
(r"/queue", jobs.QueueHandler),
self.redirect("/builds/%s" % build.uuid)
+class GroupShowHandler(base.BaseHandler):
+ def get(self, uuid):
+ group = self.backend.builds.groups.get_by_uuid(uuid)
+ if not group:
+ raise tornado.web.HTTPError(404, "Could not find build group %s" % uuid)
+
+ self.render("builds/groups/show.html", group=group)
+
+
class ListModule(ui_modules.UIModule):
def render(self, builds):
return self.render_string("builds/modules/list.html", builds=builds)