Projet

Général

Profil

0001-backoffice-show-an-slashed-eye-next-to-user-hidden-s.patch

Thomas Noël, 28 août 2019 14:20

Télécharger (3,99 ko)

Voir les différences:

Subject: [PATCH] backoffice: show an slashed eye next to user hidden statuses
 (#34919)

 tests/test_form_pages.py                | 2 ++
 wcs/backoffice/management.py            | 7 ++++---
 wcs/qommon/static/css/dc2/admin.css     | 9 +++++++++
 wcs/templates/wcs/formdata_history.html | 3 ++-
 4 files changed, 17 insertions(+), 4 deletions(-)
tests/test_form_pages.py
3713 3713
    resp = resp.form.submit('button_export_to')
3714 3714
    resp = resp.follow()
3715 3715
    assert 'Form exported in a model' in resp.body
3716
    assert 'visibility-off' in resp.body
3716 3717

  
3717 3718
    resp = resp.form.submit('button_jump2')
3718 3719
    resp = resp.follow()
......
3726 3727

  
3727 3728
    resp = login(get_app(pub), username='foo', password='foo').get(resp.request.url)
3728 3729
    assert not 'Form exported in a model' in resp.body
3730
    assert 'visibility-off' not in resp.body
3729 3731

  
3730 3732
def test_formdata_form_file_download(pub):
3731 3733
    create_user(pub)
wcs/backoffice/management.py
2105 2105
                status_colour = None
2106 2106
            status_colour = status_colour or 'ffffff'
2107 2107
            fg_colour = misc.get_foreground_colour(status_colour)
2108
            visibility_off = 'visibility-off' if formdata.get_status().get_visibility_restricted_roles() else ''
2108 2109

  
2109
            r += htmltext('<p class="current-status"><span class="item" style="background: #%s; color: %s;"></span>' %
2110
                    (status_colour, fg_colour))
2111
            r += htmltext('<span>%s %s</span></p>') % (_('Status:'), formdata.get_status_label())
2110
            r += htmltext('<p class="current-status %s"><span class="item" style="background: #%s; color: %s;"></span>' %
2111
                    (visibility_off, status_colour, fg_colour))
2112
            r += htmltext('<span class="status">%s %s</span></p>') % (_('Status:'), formdata.get_status_label())
2112 2113
            if formdata.formdef.workflow.criticality_levels:
2113 2114
                try:
2114 2115
                    level = formdata.get_criticality_level_object()
wcs/qommon/static/css/dc2/admin.css
1451 1451
	line-height: 130%;
1452 1452
}
1453 1453

  
1454
p.current-status.visibility-off span.status::after,
1455
ul#evolutions li.visibility-off span.status::after {
1456
	margin-left: 1rem;
1457
	content: "\f070";  /* fa-eye-slash */
1458
	font-family: FontAwesome;
1459
	font-weight: normal;
1460
	color: #3c3c33;
1461
}
1462

  
1454 1463
p.current-level .item,
1455 1464
p.current-status .item {
1456 1465
	float: left;
wcs/templates/wcs/formdata_history.html
7 7
    {% with status=evolution.get_status display_parts=evolution.display_parts %}
8 8
    <li class="{% if evolution.who == '_submitter' %}msg-in{% elif evolution.who %}msg-out{% else %}msg-system{% endif %}
9 9
               {% if status.is_endpoint %}endpoint{% endif %}
10
               {{ status.extra_css_class }}">
10
               {% if status.get_visibility_restricted_roles %}visibility-off{% endif %}
11
               {{ status.extra_css_class|default:"" }}">
11 12
      <span class="item {% if not evolution.status %}no-status-change{% endif %}" style="background: #{{ status.colour }}; color: {{ status.get_contrast_color}}"></span>
12 13
      <div>
13 14
       {% if evolution.status %}
14
-