Commit 983a4c70 authored by Laurent Peuch's avatar Laurent Peuch
Browse files

feat(mr): display MR from unused cube as greyish and after the others

parent 99a0de57600f
Pipeline #48925 failed with stages
in 23 minutes and 28 seconds
......@@ -142,3 +142,13 @@ table.qa td.readthedocs a {
border-radius: .25rem;
margin-bottom: 1rem;
}
.unused {
filter: opacity(75%);
font-style: italic;
color: grey;
}
.approved {
border: 1px solid lightgrey;
}
{% macro render_mrs(mrs, show_how_old="") %}
{% for project in mrs %}
{% if project["merge_requests"] %}
<h3>{{ project["project"]["name"] }}</h3>
<ul>
{% for mr in project["merge_requests"] %}
<li>
{% if mr["pipeline"] %}
<span class="job job-{{ mr["pipeline"]["status"] }}"> </span>
{% else %}
<span class="job job-empty">?</span>
{% endif %}
{% if not mr["assignees"] %}
<span title="no one is assigned">
⚠️
</span>
{% endif %}
<a href="{{ mr["web_url"] }}" target="_blank">{{ mr["title"] }}</a>
by <i>{{ mr["author"]["name"] }}</i>
{% if mr["assignees"] %}
(assigned: {% for assigned in mr["assignees"] %}{{ assigned["name"] }}{% endfor %})
{% endif %}
{% for label in mr["labels"] %}
<span class="label" style="color: {{ project["labels"][label]["text_color"] }}; background-color: {{ project["labels"][label]["color"] }}">{{ label }}</span>
{% macro render_mrs(mrs, show_how_old="", split_used_unused=True) %}
{% if not split_used_unused %}
{% for project in mrs %}
{% if project["merge_requests"] %}
<h3>{{ project["project"]["name"] }}</h3>
<ul>
{% for mr in project["merge_requests"] %}
<li>{{ render_one_mr(mr, project) }}</li>
{% endfor %}
</ul>
{% endif %}
{% endfor %}
{% if show_how_old == "updated" %}
(updated {{ mr["updated_since_x_days"] }} days ago)
{% elif show_how_old == "created" %}
(created {{ mr["created_since_x_days"] }} days ago)
{% endif %}
</li>
{% endfor %}
</ul>
{% else %}
{% for project in mrs %}
{% if ("cw-core" in project["project"]["tag_list"] or "project-dependency" in project["project"]["tag_list"]) and project["merge_requests"] %}
<h3>{{ project["project"]["name"] }}</h3>
<ul>
{% for mr in project["merge_requests"] %}
<li>{{ render_one_mr(mr, project) }}</li>
{% endfor %}
</ul>
{% endif %}
{% endfor %}
{% for project in mrs %}
{% if not ("cw-core" in project["project"]["tag_list"] or "project-dependency" in project["project"]["tag_list"]) and project["merge_requests"] %}
<div class="unused">
<h3>{{ project["project"]["name"] }} (unused)</h3>
<ul>
{% for mr in project["merge_requests"] %}
<li>{{ render_one_mr(mr, project) }}</li>
{% endfor %}
</ul>
</div>
{% endif %}
{% endfor %}
{% endif %}
{% endmacro %}
{% macro render_one_mr(mr, project) %}
{% if mr["pipeline"] %}
<span class="job job-{{ mr["pipeline"]["status"] }}"> </span>
{% else %}
<span class="job job-empty">?</span>
{% endif %}
{% if not mr["assignees"] %}
<span title="no one is assigned">
⚠️
</span>
{% endif %}
<a href="{{ mr["web_url"] }}" target="_blank">{{ mr["title"] }}</a>
by <i>{{ mr["author"]["name"] }}</i>
{% if mr["assignees"] %}
(assigned: {% for assigned in mr["assignees"] %}{{ assigned["name"] }}{% endfor %})
{% endif %}
{% if mr["approved"] %}
<span class="approved label">✅ approved</span>
{% endif %}
{% for label in mr["labels"] %}
<span class="label" style="color: {{ project["labels"][label]["text_color"] }}; background-color: {{ project["labels"][label]["color"] }}">{{ label }}</span>
{% endfor %}
{% if show_how_old == "updated" %}
(updated {{ mr["updated_since_x_days"] }} days ago)
{% elif show_how_old == "created" %}
(created {{ mr["created_since_x_days"] }} days ago)
{% endif %}
{% endmacro %}
<!doctype html>
<html>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment