1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-03 17:36:05 +00:00

fix(ui): a block or a job's cancel asks first; every delete and save says it is done

- Block in the Users list asks first: the user is signed out and their
  API tokens are deleted, which unblocking does not bring back. Block
  and Unblock then say what they did.
- Cancel on a job's page and in the job panel asks first, naming the
  job; the button says Cancel the job, apart from the dialog's Cancel.
- Deleting a user or a group, removing a host from the panel or an
  owner from a VM, and deleting an interface, a network filter or a
  secret say so, as the other deletes do.
- Renaming a tag and saving a VM's title and description say so.
This commit is contained in:
catborise 2026-11-21 20:47:26 +03:00
parent 00a44f7621
commit e79817e7db
22 changed files with 247 additions and 39 deletions

View file

@ -68,7 +68,8 @@
<li><a class="dropdown-item" href="{% url 'accounts:account' user.id %}">{% bs_icon 'person' %} {% trans "View profile" %}</a></li>
{# an administrator does not block or delete their own account #}
<li><form method="post" action="{% if user.is_active %}{% url 'admin:user_block' user.id %}{% else %}{% url 'admin:user_unblock' user.id %}{% endif %}">{% csrf_token %}
<button type="submit" class="dropdown-item"{% if user == request.user %} disabled{% endif %}>
<button type="submit" class="dropdown-item"{% if user == request.user %} disabled{% endif %}
{% if user.is_active %}data-confirm="{% blocktrans with name=user.username %}Block {{ name }}? They are signed out and their API tokens are deleted; unblocking does not bring the tokens back.{% endblocktrans %}"{% endif %}>
{% if user.is_active %}{% bs_icon 'slash-circle' %} {% trans "Block" %}{% else %}{% bs_icon 'play' %} {% trans "Unblock" %}{% endif %}
</button>
</form></li>