{#- Build display helpers for the projects pages (PRJ-33): a status badge that shows cancelled builds in a neutral colour (the shared status_badge paints them like failures), a "Started" cell that says what a build that never started is doing, and a commit cell that says "Latest on " instead of the placeholder "HEAD". #} {% import "site_shell/_macros.html" as ui %} {% macro build_status(status) -%} {%- set value = status.value if status.value is defined else status -%} {%- if value == 'cancelled' -%} {{ value | display }} {%- else -%} {{ ui.status_badge(status) }} {%- endif -%} {%- endmacro %} {% macro build_started(build) -%} {%- set value = build.status.value if build.status.value is defined else build.status -%} {%- if build.started_at -%} {{ build.started_at | format_datetime('%Y-%m-%d %H:%M') }} {%- elif value == 'queued' -%} Queued {%- elif value == 'pending' -%} Waiting to start {%- elif value == 'cancelled' -%} Never started {%- else -%} — {%- endif -%} {%- endmacro %} {% macro build_commit(build, full=false) -%} {%- if not build.commit_sha or build.commit_sha == 'HEAD' -%} Latest on {{ build.branch }} {%- elif full -%} {{ build.commit_sha }} {%- else -%} {{ build.commit_sha[:7] }} {%- endif -%} {%- endmacro %}