# t (timestamp)
# priority
# build
+# by_build
+# build_comment
# user
# by_user
#
builds.created_at AS t,
4 AS priority,
builds.id AS build,
+ NULL::integer AS by_build,
NULL::integer AS build_comment,
NULL::integer AS user,
builds.owner_id AS by_user
ELSE 4
END AS priority,
builds.id AS build,
+ NULL AS by_build,
NULL AS build_comment,
NULL AS user,
NULL AS by_user
builds.deleted_at AS t,
4 AS priority,
builds.id AS build,
+ NULL AS by_build,
NULL AS build_comment,
NULL AS user,
builds.deleted_by AS by_user
UNION ALL
+ -- Deprecated Builds
+
+ SELECT
+ 'build-deprecated' AS type,
+ deprecated_builds.created_at AS t,
+ 4 AS priority,
+ builds.id AS build,
+ builds.deprecated_by AS by_build,
+ NULL AS build_comment,
+ NULL AS user,
+ builds.owner_id AS by_user
+ FROM
+ builds
+ LEFT JOIN
+ builds deprecated_builds ON builds.deprecated_by = deprecated_builds.id
+ WHERE
+ builds.deleted_at IS NULL
+ AND
+ deprecated_builds.deleted_at IS NULL
+ AND
+ builds.deprecated_by IS NOT NULL
+
+ UNION ALL
+
-- Build Comments
SELECT
'build-comment' AS type,
build_comments.created_at AS t,
4 AS priority,
build_comments.build_id AS build,
+ NULL AS by_build,
build_comments.id AS build_comment,
NULL AS user,
build_comments.user_id AS by_user
build_watchers.added_at AS t,
1 AS priority,
build_watchers.build_id AS build,
+ NULL AS by_build,
NULL AS build_comment,
build_watchers.user_id AS user,
NULL AS by_user
build_watchers.deleted_at AS t,
1 AS priority,
build_watchers.build_id AS build,
+ NULL AS by_build,
NULL AS build_comment,
build_watchers.user_id AS user,
NULL AS by_user
def map(self):
return {
# Builds
- "build" : self.backend.builds.get_by_id,
+ "build" : self.backend.builds.get_by_id,
+ "by_build" : self.backend.builds.get_by_id,
# Build Comments
"build_comment" : self.backend.builds.comments.get_by_id,
{{ _("Build Created") }}
{% elif event.type == "build-deleted" %}
{{ _("Build Deleted") }}
+ {% elif event.type == "build-deprecated" %}
+ {{ _("This build was deprecated") }}
{% elif event.type == "build-watcher-added" %}
{{ _("%s started watching this build") % event.user }}
{% elif event.type == "build-watcher-removed" %}
<nav class="level">
<div class="level-left is-small">
+ {# Build #}
{% if event.build %}
<a class="level-item" href="/builds/{{ event.build.uuid }}">
{{ event.build }}
</a>
{% end %}
+ {# By Build #}
+ {% if event.by_build %}
+ <a class="level-item" href="/builds/{{ event.by_build.uuid }}">
+ {{ _("by %s") % event.by_build }}
+ </a>
+ {% end %}
+
+ {# By User #}
{% if event.by_user %}
<a class="level-item" href="/users/{{ event.by_user.name }}">
{{ _("by %s") % event.by_user }}