Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing the edit security group rules form
bug 898862 Change-Id: I8273dee3d49d655073a7a0818150b1ba960bcca4
- Loading branch information
1 parent
56dd28b
commit 4a4c983
Showing
2 changed files
with
54 additions
and
52 deletions.
There are no files selected for viewing
94 changes: 48 additions & 46 deletions
94
...rizon/dashboards/nova/templates/nova/access_and_security/security_groups/_edit_rules.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,55 @@ | ||
{% extends "horizon/common/_modal_form.html" %} | ||
{% load i18n %} | ||
|
||
{% block form_id %}security_group_rule_form{% endblock %} | ||
{% block form_action %}{% url horizon:nova:access_and_security:security_groups:edit_rules security_group.id %}{% endblock %} | ||
|
||
{% block modal_id %}security_group_rule_modal{% endblock %} | ||
{% block modal-header %}Edit Security Group Rules{% endblock %} | ||
|
||
{% block modal-body %} | ||
<div class="left"> | ||
<fieldset> | ||
<h3>{% trans "Add a rule"%}</h3> | ||
{% include "horizon/common/_form_fields.html" %} | ||
</fieldset> | ||
</div> | ||
<div class="right"> | ||
<h3> {% trans "Rules for Security Group"%} '{{security_group.name}}'</h3> | ||
<table id="security_groups" class="zebra-striped"> | ||
<tr> | ||
<th>{% trans "IP Protocol"%}</th> | ||
<th>{% trans "From Port"%}</th> | ||
<th>{% trans "To Port"%}</th> | ||
<th>{% trans "CIDR"%}</th> | ||
<th>{% trans "Actions"%}</th> | ||
</tr> | ||
{% for rule in security_group.rules %} | ||
<tr class="{% cycle 'odd' 'even' %}"> | ||
<td>{{ rule.ip_protocol }}</td> | ||
<td>{{ rule.from_port }}</td> | ||
<td>{{ rule.to_port }}</td> | ||
<td>{{rule.ip_range.cidr}}</td> | ||
<td id="actions"> | ||
<ul> | ||
<li class="form">{% include "nova/access_and_security/security_groups/_delete_rule.html" with form=delete_form %}</li> | ||
</ul> | ||
</td> | ||
</tr> | ||
{% empty %} | ||
<tr> | ||
<td colspan="100%"> | ||
{% trans "No rules for this security group"%} | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</table> | ||
<div id="security_group_rule_modal" class="{% block modal_class %}modal{% if hide %} hide {% else %} static_page{% endif %}{% endblock %}"> | ||
<div class="modal-header"> | ||
{% if hide %}<a href="#" class="close">×</a>{% endif %} | ||
<h3>Edit Security Group Rules</h3> | ||
</div> | ||
<div class="modal-body clearfix"> | ||
<div class="right"> | ||
<h3> {% trans "Rules for Security Group" %} '{{security_group.name}}'</h3> | ||
<table id="security_groups" class="zebra-striped"> | ||
<tr> | ||
<th>{% trans "IP Protocol" %}</th> | ||
<th>{% trans "From Port" %}</th> | ||
<th>{% trans "To Port" %}</th> | ||
<th>{% trans "CIDR" %}</th> | ||
<th>{% trans "Actions" %}</th> | ||
</tr> | ||
{% for rule in security_group.rules %} | ||
<tr class="{% cycle 'odd' 'even' %}"> | ||
<td>{{ rule.ip_protocol }}</td> | ||
<td>{{ rule.from_port }}</td> | ||
<td>{{ rule.to_port }}</td> | ||
<td>{{ rule.ip_range.cidr }}</td> | ||
<td id="actions"> | ||
<ul> | ||
<li class="form">{% include "nova/access_and_security/security_groups/_delete_rule.html" with form=delete_form %}</li> | ||
</ul> | ||
</td> | ||
</tr> | ||
{% empty %} | ||
<tr> | ||
<td colspan="100%"> | ||
{% trans "No rules for this security group" %} | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</table> | ||
</div> | ||
<form id="edit_security_group_rule_form" action="{% url horizon:nova:access_and_security:security_groups:edit_rules security_group.id %}" method="post"> | ||
{% csrf_token %} | ||
<fieldset> | ||
{% include "horizon/common/_form_fields.html" %} | ||
</fieldset> | ||
</div> | ||
<div class="modal-footer"> | ||
<input class="btn primary pull-right" type="submit" value="{% trans "Add Rule" %}" /> | ||
<a href="{% url horizon:nova:access_and_security:index %}" class="btn secondary cancel close">Cancel</a> | ||
</div> | ||
</form> | ||
</div> | ||
{% endblock %} | ||
|
||
{% block modal-footer %} | ||
<input class="btn primary pull-right" type="submit" value="{%trans "Add Rule"%}" /> | ||
<a href="{% url horizon:nova:access_and_security:index %}" class="btn secondary cancel close">Cancel</a> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters