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();
if(group.length > 0) {
text = gettext('Are you sure you want to remove host group <strong>"%(group)s"</strong> from <strong>"%(host)s"</strong>?'); 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); 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,6 +28,7 @@ ...@@ -28,6 +28,7 @@
<div class="page-header"> <div class="page-header">
<h3>{% trans "Groups" %}</h3> <h3>{% trans "Groups" %}</h3>
</div> </div>
{% if group_rule_list|length > 0 %}
{% for group in group_rule_list %} {% for group in group_rule_list %}
<div> <div>
<h4 id="{{ group.pk }}_group_pk">{{ group.name }} <h4 id="{{ group.pk }}_group_pk">{{ group.name }}
...@@ -39,6 +40,9 @@ ...@@ -39,6 +40,9 @@
{% 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