icônes pour les différents types de statut (#12928) #1039

Merged
fpeters merged 1 commits from wip/12928-status-icons into main 2024-01-26 08:47:39 +01:00
3 changed files with 49 additions and 2 deletions

View File

@ -74,6 +74,19 @@ def test_workflows_default(pub):
assert 'Change Status Name' not in resp.text
assert 'Delete' not in resp.text
# check status type icons/labels
resp = app.get('/backoffice/workflows/_default/')
assert [
(PyQuery(x).text(), re.search(r'status-type-[a-z]+', x.attrib['class']).group(0))
for x in resp.pyquery('#status-list li')
] == [
('Just Submitted (transition status)', 'status-type-transition'),
('New (pause status)', 'status-type-waitpoint'),
('Rejected (final status)', 'status-type-endpoint'),
('Accepted (pause status)', 'status-type-waitpoint'),
('Finished (final status)', 'status-type-endpoint'),
]
def test_workflows_new(pub):
create_superuser(pub)

View File

@ -546,6 +546,32 @@ ul#status-list li a {
border-right: 5px solid transparent;
}
ul#status-list a.biglistitem--content {
display: flex;
justify-content: space-between;
}
.status-type {
&::before {
color: #505050;
font-size: 70%;
font-family: FontAwesome;
width: 2em;
display: block;
text-align: center;
cursor: help;
}
&--endpoint::before {
content: "\f04d"; /* stop */
}
&--waitpoint::before {
content: "\f04c"; /* pause */
}
&--transition::before {
content: "\f04e"; /* forward */
}
}
ul#evolutions span.time:before {
font-family: FontAwesome;
content: "\f017 "; /* clock-o */

View File

@ -40,11 +40,19 @@
{% endif %}
{% spaceless %}
{% for status in workflow.possible_status %}
<li class="biglistitem {{ status.get_visibility_mode }}-status"
<li class="biglistitem {{ status.get_visibility_mode }}-status
status-type-{% if status.is_endpoint %}endpoint{% elif status.is_waitpoint %}waitpoint{% else %}transition{% endif %}"
data-id="{{ status.id }}">
<a class="biglistitem--content" href="status/{{ status.id }}/"
{% if status.colour %}style="border-color: {{status.colour}}"{% endif %}
>{{ status.name }}</a></li>
>{{ status.name }}
{% if status.is_endpoint %}<span class="status-type status-type--endpoint" title="{% trans "final status" %}"
><span class="sr-only">({% trans "final status" %})</span></span>
{% elif status.is_waitpoint %}<span class="status-type status-type--waitpoint" title="{% trans "pause status" %}"
><span class="sr-only">({% trans "pause status" %})</span></span>
{% else %}<span class="status-type status-type--transition" title="{% trans "transition status" %}"
><span class="sr-only">({% trans "transition status" %})</span></span>{% endif %}
</a></li>
{% endfor %}
{% endspaceless %}
</ul>