networks: Prevent unintended changes to primary connection.

Helps: #1962

Shown an alarming warning in connection_show page (only) for the primary
connection. Captions 'Deactivate' and 'Delete' buttons, now explicitly
mention the primary connection and they are placed within the warning
box.

Signed-off-by: Fioddor Superconcentrado <fioddor@gmail.com>
[sunil: Primary connection is not the same as connection user is using]
[sunil: Reduce the importance of primary connection as it is just default route]
[sunil: Update primary connection message]
[sunil: Fix the use of exclamation icon for screen readers as per bootstrap]
[sunil: Don't place buttons inside the warning, as it is non-intuitive UI]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
Fioddor Superconcentrado 2020-12-15 20:33:25 +01:00 committed by Sunil Mohan Adapa
parent 6e747f281e
commit 012a9a0fc7
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2

View File

@ -17,6 +17,19 @@
<div class="row">
<div class="col-md-8 offset-md-2">
{% if connection.primary %}
<div class="alert alert-warning" role="alert">
<span class="fa fa-exclamation-triangle" aria-hidden="true"></span>
<span class="sr-only">{% trans "Caution:" %}</span>
{% blocktrans trimmed %}
This is the primary connection that {{ box_name }} relies on for
Internet connectivity. Altering it may render your {{ box_name }}
unreachable. Ensure that you have other means to access
{{ box_name }} before altering this connection.
{% endblocktrans %}
</div>
{% endif %}
<div class="btn-toolbar">
<a href="{% url 'networks:edit' connection.uuid %}"
class="btn btn-primary" role="button"