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 { ...@@ -142,3 +142,13 @@ table.qa td.readthedocs a {
border-radius: .25rem; border-radius: .25rem;
margin-bottom: 1rem; margin-bottom: 1rem;
} }
.unused {
filter: opacity(75%);
font-style: italic;
color: grey;
}
.approved {
border: 1px solid lightgrey;
}
{% macro render_mrs(mrs, show_how_old="") %} {% macro render_mrs(mrs, show_how_old="", split_used_unused=True) %}
{% for project in mrs %} {% if not split_used_unused %}
{% if project["merge_requests"] %} {% for project in mrs %}
<h3>{{ project["project"]["name"] }}</h3> {% if project["merge_requests"] %}
<h3>{{ project["project"]["name"] }}</h3>
<ul>
{% for mr in project["merge_requests"] %} <ul>
<li> {% for mr in project["merge_requests"] %}
{% if mr["pipeline"] %} <li>{{ render_one_mr(mr, project) }}</li>
<span class="job job-{{ mr["pipeline"]["status"] }}"> </span> {% endfor %}
{% else %} </ul>
<span class="job job-empty">?</span> {% endif %}
{% 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>
{% endfor %} {% endfor %}
{% if show_how_old == "updated" %} {% else %}
(updated {{ mr["updated_since_x_days"] }} days ago)
{% elif show_how_old == "created" %} {% for project in mrs %}
(created {{ mr["created_since_x_days"] }} days ago) {% if ("cw-core" in project["project"]["tag_list"] or "project-dependency" in project["project"]["tag_list"]) and project["merge_requests"] %}
{% endif %} <h3>{{ project["project"]["name"] }}</h3>
</li>
{% endfor %} <ul>
</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 %} {% 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 %} {% 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 %} {% endmacro %}
<!doctype html> <!doctype html>
<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