Commit 5d86162a by Kálmán Viktor

network: host edit fixes

parent e13ef09d
......@@ -8,8 +8,13 @@ $('i[class="icon-remove"]').click(function() {
host = $('.page-header').children('h2').text()
group = $(this).closest('h4').text();
text = gettext('Are you sure you want to remove host group <strong>"%(group)s"</strong> from <strong>"%(host)s"</strong>?');
s = interpolate(text, {'group': group, 'host': host}, true);
if(group.length > 0) {
text = gettext('Are you sure you want to remove host group <strong>"%(group)s"</strong> from <strong>"%(host)s"</strong>?');
s = interpolate(text, {'group': group, 'host': host}, true);
} else {
s = gettext('Are you sure you want to delete this rule?');
}
bootbox.dialog({
message: s,
buttons: {
......
......@@ -28,7 +28,8 @@
<div class="page-header">
<h3>{% trans "Groups" %}</h3>
</div>
{% for group in group_rule_list %}
{% if group_rule_list|length > 0 %}
{% for group in group_rule_list %}
<div>
<h4 id="{{ group.pk }}_group_pk">{{ group.name }}
<a href="{% url "network.remove_host_group" pk=host_pk group_pk=group.pk %}?from={{ request.path }}">
......@@ -38,7 +39,10 @@
</h4>
{% render_table group.table %}
</div>
{% endfor %}
{% endfor %}
{% else %}
{% trans "This host is not added to any host groups!" %}
{% endif %}
<div class="page-header">
<h3>Add host group</h3>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment