Commit 8382230f by Kálmán Viktor

network: rule list to host group edit

parent c6cbc766
...@@ -15,5 +15,15 @@ ...@@ -15,5 +15,15 @@
<div class="col-sm-6"> <div class="col-sm-6">
{% crispy form %} {% crispy form %}
</div> </div>
<div class="col-sm-5 col-sm-offset-1">
<div class="page-header">
<h3>{% trans "Rules" %}</h3>
</div>
{% if rule_list.data.data.count > 0 %}
{% render_table rule_list %}
{% else %}
{% trans "No rules associated with this host group!" %}
{% endif %}
</div>
</div> </div>
{% endblock %} {% endblock %}
...@@ -243,6 +243,14 @@ class GroupDetail(UpdateView, SuccessMessageMixin): ...@@ -243,6 +243,14 @@ class GroupDetail(UpdateView, SuccessMessageMixin):
if 'pk' in self.kwargs: if 'pk' in self.kwargs:
return reverse_lazy('network.group', kwargs=self.kwargs) return reverse_lazy('network.group', kwargs=self.kwargs)
def get_context_data(self, *args, **kwargs):
context = super(GroupDetail, self).get_context_data(**kwargs)
# records
Please register or sign in to reply
q = Rule.objects.filter(hostgroup=self.object)
context['rule_list'] = SmallRuleTable(q)
return context
class GroupDelete(DeleteView): class GroupDelete(DeleteView):
model = Group model = Group
......
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