diff --git a/openstack_dashboard/dashboards/project/network_topology/forms.py b/openstack_dashboard/dashboards/project/network_topology/forms.py new file mode 100644 index 0000000000..77f913d6df --- /dev/null +++ b/openstack_dashboard/dashboards/project/network_topology/forms.py @@ -0,0 +1,18 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +from openstack_dashboard.dashboards.project.routers \ + import forms as router_forms + + +class NTCreateRouterForm(router_forms.CreateForm): + failure_url = 'horizon:project:network_topology:index' diff --git a/openstack_dashboard/dashboards/project/network_topology/templates/network_topology/_create_router.html b/openstack_dashboard/dashboards/project/network_topology/templates/network_topology/_create_router.html deleted file mode 100644 index 73c9c33bd6..0000000000 --- a/openstack_dashboard/dashboards/project/network_topology/templates/network_topology/_create_router.html +++ /dev/null @@ -1,16 +0,0 @@ -{% extends "horizon/common/_modal_form.html" %} -{% load i18n horizon humanize %} - -{% block form_id %}{% endblock %} -{% block form_action %}{% url 'horizon:project:network_topology:createrouter' %}?{{ request.GET.urlencode }}{% endblock %} - -{% block modal_id %}create_router_modal{% endblock %} -{% block modal-header %}{% trans "Create Router" %}{% endblock %} - -{% block modal-body %} -
-
- {% include "horizon/common/_form_fields.html" %} -
-
-{% endblock %} diff --git a/openstack_dashboard/dashboards/project/network_topology/templates/network_topology/create_router.html b/openstack_dashboard/dashboards/project/network_topology/templates/network_topology/create_router.html deleted file mode 100644 index 77f829959a..0000000000 --- a/openstack_dashboard/dashboards/project/network_topology/templates/network_topology/create_router.html +++ /dev/null @@ -1,7 +0,0 @@ -{% extends 'base.html' %} -{% load i18n %} -{% block title %}{% trans "Create Router" %}{% endblock %} - -{% block main %} - {% include 'project/network_topology/_create_router.html' %} -{% endblock %} diff --git a/openstack_dashboard/dashboards/project/network_topology/views.py b/openstack_dashboard/dashboards/project/network_topology/views.py index cbf101cda1..ad86de2124 100644 --- a/openstack_dashboard/dashboards/project/network_topology/views.py +++ b/openstack_dashboard/dashboards/project/network_topology/views.py @@ -30,6 +30,7 @@ from horizon import tabs from horizon.utils.lazy_encoder import LazyTranslationEncoder from openstack_dashboard import api +from openstack_dashboard.dashboards.project.network_topology import forms from openstack_dashboard.dashboards.project.network_topology.instances \ import tables as instances_tables from openstack_dashboard.dashboards.project.network_topology.networks \ @@ -120,8 +121,9 @@ class NTAddInterfaceView(p_views.AddInterfaceView): class NTCreateRouterView(r_views.CreateView): - template_name = 'project/network_topology/create_router.html' + form_class = forms.NTCreateRouterForm success_url = reverse_lazy("horizon:project:network_topology:index") + submit_url = reverse_lazy("horizon:project:network_topology:createrouter") page_title = _("Create a Router")