Change display of cancelled users, fix edit link

It’s confusing showing green ticks for cancelled invites. This commit
changes the appearance so that only pending or active users (ie those
that could actually do some damage) get green ticks.

Also fixes missing edit links caused by instances of `User` having
`.state` but instances of `InvitedUser` having `.status`.

Right now these are two separate lists. Which makes it harder to add
improvements that will make large numbers of users easier to manage.
This commit is contained in:
Chris Hill-Scott
2018-01-26 17:14:00 +00:00
parent 6fcb2dfde7
commit 2221a8ca48
3 changed files with 52 additions and 14 deletions

View File

@@ -54,7 +54,7 @@
{{ user.email_address }} (invited)
{%- elif user.status == 'cancelled' -%}
{{ user.email_address }} (cancelled invite)
{%- elif user.email_address == current_user.email_address -%}
{%- elif user.id == current_user.id -%}
(you)
{% else %}
{{ user.email_address }}
@@ -93,7 +93,7 @@
<li class="tick-cross-list-edit-link">
{% if user.status == 'pending' %}
<a href="{{ url_for('.cancel_invited_user', service_id=current_service.id, invited_user_id=user.id)}}">Cancel invitation</a>
{% elif user.status == 'active' and current_user.id != user.id %}
{% elif user.state == 'active' and current_user.id != user.id %}
<a href="{{ url_for('.edit_user_permissions', service_id=current_service.id, user_id=user.id)}}">Edit permissions</a>
{% endif %}
</li>