summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Lycka <marek.lycka@ultimum.io>2017-09-08 15:02:43 +0200
committerMarek Lycka <marek.lycka@ultimum.io>2017-09-17 13:26:27 +0200
commitf3048c76ec6a17e615b025189ef0393584a6c4c7 (patch)
tree9ed81240e5d20b7fa373022fb508b6d7335c795d
parentf14de1c22a1bf56618daa4d0b73caa0807022e73 (diff)
Removes and simplifies GBPUI templates
Removes unused templates and simplifies remaining templates and views by extracting common logic in the same way as the previous partial patch for this bug did. Change-Id: I832a7ab88e99103b9e6abdfd8be44fcd8bee1a11 Closes-Bug: 1710852 Co-Authored-By: viktor.krivak@ultimum.io
Notes
Notes (review): Code-Review+2: Thomas Bachman <bachman@noironetworks.com> Code-Review+2: Sumit Naiksatam <sumitnaiksatam@gmail.com> Workflow+1: Sumit Naiksatam <sumitnaiksatam@gmail.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Fri, 22 Sep 2017 18:21:53 +0000 Reviewed-on: https://review.openstack.org/502223 Project: openstack/group-based-policy-ui Branch: refs/heads/master
-rw-r--r--gbpui/common/forms.py7
-rw-r--r--gbpui/panels/application_policy/templates/application_policy/_add_policy_action.html25
-rw-r--r--gbpui/panels/application_policy/templates/application_policy/_add_policy_classifier.html30
-rw-r--r--gbpui/panels/application_policy/templates/application_policy/_policyaction_details.html2
-rw-r--r--gbpui/panels/application_policy/templates/application_policy/_update_policy_action.html25
-rw-r--r--gbpui/panels/application_policy/templates/application_policy/_update_policy_classifier.html29
-rw-r--r--gbpui/panels/application_policy/templates/application_policy/_update_policy_rule.html25
-rw-r--r--gbpui/panels/application_policy/templates/application_policy/_update_policy_rule_set.html26
-rw-r--r--gbpui/panels/application_policy/templates/application_policy/addpolicy_rule_set.html11
-rw-r--r--gbpui/panels/application_policy/templates/application_policy/addpolicyaction.html11
-rw-r--r--gbpui/panels/application_policy/templates/application_policy/addpolicyclassifier.html11
-rw-r--r--gbpui/panels/application_policy/templates/application_policy/addpolicyrule.html11
-rw-r--r--gbpui/panels/application_policy/templates/application_policy/details_tabs.html15
-rw-r--r--gbpui/panels/application_policy/views.py118
-rw-r--r--gbpui/panels/network_policy/templates/network_policy/_add_l2policy.html25
-rw-r--r--gbpui/panels/network_policy/templates/network_policy/_add_l3policy.html45
-rw-r--r--gbpui/panels/network_policy/templates/network_policy/_create_external_connectivity.html24
-rw-r--r--gbpui/panels/network_policy/templates/network_policy/_create_external_route_param.html24
-rw-r--r--gbpui/panels/network_policy/templates/network_policy/_create_external_segment_param.html24
-rw-r--r--gbpui/panels/network_policy/templates/network_policy/_create_nat_pool.html24
-rw-r--r--gbpui/panels/network_policy/templates/network_policy/_create_network_service_param.html24
-rw-r--r--gbpui/panels/network_policy/templates/network_policy/_create_service_policy.html25
-rw-r--r--gbpui/panels/network_policy/templates/network_policy/_update_external_connectivity.html25
-rw-r--r--gbpui/panels/network_policy/templates/network_policy/_update_l2policy.html25
-rw-r--r--gbpui/panels/network_policy/templates/network_policy/_update_l3policy.html44
-rw-r--r--gbpui/panels/network_policy/templates/network_policy/_update_nat_pool.html25
-rw-r--r--gbpui/panels/network_policy/templates/network_policy/_update_service_policy.html25
-rw-r--r--gbpui/panels/network_policy/templates/network_policy/details_tabs.html15
-rw-r--r--gbpui/panels/network_policy/views.py213
-rw-r--r--gbpui/panels/network_services/forms.py88
-rw-r--r--gbpui/panels/network_services/templates/network_services/_create_service_chain_instance.html25
-rw-r--r--gbpui/panels/network_services/templates/network_services/_create_service_chain_node.html26
-rw-r--r--gbpui/panels/network_services/templates/network_services/_create_service_profile.html26
-rw-r--r--gbpui/panels/network_services/templates/network_services/_scspec_details.html64
-rw-r--r--gbpui/panels/network_services/templates/network_services/_service_chain_spec_details.html0
-rw-r--r--gbpui/panels/network_services/templates/network_services/_update_service_chain_instance.html25
-rw-r--r--gbpui/panels/network_services/templates/network_services/_update_service_chain_node.html25
-rw-r--r--gbpui/panels/network_services/templates/network_services/details_tabs.html15
-rw-r--r--gbpui/panels/network_services/templates/network_services/index.html0
-rw-r--r--gbpui/panels/network_services/urls.py7
-rw-r--r--gbpui/panels/network_services/views.py91
-rw-r--r--gbpui/panels/policytargets/templates/policytargets/group_details.html11
-rw-r--r--gbpui/panels/policytargets/views.py67
-rw-r--r--gbpui/templates/gbpui/details_tabs.html (renamed from gbpui/panels/policytargets/templates/policytargets/details_tabs.html)2
44 files changed, 311 insertions, 1094 deletions
diff --git a/gbpui/common/forms.py b/gbpui/common/forms.py
index 09473a5..e99874f 100644
--- a/gbpui/common/forms.py
+++ b/gbpui/common/forms.py
@@ -31,3 +31,10 @@ class ReversingModalFormView(forms.ModalFormView):
31 submit_params = self.get_submit_url_params(**kwargs) 31 submit_params = self.get_submit_url_params(**kwargs)
32 submit_url = reverse(self.submit_url, kwargs=submit_params) 32 submit_url = reverse(self.submit_url, kwargs=submit_params)
33 return submit_url 33 return submit_url
34
35
36class HelpTextModalMixin(object):
37 def get_context_data(self, **kwargs):
38 context = super(HelpTextModalMixin, self).get_context_data(**kwargs)
39 context["help_text"] = self.help_text
40 return context
diff --git a/gbpui/panels/application_policy/templates/application_policy/_add_policy_action.html b/gbpui/panels/application_policy/templates/application_policy/_add_policy_action.html
deleted file mode 100644
index f07ae3d..0000000
--- a/gbpui/panels/application_policy/templates/application_policy/_add_policy_action.html
+++ /dev/null
@@ -1,25 +0,0 @@
1{% extends "horizon/common/_modal_form.html" %}
2{% load i18n %}
3{% load url from future %}
4
5{% block form_id %}add_policy_action_form{% endblock %}
6{% block form_action %}{% url "horizon:project:application_policy:addpolicyaction" %}{% endblock %}
7
8{% block modal_id %}add_policy_action_modal{% endblock %}
9{% block modal-header %}{% trans "Create Policy Action" %}{% endblock %}
10
11{% block modal-body %}
12<div class="left">
13 <fieldset>
14 {% include "horizon/common/_form_fields.html" %}
15 </fieldset>
16</div>
17<div class="right">
18 <h3>{% trans "Description" %}:</h3>
19</div>
20{% endblock %}
21
22{% block modal-footer %}
23 <input class="btn btn-primary pull-right" type="submit" value="{% trans "Create Policy Action" %}" />
24 <a href="{% url "horizon:project:application_policy:index" %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
25{% endblock %}
diff --git a/gbpui/panels/application_policy/templates/application_policy/_add_policy_classifier.html b/gbpui/panels/application_policy/templates/application_policy/_add_policy_classifier.html
deleted file mode 100644
index feedad6..0000000
--- a/gbpui/panels/application_policy/templates/application_policy/_add_policy_classifier.html
+++ /dev/null
@@ -1,30 +0,0 @@
1{% extends "horizon/common/_modal_form.html" %}
2{% load i18n %}
3{% load url from future %}
4
5{% block form_id %}add_policy_classifier_form{% endblock %}
6{% block form_action %}{% url "horizon:project:application_policy:addpolicyclassifier" %}{% endblock %}
7
8{% block modal_id %}add_policy_classifier_modal{% endblock %}
9{% block modal-header %}{% trans "Create Policy Classifier" %}{% endblock %}
10
11{% block modal-body %}
12<div class="left">
13 <fieldset>
14 {% include "horizon/common/_form_fields.html" %}
15 </fieldset>
16</div>
17<div class="right">
18 <h3>{% trans "Description" %}:</h3>
19</div>
20{% endblock %}
21
22{% block modal-footer %}
23 <input class="btn btn-primary pull-right" type="submit" value="{% trans "Create Policy Classifier" %}" />
24 <a href="{% url "horizon:project:application_policy:index" %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
25{% endblock %}
26
27
28{% block modal-js %}
29 <script src='{{ STATIC_URL }}dashboard/js/horizon.protocolmap.js' type="text/javascript"></script>
30{% endblock %}
diff --git a/gbpui/panels/application_policy/templates/application_policy/_policyaction_details.html b/gbpui/panels/application_policy/templates/application_policy/_policyaction_details.html
index da05417..e70d08f 100644
--- a/gbpui/panels/application_policy/templates/application_policy/_policyaction_details.html
+++ b/gbpui/panels/application_policy/templates/application_policy/_policyaction_details.html
@@ -16,7 +16,7 @@
16 <dt>{% trans "Project ID" %}</dt> 16 <dt>{% trans "Project ID" %}</dt>
17 <dd>{{ policyaction.tenant_id }}</dd> 17 <dd>{{ policyaction.tenant_id }}</dd>
18 18
19 <dt>{% trans "Action Value" %}</dt> 19 <dt>{% trans "Action Value" %}</dt>
20 <dd>{{ policyaction.action_value|default:_("-") }}</dd> 20 <dd>{{ policyaction.action_value|default:_("-") }}</dd>
21 21
22 <dt>{% trans "Action Type" %}</dt> 22 <dt>{% trans "Action Type" %}</dt>
diff --git a/gbpui/panels/application_policy/templates/application_policy/_update_policy_action.html b/gbpui/panels/application_policy/templates/application_policy/_update_policy_action.html
deleted file mode 100644
index ba299ef..0000000
--- a/gbpui/panels/application_policy/templates/application_policy/_update_policy_action.html
+++ /dev/null
@@ -1,25 +0,0 @@
1{% extends "horizon/common/_modal_form.html" %}
2{% load i18n %}
3{% load url from future %}
4
5{% block form_id %}update_policy_action_form{% endblock %}
6{% block form_action %}{% url "horizon:project:application_policy:updatepolicyaction" policyaction_id %}{% endblock %}
7
8{% block modal_id %}update_policy_action_modal{% endblock %}
9{% block modal-header %}{% trans "Edit Policy Action" %}{% endblock %}
10
11{% block modal-body %}
12<div class="left">
13 <fieldset>
14 {% include "horizon/common/_form_fields.html" %}
15 </fieldset>
16</div>
17<div class="right">
18 <h3>{% trans "Description" %}:</h3>
19</div>
20{% endblock %}
21
22{% block modal-footer %}
23 <input class="btn btn-primary pull-right" type="submit" value="{% trans "Update Policy Action" %}" />
24 <a href="{% url "horizon:project:application_policy:index" %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
25{% endblock %}
diff --git a/gbpui/panels/application_policy/templates/application_policy/_update_policy_classifier.html b/gbpui/panels/application_policy/templates/application_policy/_update_policy_classifier.html
deleted file mode 100644
index 8b6efad..0000000
--- a/gbpui/panels/application_policy/templates/application_policy/_update_policy_classifier.html
+++ /dev/null
@@ -1,29 +0,0 @@
1{% extends "horizon/common/_modal_form.html" %}
2{% load i18n %}
3{% load url from future %}
4
5{% block form_id %}update_policy_classifier_form{% endblock %}
6{% block form_action %}{% url "horizon:project:application_policy:updatepolicyclassifier" policyclassifier_id %}{% endblock %}
7
8{% block modal_id %}update_policy_classifier_modal{% endblock %}
9{% block modal-header %}{% trans "Edit Policy Classifier" %}{% endblock %}
10
11{% block modal-body %}
12<div class="left">
13 <fieldset>
14 {% include "horizon/common/_form_fields.html" %}
15 </fieldset>
16</div>
17<div class="right">
18 <h3>{% trans "Description" %}:</h3>
19</div>
20{% endblock %}
21
22{% block modal-footer %}
23 <input class="btn btn-primary pull-right" type="submit" value="{% trans "Update Policy Classifier" %}" />
24 <a href="{% url "horizon:project:application_policy:index" %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
25{% endblock %}
26
27{% block modal-js %}
28 <script src='{{ STATIC_URL }}dashboard/js/horizon.protocolmap.js' type="text/javascript"></script>
29{% endblock %}
diff --git a/gbpui/panels/application_policy/templates/application_policy/_update_policy_rule.html b/gbpui/panels/application_policy/templates/application_policy/_update_policy_rule.html
deleted file mode 100644
index 4756a68..0000000
--- a/gbpui/panels/application_policy/templates/application_policy/_update_policy_rule.html
+++ /dev/null
@@ -1,25 +0,0 @@
1{% extends "horizon/common/_modal_form.html" %}
2{% load i18n %}
3{% load url from future %}
4
5{% block form_id %}update_policy_rule_form{% endblock %}
6{% block form_action %}{% url "horizon:project:application_policy:updatepolicyrule" policyrule_id %}{% endblock %}
7
8{% block modal_id %}update_policy_rule_modal{% endblock %}
9{% block modal-header %}{% trans "Edit Policy Rule" %}{% endblock %}
10
11{% block modal-body %}
12<div class="left">
13 <fieldset>
14 {% include "horizon/common/_form_fields.html" %}
15 </fieldset>
16</div>
17<div class="right">
18 <h3>{% trans "Description" %}:</h3>
19</div>
20{% endblock %}
21
22{% block modal-footer %}
23 <input class="btn btn-primary pull-right" type="submit" value="{% trans "Update Policy Rule" %}" />
24 <a href="{% url "horizon:project:application_policy:index" %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
25{% endblock %}
diff --git a/gbpui/panels/application_policy/templates/application_policy/_update_policy_rule_set.html b/gbpui/panels/application_policy/templates/application_policy/_update_policy_rule_set.html
deleted file mode 100644
index 3a3e4cd..0000000
--- a/gbpui/panels/application_policy/templates/application_policy/_update_policy_rule_set.html
+++ /dev/null
@@ -1,26 +0,0 @@
1{% extends "horizon/common/_modal_form.html" %}
2{% load i18n %}
3{% load url from future %}
4
5{% block form_id %}update_policy_rule_set_form{% endblock %}
6{% block form_action %}{% url "horizon:project:application_policy:updatepolicy_rule_set" policy_rule_set_id %}{% endblock %}
7
8{% block modal_id %}update_policy_rule_set_modal{% endblock %}
9{% block modal-header %}{% trans "Edit Policy Rule Set" %}{% endblock %}
10
11{% block modal-body %}
12<div class="left">
13 <fieldset>
14 {% include "horizon/common/_form_fields.html" %}
15 </fieldset>
16</div>
17<div class="right">
18 <h3>{% trans "Description" %}:</h3>
19 <p>{% trans "Select one or multiple rules by pressing Ctrl" %}</p>
20</div>
21{% endblock %}
22
23{% block modal-footer %}
24 <input class="btn btn-primary pull-right" type="submit" value="{% trans "Update Policy Rule Set" %}" />
25 <a href="{% url "horizon:project:application_policy:index" %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
26{% endblock %}
diff --git a/gbpui/panels/application_policy/templates/application_policy/addpolicy_rule_set.html b/gbpui/panels/application_policy/templates/application_policy/addpolicy_rule_set.html
deleted file mode 100644
index b25277a..0000000
--- a/gbpui/panels/application_policy/templates/application_policy/addpolicy_rule_set.html
+++ /dev/null
@@ -1,11 +0,0 @@
1{% extends 'base.html' %}
2{% load i18n %}
3{% block title %}{% trans "Create Policy Rule Set" %}{% endblock %}
4
5{% block page_header %}
6 {% include "horizon/common/_page_header.html" with title=_("Create Policy Rule Set") %}
7{% endblock page_header %}
8
9{% block main %}
10 {% include 'horizon/common/_workflow.html' %}
11{% endblock %}
diff --git a/gbpui/panels/application_policy/templates/application_policy/addpolicyaction.html b/gbpui/panels/application_policy/templates/application_policy/addpolicyaction.html
deleted file mode 100644
index 2834cc1..0000000
--- a/gbpui/panels/application_policy/templates/application_policy/addpolicyaction.html
+++ /dev/null
@@ -1,11 +0,0 @@
1{% extends 'base.html' %}
2{% load i18n %}
3{% block title %}{% trans "Create New Action" %}{% endblock %}
4
5{% block page_header %}
6 {% include "horizon/common/_page_header.html" with title=_("Create New Action") %}
7{% endblock page_header %}
8
9{% block main %}
10 {% include 'horizon/common/_workflow.html' %}
11{% endblock %}
diff --git a/gbpui/panels/application_policy/templates/application_policy/addpolicyclassifier.html b/gbpui/panels/application_policy/templates/application_policy/addpolicyclassifier.html
deleted file mode 100644
index 4e7492c..0000000
--- a/gbpui/panels/application_policy/templates/application_policy/addpolicyclassifier.html
+++ /dev/null
@@ -1,11 +0,0 @@
1{% extends 'base.html' %}
2{% load i18n %}
3{% block title %}{% trans "Create New Classifier" %}{% endblock %}
4
5{% block page_header %}
6 {% include "horizon/common/_page_header.html" with title=_("Create New Classifier") %}
7{% endblock page_header %}
8
9{% block main %}
10 {% include 'horizon/common/_workflow.html' %}
11{% endblock %}
diff --git a/gbpui/panels/application_policy/templates/application_policy/addpolicyrule.html b/gbpui/panels/application_policy/templates/application_policy/addpolicyrule.html
deleted file mode 100644
index 23148c2..0000000
--- a/gbpui/panels/application_policy/templates/application_policy/addpolicyrule.html
+++ /dev/null
@@ -1,11 +0,0 @@
1{% extends 'base.html' %}
2{% load i18n %}
3{% block title %}{% trans "Create New Policy Rule Set" %}{% endblock %}
4
5{% block page_header %}
6 {% include "horizon/common/_page_header.html" with title=_("Create New Policy Rule Set") %}
7{% endblock page_header %}
8
9{% block main %}
10 {% include 'horizon/common/_workflow.html' %}
11{% endblock %}
diff --git a/gbpui/panels/application_policy/templates/application_policy/details_tabs.html b/gbpui/panels/application_policy/templates/application_policy/details_tabs.html
deleted file mode 100644
index 32a19a5..0000000
--- a/gbpui/panels/application_policy/templates/application_policy/details_tabs.html
+++ /dev/null
@@ -1,15 +0,0 @@
1{% extends 'base.html' %}
2{% load i18n %}
3{% block title %}{% trans "Application Policies" %}{% endblock %}
4
5{% block page_header %}
6 {% include "horizon/common/_page_header.html" with title=_("Application Policies") %}
7{% endblock page_header %}
8
9{% block main %}
10<div class="row">
11 <div class="col-sm-12">
12 {{ tab_group.render }}
13 </div>
14</div>
15{% endblock %}
diff --git a/gbpui/panels/application_policy/views.py b/gbpui/panels/application_policy/views.py
index 705de07..91f368d 100644
--- a/gbpui/panels/application_policy/views.py
+++ b/gbpui/panels/application_policy/views.py
@@ -11,7 +11,6 @@
11# under the License. 11# under the License.
12from django.core.urlresolvers import reverse 12from django.core.urlresolvers import reverse
13 13
14from horizon import forms
15from horizon import tabs 14from horizon import tabs
16from horizon import workflows 15from horizon import workflows
17 16
@@ -19,6 +18,9 @@ import forms as policy_rule_set_forms
19import tabs as policy_rule_set_tabs 18import tabs as policy_rule_set_tabs
20import workflows as policy_rule_set_workflows 19import workflows as policy_rule_set_workflows
21 20
21from django.utils.translation import ugettext_lazy as _
22from gbpui.common import forms as gbforms
23
22PolicyRuleSetTabs = policy_rule_set_tabs.ApplicationPoliciesTabs 24PolicyRuleSetTabs = policy_rule_set_tabs.ApplicationPoliciesTabs
23PolicyRuleSetDetailsTabs = policy_rule_set_tabs.PolicyRuleSetDetailsTabs 25PolicyRuleSetDetailsTabs = policy_rule_set_tabs.PolicyRuleSetDetailsTabs
24PolicyRuleDetailsTabs = policy_rule_set_tabs.PolicyRuleDetailsTabs 26PolicyRuleDetailsTabs = policy_rule_set_tabs.PolicyRuleDetailsTabs
@@ -31,26 +33,26 @@ AddPolicyClassifier = policy_rule_set_workflows.AddPolicyClassifier
31 33
32class IndexView(tabs.TabbedTableView): 34class IndexView(tabs.TabbedTableView):
33 tab_group_class = (PolicyRuleSetTabs) 35 tab_group_class = (PolicyRuleSetTabs)
34 template_name = 'project/application_policy/details_tabs.html' 36 template_name = "gbpui/details_tabs.html"
37 page_title = _("Application Policies")
35 38
36 39
37class AddPolicyRuleSetView(workflows.WorkflowView): 40class AddPolicyRuleSetView(workflows.WorkflowView):
38 workflow_class = AddPolicyRuleSet 41 workflow_class = AddPolicyRuleSet
39 template_name = "project/application_policy/addpolicy_rule_set.html"
40
41 def get_object_id(self, policy_rule_set):
42 return [policy_rule_set.id]
43 42
44 43
45class UpdatePolicyRuleSetView(forms.ModalFormView): 44class UpdatePolicyRuleSetView(gbforms.HelpTextModalMixin,
45 gbforms.ReversingModalFormView):
46 form_class = policy_rule_set_forms.UpdatePolicyRuleSetForm 46 form_class = policy_rule_set_forms.UpdatePolicyRuleSetForm
47 template_name = 'project/application_policy/update_policy_rule_set.html' 47 modal_header = _("Edit Policy Rule Set")
48 submit_label = _("Update Policy Rule Set")
49 submit_url = "horizon:project:application_policy:updatepolicy_rule_set"
50 template_name = "gbpui/form_with_description.html"
51 page_title = _("Update Rule Set")
52 help_text = _("Update Rule Set.")
48 53
49 def get_context_data(self, **kwargs): 54 def get_submit_url_params(self, **kwargs):
50 context = super( 55 return {"policy_rule_set_id": self.kwargs['policy_rule_set_id']}
51 UpdatePolicyRuleSetView, self).get_context_data(**kwargs)
52 context['policy_rule_set_id'] = self.kwargs['policy_rule_set_id']
53 return context
54 56
55 def get_initial(self): 57 def get_initial(self):
56 return {'policy_rule_set_id': self.kwargs['policy_rule_set_id']} 58 return {'policy_rule_set_id': self.kwargs['policy_rule_set_id']}
@@ -58,15 +60,17 @@ class UpdatePolicyRuleSetView(forms.ModalFormView):
58 60
59class AddPolicyRuleView(workflows.WorkflowView): 61class AddPolicyRuleView(workflows.WorkflowView):
60 workflow_class = AddPolicyRule 62 workflow_class = AddPolicyRule
61 template_name = "project/application_policy/addpolicyrule.html"
62
63 def get_object_id(self, rule):
64 return [rule.id]
65 63
66 64
67class AddPolicyClassifierView(forms.ModalFormView): 65class AddPolicyClassifierView(gbforms.HelpTextModalMixin,
66 gbforms.ReversingModalFormView):
68 form_class = policy_rule_set_forms.AddPolicyClassifierForm 67 form_class = policy_rule_set_forms.AddPolicyClassifierForm
69 template_name = "project/application_policy/add_policy_classifier.html" 68 template_name = "gbpui/form_with_description.html"
69 submit_url = "horizon:project:application_policy:addpolicyclassifier"
70 modal_header = _("Create Policy Classifier")
71 page_title = _("Create Policy Classifier")
72 help_text = _("Create Policy Classifier.")
73 submit_label = _("Save Changes")
70 74
71 def get_success_url(self): 75 def get_success_url(self):
72 return reverse('horizon:project:application_policy:index') 76 return reverse('horizon:project:application_policy:index')
@@ -75,26 +79,32 @@ class AddPolicyClassifierView(forms.ModalFormView):
75 return [classifier.id] 79 return [classifier.id]
76 80
77 81
78class AddPolicyActionView(forms.ModalFormView): 82class AddPolicyActionView(gbforms.HelpTextModalMixin,
83 gbforms.ReversingModalFormView):
79 form_class = policy_rule_set_forms.AddPolicyActionForm 84 form_class = policy_rule_set_forms.AddPolicyActionForm
80 template_name = "project/application_policy/add_policy_action.html" 85 template_name = "gbpui/form_with_description.html"
86 submit_url = "horizon:project:application_policy:addpolicyaction"
87 modal_header = _("Create Policy Action")
88 page_title = _("Create Policy Action")
89 submit_label = _("Create")
90 help_text = _("Create Policy Action.")
81 91
82 def get_success_url(self): 92 def get_success_url(self):
83 return reverse('horizon:project:application_policy:index') 93 return reverse('horizon:project:application_policy:index')
84 94
85 def get_object_id(self, policyaction):
86 return [policyaction.id]
87 95
88 96class UpdatePolicyActionView(gbforms.HelpTextModalMixin,
89class UpdatePolicyActionView(forms.ModalFormView): 97 gbforms.ReversingModalFormView):
90 form_class = policy_rule_set_forms.UpdatePolicyActionForm 98 form_class = policy_rule_set_forms.UpdatePolicyActionForm
91 template_name = "project/application_policy/update_policy_action.html" 99 template_name = "gbpui/form_with_description.html"
100 submit_url = "horizon:project:application_policy:updatepolicyaction"
101 modal_header = _("Edit Policy Action")
102 page_title = _("Edit Policy Action")
103 submit_label = _("Save Changes")
104 help_text = _("Edit Policy Action.")
92 105
93 def get_context_data(self, **kwargs): 106 def get_submit_url_params(self, **kwargs):
94 context = super( 107 return {"policyaction_id": self.kwargs['policyaction_id']}
95 UpdatePolicyActionView, self).get_context_data(**kwargs)
96 context['policyaction_id'] = self.kwargs['policyaction_id']
97 return context
98 108
99 def get_initial(self): 109 def get_initial(self):
100 return {'policyaction_id': self.kwargs['policyaction_id']} 110 return {'policyaction_id': self.kwargs['policyaction_id']}
@@ -102,22 +112,29 @@ class UpdatePolicyActionView(forms.ModalFormView):
102 112
103class PolicyRuleSetDetailsView(tabs.TabView): 113class PolicyRuleSetDetailsView(tabs.TabView):
104 tab_group_class = (PolicyRuleSetDetailsTabs) 114 tab_group_class = (PolicyRuleSetDetailsTabs)
105 template_name = 'project/application_policy/details_tabs.html' 115 template_name = 'gbpui/details_tabs.html'
116 page_title = _("Policy Rule Set Details")
106 117
107 118
108class PolicyRuleDetailsView(tabs.TabView): 119class PolicyRuleDetailsView(tabs.TabView):
109 tab_group_class = (PolicyRuleDetailsTabs) 120 tab_group_class = (PolicyRuleDetailsTabs)
110 template_name = 'project/application_policy/details_tabs.html' 121 template_name = 'gbpui/details_tabs.html'
122 page_title = _("Policy Rule Details")
111 123
112 124
113class UpdatePolicyRuleView(forms.ModalFormView): 125class UpdatePolicyRuleView(gbforms.HelpTextModalMixin,
126 gbforms.ReversingModalFormView):
114 form_class = policy_rule_set_forms.UpdatePolicyRuleForm 127 form_class = policy_rule_set_forms.UpdatePolicyRuleForm
115 template_name = "project/application_policy/update_policy_rule.html"
116 128
117 def get_context_data(self, **kwargs): 129 modal_header = _("Edit Policy Rule")
118 context = super(UpdatePolicyRuleView, self).get_context_data(**kwargs) 130 submit_label = _("Update Policy Rule")
119 context['policyrule_id'] = self.kwargs['policyrule_id'] 131 submit_url = "horizon:project:application_policy:updatepolicyrule"
120 return context 132 template_name = "gbpui/form_with_description.html"
133 page_title = _("Edit Policy Rule")
134 help_text = _("Edit Policy Rule.")
135
136 def get_submit_url_params(self, **kwargs):
137 return {"policyrule_id": self.kwargs['policyrule_id']}
121 138
122 def get_initial(self): 139 def get_initial(self):
123 return {'policyrule_id': self.kwargs['policyrule_id']} 140 return {'policyrule_id': self.kwargs['policyrule_id']}
@@ -125,18 +142,22 @@ class UpdatePolicyRuleView(forms.ModalFormView):
125 142
126class PolicyClassifierDetailsView(tabs.TabView): 143class PolicyClassifierDetailsView(tabs.TabView):
127 tab_group_class = (PolicyClassifierDetailsTabs) 144 tab_group_class = (PolicyClassifierDetailsTabs)
128 template_name = 'project/application_policy/details_tabs.html' 145 template_name = "gbpui/details_tabs.html"
146 page_title = _("Policy Classifier Details")
129 147
130 148
131class UpdatePolicyClassifierView(forms.ModalFormView): 149class UpdatePolicyClassifierView(gbforms.HelpTextModalMixin,
150 gbforms.ReversingModalFormView):
132 form_class = policy_rule_set_forms.UpdatePolicyClassifierForm 151 form_class = policy_rule_set_forms.UpdatePolicyClassifierForm
133 template_name = "project/application_policy/update_policy_classifier.html" 152 modal_header = _("Edit Policy Classifier")
153 submit_label = _("Update Policy Classifier")
154 submit_url = "horizon:project:application_policy:updatepolicyclassifier"
155 template_name = "gbpui/form_with_description.html"
156 page_title = _("Edit Policy Classifier")
157 help_text = _("Edit Policy Classifier.")
134 158
135 def get_context_data(self, **kwargs): 159 def get_submit_url_params(self, **kwargs):
136 context = super( 160 return {"policyclassifier_id": self.kwargs['policyclassifier_id']}
137 UpdatePolicyClassifierView, self).get_context_data(**kwargs)
138 context['policyclassifier_id'] = self.kwargs['policyclassifier_id']
139 return context
140 161
141 def get_initial(self): 162 def get_initial(self):
142 return {'policyclassifier_id': self.kwargs['policyclassifier_id']} 163 return {'policyclassifier_id': self.kwargs['policyclassifier_id']}
@@ -144,4 +165,5 @@ class UpdatePolicyClassifierView(forms.ModalFormView):
144 165
145class PolicyActionDetailsView(tabs.TabView): 166class PolicyActionDetailsView(tabs.TabView):
146 tab_group_class = (PolicyActionDetailsTabs) 167 tab_group_class = (PolicyActionDetailsTabs)
147 template_name = 'project/application_policy/details_tabs.html' 168 template_name = "gbpui/details_tabs.html"
169 page_title = _("Policy Action Details")
diff --git a/gbpui/panels/network_policy/templates/network_policy/_add_l2policy.html b/gbpui/panels/network_policy/templates/network_policy/_add_l2policy.html
deleted file mode 100644
index b678145..0000000
--- a/gbpui/panels/network_policy/templates/network_policy/_add_l2policy.html
+++ /dev/null
@@ -1,25 +0,0 @@
1{% extends "horizon/common/_modal_form.html" %}
2{% load i18n %}
3{% load url from future %}
4
5{% block form_id %}add_l2policy_form{% endblock %}
6{% block form_action %}{% url 'horizon:project:network_policy:addl2policy' %}{% endblock %}
7
8{% block modal-header %}{% trans "Add L2Policy" %}{% endblock %}
9
10{% block modal-body %}
11<div class="left">
12 <fieldset>
13 {% include "horizon/common/_form_fields.html" %}
14 </fieldset>
15</div>
16<div class="right">
17 <h3>{% trans "Description:" %}</h3>
18 <p>{% trans "Add L2 Policy." %}</p>
19</div>
20{% endblock %}
21
22{% block modal-footer %}
23 <input class="btn btn-primary pull-right" type="submit" value="{% trans "Save Changes" %}" />
24 <a href="{% url 'horizon:project:network_policy:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
25{% endblock %}
diff --git a/gbpui/panels/network_policy/templates/network_policy/_add_l3policy.html b/gbpui/panels/network_policy/templates/network_policy/_add_l3policy.html
deleted file mode 100644
index 7a08de4..0000000
--- a/gbpui/panels/network_policy/templates/network_policy/_add_l3policy.html
+++ /dev/null
@@ -1,45 +0,0 @@
1{% extends "horizon/common/_modal_form.html" %}
2{% load i18n %}
3{% load url from future %}
4
5{% block form_id %}add_l3policy_form{% endblock %}
6{% block form_action %}{% url 'horizon:project:network_policy:addl3policy' %}{% endblock %}
7
8{% block modal-header %}{% trans "Add L3Policy" %}{% endblock %}
9
10{% block modal-body %}
11<div class="left">
12 <fieldset>
13 {% include "horizon/common/_form_fields.html" %}
14 </fieldset>
15</div>
16<div class="right">
17 <h3>{% trans "Description:" %}</h3>
18 <p>{% trans "Add L3 Policy." %}</p>
19</div>
20{% endblock %}
21
22
23{% block modal-js %}
24<script>
25 $(function(){
26 if($('#id_external_segments>option:selected').val() == ''){
27 $('#id_segment_ip').parent().parent().hide();
28 }
29 $('#id_external_segments').on('change',function(){
30 if($('#id_external_segments>option:selected').val() == ''){
31 $('#id_segment_ip').parent().parent().hide();
32 }else{
33 $('#id_segment_ip').parent().parent().show();
34 }
35 });
36});
37</script>
38{% endblock %}
39
40
41
42{% block modal-footer %}
43 <input class="btn btn-primary pull-right" type="submit" value="{% trans "Save Changes" %}" />
44 <a href="{% url 'horizon:project:network_policy:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
45{% endblock %}
diff --git a/gbpui/panels/network_policy/templates/network_policy/_create_external_connectivity.html b/gbpui/panels/network_policy/templates/network_policy/_create_external_connectivity.html
deleted file mode 100644
index f36e8d7..0000000
--- a/gbpui/panels/network_policy/templates/network_policy/_create_external_connectivity.html
+++ /dev/null
@@ -1,24 +0,0 @@
1{% extends "horizon/common/_modal_form.html" %}
2{% load i18n %}
3{% load url from future %}
4
5{% block form_id %}create_external_connectivity{% endblock %}
6{% block form_action %}{% url 'horizon:project:network_policy:create_external_connectivity' %}{% endblock %}
7
8{% block modal-header %}{% trans "Create External Connectivity" %}{% endblock %}
9
10{% block modal-body %}
11<div class="left">
12 <fieldset>
13 {% include "horizon/common/_form_fields.html" %}
14 </fieldset>
15</div>
16<div class="right">
17 <h3>{% trans "Description:" %}</h3>
18</div>
19{% endblock %}
20
21{% block modal-footer %}
22 <input class="btn btn-primary pull-right" type="submit" value="{% trans "Create" %}" />
23 <a href="{% url 'horizon:project:network_policy:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
24{% endblock %}
diff --git a/gbpui/panels/network_policy/templates/network_policy/_create_external_route_param.html b/gbpui/panels/network_policy/templates/network_policy/_create_external_route_param.html
deleted file mode 100644
index 5704638..0000000
--- a/gbpui/panels/network_policy/templates/network_policy/_create_external_route_param.html
+++ /dev/null
@@ -1,24 +0,0 @@
1{% extends "horizon/common/_modal_form.html" %}
2{% load i18n %}
3{% load url from future %}
4
5{% block form_id %}add_external_route_param_form{% endblock %}
6{% block form_action %}{% url 'horizon:project:network_policy:add_external_route_param' %}{% endblock %}
7
8{% block modal-header %}{% trans "Add External Route Parameter" %}{% endblock %}
9
10{% block modal-body %}
11<div class="left">
12 <fieldset>
13 {% include "horizon/common/_form_fields.html" %}
14 </fieldset>
15</div>
16<div class="right">
17 <h3>{% trans "Description:" %}</h3>
18</div>
19{% endblock %}
20
21{% block modal-footer %}
22 <input class="btn btn-primary pull-right" type="submit" value="{% trans "Create" %}" />
23 <a href="{% url 'horizon:project:network_policy:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
24{% endblock %}
diff --git a/gbpui/panels/network_policy/templates/network_policy/_create_external_segment_param.html b/gbpui/panels/network_policy/templates/network_policy/_create_external_segment_param.html
deleted file mode 100644
index 695db2c..0000000
--- a/gbpui/panels/network_policy/templates/network_policy/_create_external_segment_param.html
+++ /dev/null
@@ -1,24 +0,0 @@
1{% extends "horizon/common/_modal_form.html" %}
2{% load i18n %}
3{% load url from future %}
4
5{% block form_id %}add_external_segment_param_form{% endblock %}
6{% block form_action %}{% url 'horizon:project:network_policy:add_external_segment_param' %}{% endblock %}
7
8{% block modal-header %}{% trans "Add External Segment Parameter" %}{% endblock %}
9
10{% block modal-body %}
11<div class="left">
12 <fieldset>
13 {% include "horizon/common/_form_fields.html" %}
14 </fieldset>
15</div>
16<div class="right">
17 <h3>{% trans "Description:" %}</h3>
18</div>
19{% endblock %}
20
21{% block modal-footer %}
22 <input class="btn btn-primary pull-right" type="submit" value="{% trans "Create" %}" />
23 <a href="{% url 'horizon:project:network_policy:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
24{% endblock %}
diff --git a/gbpui/panels/network_policy/templates/network_policy/_create_nat_pool.html b/gbpui/panels/network_policy/templates/network_policy/_create_nat_pool.html
deleted file mode 100644
index 3087b2b..0000000
--- a/gbpui/panels/network_policy/templates/network_policy/_create_nat_pool.html
+++ /dev/null
@@ -1,24 +0,0 @@
1{% extends "horizon/common/_modal_form.html" %}
2{% load i18n %}
3{% load url from future %}
4
5{% block form_id %}create_nat_pool{% endblock %}
6{% block form_action %}{% url 'horizon:project:network_policy:create_nat_pool' %}{% endblock %}
7
8{% block modal-header %}{% trans "Create NAT Pool" %}{% endblock %}
9
10{% block modal-body %}
11<div class="left">
12 <fieldset>
13 {% include "horizon/common/_form_fields.html" %}
14 </fieldset>
15</div>
16<div class="right">
17 <h3>{% trans "Description:" %}</h3>
18</div>
19{% endblock %}
20
21{% block modal-footer %}
22 <input class="btn btn-primary pull-right" type="submit" value="{% trans "Create" %}" />
23 <a href="{% url 'horizon:project:network_policy:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
24{% endblock %}
diff --git a/gbpui/panels/network_policy/templates/network_policy/_create_network_service_param.html b/gbpui/panels/network_policy/templates/network_policy/_create_network_service_param.html
deleted file mode 100644
index 72b0af7..0000000
--- a/gbpui/panels/network_policy/templates/network_policy/_create_network_service_param.html
+++ /dev/null
@@ -1,24 +0,0 @@
1{% extends "horizon/common/_modal_form.html" %}
2{% load i18n %}
3{% load url from future %}
4
5{% block form_id %}add_network_service_param_form{% endblock %}
6{% block form_action %}{% url 'horizon:project:network_policy:add_network_service_param' %}{% endblock %}
7
8{% block modal-header %}{% trans "Add Network Service Parameter" %}{% endblock %}
9
10{% block modal-body %}
11<div class="left">
12 <fieldset>
13 {% include "horizon/common/_form_fields.html" %}
14 </fieldset>
15</div>
16<div class="right">
17 <h3>{% trans "Description:" %}</h3>
18</div>
19{% endblock %}
20
21{% block modal-footer %}
22 <input class="btn btn-primary pull-right" type="submit" value="{% trans "Create" %}" />
23 <a href="{% url 'horizon:project:network_policy:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
24{% endblock %}
diff --git a/gbpui/panels/network_policy/templates/network_policy/_create_service_policy.html b/gbpui/panels/network_policy/templates/network_policy/_create_service_policy.html
deleted file mode 100644
index 97dea73..0000000
--- a/gbpui/panels/network_policy/templates/network_policy/_create_service_policy.html
+++ /dev/null
@@ -1,25 +0,0 @@
1{% extends "horizon/common/_modal_form.html" %}
2{% load i18n %}
3{% load url from future %}
4
5{% block form_id %}create_service_policy_form{% endblock %}
6{% block form_action %}{% url 'horizon:project:network_policy:create_servicepolicy' %}{% endblock %}
7
8{% block modal-header %}{% trans "Create Service Policy" %}{% endblock %}
9
10{% block modal-body %}
11<div class="left">
12 <fieldset>
13 {% include "horizon/common/_form_fields.html" %}
14 </fieldset>
15</div>
16<div class="right">
17 <h3>{% trans "Description:" %}</h3>
18 <p>{% trans "Create Service Policy." %}</p>
19</div>
20{% endblock %}
21
22{% block modal-footer %}
23 <input class="btn btn-primary pull-right" type="submit" value="{% trans "Create" %}" />
24 <a href="{% url 'horizon:project:network_policy:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
25{% endblock %}
diff --git a/gbpui/panels/network_policy/templates/network_policy/_update_external_connectivity.html b/gbpui/panels/network_policy/templates/network_policy/_update_external_connectivity.html
deleted file mode 100644
index cca6285..0000000
--- a/gbpui/panels/network_policy/templates/network_policy/_update_external_connectivity.html
+++ /dev/null
@@ -1,25 +0,0 @@
1{% extends "horizon/common/_modal_form.html" %}
2{% load i18n %}
3{% load url from future %}
4
5{% block form_id %}update_external_connectivity_form{% endblock %}
6{% block form_action %}{% url 'horizon:project:network_policy:update_externalconnectivity' external_connectivity_id %}{% endblock %}
7
8{% block modal-header %}{% trans "Update External Connectivity" %}{% endblock %}
9
10{% block modal-body %}
11<div class="left">
12 <fieldset>
13 {% include "horizon/common/_form_fields.html" %}
14 </fieldset>
15</div>
16<div class="right">
17 <h3>{% trans "Description:" %}</h3>
18 <p>{% trans "Update Service Policy." %}</p>
19</div>
20{% endblock %}
21
22{% block modal-footer %}
23 <input class="btn btn-primary pull-right" type="submit" value="{% trans "Update" %}" />
24 <a href="{% url 'horizon:project:network_policy:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
25{% endblock %}
diff --git a/gbpui/panels/network_policy/templates/network_policy/_update_l2policy.html b/gbpui/panels/network_policy/templates/network_policy/_update_l2policy.html
deleted file mode 100644
index b25f862..0000000
--- a/gbpui/panels/network_policy/templates/network_policy/_update_l2policy.html
+++ /dev/null
@@ -1,25 +0,0 @@
1{% extends "horizon/common/_modal_form.html" %}
2{% load i18n %}
3{% load url from future %}
4
5{% block form_id %}update_l2policy_form{% endblock %}
6{% block form_action %}{% url 'horizon:project:network_policy:update_l2policy' l2policy_id %}{% endblock %}
7
8{% block modal-header %}{% trans "Update L2Policy" %}{% endblock %}
9
10{% block modal-body %}
11<div class="left">
12 <fieldset>
13 {% include "horizon/common/_form_fields.html" %}
14 </fieldset>
15</div>
16<div class="right">
17 <h3>{% trans "Description:" %}</h3>
18 <p>{% trans "Update L2 Policy." %}</p>
19</div>
20{% endblock %}
21
22{% block modal-footer %}
23 <input class="btn btn-primary pull-right" type="submit" value="{% trans "Save Changes" %}" />
24 <a href="{% url 'horizon:project:network_policy:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
25{% endblock %}
diff --git a/gbpui/panels/network_policy/templates/network_policy/_update_l3policy.html b/gbpui/panels/network_policy/templates/network_policy/_update_l3policy.html
deleted file mode 100644
index 927464c..0000000
--- a/gbpui/panels/network_policy/templates/network_policy/_update_l3policy.html
+++ /dev/null
@@ -1,44 +0,0 @@
1{% extends "horizon/common/_modal_form.html" %}
2{% load i18n %}
3{% load url from future %}
4
5{% block form_id %}update_l3policy_form{% endblock %}
6{% block form_action %}{% url 'horizon:project:network_policy:update_l3policy' l3policy_id %}{% endblock %}
7
8{% block modal-header %}{% trans "Update L3Policy" %}{% endblock %}
9
10{% block modal-body %}
11<div class="left">
12 <fieldset>
13 {% include "horizon/common/_form_fields.html" %}
14 </fieldset>
15</div>
16<div class="right">
17 <h3>{% trans "Description:" %}</h3>
18 <p>{% trans "Update L3 Policy." %}</p>
19</div>
20{% endblock %}
21
22
23{% block modal-js %}
24<script>
25 $(function(){
26 if($('#id_external_segments>option:selected').val() == ''){
27 $('#id_segment_ip').parent().parent().hide();
28 }
29 $('#id_external_segments').on('change',function(){
30 if($('#id_external_segments>option:selected').val() == ''){
31 $('#id_segment_ip').parent().parent().hide();
32 }else{
33 $('#id_segment_ip').parent().parent().show();
34 }
35 });
36});
37</script>
38{% endblock %}
39
40
41{% block modal-footer %}
42 <input class="btn btn-primary pull-right" type="submit" value="{% trans "Save Changes" %}" />
43 <a href="{% url 'horizon:project:network_policy:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
44{% endblock %}
diff --git a/gbpui/panels/network_policy/templates/network_policy/_update_nat_pool.html b/gbpui/panels/network_policy/templates/network_policy/_update_nat_pool.html
deleted file mode 100644
index d803ce6..0000000
--- a/gbpui/panels/network_policy/templates/network_policy/_update_nat_pool.html
+++ /dev/null
@@ -1,25 +0,0 @@
1{% extends "horizon/common/_modal_form.html" %}
2{% load i18n %}
3{% load url from future %}
4
5{% block form_id %}update_nat_pool_form{% endblock %}
6{% block form_action %}{% url 'horizon:project:network_policy:update_natpool' nat_pool_id %}{% endblock %}
7
8{% block modal-header %}{% trans "Update NAT Pool" %}{% endblock %}
9
10{% block modal-body %}
11<div class="left">
12 <fieldset>
13 {% include "horizon/common/_form_fields.html" %}
14 </fieldset>
15</div>
16<div class="right">
17 <h3>{% trans "Description:" %}</h3>
18 <p>{% trans "Update NAT Pool." %}</p>
19</div>
20{% endblock %}
21
22{% block modal-footer %}
23 <input class="btn btn-primary pull-right" type="submit" value="{% trans "Update" %}" />
24 <a href="{% url 'horizon:project:network_policy:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
25{% endblock %}
diff --git a/gbpui/panels/network_policy/templates/network_policy/_update_service_policy.html b/gbpui/panels/network_policy/templates/network_policy/_update_service_policy.html
deleted file mode 100644
index 1156b27..0000000
--- a/gbpui/panels/network_policy/templates/network_policy/_update_service_policy.html
+++ /dev/null
@@ -1,25 +0,0 @@
1{% extends "horizon/common/_modal_form.html" %}
2{% load i18n %}
3{% load url from future %}
4
5{% block form_id %}update_service_policy_form{% endblock %}
6{% block form_action %}{% url 'horizon:project:network_policy:update_service_policy' service_policy_id %}{% endblock %}
7
8{% block modal-header %}{% trans "Update Service Policy" %}{% endblock %}
9
10{% block modal-body %}
11<div class="left">
12 <fieldset>
13 {% include "horizon/common/_form_fields.html" %}
14 </fieldset>
15</div>
16<div class="right">
17 <h3>{% trans "Description:" %}</h3>
18 <p>{% trans "Update Service Policy." %}</p>
19</div>
20{% endblock %}
21
22{% block modal-footer %}
23 <input class="btn btn-primary pull-right" type="submit" value="{% trans "Update" %}" />
24 <a href="{% url 'horizon:project:network_policy:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
25{% endblock %}
diff --git a/gbpui/panels/network_policy/templates/network_policy/details_tabs.html b/gbpui/panels/network_policy/templates/network_policy/details_tabs.html
deleted file mode 100644
index db9d52c..0000000
--- a/gbpui/panels/network_policy/templates/network_policy/details_tabs.html
+++ /dev/null
@@ -1,15 +0,0 @@
1{% extends 'base.html' %}
2{% load i18n %}
3{% block title %}{% trans "Network and Services' Policies" %}{% endblock %}
4
5{% block page_header %}
6{% include "horizon/common/_page_header.html" with title=_("Network and Services' Policies") %}
7{% endblock page_header %}
8
9{% block main %}
10<div class="row">
11 <div class="col-sm-12">
12 {{ tab_group.render }}
13 </div>
14</div>
15{% endblock %}
diff --git a/gbpui/panels/network_policy/views.py b/gbpui/panels/network_policy/views.py
index ef87c4a..14a7f66 100644
--- a/gbpui/panels/network_policy/views.py
+++ b/gbpui/panels/network_policy/views.py
@@ -13,11 +13,11 @@ from django.core.urlresolvers import reverse
13from django.utils.translation import ugettext_lazy as _ 13from django.utils.translation import ugettext_lazy as _
14 14
15from horizon import exceptions 15from horizon import exceptions
16from horizon import forms
17from horizon import tables 16from horizon import tables
18from horizon import tabs 17from horizon import tabs
19 18
20from gbpui import client 19from gbpui import client
20from gbpui.common import forms as gbforms
21 21
22import forms as np_forms 22import forms as np_forms
23import tables as np_tables 23import tables as np_tables
@@ -26,29 +26,37 @@ import tabs as np_tabs
26 26
27class IndexView(tabs.TabbedTableView): 27class IndexView(tabs.TabbedTableView):
28 tab_group_class = (np_tabs.L3PolicyTabs) 28 tab_group_class = (np_tabs.L3PolicyTabs)
29 template_name = 'project/network_policy/details_tabs.html' 29 template_name = "gbpui/details_tabs.html"
30 page_title = _("Network and Services' Policies")
30 31
31 32
32class AddL3policyView(forms.ModalFormView): 33class AddL3policyView(gbforms.HelpTextModalMixin,
34 gbforms.ReversingModalFormView):
33 form_class = np_forms.AddL3PolicyForm 35 form_class = np_forms.AddL3PolicyForm
34 template_name = "project/network_policy/add_l3policy.html"
35 36
36 def get_context_data(self, **kwargs): 37 template_name = "gbpui/form_with_description.html"
37 context = super(AddL3policyView, self).get_context_data(**kwargs) 38 submit_url = "horizon:project:network_policy:addl3policy"
38 return context 39 modal_header = _("Add L3Policy")
40 submit_label = _("Create")
41 page_title = _("Add L3Policy")
42 help_text = _("Add L3 Policy.")
39 43
40 def get_initial(self): 44 def get_initial(self):
41 return self.kwargs 45 return self.kwargs
42 46
43 47
44class L3PolicyUpdateView(forms.ModalFormView): 48class L3PolicyUpdateView(gbforms.HelpTextModalMixin,
49 gbforms.ReversingModalFormView):
45 form_class = np_forms.UpdateL3PolicyForm 50 form_class = np_forms.UpdateL3PolicyForm
46 template_name = "project/network_policy/update_l3policy.html" 51 template_name = "gbpui/form_with_description.html"
52 submit_url = "horizon:project:network_policy:update_l3policy"
53 modal_header = _("Update L3Policy")
54 submit_label = _("Save Changes")
55 page_title = _("Update L3Policy")
56 help_text = _("Update L3Policy.")
47 57
48 def get_context_data(self, **kwargs): 58 def get_submit_url_params(self, **kwargs):
49 context = super(L3PolicyUpdateView, self).get_context_data(**kwargs) 59 return {"l3policy_id": self.kwargs["l3policy_id"]}
50 context['l3policy_id'] = self.kwargs['l3policy_id']
51 return context
52 60
53 def get_initial(self): 61 def get_initial(self):
54 return self.kwargs 62 return self.kwargs
@@ -76,26 +84,29 @@ class L3PolicyDetailsView(tables.MultiTableView):
76 return context 84 return context
77 85
78 86
79class AddL2policyView(forms.ModalFormView): 87class AddL2policyView(gbforms.HelpTextModalMixin,
88 gbforms.ReversingModalFormView):
80 form_class = np_forms.AddL2PolicyForm 89 form_class = np_forms.AddL2PolicyForm
81 template_name = "project/network_policy/add_l2policy.html" 90 template_name = "gbpui/form_with_description.html"
82 91 submit_url = "horizon:project:network_policy:addl2policy"
83 def get_context_data(self, **kwargs): 92 modal_header = _("Add L2Policy")
84 context = super(AddL2policyView, self).get_context_data(**kwargs) 93 submit_label = _("Save Changes")
85 return context 94 page_title = _("Add L2Policy")
95 help_text = _("Add L2Policy.")
86 96
87 def get_initial(self):
88 return self.kwargs
89 97
90 98class L2PolicyUpdateView(gbforms.HelpTextModalMixin,
91class L2PolicyUpdateView(forms.ModalFormView): 99 gbforms.ReversingModalFormView):
92 form_class = np_forms.UpdateL2PolicyForm 100 form_class = np_forms.UpdateL2PolicyForm
93 template_name = "project/network_policy/update_l2policy.html" 101 template_name = "gbpui/form_with_description.html"
102 submit_url = "horizon:project:network_policy:update_l2policy"
103 modal_header = _("Update L2Policy")
104 submit_label = _("Save Changes")
105 page_title = _("Update L2Policy")
106 help_text = _("Update L2Policy.")
94 107
95 def get_context_data(self, **kwargs): 108 def get_submit_url_params(self, **kwargs):
96 context = super(L2PolicyUpdateView, self).get_context_data(**kwargs) 109 return {"l2policy_id": self.kwargs["l2policy_id"]}
97 context['l2policy_id'] = self.kwargs['l2policy_id']
98 return context
99 110
100 def get_initial(self): 111 def get_initial(self):
101 return self.kwargs 112 return self.kwargs
@@ -103,81 +114,112 @@ class L2PolicyUpdateView(forms.ModalFormView):
103 114
104class L2PolicyDetailsView(tabs.TabView): 115class L2PolicyDetailsView(tabs.TabView):
105 tab_group_class = (np_tabs.L2PolicyDetailsTabs) 116 tab_group_class = (np_tabs.L2PolicyDetailsTabs)
106 template_name = 'project/network_policy/details_tabs.html' 117 template_name = "gbpui/details_tabs.html"
118 page_title = _("L2 Policy Details")
107 119
108 120
109class CreateServicePolicyView(forms.ModalFormView): 121class CreateServicePolicyView(gbforms.HelpTextModalMixin,
122 gbforms.ReversingModalFormView):
110 form_class = np_forms.CreateServicePolicyForm 123 form_class = np_forms.CreateServicePolicyForm
111 template_name = "project/network_policy/create_service_policy.html"
112 124
113 def get_context_data(self, **kwargs): 125 template_name = "gbpui/form_with_description.html"
114 context = super( 126 submit_url = "horizon:project:network_policy:create_servicepolicy"
115 CreateServicePolicyView, self).get_context_data(**kwargs) 127 modal_header = _("Create Service Policy")
116 return context 128 submit_label = _("Create")
129 page_title = _("Create Service Policy")
130 help_text = _("Create Service Policy.")
117 131
118 132
119class AddExternalSegmentParamView(forms.ModalFormView): 133class AddExternalSegmentParamView(gbforms.HelpTextModalMixin,
134 gbforms.ReversingModalFormView):
120 form_class = np_forms.CreateExternalSegmentParamForm 135 form_class = np_forms.CreateExternalSegmentParamForm
121 template_name = "project/network_policy/create_external_segment_param.html" 136 template_name = "gbpui/form_with_description.html"
137 submit_url = "horizon:project:network_policy:add_external_segment_param"
138 modal_header = _("Add External Segment Parameter")
139 submit_label = _("Create")
140 page_title = _("Add External Segment Parameter")
141 help_text = _("Add External Segment Parameter.")
122 142
123 def get_object_id(self, params): 143 def get_object_id(self, params):
124 return params.name 144 return params.name
125 145
126 146
127class AddNetworkServiceParamView(forms.ModalFormView): 147class AddNetworkServiceParamView(gbforms.HelpTextModalMixin,
148 gbforms.ReversingModalFormView):
128 form_class = np_forms.CreateNetworkServiceParamForm 149 form_class = np_forms.CreateNetworkServiceParamForm
129 template_name = "project/network_policy/create_network_service_param.html" 150 template_name = "gbpui/form_with_description.html"
151 submit_url = "horizon:project:network_policy:add_network_service_param"
152 modal_header = _("Add Network Service Parameter")
153 submit_label = _("Create")
154 page_title = _("Add Network Service Parameter")
155 help_text = _("Add Network Service Parameter.")
130 156
131 def get_object_id(self, params): 157 def get_object_id(self, params):
132 return params.name 158 return params.name
133 159
134 160
135class AddExternalRouteParamView(forms.ModalFormView): 161class AddExternalRouteParamView(gbforms.HelpTextModalMixin,
162 gbforms.ReversingModalFormView):
136 form_class = np_forms.CreateExternalRouteParamForm 163 form_class = np_forms.CreateExternalRouteParamForm
137 template_name = "project/network_policy/create_external_route_param.html" 164 template_name = "gbpui/form_with_description.html"
165 submit_url = "horizon:project:network_policy:add_external_route_param"
166 modal_header = _("Add External Route Parameter")
167 submit_label = _("Create")
168 page_title = _("Add External Route Parameter")
169 help_text = _("Add External Route Parameter.")
138 170
139 def get_object_id(self, params): 171 def get_object_id(self, params):
140 return params.name 172 return params.name
141 173
142 174
143class UpdateNATPoolView(forms.ModalFormView): 175class UpdateNATPoolView(gbforms.HelpTextModalMixin,
176 gbforms.ReversingModalFormView):
144 form_class = np_forms.UpdateNATPoolForm 177 form_class = np_forms.UpdateNATPoolForm
145 template_name = "project/network_policy/update_nat_pool.html" 178 template_name = "gbpui/form_with_description.html"
179 submit_url = "horizon:project:network_policy:update_natpool"
180 modal_header = _("Update NAT Pool")
181 submit_label = _("Save Changes")
182 page_title = _("Update NAT Pool")
183 help_text = _("Update NAT Pool.")
146 184
147 def get_context_data(self, **kwargs): 185 def get_submit_url_params(self, **kwargs):
148 context = super( 186 return {"nat_pool_id": self.kwargs["nat_pool_id"]}
149 UpdateNATPoolView, self).get_context_data(**kwargs)
150 context['nat_pool_id'] = self.kwargs['nat_pool_id']
151 return context
152 187
153 def get_initial(self): 188 def get_initial(self):
154 return self.kwargs 189 return self.kwargs
155 190
156 191
157class UpdateExternalConnectivityView(forms.ModalFormView): 192class UpdateExternalConnectivityView(gbforms.HelpTextModalMixin,
193 gbforms.ReversingModalFormView):
158 form_class = np_forms.UpdateExternalConnectivityForm 194 form_class = np_forms.UpdateExternalConnectivityForm
159 template_name = "project/network_policy/update_external_connectivity.html" 195 template_name = "gbpui/form_with_description.html"
160 196 submit_url = "horizon:project:network_policy:update_externalconnectivity"
161 def get_context_data(self, **kwargs): 197 modal_header = _("Update External Connectivity")
162 context = super( 198 submit_label = _("Save Changes")
163 UpdateExternalConnectivityView, self).get_context_data(**kwargs) 199 page_title = _("Update External Connectivity")
164 context['external_connectivity_id'] = \ 200 help_text = _("Update External Connectivity.")
165 self.kwargs['external_connectivity_id'] 201
166 return context 202 def get_submit_url_params(self, **kwargs):
203 return {
204 "external_connectivity_id": self.kwargs["external_connectivity_id"]
205 }
167 206
168 def get_initial(self): 207 def get_initial(self):
169 return self.kwargs 208 return self.kwargs
170 209
171 210
172class UpdateServicePolicyView(forms.ModalFormView): 211class UpdateServicePolicyView(gbforms.HelpTextModalMixin,
212 gbforms.ReversingModalFormView):
173 form_class = np_forms.UpdateServicePolicyForm 213 form_class = np_forms.UpdateServicePolicyForm
174 template_name = "project/network_policy/update_service_policy.html" 214 template_name = "gbpui/form_with_description.html"
215 submit_url = "horizon:project:network_policy:update_service_policy"
216 modal_header = _("Update Service Policy")
217 submit_label = _("Save Changes")
218 page_title = _("Update Service Policy")
219 help_text = _("Update Service Policy.")
175 220
176 def get_context_data(self, **kwargs): 221 def get_submit_url_params(self, **kwargs):
177 context = super( 222 return {"service_policy_id": self.kwargs["service_policy_id"]}
178 UpdateServicePolicyView, self).get_context_data(**kwargs)
179 context['service_policy_id'] = self.kwargs['service_policy_id']
180 return context
181 223
182 def get_initial(self): 224 def get_initial(self):
183 return self.kwargs 225 return self.kwargs
@@ -185,40 +227,45 @@ class UpdateServicePolicyView(forms.ModalFormView):
185 227
186class ServicePolicyDetailsView(tabs.TabView): 228class ServicePolicyDetailsView(tabs.TabView):
187 tab_group_class = (np_tabs.ServicePolicyDetailsTabs) 229 tab_group_class = (np_tabs.ServicePolicyDetailsTabs)
188 template_name = 'project/network_policy/details_tabs.html' 230 template_name = 'gbpui/details_tabs.html'
231 page_title = _("Service Policy Details")
189 232
190 233
191class CreateExternalConnectivityView(forms.ModalFormView): 234class CreateExternalConnectivityView(gbforms.HelpTextModalMixin,
235 gbforms.ReversingModalFormView):
192 form_class = np_forms.CreateExternalConnectivityForm 236 form_class = np_forms.CreateExternalConnectivityForm
193 template_name = "project/network_policy/create_external_connectivity.html" 237 template_name = "gbpui/form_with_description.html"
194 238 submit_url = "horizon:project:network_policy:create_external_connectivity"
195 def get_context_data(self, **kwargs): 239 modal_header = _("Create External Connectivity")
196 context = super( 240 submit_label = _("Save Changes")
197 CreateExternalConnectivityView, self).get_context_data(**kwargs) 241 page_title = _("Create External Connectivity")
198 return context 242 help_text = _("Create External Connectivity.")
199 243
200 def get_success_url(self): 244 def get_success_url(self):
201 return reverse('horizon:project:network_policy:index') 245 return reverse('horizon:project:network_policy:index')
202 246
203 def get_object_id(self, external_segment):
204 return [external_segment.id]
205
206 247
207class ExternalConnectivityDetailsView(tabs.TabView): 248class ExternalConnectivityDetailsView(tabs.TabView):
208 tab_group_class = (np_tabs.ExternalConnectivityDetailsTabs) 249 tab_group_class = (np_tabs.ExternalConnectivityDetailsTabs)
209 template_name = 'project/network_policy/details_tabs.html' 250 template_name = "gbpui/details_tabs.html"
251 page_title = _("External Connectivity Details")
210 252
211 253
212class CreateNATPoolView(forms.ModalFormView): 254class CreateNATPoolView(gbforms.HelpTextModalMixin,
255 gbforms.ReversingModalFormView):
213 form_class = np_forms.CreateNATPoolForm 256 form_class = np_forms.CreateNATPoolForm
214 template_name = "project/network_policy/create_nat_pool.html" 257 template_name = "gbpui/form_with_description.html"
258 submit_url = "horizon:project:network_policy:create_nat_pool"
259 modal_header = _("Create NAT Pool")
260 submit_label = _("Create")
261 page_title = _("Create NAT Pool")
262 help_text = _("Create NAT Pool.")
215 263
216 def get_context_data(self, **kwargs): 264 def get_success_url(self):
217 context = super( 265 return reverse('horizon:project:application_policy:index')
218 CreateNATPoolView, self).get_context_data(**kwargs)
219 return context
220 266
221 267
222class NATPoolDetailsView(tabs.TabView): 268class NATPoolDetailsView(tabs.TabView):
223 tab_group_class = (np_tabs.NATPoolDetailsTabs) 269 tab_group_class = (np_tabs.NATPoolDetailsTabs)
224 template_name = 'project/network_policy/details_tabs.html' 270 template_name = 'gbpui/details_tabs.html'
271 page_title = _("NAT Pool Details")
diff --git a/gbpui/panels/network_services/forms.py b/gbpui/panels/network_services/forms.py
index 67fb63d..69d4bf6 100644
--- a/gbpui/panels/network_services/forms.py
+++ b/gbpui/panels/network_services/forms.py
@@ -298,91 +298,3 @@ class UpdateServiceChainSpecForm(CreateServiceChainSpecForm, BaseUpdateForm):
298 msg = _("Failed to update Service Chain Spec. %s") % (str(e)) 298 msg = _("Failed to update Service Chain Spec. %s") % (str(e))
299 LOG.error(msg) 299 LOG.error(msg)
300 exceptions.handle(request, msg, redirect=shortcuts.redirect) 300 exceptions.handle(request, msg, redirect=shortcuts.redirect)
301
302
303class CreateServiceChainInstanceForm(forms.SelfHandlingForm):
304 name = forms.CharField(max_length=80, label=_("Name"))
305 description = forms.CharField(
306 max_length=80, label=_("Description"), required=False)
307 servicechain_spec = forms.ChoiceField(label=_("ServiceChain Spec"))
308 provider_ptg = forms.ChoiceField(label=_("Provider PTG"))
309 consumer_ptg = forms.ChoiceField(label=_("Consumer PTG"))
310 classifier = forms.ChoiceField(label=_("Classifier"))
311
312 def __init__(self, request, *args, **kwargs):
313 super(CreateServiceChainInstanceForm, self).__init__(
314 request, *args, **kwargs)
315 try:
316 sc_specs = client.servicechainspec_list(request,
317 tenant_id=request.user.tenant_id)
318 ptgs = client.policy_target_list(request,
319 tenant_id=request.user.tenant_id)
320 ptgs = [(item.id, item.name) for item in ptgs]
321 classifiers = client.policyclassifier_list(request,
322 tenant_id=request.user.tenant_id)
323 self.fields['servicechain_spec'].choices = [
324 (item.id, item.name) for item in sc_specs]
325 self.fields['provider_ptg'].choices = ptgs
326 self.fields['consumer_ptg'].choices = ptgs
327 self.fields['classifier'].choices = [
328 (item.id, item.name) for item in classifiers]
329 except Exception:
330 msg = _("Failed to retrive policy targets")
331 LOG.error(msg)
332
333 def handle(self, request, context):
334 url = reverse("horizon:project:network_services:index")
335 try:
336 if context.get('name'):
337 context['name'] = html.escape(context['name'])
338 if context.get('description'):
339 context['description'] = html.escape(context['description'])
340 client.create_servicechain_instance(request, **context)
341 msg = _("Service Chain Instance Created Successfully!")
342 LOG.debug(msg)
343 return http.HttpResponseRedirect(url)
344 except Exception as e:
345 msg = _("Failed to create Service Chain Instance. %s") % (str(e))
346 LOG.error(msg)
347 exceptions.handle(request, msg, redirect=shortcuts.redirect)
348
349
350class UpdateServiceChainInstanceForm(forms.SelfHandlingForm):
351 name = forms.CharField(max_length=80, label=_("Name"))
352 description = forms.CharField(
353 max_length=80, label=_("Description"), required=False)
354 servicechain_spec = forms.ChoiceField(label=_("ServiceChain Spec"))
355
356 def __init__(self, request, *args, **kwargs):
357 super(UpdateServiceChainInstanceForm, self).__init__(
358 request, *args, **kwargs)
359 try:
360 scinstance_id = self.initial['scinstance_id']
361 sc_specs = client.servicechainspec_list(request,
362 tenant_id=request.user.tenant_id)
363 self.fields['servicechain_spec'].choices = [
364 (item.id, item.name) for item in sc_specs]
365 scinstance = client.get_servicechain_instance(
366 request, scinstance_id)
367 for attr in ['name', 'description', 'servicechain_spec']:
368 self.fields[attr].initial = getattr(scinstance, attr)
369 except Exception:
370 pass
371
372 def handle(self, request, context):
373 url = reverse("horizon:project:network_services:index")
374 try:
375 scinstance_id = self.initial['scinstance_id']
376 if context.get('name'):
377 context['name'] = html.escape(context['name'])
378 if context.get('description'):
379 context['description'] = html.escape(context['description'])
380 client.update_servicechain_instance(
381 request, scinstance_id, **context)
382 msg = _("Service Chain Instance Created Successfully!")
383 LOG.debug(msg)
384 return http.HttpResponseRedirect(url)
385 except Exception as e:
386 msg = _("Failed to create Service Chain Instance. %s") % (str(e))
387 LOG.error(msg)
388 exceptions.handle(request, msg, redirect=shortcuts.redirect)
diff --git a/gbpui/panels/network_services/templates/network_services/_create_service_chain_instance.html b/gbpui/panels/network_services/templates/network_services/_create_service_chain_instance.html
deleted file mode 100644
index c4c3c71..0000000
--- a/gbpui/panels/network_services/templates/network_services/_create_service_chain_instance.html
+++ /dev/null
@@ -1,25 +0,0 @@
1{% extends "horizon/common/_modal_form.html" %}
2{% load i18n %}
3{% load url from future %}
4
5{% block form_id %}create_service_chain_instance{% endblock %}
6{% block form_action %}{% url 'horizon:project:network_services:create_sc_instance' %}{% endblock %}
7
8{% block modal-header %}{% trans "Create Service Chain Instance" %}{% endblock %}
9
10{% block modal-body %}
11<div class="left">
12 <fieldset>
13 {% include "horizon/common/_form_fields.html" %}
14 </fieldset>
15</div>
16<div class="right">
17 <h3>{% trans "Description:" %}</h3>
18 <p>{% trans "Create Service Chain Instance." %}</p>
19</div>
20{% endblock %}
21
22{% block modal-footer %}
23 <input class="btn btn-primary pull-right" type="submit" value="{% trans "Save Changes" %}" />
24 <a href="{% url 'horizon:project:network_services:create_sc_instance' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
25{% endblock %}
diff --git a/gbpui/panels/network_services/templates/network_services/_create_service_chain_node.html b/gbpui/panels/network_services/templates/network_services/_create_service_chain_node.html
deleted file mode 100644
index 866f00f..0000000
--- a/gbpui/panels/network_services/templates/network_services/_create_service_chain_node.html
+++ /dev/null
@@ -1,26 +0,0 @@
1{% extends "horizon/common/_modal_form.html" %}
2{% load i18n %}
3{% load url from future %}
4
5{% block form_id %}create_service_chain_node{% endblock %}
6{% block form_action %}{% url 'horizon:project:network_services:create_sc_node' %}{% endblock %}
7{% block form_attrs %}enctype="multipart/form-data"{% endblock %}
8
9{% block modal-header %}{% trans "Create Service Chain Node" %}{% endblock %}
10
11{% block modal-body %}
12<div class="left">
13 <fieldset>
14 {% include "horizon/common/_form_fields.html" %}
15 </fieldset>
16</div>
17<div class="right">
18 <h3>{% trans "Description:" %}</h3>
19 <p>{% trans "Create Service Chain Node." %}</p>
20</div>
21{% endblock %}
22
23{% block modal-footer %}
24 <input class="btn btn-primary pull-right" type="submit" value="{% trans "Save Changes" %}" />
25 <a href="{% url 'horizon:project:network_services:create_sc_node' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
26{% endblock %}
diff --git a/gbpui/panels/network_services/templates/network_services/_create_service_profile.html b/gbpui/panels/network_services/templates/network_services/_create_service_profile.html
deleted file mode 100644
index ee3c24e..0000000
--- a/gbpui/panels/network_services/templates/network_services/_create_service_profile.html
+++ /dev/null
@@ -1,26 +0,0 @@
1{% extends "horizon/common/_modal_form.html" %}
2{% load i18n %}
3{% load url from future %}
4
5{% block form_id %}create_service_profile_form{% endblock %}
6{% block form_action %}{% url "horizon:project:network_services:create_service_profile" %}{% endblock %}
7
8{% block modal_id %}create_service_profile_modal{% endblock %}
9{% block modal-header %}{% trans "Create Service Profile" %}{% endblock %}
10
11{% block modal-body %}
12<div class="left">
13 <fieldset>
14 {% include "horizon/common/_form_fields.html" %}
15 </fieldset>
16</div>
17<div class="right">
18 <h3>{% trans "Description" %}:</h3>
19 <p>{% trans "Create Service Profile." %}</p>
20</div>
21{% endblock %}
22
23{% block modal-footer %}
24 <input class="btn btn-primary pull-right" type="submit" value="{% trans "Save changes" %}" />
25 <a href="{% url "horizon:project:network_services:index" %}" class="btn btn-default secondary cancel close">{% trans "Cancel" %}</a>
26{% endblock %}
diff --git a/gbpui/panels/network_services/templates/network_services/_scspec_details.html b/gbpui/panels/network_services/templates/network_services/_scspec_details.html
index d96a5aa..14cb7ad 100644
--- a/gbpui/panels/network_services/templates/network_services/_scspec_details.html
+++ b/gbpui/panels/network_services/templates/network_services/_scspec_details.html
@@ -4,7 +4,7 @@
4<div class="info row detail"> 4<div class="info row detail">
5 <hr class="header_rule"> 5 <hr class="header_rule">
6 <dl> 6 <dl>
7 <dt>{% trans "Name" %}</dt> 7 <dt>{% trans "Name" %}</dt>
8 <dd>{{ scspec.name|default:_("-") }}</dd> 8 <dd>{{ scspec.name|default:_("-") }}</dd>
9 9
10 <dt>{% trans "Description" %}</dt> 10 <dt>{% trans "Description" %}</dt>
@@ -16,35 +16,35 @@
16 <dt>{% trans "Shared" %}</dt> 16 <dt>{% trans "Shared" %}</dt>
17 <dd>{{ scspec.shared }}</dd> 17 <dd>{{ scspec.shared }}</dd>
18 </dl> 18 </dl>
19 {% if scspec.nodes %} 19 {% if scspec.nodes %}
20 <div class="panel panel-default"> 20 <div class="panel panel-default">
21 <div class="panel-heading">Nodes</div> 21 <div class="panel-heading">Nodes</div>
22 <div class="panel-body"> 22 <div class="panel-body">
23 <table class="table"> 23 <table class="table">
24 <thead> 24 <thead>
25 <tr> 25 <tr>
26 <th>Name</th> 26 <th>Name</th>
27 <th>Service Profile</th> 27 <th>Service Profile</th>
28 <th>Config</th> 28 <th>Config</th>
29 </tr> 29 </tr>
30 </thead> 30 </thead>
31 {% for node in scspec.nodes %} 31 {% for node in scspec.nodes %}
32 <tr> 32 <tr>
33 <td> 33 <td>
34 <a href="{% url 'horizon:project:network_services:sc_node_details' scnode_id=node.id %}"> 34 <a href="{% url 'horizon:project:network_services:sc_node_details' scnode_id=node.id %}">
35 {{node.name}}</a> 35 {{node.name}}</a>
36 </td> 36 </td>
37 <td> 37 <td>
38 <a href="{% url 'horizon:project:network_services:service_profile_details' sp_id=node.service_profile_id %}"> 38 <a href="{% url 'horizon:project:network_services:service_profile_details' sp_id=node.service_profile_id %}">
39 {{ node.service_profile_id }}</a> 39 {{ node.service_profile_id }}</a>
40 </td> 40 </td>
41 <td> 41 <td>
42 <div style ="white-space:pre;overflow-y: scroll;height:300px;background-color:#EEEEEE">{{node.config}}</div> 42 <div style ="white-space:pre;overflow-y: scroll;height:300px;background-color:#EEEEEE">{{node.config}}</div>
43 </td> 43 </td>
44 </tr> 44 </tr>
45 {% endfor %} 45 {% endfor %}
46 </table> 46 </table>
47 </div> 47 </div>
48 </div> 48 </div>
49 {% endif %} 49 {% endif %}
50</div> 50</div>
diff --git a/gbpui/panels/network_services/templates/network_services/_service_chain_spec_details.html b/gbpui/panels/network_services/templates/network_services/_service_chain_spec_details.html
deleted file mode 100644
index e69de29..0000000
--- a/gbpui/panels/network_services/templates/network_services/_service_chain_spec_details.html
+++ /dev/null
diff --git a/gbpui/panels/network_services/templates/network_services/_update_service_chain_instance.html b/gbpui/panels/network_services/templates/network_services/_update_service_chain_instance.html
deleted file mode 100644
index 5e42f55..0000000
--- a/gbpui/panels/network_services/templates/network_services/_update_service_chain_instance.html
+++ /dev/null
@@ -1,25 +0,0 @@
1{% extends "horizon/common/_modal_form.html" %}
2{% load i18n %}
3{% load url from future %}
4
5{% block form_id %}update_service_chain_instance{% endblock %}
6{% block form_action %}{% url 'horizon:project:network_services:update_sc_instance' scinstance_id %}{% endblock %}
7
8{% block modal-header %}{% trans "Update Service Chain Instance" %}{% endblock %}
9
10{% block modal-body %}
11<div class="left">
12 <fieldset>
13 {% include "horizon/common/_form_fields.html" %}
14 </fieldset>
15</div>
16<div class="right">
17 <h3>{% trans "Description:" %}</h3>
18 <p>{% trans "Update Service Chain Instance." %}</p>
19</div>
20{% endblock %}
21
22{% block modal-footer %}
23 <input class="btn btn-primary pull-right" type="submit" value="{% trans "Save Changes" %}" />
24 <a href="{% url 'horizon:project:network_services:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
25{% endblock %}
diff --git a/gbpui/panels/network_services/templates/network_services/_update_service_chain_node.html b/gbpui/panels/network_services/templates/network_services/_update_service_chain_node.html
deleted file mode 100644
index 65431d4..0000000
--- a/gbpui/panels/network_services/templates/network_services/_update_service_chain_node.html
+++ /dev/null
@@ -1,25 +0,0 @@
1{% extends "horizon/common/_modal_form.html" %}
2{% load i18n %}
3{% load url from future %}
4
5{% block form_id %}update_service_chain_node{% endblock %}
6{% block form_action %}{% url 'horizon:project:network_services:update_sc_node' scnode_id %}{% endblock %}
7
8{% block modal-header %}{% trans "Update Service Chain Node" %}{% endblock %}
9
10{% block modal-body %}
11<div class="left">
12 <fieldset>
13 {% include "horizon/common/_form_fields.html" %}
14 </fieldset>
15</div>
16<div class="right">
17 <h3>{% trans "Description:" %}</h3>
18 <p>{% trans "Update Service Chain Node." %}</p>
19</div>
20{% endblock %}
21
22{% block modal-footer %}
23 <input class="btn btn-primary pull-right" type="submit" value="{% trans "Save Changes" %}" />
24 <a href="{% url 'horizon:project:network_services:index' %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
25{% endblock %}
diff --git a/gbpui/panels/network_services/templates/network_services/details_tabs.html b/gbpui/panels/network_services/templates/network_services/details_tabs.html
deleted file mode 100644
index e8124c3..0000000
--- a/gbpui/panels/network_services/templates/network_services/details_tabs.html
+++ /dev/null
@@ -1,15 +0,0 @@
1{% extends 'base.html' %}
2{% load i18n %}
3{% block title %}{% trans "Network Services" %}{% endblock %}
4
5{% block page_header %}
6{% include "horizon/common/_page_header.html" with title=_("Network Services") %}
7{% endblock page_header %}
8
9{% block main %}
10<div class="row">
11 <div class="col-sm-12">
12 {{ tab_group.render }}
13 </div>
14</div>
15{% endblock %}
diff --git a/gbpui/panels/network_services/templates/network_services/index.html b/gbpui/panels/network_services/templates/network_services/index.html
deleted file mode 100644
index e69de29..0000000
--- a/gbpui/panels/network_services/templates/network_services/index.html
+++ /dev/null
diff --git a/gbpui/panels/network_services/urls.py b/gbpui/panels/network_services/urls.py
index f0a5d35..377bfd0 100644
--- a/gbpui/panels/network_services/urls.py
+++ b/gbpui/panels/network_services/urls.py
@@ -10,7 +10,6 @@
10# License for the specific language governing permissions and limitations 10# License for the specific language governing permissions and limitations
11# under the License. 11# under the License.
12 12
13
14from django.conf.urls import url # noqa 13from django.conf.urls import url # noqa
15 14
16import views 15import views
@@ -41,12 +40,6 @@ urlpatterns = [
41 url(r'^sc_spec/(?P<scspec_id>[^/]+)/$', 40 url(r'^sc_spec/(?P<scspec_id>[^/]+)/$',
42 views.ServiceChainSpecDetailsView.as_view(), 41 views.ServiceChainSpecDetailsView.as_view(),
43 name='sc_spec_details'), 42 name='sc_spec_details'),
44 url(r'^create_sc_instance$',
45 views.CreateServiceChainInstanceView.as_view(),
46 name='create_sc_instance'),
47 url(r'^update_sc_instance/(?P<scinstance_id>[^/]+)/$',
48 views.UpdateServiceChainInstanceView.as_view(),
49 name='update_sc_instance'),
50 url(r'^sc_instance/(?P<scinstance_id>[^/]+)/$', 43 url(r'^sc_instance/(?P<scinstance_id>[^/]+)/$',
51 views.ServiceChainInstanceDetailsView.as_view(), 44 views.ServiceChainInstanceDetailsView.as_view(),
52 name='sc_instance_details'), 45 name='sc_instance_details'),
diff --git a/gbpui/panels/network_services/views.py b/gbpui/panels/network_services/views.py
index 714354d..eb6b991 100644
--- a/gbpui/panels/network_services/views.py
+++ b/gbpui/panels/network_services/views.py
@@ -15,46 +15,56 @@ from horizon import tabs
15import forms as ns_forms 15import forms as ns_forms
16import tabs as ns_tabs 16import tabs as ns_tabs
17 17
18from django.utils.translation import ugettext_lazy as _
19from gbpui.common import forms as gbforms
20
18 21
19class IndexView(tabs.TabbedTableView): 22class IndexView(tabs.TabbedTableView):
20 tab_group_class = (ns_tabs.ServiceChainTabs) 23 tab_group_class = (ns_tabs.ServiceChainTabs)
21 template_name = 'project/network_services/details_tabs.html' 24 template_name = 'gbpui/details_tabs.html'
25 page_title = _("Network Services")
22 26
23 27
24class ServiceProfileDetailsView(tabs.TabView): 28class ServiceProfileDetailsView(tabs.TabView):
25 tab_group_class = (ns_tabs.ServiceProfileDetailsTabGroup) 29 tab_group_class = (ns_tabs.ServiceProfileDetailsTabGroup)
26 template_name = 'project/network_services/details_tabs.html' 30 template_name = 'gbpui/details_tabs.html'
31 page_title = _("Service Profile Details")
27 32
28 33
29class CreateServiceProfileView(forms.ModalFormView): 34class CreateServiceProfileView(gbforms.HelpTextModalMixin,
35 gbforms.ReversingModalFormView):
30 form_class = ns_forms.CreateServiceProfileForm 36 form_class = ns_forms.CreateServiceProfileForm
31 template_name = "project/network_services/create_service_profile.html" 37 template_name = "gbpui/form_with_description.html"
38 submit_url = "horizon:project:network_services:create_service_profile"
39 modal_header = _("Create Service Profile")
40 submit_label = _("Create")
41 page_title = _("Create Service Profile")
42 help_text = _("Create Service Profile.")
32 43
33 def get_context_data(self, **kwargs):
34 context = super(
35 CreateServiceProfileView, self).get_context_data(**kwargs)
36 return context
37 44
38 45class CreateServiceChainNodeView(gbforms.HelpTextModalMixin,
39class CreateServiceChainNodeView(forms.ModalFormView): 46 gbforms.ReversingModalFormView):
40 form_class = ns_forms.CreateServiceChainNodeForm 47 form_class = ns_forms.CreateServiceChainNodeForm
41 template_name = "project/network_services/create_service_chain_node.html" 48 template_name = "gbpui/form_with_description.html"
42 49 submit_url = "horizon:project:network_services:create_sc_node"
43 def get_context_data(self, **kwargs): 50 modal_header = _("Create Service Chain Node")
44 context = super( 51 submit_label = _("Create")
45 CreateServiceChainNodeView, self).get_context_data(**kwargs) 52 page_title = _("Create Service Chain Node")
46 return context 53 help_text = _("Create Service Chain Node.")
47 54
48 55
49class UpdateServiceChainNodeView(forms.ModalFormView): 56class UpdateServiceChainNodeView(gbforms.HelpTextModalMixin,
57 gbforms.ReversingModalFormView):
50 form_class = ns_forms.UpdateServiceChainNodeForm 58 form_class = ns_forms.UpdateServiceChainNodeForm
51 template_name = "project/network_services/update_service_chain_node.html" 59 template_name = "gbpui/form_with_description.html"
60 submit_url = "horizon:project:network_services:update_sc_node"
61 modal_header = _("Update Service Chain Node")
62 submit_label = _("Save Changes")
63 page_title = _("Update Service Chain Node")
64 help_text = _("Update Service Chain Node.")
52 65
53 def get_context_data(self, **kwargs): 66 def get_submit_url_params(self, **kwargs):
54 context = super( 67 return {"scnode_id": self.kwargs['scnode_id']}
55 UpdateServiceChainNodeView, self).get_context_data(**kwargs)
56 context['scnode_id'] = self.kwargs['scnode_id']
57 return context
58 68
59 def get_initial(self): 69 def get_initial(self):
60 return self.kwargs 70 return self.kwargs
@@ -62,7 +72,8 @@ class UpdateServiceChainNodeView(forms.ModalFormView):
62 72
63class ServiceChainNodeDetailsView(tabs.TabView): 73class ServiceChainNodeDetailsView(tabs.TabView):
64 tab_group_class = (ns_tabs.SCNodeDetailsTabGroup) 74 tab_group_class = (ns_tabs.SCNodeDetailsTabGroup)
65 template_name = 'project/network_services/details_tabs.html' 75 template_name = 'gbpui/details_tabs.html'
76 page_title = _("Service Chain Node Details")
66 77
67 78
68class CreateServiceChainSpecView(forms.ModalFormView): 79class CreateServiceChainSpecView(forms.ModalFormView):
@@ -91,35 +102,11 @@ class UpdateServiceChainSpecView(forms.ModalFormView):
91 102
92class ServiceChainSpecDetailsView(tabs.TabView): 103class ServiceChainSpecDetailsView(tabs.TabView):
93 tab_group_class = (ns_tabs.SCSpecDetailsTabGroup) 104 tab_group_class = (ns_tabs.SCSpecDetailsTabGroup)
94 template_name = 'project/network_services/details_tabs.html' 105 template_name = 'gbpui/details_tabs.html'
95 106 page_title = _("Service Chain Spec Details")
96
97class CreateServiceChainInstanceView(forms.ModalFormView):
98 form_class = ns_forms.CreateServiceChainInstanceForm
99 template_name = "project/network_services/" \
100 "create_service_chain_instance.html"
101
102 def get_context_data(self, **kwargs):
103 context = super(
104 CreateServiceChainInstanceView, self).get_context_data(**kwargs)
105 return context
106
107
108class UpdateServiceChainInstanceView(forms.ModalFormView):
109 form_class = ns_forms.UpdateServiceChainInstanceForm
110 template_name = "project/network_services/" \
111 "update_service_chain_instance.html"
112
113 def get_context_data(self, **kwargs):
114 context = super(
115 UpdateServiceChainInstanceView, self).get_context_data(**kwargs)
116 context['scinstance_id'] = self.kwargs['scinstance_id']
117 return context
118
119 def get_initial(self):
120 return self.kwargs
121 107
122 108
123class ServiceChainInstanceDetailsView(tabs.TabView): 109class ServiceChainInstanceDetailsView(tabs.TabView):
124 tab_group_class = (ns_tabs.SCInstanceDetailsTabGroup) 110 tab_group_class = (ns_tabs.SCInstanceDetailsTabGroup)
125 template_name = 'project/network_services/details_tabs.html' 111 template_name = 'gbpui/details_tabs.html'
112 page_title = _("Service Chain Instance Details")
diff --git a/gbpui/panels/policytargets/templates/policytargets/group_details.html b/gbpui/panels/policytargets/templates/policytargets/group_details.html
deleted file mode 100644
index c7ae02a..0000000
--- a/gbpui/panels/policytargets/templates/policytargets/group_details.html
+++ /dev/null
@@ -1,11 +0,0 @@
1{% extends 'base.html' %}
2{% load i18n %}
3{% block title %}{% trans "Groups Details" %}{% endblock %}
4
5{% block main %}
6<div class="row">
7 <div class="col-sm-12">
8 {{ tab_group.render }}
9 </div>
10</div>
11{% endblock %}
diff --git a/gbpui/panels/policytargets/views.py b/gbpui/panels/policytargets/views.py
index 1a161d5..608ad75 100644
--- a/gbpui/panels/policytargets/views.py
+++ b/gbpui/panels/policytargets/views.py
@@ -12,13 +12,11 @@
12 12
13import json 13import json
14 14
15from django.core.urlresolvers import reverse
16from django.core.urlresolvers import reverse_lazy 15from django.core.urlresolvers import reverse_lazy
17from django.http import HttpResponse # noqa 16from django.http import HttpResponse # noqa
18from django.utils.translation import ugettext_lazy as _ 17from django.utils.translation import ugettext_lazy as _
19 18
20from horizon import exceptions 19from horizon import exceptions
21from horizon import forms
22from horizon import tabs 20from horizon import tabs
23from horizon.utils import memoized 21from horizon.utils import memoized
24from horizon import workflows 22from horizon import workflows
@@ -45,7 +43,7 @@ AddExternalPTG = policy_target_workflows.AddExternalPTG
45 43
46class IndexView(tabs.TabbedTableView): 44class IndexView(tabs.TabbedTableView):
47 tab_group_class = (PTGTabs) 45 tab_group_class = (PTGTabs)
48 template_name = 'project/policytargets/details_tabs.html' 46 template_name = 'gbpui/details_tabs.html'
49 page_title = _("Groups") 47 page_title = _("Groups")
50 48
51 49
@@ -59,7 +57,7 @@ class AddExternalPTGView(workflows.WorkflowView):
59 57
60class PTGDetailsView(tabs.TabbedTableView): 58class PTGDetailsView(tabs.TabbedTableView):
61 tab_group_class = (policy_target_tabs.PTGMemberTabs) 59 tab_group_class = (policy_target_tabs.PTGMemberTabs)
62 template_name = 'project/policytargets/group_details.html' 60 template_name = 'gbpui/details_tabs.html'
63 page_title = _("Group: {{ policy_target.name }}") 61 page_title = _("Group: {{ policy_target.name }}")
64 62
65 def get_context_data(self, **kwargs): 63 def get_context_data(self, **kwargs):
@@ -75,7 +73,7 @@ class PTGDetailsView(tabs.TabbedTableView):
75 73
76class ExternalPTGDetailsView(tabs.TabbedTableView): 74class ExternalPTGDetailsView(tabs.TabbedTableView):
77 tab_group_class = (policy_target_tabs.ExternalPTGMemberTabs) 75 tab_group_class = (policy_target_tabs.ExternalPTGMemberTabs)
78 template_name = 'project/policytargets/group_details.html' 76 template_name = 'gbpui/details_tabs.html'
79 page_title = _("Group: {{ policy_target.name }}") 77 page_title = _("Group: {{ policy_target.name }}")
80 78
81 def get_context_data(self, **kwargs): 79 def get_context_data(self, **kwargs):
@@ -92,7 +90,6 @@ class ExternalPTGDetailsView(tabs.TabbedTableView):
92 90
93class LaunchVMView(workflows.WorkflowView): 91class LaunchVMView(workflows.WorkflowView):
94 workflow_class = policy_target_workflows.LaunchInstance 92 workflow_class = policy_target_workflows.LaunchInstance
95 template_name = "project/policytargets/add_vm.html"
96 93
97 def get_initial(self): 94 def get_initial(self):
98 initial = super(LaunchVMView, self).get_initial() 95 initial = super(LaunchVMView, self).get_initial()
@@ -101,7 +98,8 @@ class LaunchVMView(workflows.WorkflowView):
101 return initial 98 return initial
102 99
103 100
104class UpdatePTGView(forms.ModalFormView): 101class UpdatePTGView(gbforms.HelpTextModalMixin,
102 gbforms.ReversingModalFormView):
105 form_class = policy_target_forms.UpdatePolicyTargetForm 103 form_class = policy_target_forms.UpdatePolicyTargetForm
106 form_id = "update_policy_target_form" 104 form_id = "update_policy_target_form"
107 modal_header = _("Edit Group") 105 modal_header = _("Edit Group")
@@ -113,16 +111,10 @@ class UpdatePTGView(forms.ModalFormView):
113 page_title = _("Edit Group") 111 page_title = _("Edit Group")
114 help_text = _("You may update group details here.") 112 help_text = _("You may update group details here.")
115 113
116 def get_context_data(self, **kwargs): 114 def get_submit_url_params(self, **kwargs):
117 context = super(UpdatePTGView, self).get_context_data(**kwargs) 115 return {
118 obj_id = self.kwargs['policy_target_id'] 116 "policy_target_id": self.kwargs["policy_target_id"]
119 context["policy_target_id"] = obj_id 117 }
120 obj = self._get_object()
121 if obj:
122 context['name'] = obj.name
123 context["submit_url"] = reverse(self.submit_url, args=(obj_id,))
124 context["help_text"] = self.help_text
125 return context
126 118
127 @memoized.memoized_method 119 @memoized.memoized_method
128 def _get_object(self, *args, **kwargs): 120 def _get_object(self, *args, **kwargs):
@@ -141,7 +133,8 @@ class UpdatePTGView(forms.ModalFormView):
141 return self.kwargs 133 return self.kwargs
142 134
143 135
144class UpdateExternalPTGView(forms.ModalFormView): 136class UpdateExternalPTGView(gbforms.HelpTextModalMixin,
137 gbforms.ReversingModalFormView):
145 form_class = policy_target_forms.UpdateExternalPolicyTargetForm 138 form_class = policy_target_forms.UpdateExternalPolicyTargetForm
146 form_id = "update_policy_target_form" 139 form_id = "update_policy_target_form"
147 modal_header = _("Edit Group") 140 modal_header = _("Edit Group")
@@ -153,16 +146,10 @@ class UpdateExternalPTGView(forms.ModalFormView):
153 page_title = _("Edit Group") 146 page_title = _("Edit Group")
154 help_text = _("You may update external policy details here.") 147 help_text = _("You may update external policy details here.")
155 148
156 def get_context_data(self, **kwargs): 149 def get_submit_url_params(self, **kwargs):
157 context = super(UpdateExternalPTGView, self).get_context_data(**kwargs) 150 return {
158 obj_id = self.kwargs['ext_policy_target_id'] 151 "ext_policy_target_id": self.kwargs["ext_policy_target_id"]
159 context["ext_policy_target_id"] = obj_id 152 }
160 obj = self._get_object()
161 if obj:
162 context['name'] = obj.name
163 context["submit_url"] = reverse(self.submit_url, args=(obj_id,))
164 context["help_text"] = self.help_text
165 return context
166 153
167 @memoized.memoized_method 154 @memoized.memoized_method
168 def _get_object(self, *args, **kwargs): 155 def _get_object(self, *args, **kwargs):
@@ -181,7 +168,8 @@ class UpdateExternalPTGView(forms.ModalFormView):
181 return self.kwargs 168 return self.kwargs
182 169
183 170
184class ExtAddProvidedPRSView(gbforms.ReversingModalFormView): 171class ExtAddProvidedPRSView(gbforms.HelpTextModalMixin,
172 gbforms.ReversingModalFormView):
185 form_class = policy_target_forms.ExtAddProvidedPRSForm 173 form_class = policy_target_forms.ExtAddProvidedPRSForm
186 form_id = "ext_add_provided_form" 174 form_id = "ext_add_provided_form"
187 modal_header = _("Add Provided PRS") 175 modal_header = _("Add Provided PRS")
@@ -202,7 +190,8 @@ class ExtAddProvidedPRSView(gbforms.ReversingModalFormView):
202 return self.kwargs 190 return self.kwargs
203 191
204 192
205class ExtRemoveProvidedPRSView(gbforms.ReversingModalFormView): 193class ExtRemoveProvidedPRSView(gbforms.HelpTextModalMixin,
194 gbforms.ReversingModalFormView):
206 form_class = policy_target_forms.ExtRemoveProvidedPRSForm 195 form_class = policy_target_forms.ExtRemoveProvidedPRSForm
207 form_id = "ext_remove_provided_form" 196 form_id = "ext_remove_provided_form"
208 modal_header = _("Remove Provided PRS") 197 modal_header = _("Remove Provided PRS")
@@ -223,7 +212,8 @@ class ExtRemoveProvidedPRSView(gbforms.ReversingModalFormView):
223 return self.kwargs 212 return self.kwargs
224 213
225 214
226class AddProvidedPRSView(gbforms.ReversingModalFormView): 215class AddProvidedPRSView(gbforms.HelpTextModalMixin,
216 gbforms.ReversingModalFormView):
227 form_class = policy_target_forms.AddProvidedPRSForm 217 form_class = policy_target_forms.AddProvidedPRSForm
228 form_id = "add_provided_form" 218 form_id = "add_provided_form"
229 modal_header = _("Add Provided PRS") 219 modal_header = _("Add Provided PRS")
@@ -244,7 +234,8 @@ class AddProvidedPRSView(gbforms.ReversingModalFormView):
244 return self.kwargs 234 return self.kwargs
245 235
246 236
247class RemoveProvidedPRSView(gbforms.ReversingModalFormView): 237class RemoveProvidedPRSView(gbforms.HelpTextModalMixin,
238 gbforms.ReversingModalFormView):
248 form_class = policy_target_forms.RemoveProvidedPRSForm 239 form_class = policy_target_forms.RemoveProvidedPRSForm
249 form_id = "remove_provided_form" 240 form_id = "remove_provided_form"
250 modal_header = _("Remove Provided PRS") 241 modal_header = _("Remove Provided PRS")
@@ -265,7 +256,8 @@ class RemoveProvidedPRSView(gbforms.ReversingModalFormView):
265 return self.kwargs 256 return self.kwargs
266 257
267 258
268class ExtAddConsumedPRSView(gbforms.ReversingModalFormView): 259class ExtAddConsumedPRSView(gbforms.HelpTextModalMixin,
260 gbforms.ReversingModalFormView):
269 form_class = policy_target_forms.ExtAddConsumedPRSForm 261 form_class = policy_target_forms.ExtAddConsumedPRSForm
270 form_id = "ext_add_consumed_form" 262 form_id = "ext_add_consumed_form"
271 modal_header = _("Add Policy Rule Set") 263 modal_header = _("Add Policy Rule Set")
@@ -286,7 +278,8 @@ class ExtAddConsumedPRSView(gbforms.ReversingModalFormView):
286 return self.kwargs 278 return self.kwargs
287 279
288 280
289class ExtRemoveConsumedPRSView(gbforms.ReversingModalFormView): 281class ExtRemoveConsumedPRSView(gbforms.HelpTextModalMixin,
282 gbforms.ReversingModalFormView):
290 form_class = policy_target_forms.ExtRemoveConsumedPRSForm 283 form_class = policy_target_forms.ExtRemoveConsumedPRSForm
291 form_id = "remove_contract_form" 284 form_id = "remove_contract_form"
292 modal_header = _("Remove Policy Rule Set") 285 modal_header = _("Remove Policy Rule Set")
@@ -307,7 +300,8 @@ class ExtRemoveConsumedPRSView(gbforms.ReversingModalFormView):
307 return self.kwargs 300 return self.kwargs
308 301
309 302
310class AddConsumedPRSView(gbforms.ReversingModalFormView): 303class AddConsumedPRSView(gbforms.HelpTextModalMixin,
304 gbforms.ReversingModalFormView):
311 form_class = policy_target_forms.AddConsumedPRSForm 305 form_class = policy_target_forms.AddConsumedPRSForm
312 form_id = "add_consumed_form" 306 form_id = "add_consumed_form"
313 modal_header = _("Add ") 307 modal_header = _("Add ")
@@ -328,7 +322,8 @@ class AddConsumedPRSView(gbforms.ReversingModalFormView):
328 return self.kwargs 322 return self.kwargs
329 323
330 324
331class RemoveConsumedPRSView(gbforms.ReversingModalFormView): 325class RemoveConsumedPRSView(gbforms.HelpTextModalMixin,
326 gbforms.ReversingModalFormView):
332 form_class = policy_target_forms.RemoveConsumedPRSForm 327 form_class = policy_target_forms.RemoveConsumedPRSForm
333 form_id = "remove_contract_form" 328 form_id = "remove_contract_form"
334 modal_header = _("Remove Policy Rule Set") 329 modal_header = _("Remove Policy Rule Set")
diff --git a/gbpui/panels/policytargets/templates/policytargets/details_tabs.html b/gbpui/templates/gbpui/details_tabs.html
index 552d681..b24b36a 100644
--- a/gbpui/panels/policytargets/templates/policytargets/details_tabs.html
+++ b/gbpui/templates/gbpui/details_tabs.html
@@ -1,6 +1,6 @@
1{% extends 'base.html' %} 1{% extends 'base.html' %}
2{% load i18n %} 2{% load i18n %}
3{% block title %}{% trans "Groups" %}{% endblock %} 3{% block title %}{{ page_title }}{% endblock %}
4 4
5{% block main %} 5{% block main %}
6<div class="row"> 6<div class="row">