From 871083967fe8df64561b9e318ef9b3b44af4c466 Mon Sep 17 00:00:00 2001 From: catborise Date: Wed, 20 May 2020 16:18:27 +0300 Subject: [PATCH] bootstrap 4.5 fixations & fix various localizations --- accounts/templates/accounts.html | 6 +- console/templates/console-base.html | 2 +- create/templates/create_instance_w2.html | 4 +- instances/templates/add_instance_volume.html | 2 +- instances/templates/edit_instance_volume.html | 2 +- instances/templates/instance.html | 111 ++++++++++-------- instances/views.py | 8 +- networks/templates/add_network_qos.html | 2 +- networks/templates/network.html | 18 +-- networks/views.py | 4 +- nwfilters/templates/nwfilter.html | 52 ++++---- storages/templates/create_stg_vol_block.html | 2 +- storages/templates/storage.html | 2 +- 13 files changed, 115 insertions(+), 100 deletions(-) diff --git a/accounts/templates/accounts.html b/accounts/templates/accounts.html index b89de8c..e2e766d 100644 --- a/accounts/templates/accounts.html +++ b/accounts/templates/accounts.html @@ -80,19 +80,19 @@
-
+
-
+
-
+
diff --git a/console/templates/console-base.html b/console/templates/console-base.html index 1205a3e..066c6fe 100644 --- a/console/templates/console-base.html +++ b/console/templates/console-base.html @@ -71,7 +71,7 @@ {% if user_quota_msg %} {% else %} @@ -424,11 +424,11 @@
{% if vcpu.enabled == 'yes' and vcpu.hotpluggable == "yes" %} - + {% elif vcpu.enabled == 'yes' and vcpu.hotpluggable == "no" %} - + {% else %} - + {% endif %}
@@ -531,7 +531,7 @@
{% csrf_token %}
- +
{% ifequal status 5 %} @@ -561,10 +561,10 @@ {{ snap.name }} {{ snap.date|date:"M d H:i:s" }} - {% csrf_token %} + {% csrf_token %} {% ifequal status 5 %} - {% else %} @@ -578,7 +578,7 @@ {% csrf_token %} -
@@ -684,13 +684,13 @@ {% ifequal status 5 %}

{% trans "Enable Boot Menu for your instance when it starts up " %} {% ifequal bootmenu 0 %} - + {% else %} - + {% endifequal %} {% else %} {% ifequal bootmenu 0 %} -

{% trans "**** Please shutdown instance to modify boot menu ****" %}

+

**** {% trans "Please shutdown instance to modify boot menu" %} ****

{% endifequal %} {% endifequal %}
@@ -721,10 +721,10 @@
- +
- +
@@ -741,8 +741,13 @@
{% csrf_token %}

{% trans "Instance Media" %} + {% if status == 5 and allow_admin_or_not_template %} + + {% endif %} @@ -781,24 +786,24 @@ {% else %} {% endif %} - {% if status == 5 and allow_admin_or_not_template %} - - {% endif %} + {% else %} -

+
+
+
+ + {% if allow_admin_or_not_template %} + + {% else %} + + {% endif %} +
-
- - {% if allow_admin_or_not_template %} - - {% else %} - - {% endif %} -
+
{% endif %}
@@ -815,7 +820,7 @@
- +
@@ -893,9 +898,10 @@ {% include 'add_instance_network_block.html' %}

-
-

{% trans "Network Devices" %}

-
{% trans "Device" %}
+
+
+
{% trans "Network Devices" %}
+
@@ -925,7 +931,7 @@ - + - - + - + - - + {% endfor %}
{% trans 'Name' %}
{% csrf_token %} @@ -937,6 +943,7 @@
{% trans 'IPv4' %}{% trans 'IPv4' %} {% for ipv4 in network.ipv4|default:"unknown" %}{{ ipv4 }}{% endfor %} {% trans 'IPv6' %} + {% trans 'IPv6' %} {% for ipv6 in network.ipv6|default:"unknown" %}{{ ipv6 }}{% endfor %} {% trans 'Model' %}{% trans 'Model' %} {{ network.model }} {% trans 'QoS' %} + {% csrf_token %} {% include 'add_network_qos.html' with id=forloop.counter0 %} @@ -1020,22 +1028,23 @@
+
{% if qos %}
-

{% trans "Qos Configuration" %}

+

{% trans "QoS Configuration" %}

- + @@ -1062,12 +1071,12 @@ @@ -1195,15 +1204,15 @@

-
{% trans "MAC/Direction" %}{% trans "MAC" %}/{% trans "Direction" %} {% trans "Average" %} {% trans "Peak" %} {% trans "Burst" %}
+
{% for userinstance in userinstances %} @@ -248,7 +248,7 @@ class="btn btn-primary btn-block" value="Apply" name="modify_dhcp_range" - title="Edit DHCP Range" + title="{% trans "Edit DHCP Range" %}" onclick="return confirm('{% trans "Are you sure?" %}')"/> @@ -298,12 +298,12 @@ @@ -322,7 +322,7 @@ {% include 'add_network_qos.html' %} {% endif %} - +
{{ userinstance.user }} - {% csrf_token %} + {% csrf_token %} - @@ -1928,8 +1937,8 @@ }); $('#boot_order_down').bind('click', function() { - var countOptions = $('#b_order label').size(); - var countSelected = $('#b_order label input:checked').size(); + var countOptions = $('#b_order label').length; + var countSelected = $('#b_order label input:checked').length; $('#b_order label input:checked').each( function() { var label = $(this).parent(); var newPos = label.index() + countSelected; diff --git a/instances/views.py b/instances/views.py index ab49fab..3ec575b 100644 --- a/instances/views.py +++ b/instances/views.py @@ -917,10 +917,10 @@ def instance(request, compute_id, vname): try: conn.set_qos(mac, qos_dir, average, peak, burst) if conn.get_status() == 5: - messages.success(request, "{} Qos is set".format(qos_dir.capitalize())) + messages.success(request, "{} QoS is set".format(qos_dir.capitalize())) else: messages.success(request, - "{} Qos is set. Network XML is changed.".format(qos_dir.capitalize()) + + "{} QoS is set. Network XML is changed.".format(qos_dir.capitalize()) + "Stop and start network to activate new config") except libvirtError as le: @@ -932,10 +932,10 @@ def instance(request, compute_id, vname): conn.unset_qos(mac, qos_dir) if conn.get_status() == 5: - messages.success(request, "{} Qos is deleted".format(qos_dir.capitalize())) + messages.success(request, "{} QoS is deleted".format(qos_dir.capitalize())) else: messages.success(request, - "{} Qos is deleted. Network XML is changed. ".format(qos_dir.capitalize()) + + "{} QoS is deleted. Network XML is changed. ".format(qos_dir.capitalize()) + "Stop and start network to activate new config.") return HttpResponseRedirect(request.get_full_path() + '#network') diff --git a/networks/templates/add_network_qos.html b/networks/templates/add_network_qos.html index de6882f..1397c7a 100644 --- a/networks/templates/add_network_qos.html +++ b/networks/templates/add_network_qos.html @@ -10,7 +10,7 @@
@@ -353,12 +353,12 @@ diff --git a/networks/views.py b/networks/views.py index 8905d9c..369feda 100644 --- a/networks/views.py +++ b/networks/views.py @@ -216,7 +216,7 @@ def network(request, compute_id, pool): _("{} Qos is set. Network XML is changed.").format(qos_dir.capitalize()) + _("Stop and start network to activate new config")) else: - messages.success(request, _("{} Qos is set").format(qos_dir.capitalize())) + messages.success(request, _("{} QoS is set").format(qos_dir.capitalize())) except libvirtError as lib_err: messages.error(request, lib_err) return HttpResponseRedirect(request.get_full_path()) @@ -230,7 +230,7 @@ def network(request, compute_id, pool): _("{} Qos is deleted. Network XML is changed. ").format(qos_dir.capitalize()) + _("Stop and start network to activate new config.")) else: - messages.success(request, _("{} Qos is deleted").format(qos_dir.capitalize())) + messages.success(request, _("{} QoS is deleted").format(qos_dir.capitalize())) return HttpResponseRedirect(request.get_full_path()) conn.close() diff --git a/nwfilters/templates/nwfilter.html b/nwfilters/templates/nwfilter.html index a6238fe..51743c5 100644 --- a/nwfilters/templates/nwfilter.html +++ b/nwfilters/templates/nwfilter.html @@ -47,11 +47,10 @@
- - +
{% csrf_token %} @@ -68,30 +67,37 @@
- - {% csrf_token %} -
-
-
- {% trans "Filter" %} -
- +
+
- + + +
-
+
diff --git a/storages/templates/create_stg_vol_block.html b/storages/templates/create_stg_vol_block.html index c5fb148..99c8f99 100644 --- a/storages/templates/create_stg_vol_block.html +++ b/storages/templates/create_stg_vol_block.html @@ -42,8 +42,8 @@
# {% trans "Reference" %}
- +
## {% trans "Name" %} {% trans "Allocated" %} {% trans "Size" %}