Commit 5d86162a by Kálmán Viktor

network: host edit fixes

parent e13ef09d
...@@ -8,8 +8,13 @@ $('i[class="icon-remove"]').click(function() { ...@@ -8,8 +8,13 @@ $('i[class="icon-remove"]').click(function() {
host = $('.page-header').children('h2').text() host = $('.page-header').children('h2').text()
group = $(this).closest('h4').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>?'); if(group.length > 0) {
s = interpolate(text, {'group': group, 'host': host}, true); 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({ bootbox.dialog({
message: s, message: s,
buttons: { buttons: {
......
...@@ -28,7 +28,8 @@ ...@@ -28,7 +28,8 @@
<div class="page-header"> <div class="page-header">
<h3>{% trans "Groups" %}</h3> <h3>{% trans "Groups" %}</h3>
</div> </div>
{% for group in group_rule_list %} {% if group_rule_list|length > 0 %}
{% for group in group_rule_list %}
<div> <div>
<h4 id="{{ group.pk }}_group_pk">{{ group.name }} <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 }}"> <a href="{% url "network.remove_host_group" pk=host_pk group_pk=group.pk %}?from={{ request.path }}">
...@@ -38,7 +39,10 @@ ...@@ -38,7 +39,10 @@
</h4> </h4>
{% render_table group.table %} {% render_table group.table %}
</div> </div>
{% endfor %} {% endfor %}
{% else %}
{% trans "This host is not added to any host groups!" %}
{% endif %}
<div class="page-header"> <div class="page-header">
<h3>Add host group</h3> <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