Renames legacy dashboards.

The "Nova" dashboard is now "Project" and the "Syspanel" dashboard
is now "Admin" to match the current real names of the dashboards
which better match their purposes.

Implements blueprint fix-legacy-dashboard-names

Change-Id: I702aa0d54c4e3b0ac10db46e6d6ed32803919b7b
This commit is contained in:
Gabriel Hurley 2012-10-03 14:29:24 -07:00
parent b8c2634f65
commit a058bfc1d6
307 changed files with 766 additions and 811 deletions

View File

@ -20,18 +20,18 @@ import horizon
class SystemPanels(horizon.PanelGroup): class SystemPanels(horizon.PanelGroup):
slug = "syspanel" slug = "admin"
name = _("System Panel") name = _("System Panel")
panels = ('overview', 'instances', 'volumes', 'services', 'flavors', panels = ('overview', 'instances', 'volumes', 'services', 'flavors',
'images', 'projects', 'users', 'quotas', 'networks',) 'images', 'projects', 'users', 'quotas', 'networks',)
class Syspanel(horizon.Dashboard): class Admin(horizon.Dashboard):
name = _("Admin") name = _("Admin")
slug = "syspanel" slug = "admin"
panels = (SystemPanels,) panels = (SystemPanels,)
default_panel = 'overview' default_panel = 'overview'
permissions = ('openstack.roles.admin',) permissions = ('openstack.roles.admin',)
horizon.register(Syspanel) horizon.register(Admin)

View File

@ -21,7 +21,7 @@
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
import horizon import horizon
from horizon.dashboards.syspanel import dashboard from horizon.dashboards.admin import dashboard
class Flavors(horizon.Panel): class Flavors(horizon.Panel):
@ -29,4 +29,4 @@ class Flavors(horizon.Panel):
slug = 'flavors' slug = 'flavors'
dashboard.Syspanel.register(Flavors) dashboard.Admin.register(Flavors)

View File

@ -20,14 +20,14 @@ class DeleteFlavor(tables.DeleteAction):
class CreateFlavor(tables.LinkAction): class CreateFlavor(tables.LinkAction):
name = "create" name = "create"
verbose_name = _("Create Flavor") verbose_name = _("Create Flavor")
url = "horizon:syspanel:flavors:create" url = "horizon:admin:flavors:create"
classes = ("ajax-modal", "btn-create") classes = ("ajax-modal", "btn-create")
class EditFlavor(tables.LinkAction): class EditFlavor(tables.LinkAction):
name = "edit" name = "edit"
verbose_name = _("Edit Flavor") verbose_name = _("Edit Flavor")
url = "horizon:syspanel:flavors:edit" url = "horizon:admin:flavors:edit"
classes = ("ajax-modal", "btn-edit") classes = ("ajax-modal", "btn-edit")

View File

@ -2,7 +2,7 @@
{% load i18n %} {% load i18n %}
{% block form_id %}create_flavor_form{% endblock %} {% block form_id %}create_flavor_form{% endblock %}
{% block form_action %}{% url horizon:syspanel:flavors:create %}{% endblock %} {% block form_action %}{% url horizon:admin:flavors:create %}{% endblock %}
{% block modal_id %}create_flavor_modal{% endblock %} {% block modal_id %}create_flavor_modal{% endblock %}
{% block modal-header %}{% trans "Create Flavor" %}{% endblock %} {% block modal-header %}{% trans "Create Flavor" %}{% endblock %}
@ -21,5 +21,5 @@
{% block modal-footer %} {% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Create Flavor" %}" /> <input class="btn btn-primary pull-right" type="submit" value="{% trans "Create Flavor" %}" />
<a href="{% url horizon:syspanel:flavors:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a> <a href="{% url horizon:admin:flavors:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %} {% endblock %}

View File

@ -2,7 +2,7 @@
{% load i18n %} {% load i18n %}
{% block form_id %}edit_flavor_form{% endblock %} {% block form_id %}edit_flavor_form{% endblock %}
{% block form_action %}{% url horizon:syspanel:flavors:edit flavor_id %}{% endblock %} {% block form_action %}{% url horizon:admin:flavors:edit flavor_id %}{% endblock %}
{% block modal_id %}edit_flavor_modal{% endblock %} {% block modal_id %}edit_flavor_modal{% endblock %}
{% block modal-header %}{% trans "Edit Flavor" %}{% endblock %} {% block modal-header %}{% trans "Edit Flavor" %}{% endblock %}
@ -22,5 +22,5 @@
{% block modal-footer %} {% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Save" %}" /> <input class="btn btn-primary pull-right" type="submit" value="{% trans "Save" %}" />
<a href="{% url horizon:syspanel:flavors:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a> <a href="{% url horizon:admin:flavors:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %} {% endblock %}

View File

@ -7,5 +7,5 @@
{% endblock page_header %} {% endblock page_header %}
{% block main %} {% block main %}
{% include "syspanel/flavors/_create.html" %} {% include "admin/flavors/_create.html" %}
{% endblock %} {% endblock %}

View File

@ -7,5 +7,5 @@
{% endblock page_header %} {% endblock page_header %}
{% block main %} {% block main %}
{% include "syspanel/flavors/_edit.html" %} {% include "admin/flavors/_edit.html" %}
{% endblock %} {% endblock %}

View File

@ -24,10 +24,10 @@ class FlavorsTests(test.BaseAdminViewTests):
ephemeral=eph).AndReturn(flavor) ephemeral=eph).AndReturn(flavor)
self.mox.ReplayAll() self.mox.ReplayAll()
url = reverse('horizon:syspanel:flavors:create') url = reverse('horizon:admin:flavors:create')
resp = self.client.get(url) resp = self.client.get(url)
self.assertEqual(resp.status_code, 200) self.assertEqual(resp.status_code, 200)
self.assertTemplateUsed(resp, "syspanel/flavors/create.html") self.assertTemplateUsed(resp, "admin/flavors/create.html")
data = {'name': flavor.name, data = {'name': flavor.name,
'vcpus': flavor.vcpus, 'vcpus': flavor.vcpus,
@ -36,7 +36,7 @@ class FlavorsTests(test.BaseAdminViewTests):
'eph_gb': eph} 'eph_gb': eph}
resp = self.client.post(url, data) resp = self.client.post(url, data)
self.assertRedirectsNoFollow(resp, self.assertRedirectsNoFollow(resp,
reverse("horizon:syspanel:flavors:index")) reverse("horizon:admin:flavors:index"))
def test_edit_flavor(self): def test_edit_flavor(self):
flavors = self.flavors.list() flavors = self.flavors.list()
@ -65,10 +65,10 @@ class FlavorsTests(test.BaseAdminViewTests):
ephemeral=eph).AndReturn(flavor) ephemeral=eph).AndReturn(flavor)
self.mox.ReplayAll() self.mox.ReplayAll()
url = reverse('horizon:syspanel:flavors:edit', args=[flavor.id]) url = reverse('horizon:admin:flavors:edit', args=[flavor.id])
resp = self.client.get(url) resp = self.client.get(url)
self.assertEqual(resp.status_code, 200) self.assertEqual(resp.status_code, 200)
self.assertTemplateUsed(resp, "syspanel/flavors/edit.html") self.assertTemplateUsed(resp, "admin/flavors/edit.html")
data = {'flavor_id': flavor.id, data = {'flavor_id': flavor.id,
'name': flavor.name, 'name': flavor.name,
@ -78,4 +78,4 @@ class FlavorsTests(test.BaseAdminViewTests):
'eph_gb': eph} 'eph_gb': eph}
resp = self.client.post(url, data) resp = self.client.post(url, data)
self.assertRedirectsNoFollow(resp, self.assertRedirectsNoFollow(resp,
reverse("horizon:syspanel:flavors:index")) reverse("horizon:admin:flavors:index"))

View File

@ -21,7 +21,7 @@
from django.conf.urls.defaults import patterns, url from django.conf.urls.defaults import patterns, url
from .views import IndexView, CreateView, EditView from .views import IndexView, CreateView, EditView
urlpatterns = patterns('horizon.dashboards.syspanel.flavors.views', urlpatterns = patterns('horizon.dashboards.admin.flavors.views',
url(r'^$', IndexView.as_view(), name='index'), url(r'^$', IndexView.as_view(), name='index'),
url(r'^create/$', CreateView.as_view(), name='create'), url(r'^create/$', CreateView.as_view(), name='create'),
url(r'^(?P<id>[^/]+)/edit/$', EditView.as_view(), name='edit') url(r'^(?P<id>[^/]+)/edit/$', EditView.as_view(), name='edit')

View File

@ -36,7 +36,7 @@ LOG = logging.getLogger(__name__)
class IndexView(tables.DataTableView): class IndexView(tables.DataTableView):
table_class = FlavorsTable table_class = FlavorsTable
template_name = 'syspanel/flavors/index.html' template_name = 'admin/flavors/index.html'
def get_data(self): def get_data(self):
request = self.request request = self.request
@ -53,14 +53,14 @@ class IndexView(tables.DataTableView):
class CreateView(forms.ModalFormView): class CreateView(forms.ModalFormView):
form_class = CreateFlavor form_class = CreateFlavor
template_name = 'syspanel/flavors/create.html' template_name = 'admin/flavors/create.html'
success_url = reverse_lazy('horizon:syspanel:flavors:index') success_url = reverse_lazy('horizon:admin:flavors:index')
class EditView(forms.ModalFormView): class EditView(forms.ModalFormView):
form_class = EditFlavor form_class = EditFlavor
template_name = 'syspanel/flavors/edit.html' template_name = 'admin/flavors/edit.html'
success_url = reverse_lazy('horizon:syspanel:flavors:index') success_url = reverse_lazy('horizon:admin:flavors:index')
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
context = super(EditView, self).get_context_data(**kwargs) context = super(EditView, self).get_context_data(**kwargs)

View File

@ -18,7 +18,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from horizon.dashboards.nova.images_and_snapshots.images import forms from horizon.dashboards.project.images_and_snapshots.images import forms
class AdminUpdateImageForm(forms.UpdateImageForm): class AdminUpdateImageForm(forms.UpdateImageForm):

View File

@ -21,7 +21,7 @@
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
import horizon import horizon
from horizon.dashboards.syspanel import dashboard from horizon.dashboards.admin import dashboard
class Images(horizon.Panel): class Images(horizon.Panel):
@ -29,4 +29,4 @@ class Images(horizon.Panel):
slug = 'images' slug = 'images'
dashboard.Syspanel.register(Images) dashboard.Admin.register(Images)

View File

@ -17,7 +17,7 @@
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from horizon import tables from horizon import tables
from horizon.dashboards.nova.images_and_snapshots.images.tables import ( from horizon.dashboards.project.images_and_snapshots.images.tables import (
ImagesTable, EditImage, DeleteImage) ImagesTable, EditImage, DeleteImage)
@ -27,7 +27,7 @@ class AdminDeleteImage(DeleteImage):
class AdminEditImage(EditImage): class AdminEditImage(EditImage):
url = "horizon:syspanel:images:update" url = "horizon:admin:images:update"
def allowed(self, request, image=None): def allowed(self, request, image=None):
return True return True
@ -35,7 +35,7 @@ class AdminEditImage(EditImage):
class AdminImagesTable(ImagesTable): class AdminImagesTable(ImagesTable):
name = tables.Column("name", name = tables.Column("name",
link="horizon:syspanel:images:detail", link="horizon:admin:images:detail",
verbose_name=_("Image Name")) verbose_name=_("Image Name"))
class Meta: class Meta:

View File

@ -2,7 +2,7 @@
{% load i18n %} {% load i18n %}
{% block form_id %}update_image_form{% endblock %} {% block form_id %}update_image_form{% endblock %}
{% block form_action %}{% url horizon:syspanel:images:update image.id %}{% endblock %} {% block form_action %}{% url horizon:admin:images:update image.id %}{% endblock %}
{% block modal_id %}update_image_modal{% endblock %} {% block modal_id %}update_image_modal{% endblock %}
{% block modal-header %}{% trans "Update Image" %}{% endblock %} {% block modal-header %}{% trans "Update Image" %}{% endblock %}
@ -21,5 +21,5 @@
{% block modal-footer %} {% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Update Image" %}" /> <input class="btn btn-primary pull-right" type="submit" value="{% trans "Update Image" %}" />
<a href="{% url horizon:syspanel:images:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a> <a href="{% url horizon:admin:images:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %} {% endblock %}

View File

@ -8,5 +8,5 @@
{% endblock page_header %} {% endblock page_header %}
{% block main %} {% block main %}
{% include 'syspanel/images/_update.html' %} {% include 'admin/images/_update.html' %}
{% endblock %} {% endblock %}

View File

@ -34,8 +34,8 @@ class ImagesViewTest(test.BaseAdminViewTests):
self.mox.ReplayAll() self.mox.ReplayAll()
res = self.client.get( res = self.client.get(
reverse('horizon:syspanel:images:index')) reverse('horizon:admin:images:index'))
self.assertTemplateUsed(res, 'syspanel/images/index.html') self.assertTemplateUsed(res, 'admin/images/index.html')
self.assertEqual(len(res.context['images_table'].data), self.assertEqual(len(res.context['images_table'].data),
len(self.images.list())) len(self.images.list()))
@ -59,12 +59,12 @@ class ImagesViewTest(test.BaseAdminViewTests):
True]) True])
self.mox.ReplayAll() self.mox.ReplayAll()
url = reverse('horizon:syspanel:images:index') url = reverse('horizon:admin:images:index')
res = self.client.get(url) res = self.client.get(url)
# get all # get all
self.assertEqual(len(res.context['images_table'].data), self.assertEqual(len(res.context['images_table'].data),
len(self.images.list())) len(self.images.list()))
self.assertTemplateUsed(res, 'syspanel/images/index.html') self.assertTemplateUsed(res, 'admin/images/index.html')
page_size = getattr(settings, "API_RESULT_PAGE_SIZE", None) page_size = getattr(settings, "API_RESULT_PAGE_SIZE", None)
settings.API_RESULT_PAGE_SIZE = 2 settings.API_RESULT_PAGE_SIZE = 2
@ -74,7 +74,7 @@ class ImagesViewTest(test.BaseAdminViewTests):
self.assertEqual(len(res.context['images_table'].data), self.assertEqual(len(res.context['images_table'].data),
settings.API_RESULT_PAGE_SIZE) settings.API_RESULT_PAGE_SIZE)
url = "?".join([reverse('horizon:syspanel:images:index'), url = "?".join([reverse('horizon:admin:images:index'),
"=".join([AdminImagesTable._meta.pagination_param, "=".join([AdminImagesTable._meta.pagination_param,
self.images.list()[2].id])]) self.images.list()[2].id])])
res = self.client.get(url) res = self.client.get(url)
@ -82,7 +82,7 @@ class ImagesViewTest(test.BaseAdminViewTests):
self.assertEqual(len(res.context['images_table'].data), self.assertEqual(len(res.context['images_table'].data),
settings.API_RESULT_PAGE_SIZE) settings.API_RESULT_PAGE_SIZE)
url = "?".join([reverse('horizon:syspanel:images:index'), url = "?".join([reverse('horizon:admin:images:index'),
"=".join([AdminImagesTable._meta.pagination_param, "=".join([AdminImagesTable._meta.pagination_param,
self.images.list()[4].id])]) self.images.list()[4].id])])
res = self.client.get(url) res = self.client.get(url)

View File

@ -23,7 +23,7 @@ from django.conf.urls.defaults import patterns, url
from .views import IndexView, UpdateView, DetailView from .views import IndexView, UpdateView, DetailView
urlpatterns = patterns('horizon.dashboards.syspanel.images.views', urlpatterns = patterns('horizon.dashboards.admin.images.views',
url(r'^images/$', IndexView.as_view(), name='index'), url(r'^images/$', IndexView.as_view(), name='index'),
url(r'^(?P<image_id>[^/]+)/update/$', UpdateView.as_view(), name='update'), url(r'^(?P<image_id>[^/]+)/update/$', UpdateView.as_view(), name='update'),
url(r'^(?P<image_id>[^/]+)/detail/$', DetailView.as_view(), name='detail') url(r'^(?P<image_id>[^/]+)/detail/$', DetailView.as_view(), name='detail')

View File

@ -26,7 +26,7 @@ from django.utils.translation import ugettext_lazy as _
from horizon import api from horizon import api
from horizon import exceptions from horizon import exceptions
from horizon import tables from horizon import tables
from horizon.dashboards.nova.images_and_snapshots.images import views from horizon.dashboards.project.images_and_snapshots.images import views
from .tables import AdminImagesTable from .tables import AdminImagesTable
from .forms import AdminUpdateImageForm from .forms import AdminUpdateImageForm
@ -36,7 +36,7 @@ LOG = logging.getLogger(__name__)
class IndexView(tables.DataTableView): class IndexView(tables.DataTableView):
table_class = AdminImagesTable table_class = AdminImagesTable
template_name = 'syspanel/images/index.html' template_name = 'admin/images/index.html'
def has_more_data(self, table): def has_more_data(self, table):
return self._more return self._more
@ -56,9 +56,9 @@ class IndexView(tables.DataTableView):
class UpdateView(views.UpdateView): class UpdateView(views.UpdateView):
template_name = 'syspanel/images/update.html' template_name = 'admin/images/update.html'
form_class = AdminUpdateImageForm form_class = AdminUpdateImageForm
success_url = reverse_lazy('horizon:syspanel:images:index') success_url = reverse_lazy('horizon:admin:images:index')
class DetailView(views.DetailView): class DetailView(views.DetailView):

View File

@ -21,7 +21,7 @@
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
import horizon import horizon
from horizon.dashboards.syspanel import dashboard from horizon.dashboards.admin import dashboard
class Instances(horizon.Panel): class Instances(horizon.Panel):
@ -30,4 +30,4 @@ class Instances(horizon.Panel):
permissions = ('openstack.roles.admin',) permissions = ('openstack.roles.admin',)
dashboard.Syspanel.register(Instances) dashboard.Admin.register(Instances)

View File

@ -22,7 +22,7 @@ from django.utils.translation import ugettext_lazy as _
from horizon import api from horizon import api
from horizon import tables from horizon import tables
from horizon.dashboards.nova.instances.tables import (TerminateInstance, from horizon.dashboards.project.instances.tables import (TerminateInstance,
EditInstance, ConsoleLink, LogLink, CreateSnapshot, EditInstance, ConsoleLink, LogLink, CreateSnapshot,
TogglePause, ToggleSuspend, RebootInstance, get_size, UpdateRow, TogglePause, ToggleSuspend, RebootInstance, get_size, UpdateRow,
get_ips, get_power_state) get_ips, get_power_state)
@ -41,7 +41,7 @@ class AdminUpdateRow(UpdateRow):
return instance return instance
class SyspanelInstancesTable(tables.DataTable): class AdminInstancesTable(tables.DataTable):
TASK_STATUS_CHOICES = ( TASK_STATUS_CHOICES = (
(None, True), (None, True),
("none", True) ("none", True)
@ -66,7 +66,7 @@ class SyspanelInstancesTable(tables.DataTable):
verbose_name=_("Host"), verbose_name=_("Host"),
classes=('nowrap-col',)) classes=('nowrap-col',))
name = tables.Column("name", name = tables.Column("name",
link=("horizon:nova:instances:detail"), link=("horizon:project:instances:detail"),
verbose_name=_("Instance Name")) verbose_name=_("Instance Name"))
ip = tables.Column(get_ips, verbose_name=_("IP Address")) ip = tables.Column(get_ips, verbose_name=_("IP Address"))
size = tables.Column(get_size, size = tables.Column(get_size,

View File

@ -40,8 +40,8 @@ class InstanceViewTest(test.BaseAdminViewTests):
api.nova.flavor_list(IsA(http.HttpRequest)).AndReturn(flavors) api.nova.flavor_list(IsA(http.HttpRequest)).AndReturn(flavors)
self.mox.ReplayAll() self.mox.ReplayAll()
res = self.client.get(reverse('horizon:syspanel:instances:index')) res = self.client.get(reverse('horizon:admin:instances:index'))
self.assertTemplateUsed(res, 'syspanel/instances/index.html') self.assertTemplateUsed(res, 'admin/instances/index.html')
instances = res.context['table'].data instances = res.context['table'].data
self.assertItemsEqual(instances, servers) self.assertItemsEqual(instances, servers)
@ -66,8 +66,8 @@ class InstanceViewTest(test.BaseAdminViewTests):
self.mox.ReplayAll() self.mox.ReplayAll()
res = self.client.get(reverse('horizon:syspanel:instances:index')) res = self.client.get(reverse('horizon:admin:instances:index'))
self.assertTemplateUsed(res, 'syspanel/instances/index.html') self.assertTemplateUsed(res, 'admin/instances/index.html')
instances = res.context['table'].data instances = res.context['table'].data
self.assertItemsEqual(instances, servers) self.assertItemsEqual(instances, servers)
@ -94,9 +94,9 @@ class InstanceViewTest(test.BaseAdminViewTests):
AndRaise(self.exceptions.nova) AndRaise(self.exceptions.nova)
self.mox.ReplayAll() self.mox.ReplayAll()
res = self.client.get(reverse('horizon:syspanel:instances:index')) res = self.client.get(reverse('horizon:admin:instances:index'))
instances = res.context['table'].data instances = res.context['table'].data
self.assertTemplateUsed(res, 'syspanel/instances/index.html') self.assertTemplateUsed(res, 'admin/instances/index.html')
self.assertMessageCount(res, error=len(servers)) self.assertMessageCount(res, error=len(servers))
self.assertItemsEqual(instances, servers) self.assertItemsEqual(instances, servers)
@ -107,8 +107,8 @@ class InstanceViewTest(test.BaseAdminViewTests):
self.mox.ReplayAll() self.mox.ReplayAll()
res = self.client.get(reverse('horizon:syspanel:instances:index')) res = self.client.get(reverse('horizon:admin:instances:index'))
self.assertTemplateUsed(res, 'syspanel/instances/index.html') self.assertTemplateUsed(res, 'admin/instances/index.html')
self.assertEqual(len(res.context['instances_table'].data), 0) self.assertEqual(len(res.context['instances_table'].data), 0)
@test.create_stubs({api: ('server_get', 'flavor_get',), @test.create_stubs({api: ('server_get', 'flavor_get',),
@ -126,7 +126,7 @@ class InstanceViewTest(test.BaseAdminViewTests):
admin=True).AndReturn(tenant) admin=True).AndReturn(tenant)
self.mox.ReplayAll() self.mox.ReplayAll()
url = reverse('horizon:syspanel:instances:index') + \ url = reverse('horizon:admin:instances:index') + \
"?action=row_update&table=instances&obj_id=" + server.id "?action=row_update&table=instances&obj_id=" + server.id
res = self.client.get(url, {}, res = self.client.get(url, {},

View File

@ -26,7 +26,7 @@ from .views import DetailView, AdminIndexView
INSTANCES = r'^(?P<instance_id>[^/]+)/%s$' INSTANCES = r'^(?P<instance_id>[^/]+)/%s$'
urlpatterns = patterns('horizon.dashboards.syspanel.instances.views', urlpatterns = patterns('horizon.dashboards.admin.instances.views',
url(r'^$', AdminIndexView.as_view(), name='index'), url(r'^$', AdminIndexView.as_view(), name='index'),
url(INSTANCES % 'detail', DetailView.as_view(), name='detail'), url(INSTANCES % 'detail', DetailView.as_view(), name='detail'),
url(INSTANCES % 'console', 'console', name='console'), url(INSTANCES % 'console', 'console', name='console'),

View File

@ -27,15 +27,15 @@ from django.utils.translation import ugettext_lazy as _
from horizon import api from horizon import api
from horizon import exceptions from horizon import exceptions
from horizon import tables from horizon import tables
from horizon.dashboards.syspanel.instances.tables import SyspanelInstancesTable from horizon.dashboards.admin.instances.tables import AdminInstancesTable
from horizon.dashboards.nova.instances.views import console, DetailView, vnc from horizon.dashboards.project.instances.views import console, DetailView, vnc
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
class AdminIndexView(tables.DataTableView): class AdminIndexView(tables.DataTableView):
table_class = SyspanelInstancesTable table_class = AdminInstancesTable
template_name = 'syspanel/instances/index.html' template_name = 'admin/instances/index.html'
def get_data(self): def get_data(self):
instances = [] instances = []

View File

@ -59,7 +59,7 @@ class CreateNetwork(forms.SelfHandlingForm):
messages.success(request, msg) messages.success(request, msg)
return network return network
except: except:
redirect = reverse('horizon:syspanel:networks:index') redirect = reverse('horizon:admin:networks:index')
msg = _('Failed to create network %s') % data['name'] msg = _('Failed to create network %s') % data['name']
exceptions.handle(request, msg, redirect=redirect) exceptions.handle(request, msg, redirect=redirect)
@ -71,7 +71,7 @@ class UpdateNetwork(forms.SelfHandlingForm):
widget=forms.TextInput( widget=forms.TextInput(
attrs={'readonly': 'readonly'})) attrs={'readonly': 'readonly'}))
shared = forms.BooleanField(label=_("Shared"), required=False) shared = forms.BooleanField(label=_("Shared"), required=False)
failure_url = 'horizon:syspanel:networks:index' failure_url = 'horizon:admin:networks:index'
def handle(self, request, data): def handle(self, request, data):
try: try:

View File

@ -17,7 +17,7 @@
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
import horizon import horizon
from horizon.dashboards.nova import dashboard from horizon.dashboards.admin import dashboard
class Networks(horizon.Panel): class Networks(horizon.Panel):
@ -25,4 +25,4 @@ class Networks(horizon.Panel):
slug = 'networks' slug = 'networks'
permissions = ('openstack.services.network',) permissions = ('openstack.services.network',)
dashboard.Nova.register(Networks) dashboard.Admin.register(Networks)

View File

@ -58,7 +58,7 @@ class CreatePort(forms.SelfHandlingForm):
msg = _('Failed to create a port for network %s') \ msg = _('Failed to create a port for network %s') \
% data['network_id'] % data['network_id']
LOG.info(msg) LOG.info(msg)
redirect = reverse('horizon:syspanel:networks:detail', redirect = reverse('horizon:admin:networks:detail',
args=(data['network_id'],)) args=(data['network_id'],))
exceptions.handle(request, msg, redirect=redirect) exceptions.handle(request, msg, redirect=redirect)
@ -87,6 +87,6 @@ class UpdatePort(forms.SelfHandlingForm):
except Exception: except Exception:
msg = _('Failed to update port %s') % data['port_id'] msg = _('Failed to update port %s') % data['port_id']
LOG.info(msg) LOG.info(msg)
redirect = reverse('horizon:syspanel:networks:detail', redirect = reverse('horizon:admin:networks:detail',
args=[data['network_id']]) args=[data['network_id']])
exceptions.handle(request, msg, redirect=redirect) exceptions.handle(request, msg, redirect=redirect)

View File

@ -23,7 +23,7 @@ from horizon import api
from horizon import exceptions from horizon import exceptions
from horizon import tables from horizon import tables
from horizon.dashboards.nova.networks.ports.tables import (get_fixed_ips, from horizon.dashboards.project.networks.ports.tables import (get_fixed_ips,
get_attached) get_attached)
@ -41,7 +41,7 @@ class DeletePort(tables.DeleteAction):
msg = _('Failed to delete subnet %s') % obj_id msg = _('Failed to delete subnet %s') % obj_id
LOG.info(msg) LOG.info(msg)
network_id = self.table.kwargs['network_id'] network_id = self.table.kwargs['network_id']
redirect = reverse('horizon:syspanel:networks:detail', redirect = reverse('horizon:admin:networks:detail',
args=[network_id]) args=[network_id])
exceptions.handle(request, msg, redirect=redirect) exceptions.handle(request, msg, redirect=redirect)
@ -49,7 +49,7 @@ class DeletePort(tables.DeleteAction):
class CreatePort(tables.LinkAction): class CreatePort(tables.LinkAction):
name = "create" name = "create"
verbose_name = _("Create Port") verbose_name = _("Create Port")
url = "horizon:syspanel:networks:addport" url = "horizon:admin:networks:addport"
classes = ("ajax-modal", "btn-create") classes = ("ajax-modal", "btn-create")
def get_link_url(self, datum=None): def get_link_url(self, datum=None):
@ -60,7 +60,7 @@ class CreatePort(tables.LinkAction):
class UpdatePort(tables.LinkAction): class UpdatePort(tables.LinkAction):
name = "update" name = "update"
verbose_name = _("Edit Port") verbose_name = _("Edit Port")
url = "horizon:syspanel:networks:editport" url = "horizon:admin:networks:editport"
classes = ("ajax-modal", "btn-edit") classes = ("ajax-modal", "btn-edit")
def get_link_url(self, port): def get_link_url(self, port):
@ -71,7 +71,7 @@ class UpdatePort(tables.LinkAction):
class PortsTable(tables.DataTable): class PortsTable(tables.DataTable):
name = tables.Column("name", name = tables.Column("name",
verbose_name=_("Name"), verbose_name=_("Name"),
link="horizon:syspanel:networks:ports:detail") link="horizon:admin:networks:ports:detail")
fixed_ips = tables.Column(get_fixed_ips, verbose_name=_("Fixed IPs")) fixed_ips = tables.Column(get_fixed_ips, verbose_name=_("Fixed IPs"))
device_id = tables.Column(get_attached, verbose_name=_("Device Attached")) device_id = tables.Column(get_attached, verbose_name=_("Device Attached"))
status = tables.Column("status", verbose_name=_("Status")) status = tables.Column("status", verbose_name=_("Status"))

View File

@ -28,14 +28,14 @@ LOG = logging.getLogger(__name__)
class OverviewTab(tabs.Tab): class OverviewTab(tabs.Tab):
name = _("Overview") name = _("Overview")
slug = "overview" slug = "overview"
template_name = "nova/networks/ports/_detail_overview.html" template_name = "project/networks/ports/_detail_overview.html"
def get_context_data(self, request): def get_context_data(self, request):
port_id = self.tab_group.kwargs['port_id'] port_id = self.tab_group.kwargs['port_id']
try: try:
port = api.quantum.port_get(self.request, port_id) port = api.quantum.port_get(self.request, port_id)
except: except:
redirect = reverse('horizon:syspanel:networks:index') redirect = reverse('horizon:admin:networks:index')
msg = _('Unable to retrieve port details.') msg = _('Unable to retrieve port details.')
exceptions.handle(request, msg, redirect=redirect) exceptions.handle(request, msg, redirect=redirect)
return {'port': port} return {'port': port}

View File

@ -16,9 +16,9 @@
from django.conf.urls.defaults import patterns, url from django.conf.urls.defaults import patterns, url
from horizon.dashboards.nova.networks.ports.views import DetailView from horizon.dashboards.project.networks.ports.views import DetailView
PORTS = r'^(?P<port_id>[^/]+)/%s$' PORTS = r'^(?P<port_id>[^/]+)/%s$'
urlpatterns = patterns('horizon.dashboards.syspanel.networks.ports.views', urlpatterns = patterns('horizon.dashboards.admin.networks.ports.views',
url(PORTS % 'detail', DetailView.as_view(), name='detail')) url(PORTS % 'detail', DetailView.as_view(), name='detail'))

View File

@ -29,8 +29,8 @@ LOG = logging.getLogger(__name__)
class CreateView(forms.ModalFormView): class CreateView(forms.ModalFormView):
form_class = CreatePort form_class = CreatePort
template_name = 'syspanel/networks/ports/create.html' template_name = 'admin/networks/ports/create.html'
success_url = 'horizon:syspanel:networks:detail' success_url = 'horizon:admin:networks:detail'
def get_success_url(self): def get_success_url(self):
return reverse(self.success_url, return reverse(self.success_url,
@ -43,7 +43,7 @@ class CreateView(forms.ModalFormView):
self._object = api.quantum.network_get(self.request, self._object = api.quantum.network_get(self.request,
network_id) network_id)
except: except:
redirect = reverse("horizon:syspanel:networks:detail", redirect = reverse("horizon:admin:networks:detail",
args=(self.kwargs['network_id'],)) args=(self.kwargs['network_id'],))
msg = _("Unable to retrieve network.") msg = _("Unable to retrieve network.")
exceptions.handle(self.request, msg, redirect=redirect) exceptions.handle(self.request, msg, redirect=redirect)
@ -62,9 +62,9 @@ class CreateView(forms.ModalFormView):
class UpdateView(forms.ModalFormView): class UpdateView(forms.ModalFormView):
form_class = UpdatePort form_class = UpdatePort
template_name = 'syspanel/networks/ports/update.html' template_name = 'admin/networks/ports/update.html'
context_object_name = 'port' context_object_name = 'port'
success_url = 'horizon:syspanel:networks:detail' success_url = 'horizon:admin:networks:detail'
def get_success_url(self): def get_success_url(self):
return reverse(self.success_url, return reverse(self.success_url,
@ -76,7 +76,7 @@ class UpdateView(forms.ModalFormView):
try: try:
self._object = api.quantum.port_get(self.request, port_id) self._object = api.quantum.port_get(self.request, port_id)
except: except:
redirect = reverse("horizon:syspanel:networks:detail", redirect = reverse("horizon:admin:networks:detail",
args=(self.kwargs['network_id'],)) args=(self.kwargs['network_id'],))
msg = _('Unable to retrieve port details') msg = _('Unable to retrieve port details')
exceptions.handle(self.request, msg, redirect=redirect) exceptions.handle(self.request, msg, redirect=redirect)

View File

@ -23,14 +23,14 @@ from horizon import api
from horizon import forms from horizon import forms
from horizon import exceptions from horizon import exceptions
from horizon.dashboards.nova.networks.subnets import forms as user_forms from horizon.dashboards.project.networks.subnets import forms as user_forms
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
class CreateSubnet(user_forms.CreateSubnet): class CreateSubnet(user_forms.CreateSubnet):
failure_url = 'horizon:syspanel:networks:detail' failure_url = 'horizon:admin:networks:detail'
def handle(self, request, data): def handle(self, request, data):
try: try:
@ -49,4 +49,4 @@ class CreateSubnet(user_forms.CreateSubnet):
class UpdateSubnet(user_forms.UpdateSubnet): class UpdateSubnet(user_forms.UpdateSubnet):
tenant_id = forms.CharField(widget=forms.HiddenInput()) tenant_id = forms.CharField(widget=forms.HiddenInput())
failure_url = 'horizon:syspanel:networks:detail' failure_url = 'horizon:admin:networks:detail'

View File

@ -38,7 +38,7 @@ class DeleteSubnet(tables.DeleteAction):
msg = _('Failed to delete subnet %s') % obj_id msg = _('Failed to delete subnet %s') % obj_id
LOG.info(msg) LOG.info(msg)
network_id = self.table.kwargs['network_id'] network_id = self.table.kwargs['network_id']
redirect = reverse('horizon:syspanel:networks:detail', redirect = reverse('horizon:admin:networks:detail',
args=[network_id]) args=[network_id])
exceptions.handle(request, msg, redirect=redirect) exceptions.handle(request, msg, redirect=redirect)
@ -46,7 +46,7 @@ class DeleteSubnet(tables.DeleteAction):
class CreateSubnet(tables.LinkAction): class CreateSubnet(tables.LinkAction):
name = "create" name = "create"
verbose_name = _("Create Subnet") verbose_name = _("Create Subnet")
url = "horizon:syspanel:networks:addsubnet" url = "horizon:admin:networks:addsubnet"
classes = ("ajax-modal", "btn-create") classes = ("ajax-modal", "btn-create")
def get_link_url(self, datum=None): def get_link_url(self, datum=None):
@ -57,7 +57,7 @@ class CreateSubnet(tables.LinkAction):
class UpdateSubnet(tables.LinkAction): class UpdateSubnet(tables.LinkAction):
name = "update" name = "update"
verbose_name = _("Edit Subnet") verbose_name = _("Edit Subnet")
url = "horizon:syspanel:networks:editsubnet" url = "horizon:admin:networks:editsubnet"
classes = ("ajax-modal", "btn-edit") classes = ("ajax-modal", "btn-edit")
def get_link_url(self, subnet): def get_link_url(self, subnet):
@ -67,7 +67,7 @@ class UpdateSubnet(tables.LinkAction):
class SubnetsTable(tables.DataTable): class SubnetsTable(tables.DataTable):
name = tables.Column("name", verbose_name=_("Name"), name = tables.Column("name", verbose_name=_("Name"),
link='horizon:syspanel:networks:subnets:detail') link='horizon:admin:networks:subnets:detail')
cidr = tables.Column("cidr", verbose_name=_("CIDR")) cidr = tables.Column("cidr", verbose_name=_("CIDR"))
ip_version = tables.Column("ipver_str", verbose_name=_("IP Version")) ip_version = tables.Column("ipver_str", verbose_name=_("IP Version"))
gateway_ip = tables.Column("gateway_ip", verbose_name=_("Gateway IP")) gateway_ip = tables.Column("gateway_ip", verbose_name=_("Gateway IP"))

View File

@ -16,9 +16,9 @@
from django.conf.urls.defaults import patterns, url from django.conf.urls.defaults import patterns, url
from horizon.dashboards.nova.networks.subnets.views import DetailView from horizon.dashboards.project.networks.subnets.views import DetailView
SUBNETS = r'^(?P<subnet_id>[^/]+)/%s$' SUBNETS = r'^(?P<subnet_id>[^/]+)/%s$'
urlpatterns = patterns('horizon.dashboards.syspanel.networks.subnets.views', urlpatterns = patterns('horizon.dashboards.admin.networks.subnets.views',
url(SUBNETS % 'detail', DetailView.as_view(), name='detail')) url(SUBNETS % 'detail', DetailView.as_view(), name='detail'))

View File

@ -29,8 +29,8 @@ LOG = logging.getLogger(__name__)
class CreateView(forms.ModalFormView): class CreateView(forms.ModalFormView):
form_class = CreateSubnet form_class = CreateSubnet
template_name = 'syspanel/networks/subnets/create.html' template_name = 'admin/networks/subnets/create.html'
success_url = 'horizon:syspanel:networks:detail' success_url = 'horizon:admin:networks:detail'
def get_success_url(self): def get_success_url(self):
return reverse(self.success_url, return reverse(self.success_url,
@ -43,7 +43,7 @@ class CreateView(forms.ModalFormView):
self._object = api.quantum.network_get(self.request, self._object = api.quantum.network_get(self.request,
network_id) network_id)
except: except:
redirect = reverse('horizon:nova:networks:index') redirect = reverse('horizon:project:networks:index')
msg = _("Unable to retrieve network.") msg = _("Unable to retrieve network.")
exceptions.handle(self.request, msg, redirect=redirect) exceptions.handle(self.request, msg, redirect=redirect)
return self._object return self._object
@ -61,9 +61,9 @@ class CreateView(forms.ModalFormView):
class UpdateView(forms.ModalFormView): class UpdateView(forms.ModalFormView):
form_class = UpdateSubnet form_class = UpdateSubnet
template_name = 'syspanel/networks/subnets/update.html' template_name = 'admin/networks/subnets/update.html'
context_object_name = 'subnet' context_object_name = 'subnet'
success_url = 'horizon:syspanel:networks:detail' success_url = 'horizon:admin:networks:detail'
def get_success_url(self): def get_success_url(self):
return reverse(self.success_url, return reverse(self.success_url,
@ -75,7 +75,7 @@ class UpdateView(forms.ModalFormView):
try: try:
self._object = api.quantum.subnet_get(self.request, subnet_id) self._object = api.quantum.subnet_get(self.request, subnet_id)
except: except:
redirect = reverse("horizon:syspanel:networks:detail", redirect = reverse("horizon:admin:networks:detail",
args=(self.kwargs['network_id'],)) args=(self.kwargs['network_id'],))
msg = _('Unable to retrieve subnet details') msg = _('Unable to retrieve subnet details')
exceptions.handle(self.request, msg, redirect=redirect) exceptions.handle(self.request, msg, redirect=redirect)

View File

@ -24,7 +24,7 @@ from horizon import api
from horizon import exceptions from horizon import exceptions
from horizon import tables from horizon import tables
from horizon.dashboards.nova.networks.tables import get_subnets from horizon.dashboards.project.networks.tables import get_subnets
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
@ -40,21 +40,21 @@ class DeleteNetwork(tables.DeleteAction):
except: except:
msg = _('Failed to delete network %s') % obj_id msg = _('Failed to delete network %s') % obj_id
LOG.info(msg) LOG.info(msg)
redirect = reverse('horizon:syspanel:networks:index') redirect = reverse('horizon:admin:networks:index')
exceptions.handle(request, msg, redirect=redirect) exceptions.handle(request, msg, redirect=redirect)
class CreateNetwork(tables.LinkAction): class CreateNetwork(tables.LinkAction):
name = "create" name = "create"
verbose_name = _("Create Network") verbose_name = _("Create Network")
url = "horizon:syspanel:networks:create" url = "horizon:admin:networks:create"
classes = ("ajax-modal", "btn-create") classes = ("ajax-modal", "btn-create")
class EditNetwork(tables.LinkAction): class EditNetwork(tables.LinkAction):
name = "update" name = "update"
verbose_name = _("Edit Network") verbose_name = _("Edit Network")
url = "horizon:syspanel:networks:update" url = "horizon:admin:networks:update"
classes = ("ajax-modal", "btn-edit") classes = ("ajax-modal", "btn-edit")
@ -66,7 +66,7 @@ class EditNetwork(tables.LinkAction):
class NetworksTable(tables.DataTable): class NetworksTable(tables.DataTable):
tenant = tables.Column("tenant_name", verbose_name=_("Project")) tenant = tables.Column("tenant_name", verbose_name=_("Project"))
name = tables.Column("name", verbose_name=_("Network Name"), name = tables.Column("name", verbose_name=_("Network Name"),
link='horizon:syspanel:networks:detail') link='horizon:admin:networks:detail')
subnets = tables.Column(get_subnets, subnets = tables.Column(get_subnets,
verbose_name=_("Subnets Associated"),) verbose_name=_("Subnets Associated"),)
shared = tables.Column("shared", verbose_name=_("Shared"), shared = tables.Column("shared", verbose_name=_("Shared"),

View File

@ -2,7 +2,7 @@
{% load i18n %} {% load i18n %}
{% block form_id %}create_network_form{% endblock %} {% block form_id %}create_network_form{% endblock %}
{% block form_action %}{% url horizon:syspanel:networks:create %}{% endblock %} {% block form_action %}{% url horizon:admin:networks:create %}{% endblock %}
{% block modal_id %}create_network_modal{% endblock %} {% block modal_id %}create_network_modal{% endblock %}
{% block modal-header %}{% trans "Create Network" %}{% endblock %} {% block modal-header %}{% trans "Create Network" %}{% endblock %}
@ -21,5 +21,5 @@
{% block modal-footer %} {% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Create Network" %}" /> <input class="btn btn-primary pull-right" type="submit" value="{% trans "Create Network" %}" />
<a href="{% url horizon:syspanel:networks:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a> <a href="{% url horizon:admin:networks:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %} {% endblock %}

View File

@ -2,7 +2,7 @@
{% load i18n %} {% load i18n %}
{% block form_id %}update_network_form{% endblock %} {% block form_id %}update_network_form{% endblock %}
{% block form_action %}{% url horizon:nova:networks:update network_id %}{% endblock %} {% block form_action %}{% url horizon:admin:networks:update network_id %}{% endblock %}
{% block modal-header %}{% trans "Edit Network" %}{% endblock %} {% block modal-header %}{% trans "Edit Network" %}{% endblock %}
@ -20,5 +20,5 @@
{% block modal-footer %} {% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Save Changes" %}" /> <input class="btn btn-primary pull-right" type="submit" value="{% trans "Save Changes" %}" />
<a href="{% url horizon:nova:networks:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a> <a href="{% url horizon:admin:networks:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %} {% endblock %}

View File

@ -7,5 +7,5 @@
{% endblock page_header %} {% endblock page_header %}
{% block main %} {% block main %}
{% include "syspanel/networks/_create.html" %} {% include "admin/networks/_create.html" %}
{% endblock %} {% endblock %}

View File

@ -2,7 +2,7 @@
{% load i18n %} {% load i18n %}
{% block form_id %}create_port_form{% endblock %} {% block form_id %}create_port_form{% endblock %}
{% block form_action %}{% url horizon:syspanel:networks:addport network.id %} {% block form_action %}{% url horizon:admin:networks:addport network.id %}
{% endblock %} {% endblock %}
{% block modal-header %}{% trans "Create Port" %}{% endblock %} {% block modal-header %}{% trans "Create Port" %}{% endblock %}
@ -21,5 +21,5 @@
{% block modal-footer %} {% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Create Port" %}" /> <input class="btn btn-primary pull-right" type="submit" value="{% trans "Create Port" %}" />
<a href="{% url horizon:syspanel:networks:detail network.id %}" class="btn secondary cancel close">{% trans "Cancel" %}</a> <a href="{% url horizon:admin:networks:detail network.id %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %} {% endblock %}

View File

@ -2,7 +2,7 @@
{% load i18n %} {% load i18n %}
{% block form_id %}update_port_form{% endblock %} {% block form_id %}update_port_form{% endblock %}
{% block form_action %}{% url horizon:syspanel:networks:editport network_id port_id %}{% endblock %} {% block form_action %}{% url horizon:admin:networks:editport network_id port_id %}{% endblock %}
{% block modal-header %}{% trans "Edit Port" %}{% endblock %} {% block modal-header %}{% trans "Edit Port" %}{% endblock %}
@ -25,5 +25,5 @@
{% block modal-footer %} {% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Save Changes" %}" /> <input class="btn btn-primary pull-right" type="submit" value="{% trans "Save Changes" %}" />
<a href="{% url horizon:syspanel:networks:detail network_id %}" class="btn secondary cancel close">{% trans "Cancel" %}</a> <a href="{% url horizon:admin:networks:detail network_id %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %} {% endblock %}

View File

@ -7,5 +7,5 @@
{% endblock page_header %} {% endblock page_header %}
{% block main %} {% block main %}
{% include "syspanel/networks/ports/_create.html" %} {% include "admin/networks/ports/_create.html" %}
{% endblock %} {% endblock %}

View File

@ -7,5 +7,5 @@
{% endblock page_header %} {% endblock page_header %}
{% block main %} {% block main %}
{% include 'syspanel/networks/ports/_update.html' %} {% include 'admin/networks/ports/_update.html' %}
{% endblock %} {% endblock %}

View File

@ -2,7 +2,7 @@
{% load i18n %} {% load i18n %}
{% block form_id %}create_subnet_form{% endblock %} {% block form_id %}create_subnet_form{% endblock %}
{% block form_action %}{% url horizon:syspanel:networks:addsubnet network.id %} {% block form_action %}{% url horizon:admin:networks:addsubnet network.id %}
{% endblock %} {% endblock %}
{% block modal-header %}{% trans "Create Subnet" %}{% endblock %} {% block modal-header %}{% trans "Create Subnet" %}{% endblock %}
@ -21,5 +21,5 @@
{% block modal-footer %} {% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Create Subnet" %}" /> <input class="btn btn-primary pull-right" type="submit" value="{% trans "Create Subnet" %}" />
<a href="{% url horizon:syspanel:networks:detail network.id %}" class="btn secondary cancel close">{% trans "Cancel" %}</a> <a href="{% url horizon:admin:networks:detail network.id %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %} {% endblock %}

View File

@ -2,7 +2,7 @@
{% load i18n %} {% load i18n %}
{% block form_id %}update_subnet_form{% endblock %} {% block form_id %}update_subnet_form{% endblock %}
{% block form_action %}{% url horizon:syspanel:networks:editsubnet network_id subnet_id %}{% endblock %} {% block form_action %}{% url horizon:admin:networks:editsubnet network_id subnet_id %}{% endblock %}
{% block modal-header %}{% trans "Edit Subnet" %}{% endblock %} {% block modal-header %}{% trans "Edit Subnet" %}{% endblock %}
@ -29,5 +29,5 @@
{% block modal-footer %} {% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Save Changes" %}" /> <input class="btn btn-primary pull-right" type="submit" value="{% trans "Save Changes" %}" />
<a href="{% url horizon:syspanel:networks:detail network_id %}" class="btn secondary cancel close">{% trans "Cancel" %}</a> <a href="{% url horizon:admin:networks:detail network_id %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %} {% endblock %}

View File

@ -7,5 +7,5 @@
{% endblock page_header %} {% endblock page_header %}
{% block main %} {% block main %}
{% include "nova/networks/subnets/_create.html" %} {% include "admin/networks/subnets/_create.html" %}
{% endblock %} {% endblock %}

View File

@ -7,5 +7,5 @@
{% endblock page_header %} {% endblock page_header %}
{% block main %} {% block main %}
{% include 'nova/networks/subnets/_update.html' %} {% include 'admin/networks/subnets/_update.html' %}
{% endblock %} {% endblock %}

View File

@ -7,5 +7,5 @@
{% endblock page_header %} {% endblock page_header %}
{% block main %} {% block main %}
{% include 'nova/networks/_update.html' %} {% include 'admin/networks/_update.html' %}
{% endblock %} {% endblock %}

View File

@ -23,7 +23,7 @@ from horizon import api
from horizon import test from horizon import test
INDEX_URL = reverse('horizon:syspanel:networks:index') INDEX_URL = reverse('horizon:admin:networks:index')
class NetworkTests(test.BaseAdminViewTests): class NetworkTests(test.BaseAdminViewTests):
@ -40,7 +40,7 @@ class NetworkTests(test.BaseAdminViewTests):
res = self.client.get(INDEX_URL) res = self.client.get(INDEX_URL)
self.assertTemplateUsed(res, 'syspanel/networks/index.html') self.assertTemplateUsed(res, 'admin/networks/index.html')
networks = res.context['networks_table'].data networks = res.context['networks_table'].data
self.assertItemsEqual(networks, self.networks.list()) self.assertItemsEqual(networks, self.networks.list())
@ -53,7 +53,7 @@ class NetworkTests(test.BaseAdminViewTests):
res = self.client.get(INDEX_URL) res = self.client.get(INDEX_URL)
self.assertTemplateUsed(res, 'syspanel/networks/index.html') self.assertTemplateUsed(res, 'admin/networks/index.html')
self.assertEqual(len(res.context['networks_table'].data), 0) self.assertEqual(len(res.context['networks_table'].data), 0)
self.assertMessageCount(res, error=1) self.assertMessageCount(res, error=1)
@ -71,10 +71,10 @@ class NetworkTests(test.BaseAdminViewTests):
self.mox.ReplayAll() self.mox.ReplayAll()
res = self.client.get(reverse('horizon:syspanel:networks:detail', res = self.client.get(reverse('horizon:admin:networks:detail',
args=[network_id])) args=[network_id]))
self.assertTemplateUsed(res, 'nova/networks/detail.html') self.assertTemplateUsed(res, 'project/networks/detail.html')
subnets = res.context['subnets_table'].data subnets = res.context['subnets_table'].data
ports = res.context['ports_table'].data ports = res.context['ports_table'].data
self.assertItemsEqual(subnets, [self.subnets.first()]) self.assertItemsEqual(subnets, [self.subnets.first()])
@ -94,7 +94,7 @@ class NetworkTests(test.BaseAdminViewTests):
self.mox.ReplayAll() self.mox.ReplayAll()
url = reverse('horizon:syspanel:networks:detail', args=[network_id]) url = reverse('horizon:admin:networks:detail', args=[network_id])
res = self.client.get(url) res = self.client.get(url)
redir_url = INDEX_URL redir_url = INDEX_URL
@ -114,10 +114,10 @@ class NetworkTests(test.BaseAdminViewTests):
self.mox.ReplayAll() self.mox.ReplayAll()
res = self.client.get(reverse('horizon:syspanel:networks:detail', res = self.client.get(reverse('horizon:admin:networks:detail',
args=[network_id])) args=[network_id]))
self.assertTemplateUsed(res, 'nova/networks/detail.html') self.assertTemplateUsed(res, 'project/networks/detail.html')
subnets = res.context['subnets_table'].data subnets = res.context['subnets_table'].data
ports = res.context['ports_table'].data ports = res.context['ports_table'].data
self.assertEqual(len(subnets), 0) self.assertEqual(len(subnets), 0)
@ -137,10 +137,10 @@ class NetworkTests(test.BaseAdminViewTests):
self.mox.ReplayAll() self.mox.ReplayAll()
res = self.client.get(reverse('horizon:syspanel:networks:detail', res = self.client.get(reverse('horizon:admin:networks:detail',
args=[network_id])) args=[network_id]))
self.assertTemplateUsed(res, 'nova/networks/detail.html') self.assertTemplateUsed(res, 'project/networks/detail.html')
subnets = res.context['subnets_table'].data subnets = res.context['subnets_table'].data
ports = res.context['ports_table'].data ports = res.context['ports_table'].data
self.assertItemsEqual(subnets, [self.subnets.first()]) self.assertItemsEqual(subnets, [self.subnets.first()])
@ -153,10 +153,10 @@ class NetworkTests(test.BaseAdminViewTests):
.AndReturn(tenants) .AndReturn(tenants)
self.mox.ReplayAll() self.mox.ReplayAll()
url = reverse('horizon:syspanel:networks:create') url = reverse('horizon:admin:networks:create')
res = self.client.get(url) res = self.client.get(url)
self.assertTemplateUsed(res, 'syspanel/networks/create.html') self.assertTemplateUsed(res, 'admin/networks/create.html')
@test.create_stubs({api.quantum: ('network_create',), @test.create_stubs({api.quantum: ('network_create',),
api.keystone: ('tenant_list',)}) api.keystone: ('tenant_list',)})
@ -174,7 +174,7 @@ class NetworkTests(test.BaseAdminViewTests):
form_data = {'tenant_id': tenant_id, form_data = {'tenant_id': tenant_id,
'name': network.name, 'name': network.name,
'shared': True} 'shared': True}
url = reverse('horizon:syspanel:networks:create') url = reverse('horizon:admin:networks:create')
res = self.client.post(url, form_data) res = self.client.post(url, form_data)
self.assertNoFormErrors(res) self.assertNoFormErrors(res)
@ -196,7 +196,7 @@ class NetworkTests(test.BaseAdminViewTests):
form_data = {'tenant_id': tenant_id, form_data = {'tenant_id': tenant_id,
'name': network.name, 'name': network.name,
'shared': False} 'shared': False}
url = reverse('horizon:syspanel:networks:create') url = reverse('horizon:admin:networks:create')
res = self.client.post(url, form_data) res = self.client.post(url, form_data)
self.assertNoFormErrors(res) self.assertNoFormErrors(res)
@ -210,10 +210,10 @@ class NetworkTests(test.BaseAdminViewTests):
self.mox.ReplayAll() self.mox.ReplayAll()
url = reverse('horizon:syspanel:networks:update', args=[network.id]) url = reverse('horizon:admin:networks:update', args=[network.id])
res = self.client.get(url) res = self.client.get(url)
self.assertTemplateUsed(res, 'syspanel/networks/update.html') self.assertTemplateUsed(res, 'admin/networks/update.html')
@test.create_stubs({api.quantum: ('network_get',)}) @test.create_stubs({api.quantum: ('network_get',)})
def test_network_update_get_exception(self): def test_network_update_get_exception(self):
@ -223,7 +223,7 @@ class NetworkTests(test.BaseAdminViewTests):
self.mox.ReplayAll() self.mox.ReplayAll()
url = reverse('horizon:syspanel:networks:update', args=[network.id]) url = reverse('horizon:admin:networks:update', args=[network.id])
res = self.client.get(url) res = self.client.get(url)
redir_url = INDEX_URL redir_url = INDEX_URL
@ -244,7 +244,7 @@ class NetworkTests(test.BaseAdminViewTests):
'name': network.name, 'name': network.name,
'tenant_id': network.tenant_id, 'tenant_id': network.tenant_id,
'shared': True} 'shared': True}
url = reverse('horizon:syspanel:networks:update', args=[network.id]) url = reverse('horizon:admin:networks:update', args=[network.id])
res = self.client.post(url, formData) res = self.client.post(url, formData)
self.assertRedirectsNoFollow(res, INDEX_URL) self.assertRedirectsNoFollow(res, INDEX_URL)
@ -264,7 +264,7 @@ class NetworkTests(test.BaseAdminViewTests):
'name': network.name, 'name': network.name,
'tenant_id': network.tenant_id, 'tenant_id': network.tenant_id,
'shared': False} 'shared': False}
url = reverse('horizon:syspanel:networks:update', args=[network.id]) url = reverse('horizon:admin:networks:update', args=[network.id])
res = self.client.post(url, form_data) res = self.client.post(url, form_data)
self.assertRedirectsNoFollow(res, INDEX_URL) self.assertRedirectsNoFollow(res, INDEX_URL)
@ -316,11 +316,11 @@ class NetworkTests(test.BaseAdminViewTests):
self.mox.ReplayAll() self.mox.ReplayAll()
url = reverse('horizon:syspanel:networks:subnets:detail', url = reverse('horizon:admin:networks:subnets:detail',
args=[subnet.id]) args=[subnet.id])
res = self.client.get(url) res = self.client.get(url)
self.assertTemplateUsed(res, 'nova/networks/subnets/detail.html') self.assertTemplateUsed(res, 'project/networks/subnets/detail.html')
self.assertEqual(res.context['subnet'].id, subnet.id) self.assertEqual(res.context['subnet'].id, subnet.id)
@test.create_stubs({api.quantum: ('subnet_get',)}) @test.create_stubs({api.quantum: ('subnet_get',)})
@ -331,13 +331,13 @@ class NetworkTests(test.BaseAdminViewTests):
self.mox.ReplayAll() self.mox.ReplayAll()
url = reverse('horizon:syspanel:networks:subnets:detail', url = reverse('horizon:admin:networks:subnets:detail',
args=[subnet.id]) args=[subnet.id])
res = self.client.get(url) res = self.client.get(url)
# syspanel DetailView is shared with userpanel one, so # admin DetailView is shared with userpanel one, so
# redirection URL on error is userpanel index. # redirection URL on error is userpanel index.
redir_url = reverse('horizon:nova:networks:index') redir_url = reverse('horizon:project:networks:index')
self.assertRedirectsNoFollow(res, redir_url) self.assertRedirectsNoFollow(res, redir_url)
@test.create_stubs({api.quantum: ('network_get',)}) @test.create_stubs({api.quantum: ('network_get',)})
@ -348,11 +348,11 @@ class NetworkTests(test.BaseAdminViewTests):
.AndReturn(self.networks.first()) .AndReturn(self.networks.first())
self.mox.ReplayAll() self.mox.ReplayAll()
url = reverse('horizon:syspanel:networks:addsubnet', url = reverse('horizon:admin:networks:addsubnet',
args=[network.id]) args=[network.id])
res = self.client.get(url) res = self.client.get(url)
self.assertTemplateUsed(res, 'syspanel/networks/subnets/create.html') self.assertTemplateUsed(res, 'admin/networks/subnets/create.html')
@test.create_stubs({api.quantum: ('network_get', @test.create_stubs({api.quantum: ('network_get',
'subnet_create',)}) 'subnet_create',)})
@ -382,12 +382,12 @@ class NetworkTests(test.BaseAdminViewTests):
'cidr': subnet.cidr, 'cidr': subnet.cidr,
'ip_version': subnet.ip_version, 'ip_version': subnet.ip_version,
'gateway_ip': subnet.gateway_ip} 'gateway_ip': subnet.gateway_ip}
url = reverse('horizon:syspanel:networks:addsubnet', url = reverse('horizon:admin:networks:addsubnet',
args=[subnet.network_id]) args=[subnet.network_id])
res = self.client.post(url, form_data) res = self.client.post(url, form_data)
self.assertNoFormErrors(res) self.assertNoFormErrors(res)
redir_url = reverse('horizon:syspanel:networks:detail', redir_url = reverse('horizon:admin:networks:detail',
args=[subnet.network_id]) args=[subnet.network_id])
self.assertRedirectsNoFollow(res, redir_url) self.assertRedirectsNoFollow(res, redir_url)
@ -407,14 +407,14 @@ class NetworkTests(test.BaseAdminViewTests):
'cidr': subnet.cidr, 'cidr': subnet.cidr,
'ip_version': subnet.ip_version, 'ip_version': subnet.ip_version,
'gateway_ip': subnet.gateway_ip} 'gateway_ip': subnet.gateway_ip}
url = reverse('horizon:syspanel:networks:addsubnet', url = reverse('horizon:admin:networks:addsubnet',
args=[subnet.network_id]) args=[subnet.network_id])
res = self.client.post(url, form_data) res = self.client.post(url, form_data)
self.assertNoFormErrors(res) self.assertNoFormErrors(res)
# syspanel DetailView is shared with userpanel one, so # admin DetailView is shared with userpanel one, so
# redirection URL on error is userpanel index. # redirection URL on error is userpanel index.
redir_url = reverse('horizon:nova:networks:index') redir_url = reverse('horizon:project:networks:index')
self.assertRedirectsNoFollow(res, redir_url) self.assertRedirectsNoFollow(res, redir_url)
@test.create_stubs({api.quantum: ('network_get', @test.create_stubs({api.quantum: ('network_get',
@ -445,11 +445,11 @@ class NetworkTests(test.BaseAdminViewTests):
'cidr': subnet.cidr, 'cidr': subnet.cidr,
'ip_version': subnet.ip_version, 'ip_version': subnet.ip_version,
'gateway_ip': subnet.gateway_ip} 'gateway_ip': subnet.gateway_ip}
url = reverse('horizon:syspanel:networks:addsubnet', url = reverse('horizon:admin:networks:addsubnet',
args=[subnet.network_id]) args=[subnet.network_id])
res = self.client.post(url, form_data) res = self.client.post(url, form_data)
redir_url = reverse('horizon:syspanel:networks:detail', redir_url = reverse('horizon:admin:networks:detail',
args=[subnet.network_id]) args=[subnet.network_id])
self.assertRedirectsNoFollow(res, redir_url) self.assertRedirectsNoFollow(res, redir_url)
@ -470,7 +470,7 @@ class NetworkTests(test.BaseAdminViewTests):
'cidr': cidr, 'cidr': cidr,
'ip_version': subnet.ip_version, 'ip_version': subnet.ip_version,
'gateway_ip': subnet.gateway_ip} 'gateway_ip': subnet.gateway_ip}
url = reverse('horizon:syspanel:networks:addsubnet', url = reverse('horizon:admin:networks:addsubnet',
args=[subnet.network_id]) args=[subnet.network_id])
res = self.client.post(url, form_data) res = self.client.post(url, form_data)
@ -494,7 +494,7 @@ class NetworkTests(test.BaseAdminViewTests):
'cidr': subnet.cidr, 'cidr': subnet.cidr,
'ip_version': subnet.ip_version, 'ip_version': subnet.ip_version,
'gateway_ip': gateway_ip} 'gateway_ip': gateway_ip}
url = reverse('horizon:syspanel:networks:addsubnet', url = reverse('horizon:admin:networks:addsubnet',
args=[subnet.network_id]) args=[subnet.network_id])
res = self.client.post(url, form_data) res = self.client.post(url, form_data)
@ -519,11 +519,11 @@ class NetworkTests(test.BaseAdminViewTests):
'cidr': subnet.cidr, 'cidr': subnet.cidr,
'ip_version': subnet.ip_version, 'ip_version': subnet.ip_version,
'gateway_ip': subnet.gateway_ip} 'gateway_ip': subnet.gateway_ip}
url = reverse('horizon:syspanel:networks:editsubnet', url = reverse('horizon:admin:networks:editsubnet',
args=[subnet.network_id, subnet.id]) args=[subnet.network_id, subnet.id])
res = self.client.post(url, formData) res = self.client.post(url, formData)
redir_url = reverse('horizon:syspanel:networks:detail', redir_url = reverse('horizon:admin:networks:detail',
args=[subnet.network_id]) args=[subnet.network_id])
self.assertRedirectsNoFollow(res, redir_url) self.assertRedirectsNoFollow(res, redir_url)
@ -544,7 +544,7 @@ class NetworkTests(test.BaseAdminViewTests):
'cidr': subnet.cidr, 'cidr': subnet.cidr,
'ip_version': subnet.ip_version, 'ip_version': subnet.ip_version,
'gateway_ip': gateway_ip} 'gateway_ip': gateway_ip}
url = reverse('horizon:syspanel:networks:editsubnet', url = reverse('horizon:admin:networks:editsubnet',
args=[subnet.network_id, subnet.id]) args=[subnet.network_id, subnet.id])
res = self.client.post(url, formData) res = self.client.post(url, formData)
@ -564,7 +564,7 @@ class NetworkTests(test.BaseAdminViewTests):
self.mox.ReplayAll() self.mox.ReplayAll()
formData = {'action': 'subnets__delete__%s' % subnet.id} formData = {'action': 'subnets__delete__%s' % subnet.id}
url = reverse('horizon:syspanel:networks:detail', url = reverse('horizon:admin:networks:detail',
args=[network_id]) args=[network_id])
res = self.client.post(url, formData) res = self.client.post(url, formData)
@ -585,7 +585,7 @@ class NetworkTests(test.BaseAdminViewTests):
self.mox.ReplayAll() self.mox.ReplayAll()
formData = {'action': 'subnets__delete__%s' % subnet.id} formData = {'action': 'subnets__delete__%s' % subnet.id}
url = reverse('horizon:syspanel:networks:detail', url = reverse('horizon:admin:networks:detail',
args=[network_id]) args=[network_id])
res = self.client.post(url, formData) res = self.client.post(url, formData)
@ -599,10 +599,10 @@ class NetworkTests(test.BaseAdminViewTests):
self.mox.ReplayAll() self.mox.ReplayAll()
res = self.client.get(reverse('horizon:syspanel:networks:ports:detail', res = self.client.get(reverse('horizon:admin:networks:ports:detail',
args=[port.id])) args=[port.id]))
self.assertTemplateUsed(res, 'nova/networks/ports/detail.html') self.assertTemplateUsed(res, 'project/networks/ports/detail.html')
self.assertEqual(res.context['port'].id, port.id) self.assertEqual(res.context['port'].id, port.id)
@test.create_stubs({api.quantum: ('port_get',)}) @test.create_stubs({api.quantum: ('port_get',)})
@ -613,12 +613,12 @@ class NetworkTests(test.BaseAdminViewTests):
self.mox.ReplayAll() self.mox.ReplayAll()
res = self.client.get(reverse('horizon:syspanel:networks:ports:detail', res = self.client.get(reverse('horizon:admin:networks:ports:detail',
args=[port.id])) args=[port.id]))
# syspanel DetailView is shared with userpanel one, so # admin DetailView is shared with userpanel one, so
# redirection URL on error is userpanel index. # redirection URL on error is userpanel index.
redir_url = reverse('horizon:nova:networks:index') redir_url = reverse('horizon:project:networks:index')
self.assertRedirectsNoFollow(res, redir_url) self.assertRedirectsNoFollow(res, redir_url)
@test.create_stubs({api.quantum: ('network_get',)}) @test.create_stubs({api.quantum: ('network_get',)})
@ -629,11 +629,11 @@ class NetworkTests(test.BaseAdminViewTests):
.AndReturn(self.networks.first()) .AndReturn(self.networks.first())
self.mox.ReplayAll() self.mox.ReplayAll()
url = reverse('horizon:syspanel:networks:addport', url = reverse('horizon:admin:networks:addport',
args=[network.id]) args=[network.id])
res = self.client.get(url) res = self.client.get(url)
self.assertTemplateUsed(res, 'syspanel/networks/ports/create.html') self.assertTemplateUsed(res, 'admin/networks/ports/create.html')
@test.create_stubs({api.quantum: ('network_get', @test.create_stubs({api.quantum: ('network_get',
'port_create')}) 'port_create')})
@ -659,12 +659,12 @@ class NetworkTests(test.BaseAdminViewTests):
'network_name': network.name, 'network_name': network.name,
'name': port.name, 'name': port.name,
'device_id': port.device_id} 'device_id': port.device_id}
url = reverse('horizon:syspanel:networks:addport', url = reverse('horizon:admin:networks:addport',
args=[port.network_id]) args=[port.network_id])
res = self.client.post(url, form_data) res = self.client.post(url, form_data)
self.assertNoFormErrors(res) self.assertNoFormErrors(res)
redir_url = reverse('horizon:syspanel:networks:detail', redir_url = reverse('horizon:admin:networks:detail',
args=[port.network_id]) args=[port.network_id])
self.assertRedirectsNoFollow(res, redir_url) self.assertRedirectsNoFollow(res, redir_url)
@ -692,12 +692,12 @@ class NetworkTests(test.BaseAdminViewTests):
'network_name': network.name, 'network_name': network.name,
'name': port.name, 'name': port.name,
'device_id': port.device_id} 'device_id': port.device_id}
url = reverse('horizon:syspanel:networks:addport', url = reverse('horizon:admin:networks:addport',
args=[port.network_id]) args=[port.network_id])
res = self.client.post(url, form_data) res = self.client.post(url, form_data)
self.assertNoFormErrors(res) self.assertNoFormErrors(res)
redir_url = reverse('horizon:syspanel:networks:detail', redir_url = reverse('horizon:admin:networks:detail',
args=[port.network_id]) args=[port.network_id])
self.assertRedirectsNoFollow(res, redir_url) self.assertRedirectsNoFollow(res, redir_url)
@ -709,11 +709,11 @@ class NetworkTests(test.BaseAdminViewTests):
.AndReturn(port) .AndReturn(port)
self.mox.ReplayAll() self.mox.ReplayAll()
url = reverse('horizon:syspanel:networks:editport', url = reverse('horizon:admin:networks:editport',
args=[port.network_id, port.id]) args=[port.network_id, port.id])
res = self.client.get(url) res = self.client.get(url)
self.assertTemplateUsed(res, 'syspanel/networks/ports/update.html') self.assertTemplateUsed(res, 'admin/networks/ports/update.html')
@test.create_stubs({api.quantum: ('port_get', @test.create_stubs({api.quantum: ('port_get',
'port_modify')}) 'port_modify')})
@ -731,11 +731,11 @@ class NetworkTests(test.BaseAdminViewTests):
'port_id': port.id, 'port_id': port.id,
'name': port.name, 'name': port.name,
'device_id': port.device_id} 'device_id': port.device_id}
url = reverse('horizon:syspanel:networks:editport', url = reverse('horizon:admin:networks:editport',
args=[port.network_id, port.id]) args=[port.network_id, port.id])
res = self.client.post(url, formData) res = self.client.post(url, formData)
redir_url = reverse('horizon:syspanel:networks:detail', redir_url = reverse('horizon:admin:networks:detail',
args=[port.network_id]) args=[port.network_id])
self.assertRedirectsNoFollow(res, redir_url) self.assertRedirectsNoFollow(res, redir_url)
@ -755,11 +755,11 @@ class NetworkTests(test.BaseAdminViewTests):
'port_id': port.id, 'port_id': port.id,
'name': port.name, 'name': port.name,
'device_id': port.device_id} 'device_id': port.device_id}
url = reverse('horizon:syspanel:networks:editport', url = reverse('horizon:admin:networks:editport',
args=[port.network_id, port.id]) args=[port.network_id, port.id])
res = self.client.post(url, formData) res = self.client.post(url, formData)
redir_url = reverse('horizon:syspanel:networks:detail', redir_url = reverse('horizon:admin:networks:detail',
args=[port.network_id]) args=[port.network_id])
self.assertRedirectsNoFollow(res, redir_url) self.assertRedirectsNoFollow(res, redir_url)
@ -777,7 +777,7 @@ class NetworkTests(test.BaseAdminViewTests):
self.mox.ReplayAll() self.mox.ReplayAll()
formData = {'action': 'ports__delete__%s' % port.id} formData = {'action': 'ports__delete__%s' % port.id}
url = reverse('horizon:syspanel:networks:detail', url = reverse('horizon:admin:networks:detail',
args=[network_id]) args=[network_id])
res = self.client.post(url, formData) res = self.client.post(url, formData)
@ -798,7 +798,7 @@ class NetworkTests(test.BaseAdminViewTests):
self.mox.ReplayAll() self.mox.ReplayAll()
formData = {'action': 'ports__delete__%s' % port.id} formData = {'action': 'ports__delete__%s' % port.id}
url = reverse('horizon:syspanel:networks:detail', url = reverse('horizon:admin:networks:detail',
args=[network_id]) args=[network_id])
res = self.client.post(url, formData) res = self.client.post(url, formData)

View File

@ -30,14 +30,14 @@ from .subnets.tables import SubnetsTable
from .ports.tables import PortsTable from .ports.tables import PortsTable
from .forms import CreateNetwork, UpdateNetwork from .forms import CreateNetwork, UpdateNetwork
from horizon.dashboards.nova.networks import views as user_views from horizon.dashboards.project.networks import views as user_views
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
class IndexView(tables.DataTableView): class IndexView(tables.DataTableView):
table_class = NetworksTable table_class = NetworksTable
template_name = 'syspanel/networks/index.html' template_name = 'admin/networks/index.html'
def _get_tenant_list(self): def _get_tenant_list(self):
if not hasattr(self, "_tenants"): if not hasattr(self, "_tenants"):
@ -72,14 +72,14 @@ class IndexView(tables.DataTableView):
class CreateView(forms.ModalFormView): class CreateView(forms.ModalFormView):
form_class = CreateNetwork form_class = CreateNetwork
template_name = 'syspanel/networks/create.html' template_name = 'admin/networks/create.html'
success_url = reverse_lazy('horizon:syspanel:networks:index') success_url = reverse_lazy('horizon:admin:networks:index')
class DetailView(tables.MultiTableView): class DetailView(tables.MultiTableView):
table_classes = (SubnetsTable, PortsTable) table_classes = (SubnetsTable, PortsTable)
template_name = 'nova/networks/detail.html' template_name = 'project/networks/detail.html'
failure_url = reverse_lazy('horizon:syspanel:networks:index') failure_url = reverse_lazy('horizon:admin:networks:index')
def get_subnets_data(self): def get_subnets_data(self):
try: try:
@ -129,8 +129,8 @@ class DetailView(tables.MultiTableView):
class UpdateView(user_views.UpdateView): class UpdateView(user_views.UpdateView):
form_class = UpdateNetwork form_class = UpdateNetwork
template_name = 'syspanel/networks/update.html' template_name = 'admin/networks/update.html'
success_url = reverse_lazy('horizon:syspanel:networks:index') success_url = reverse_lazy('horizon:admin:networks:index')
def get_initial(self): def get_initial(self):
network = self._get_object() network = self._get_object()

View File

@ -21,7 +21,7 @@
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
import horizon import horizon
from horizon.dashboards.syspanel import dashboard from horizon.dashboards.admin import dashboard
class Overview(horizon.Panel): class Overview(horizon.Panel):
@ -30,4 +30,4 @@ class Overview(horizon.Panel):
permissions = ('openstack.roles.admin',) permissions = ('openstack.roles.admin',)
dashboard.Syspanel.register(Overview) dashboard.Admin.register(Overview)

View File

Can't render this file because it contains an unexpected character in line 1 and column 46.

View File

@ -31,7 +31,7 @@ from horizon import usage
from horizon.templatetags.sizeformat import mbformat from horizon.templatetags.sizeformat import mbformat
INDEX_URL = reverse('horizon:nova:overview:index') INDEX_URL = reverse('horizon:project:overview:index')
class UsageViewTests(test.BaseAdminViewTests): class UsageViewTests(test.BaseAdminViewTests):
@ -50,8 +50,8 @@ class UsageViewTests(test.BaseAdminViewTests):
.AndReturn([usage_obj]) .AndReturn([usage_obj])
api.nova.tenant_quota_usages(IsA(http.HttpRequest)).AndReturn(quotas) api.nova.tenant_quota_usages(IsA(http.HttpRequest)).AndReturn(quotas)
self.mox.ReplayAll() self.mox.ReplayAll()
res = self.client.get(reverse('horizon:syspanel:overview:index')) res = self.client.get(reverse('horizon:admin:overview:index'))
self.assertTemplateUsed(res, 'syspanel/overview/usage.html') self.assertTemplateUsed(res, 'admin/overview/usage.html')
self.assertTrue(isinstance(res.context['usage'], usage.GlobalUsage)) self.assertTrue(isinstance(res.context['usage'], usage.GlobalUsage))
self.assertContains(res, self.assertContains(res,
'<td class="sortable normal_column">test_tenant' '<td class="sortable normal_column">test_tenant'
@ -82,9 +82,9 @@ class UsageViewTests(test.BaseAdminViewTests):
.AndReturn([usage_obj]) .AndReturn([usage_obj])
api.nova.tenant_quota_usages(IsA(http.HttpRequest)).AndReturn(quotas) api.nova.tenant_quota_usages(IsA(http.HttpRequest)).AndReturn(quotas)
self.mox.ReplayAll() self.mox.ReplayAll()
csv_url = reverse('horizon:syspanel:overview:index') + "?format=csv" csv_url = reverse('horizon:admin:overview:index') + "?format=csv"
res = self.client.get(csv_url) res = self.client.get(csv_url)
self.assertTemplateUsed(res, 'syspanel/overview/usage.csv') self.assertTemplateUsed(res, 'admin/overview/usage.csv')
self.assertTrue(isinstance(res.context['usage'], usage.GlobalUsage)) self.assertTrue(isinstance(res.context['usage'], usage.GlobalUsage))
self.assertContains(res, 'Tenant,VCPUs,RamMB,DiskGB,Usage(Hours)\n' self.assertContains(res, 'Tenant,VCPUs,RamMB,DiskGB,Usage(Hours)\n'
'%s,%s,%s,%s,%f' % '%s,%s,%s,%s,%f' %

View File

@ -27,7 +27,7 @@ from horizon import usage
class GlobalOverview(usage.UsageView): class GlobalOverview(usage.UsageView):
table_class = usage.GlobalUsageTable table_class = usage.GlobalUsageTable
usage_class = usage.GlobalUsage usage_class = usage.GlobalUsage
template_name = 'syspanel/overview/usage.html' template_name = 'admin/overview/usage.html'
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
context = super(GlobalOverview, self).get_context_data(**kwargs) context = super(GlobalOverview, self).get_context_data(**kwargs)

View File

@ -20,7 +20,7 @@
from horizon import api from horizon import api
from horizon import forms from horizon import forms
from horizon.dashboards.syspanel.users.forms import CreateUserForm from horizon.dashboards.admin.users.forms import CreateUserForm
class CreateUser(CreateUserForm): class CreateUser(CreateUserForm):

View File

@ -21,7 +21,7 @@
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
import horizon import horizon
from horizon.dashboards.syspanel import dashboard from horizon.dashboards.admin import dashboard
class Tenants(horizon.Panel): class Tenants(horizon.Panel):
@ -29,4 +29,4 @@ class Tenants(horizon.Panel):
slug = 'projects' slug = 'projects'
dashboard.Syspanel.register(Tenants) dashboard.Admin.register(Tenants)

View File

@ -17,7 +17,7 @@ LOG = logging.getLogger(__name__)
class ViewMembersLink(tables.LinkAction): class ViewMembersLink(tables.LinkAction):
name = "users" name = "users"
verbose_name = _("Modify Users") verbose_name = _("Modify Users")
url = "horizon:syspanel:projects:update" url = "horizon:admin:projects:update"
classes = ("ajax-modal", "btn-edit") classes = ("ajax-modal", "btn-edit")
def get_link_url(self, project): def get_link_url(self, project):
@ -30,28 +30,28 @@ class ViewMembersLink(tables.LinkAction):
class UsageLink(tables.LinkAction): class UsageLink(tables.LinkAction):
name = "usage" name = "usage"
verbose_name = _("View Usage") verbose_name = _("View Usage")
url = "horizon:syspanel:projects:usage" url = "horizon:admin:projects:usage"
classes = ("btn-stats",) classes = ("btn-stats",)
class CreateProject(tables.LinkAction): class CreateProject(tables.LinkAction):
name = "create" name = "create"
verbose_name = _("Create Project") verbose_name = _("Create Project")
url = "horizon:syspanel:projects:create" url = "horizon:admin:projects:create"
classes = ("btn-launch", "ajax-modal",) classes = ("btn-launch", "ajax-modal",)
class UpdateProject(tables.LinkAction): class UpdateProject(tables.LinkAction):
name = "update" name = "update"
verbose_name = _("Edit Project") verbose_name = _("Edit Project")
url = "horizon:syspanel:projects:update" url = "horizon:admin:projects:update"
classes = ("ajax-modal", "btn-edit") classes = ("ajax-modal", "btn-edit")
class ModifyQuotas(tables.LinkAction): class ModifyQuotas(tables.LinkAction):
name = "quotas" name = "quotas"
verbose_name = "Modify Quotas" verbose_name = "Modify Quotas"
url = "horizon:syspanel:projects:update" url = "horizon:admin:projects:update"
classes = ("ajax-modal", "btn-edit") classes = ("ajax-modal", "btn-edit")
def get_link_url(self, project): def get_link_url(self, project):
@ -140,7 +140,7 @@ class TenantUsersTable(UsersTable):
class AddUserAction(tables.LinkAction): class AddUserAction(tables.LinkAction):
name = "add_user" name = "add_user"
verbose_name = _("Add To Project") verbose_name = _("Add To Project")
url = "horizon:syspanel:projects:add_user" url = "horizon:admin:projects:add_user"
classes = ('ajax-modal',) classes = ('ajax-modal',)
def get_link_url(self, user): def get_link_url(self, user):

View File

@ -2,7 +2,7 @@
{% load i18n %} {% load i18n %}
{% block form_id %}add_user_form{% endblock %} {% block form_id %}add_user_form{% endblock %}
{% block form_action %}{% url horizon:syspanel:projects:add_user tenant_id user_id %}{% endblock %} {% block form_action %}{% url horizon:admin:projects:add_user tenant_id user_id %}{% endblock %}
{% block modal_id %}add_user_modal{% endblock %} {% block modal_id %}add_user_modal{% endblock %}
{% block modal-header %}{% trans "Add User To Project" %}{% endblock %} {% block modal-header %}{% trans "Add User To Project" %}{% endblock %}
@ -21,5 +21,5 @@
{% block modal-footer %} {% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Add" %}" /> <input class="btn btn-primary pull-right" type="submit" value="{% trans "Add" %}" />
<a href="{% url horizon:syspanel:projects:users tenant_id %}" class="btn secondary cancel close">{% trans "Cancel" %}</a> <a href="{% url horizon:admin:projects:users tenant_id %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %} {% endblock %}

View File

@ -2,7 +2,7 @@
{% load i18n %} {% load i18n %}
{% block form_id %}create_tenant_form{% endblock %} {% block form_id %}create_tenant_form{% endblock %}
{% block form_action %}{% url horizon:syspanel:projects:create %}{% endblock %} {% block form_action %}{% url horizon:admin:projects:create %}{% endblock %}
{% block modal_id %}create_tenant_modal{% endblock %} {% block modal_id %}create_tenant_modal{% endblock %}
{% block modal-header %}{% trans "Create Project" %}{% endblock %} {% block modal-header %}{% trans "Create Project" %}{% endblock %}
@ -21,5 +21,5 @@
{% block modal-footer %} {% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Create Project" %}" /> <input class="btn btn-primary pull-right" type="submit" value="{% trans "Create Project" %}" />
<a href="{% url horizon:syspanel:projects:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a> <a href="{% url horizon:admin:projects:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %} {% endblock %}

View File

@ -2,7 +2,7 @@
{% load i18n %} {% load i18n %}
{% block form_id %}create_user_form{% endblock %} {% block form_id %}create_user_form{% endblock %}
{% block form_action %}{% url horizon:syspanel:projects:create_user tenant_id %}{% endblock %} {% block form_action %}{% url horizon:admin:projects:create_user tenant_id %}{% endblock %}
{% block modal-header %}{% blocktrans %}Create User for project '{{ tenant_name }}'.{% endblocktrans %}{% endblock %} {% block modal-header %}{% blocktrans %}Create User for project '{{ tenant_name }}'.{% endblocktrans %}{% endblock %}
@ -21,5 +21,5 @@
{% block modal-footer %} {% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Create User" %}" /> <input class="btn btn-primary pull-right" type="submit" value="{% trans "Create User" %}" />
<a href="{% url horizon:syspanel:projects:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a> <a href="{% url horizon:admin:projects:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %} {% endblock %}

View File

@ -2,7 +2,7 @@
{% load i18n %} {% load i18n %}
{% block form_id %}quota_update_form{% endblock %} {% block form_id %}quota_update_form{% endblock %}
{% block form_action %}{% url horizon:syspanel:projects:quotas tenant.id %}{% endblock %} {% block form_action %}{% url horizon:admin:projects:quotas tenant.id %}{% endblock %}
{% block modal-header %}{% trans "Update Quota" %}{% endblock %} {% block modal-header %}{% trans "Update Quota" %}{% endblock %}
@ -20,5 +20,5 @@
{% block modal-footer %} {% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Update Quota" %}" /> <input class="btn btn-primary pull-right" type="submit" value="{% trans "Update Quota" %}" />
<a href="{% url horizon:syspanel:projects:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a> <a href="{% url horizon:admin:projects:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %} {% endblock %}

View File

@ -2,7 +2,7 @@
{% load i18n %} {% load i18n %}
{% block form_id %}{% endblock %} {% block form_id %}{% endblock %}
{% block form_action %}{% url horizon:syspanel:projects:update tenant.id %}{% endblock %} {% block form_action %}{% url horizon:admin:projects:update tenant.id %}{% endblock %}
{% block modal_id %}update_tenant_modal{% endblock %} {% block modal_id %}update_tenant_modal{% endblock %}
{% block modal-header %}{% trans "Update Project" %}{% endblock %} {% block modal-header %}{% trans "Update Project" %}{% endblock %}
@ -21,5 +21,5 @@
{% block modal-footer %} {% block modal-footer %}
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Update Project" %}" /> <input class="btn btn-primary pull-right" type="submit" value="{% trans "Update Project" %}" />
<a href="{% url horizon:syspanel:projects:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a> <a href="{% url horizon:admin:projects:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>
{% endblock %} {% endblock %}

View File

@ -7,5 +7,5 @@
{% endblock page_header %} {% endblock page_header %}
{% block main %} {% block main %}
{% include 'syspanel/projects/_add_user.html' %} {% include 'admin/projects/_add_user.html' %}
{% endblock %} {% endblock %}

View File

@ -3,7 +3,7 @@
{% block title %}Projects{% endblock %} {% block title %}Projects{% endblock %}
{% block page_header %} {% block page_header %}
{% url horizon:syspanel:projects:index as refresh_link %} {% url horizon:admin:projects:index as refresh_link %}
{# to make searchable false, just remove it from the include statement #} {# to make searchable false, just remove it from the include statement #}
{% include "horizon/common/_page_header.html" with title=_("Projects") refresh_link=refresh_link searchable="true" %} {% include "horizon/common/_page_header.html" with title=_("Projects") refresh_link=refresh_link searchable="true" %}
{% endblock page_header %} {% endblock page_header %}

View File

@ -7,5 +7,5 @@
{% endblock page_header %} {% endblock page_header %}
{% block main %} {% block main %}
{% include 'syspanel/projects/_quotas.html' with form=form %} {% include 'admin/projects/_quotas.html' with form=form %}
{% endblock %} {% endblock %}

View File

Can't render this file because it contains an unexpected character in line 1 and column 46.

View File

@ -24,7 +24,7 @@ from horizon import test
from .workflows import CreateProject, UpdateProject from .workflows import CreateProject, UpdateProject
from .views import QUOTA_FIELDS from .views import QUOTA_FIELDS
INDEX_URL = reverse('horizon:syspanel:projects:index') INDEX_URL = reverse('horizon:admin:projects:index')
class TenantsViewTests(test.BaseAdminViewTests): class TenantsViewTests(test.BaseAdminViewTests):
@ -35,7 +35,7 @@ class TenantsViewTests(test.BaseAdminViewTests):
self.mox.ReplayAll() self.mox.ReplayAll()
res = self.client.get(INDEX_URL) res = self.client.get(INDEX_URL)
self.assertTemplateUsed(res, 'syspanel/projects/index.html') self.assertTemplateUsed(res, 'admin/projects/index.html')
self.assertItemsEqual(res.context['table'].data, self.tenants.list()) self.assertItemsEqual(res.context['table'].data, self.tenants.list())
@ -84,10 +84,10 @@ class CreateProjectWorkflowTests(test.BaseAdminViewTests):
self.mox.ReplayAll() self.mox.ReplayAll()
url = reverse('horizon:syspanel:projects:create') url = reverse('horizon:admin:projects:create')
res = self.client.get(url) res = self.client.get(url)
self.assertTemplateUsed(res, 'syspanel/projects/create.html') self.assertTemplateUsed(res, 'admin/projects/create.html')
workflow = res.context['workflow'] workflow = res.context['workflow']
self.assertEqual(res.context['workflow'].name, CreateProject.name) self.assertEqual(res.context['workflow'].name, CreateProject.name)
@ -153,7 +153,7 @@ class CreateProjectWorkflowTests(test.BaseAdminViewTests):
workflow_data.update(self._get_workflow_data(project, quota)) workflow_data.update(self._get_workflow_data(project, quota))
url = reverse('horizon:syspanel:projects:create') url = reverse('horizon:admin:projects:create')
res = self.client.post(url, workflow_data) res = self.client.post(url, workflow_data)
self.assertNoFormErrors(res) self.assertNoFormErrors(res)
@ -178,10 +178,10 @@ class CreateProjectWorkflowTests(test.BaseAdminViewTests):
self.mox.ReplayAll() self.mox.ReplayAll()
url = reverse('horizon:syspanel:projects:create') url = reverse('horizon:admin:projects:create')
res = self.client.get(url) res = self.client.get(url)
self.assertTemplateUsed(res, 'syspanel/projects/create.html') self.assertTemplateUsed(res, 'admin/projects/create.html')
self.assertContains(res, "Unable to retrieve default quota values") self.assertContains(res, "Unable to retrieve default quota values")
@test.create_stubs({api: ('get_default_role', @test.create_stubs({api: ('get_default_role',
@ -217,7 +217,7 @@ class CreateProjectWorkflowTests(test.BaseAdminViewTests):
workflow_data = self._get_workflow_data(project, quota) workflow_data = self._get_workflow_data(project, quota)
url = reverse('horizon:syspanel:projects:create') url = reverse('horizon:admin:projects:create')
res = self.client.post(url, workflow_data) res = self.client.post(url, workflow_data)
self.assertNoFormErrors(res) self.assertNoFormErrors(res)
@ -276,7 +276,7 @@ class CreateProjectWorkflowTests(test.BaseAdminViewTests):
workflow_data.update(self._get_workflow_data(project, quota)) workflow_data.update(self._get_workflow_data(project, quota))
url = reverse('horizon:syspanel:projects:create') url = reverse('horizon:admin:projects:create')
res = self.client.post(url, workflow_data) res = self.client.post(url, workflow_data)
self.assertNoFormErrors(res) self.assertNoFormErrors(res)
@ -337,7 +337,7 @@ class CreateProjectWorkflowTests(test.BaseAdminViewTests):
workflow_data.update(self._get_workflow_data(project, quota)) workflow_data.update(self._get_workflow_data(project, quota))
url = reverse('horizon:syspanel:projects:create') url = reverse('horizon:admin:projects:create')
res = self.client.post(url, workflow_data) res = self.client.post(url, workflow_data)
self.assertNoFormErrors(res) self.assertNoFormErrors(res)
@ -370,7 +370,7 @@ class CreateProjectWorkflowTests(test.BaseAdminViewTests):
workflow_data = self._get_workflow_data(project, quota) workflow_data = self._get_workflow_data(project, quota)
workflow_data["name"] = "" workflow_data["name"] = ""
url = reverse('horizon:syspanel:projects:create') url = reverse('horizon:admin:projects:create')
res = self.client.post(url, workflow_data) res = self.client.post(url, workflow_data)
self.assertContains(res, "field is required") self.assertContains(res, "field is required")
@ -412,11 +412,11 @@ class UpdateProjectWorkflowTests(test.BaseAdminViewTests):
self.mox.ReplayAll() self.mox.ReplayAll()
url = reverse('horizon:syspanel:projects:update', url = reverse('horizon:admin:projects:update',
args=[self.tenant.id]) args=[self.tenant.id])
res = self.client.get(url) res = self.client.get(url)
self.assertTemplateUsed(res, 'syspanel/projects/update.html') self.assertTemplateUsed(res, 'admin/projects/update.html')
workflow = res.context['workflow'] workflow = res.context['workflow']
self.assertEqual(res.context['workflow'].name, UpdateProject.name) self.assertEqual(res.context['workflow'].name, UpdateProject.name)
@ -537,7 +537,7 @@ class UpdateProjectWorkflowTests(test.BaseAdminViewTests):
"enabled": project.enabled} "enabled": project.enabled}
workflow_data.update(project_data) workflow_data.update(project_data)
workflow_data.update(updated_quota) workflow_data.update(updated_quota)
url = reverse('horizon:syspanel:projects:update', url = reverse('horizon:admin:projects:update',
args=[self.tenant.id]) args=[self.tenant.id])
res = self.client.post(url, workflow_data) res = self.client.post(url, workflow_data)
@ -552,7 +552,7 @@ class UpdateProjectWorkflowTests(test.BaseAdminViewTests):
self.mox.ReplayAll() self.mox.ReplayAll()
url = reverse('horizon:syspanel:projects:update', url = reverse('horizon:admin:projects:update',
args=[self.tenant.id]) args=[self.tenant.id])
res = self.client.get(url) res = self.client.get(url)
@ -623,7 +623,7 @@ class UpdateProjectWorkflowTests(test.BaseAdminViewTests):
"enabled": project.enabled} "enabled": project.enabled}
workflow_data.update(project_data) workflow_data.update(project_data)
workflow_data.update(updated_quota) workflow_data.update(updated_quota)
url = reverse('horizon:syspanel:projects:update', url = reverse('horizon:admin:projects:update',
args=[self.tenant.id]) args=[self.tenant.id])
res = self.client.post(url, workflow_data) res = self.client.post(url, workflow_data)
@ -735,7 +735,7 @@ class UpdateProjectWorkflowTests(test.BaseAdminViewTests):
"enabled": project.enabled} "enabled": project.enabled}
workflow_data.update(project_data) workflow_data.update(project_data)
workflow_data.update(updated_quota) workflow_data.update(updated_quota)
url = reverse('horizon:syspanel:projects:update', url = reverse('horizon:admin:projects:update',
args=[self.tenant.id]) args=[self.tenant.id])
res = self.client.post(url, workflow_data) res = self.client.post(url, workflow_data)
@ -834,7 +834,7 @@ class UpdateProjectWorkflowTests(test.BaseAdminViewTests):
"enabled": project.enabled} "enabled": project.enabled}
workflow_data.update(project_data) workflow_data.update(project_data)
workflow_data.update(updated_quota) workflow_data.update(updated_quota)
url = reverse('horizon:syspanel:projects:update', url = reverse('horizon:admin:projects:update',
args=[self.tenant.id]) args=[self.tenant.id])
res = self.client.post(url, workflow_data) res = self.client.post(url, workflow_data)

View File

@ -28,7 +28,7 @@ from horizon import exceptions
from horizon import tables from horizon import tables
from horizon import usage from horizon import usage
from horizon import workflows from horizon import workflows
from horizon.dashboards.syspanel.users.views import CreateView from horizon.dashboards.admin.users.views import CreateView
from .forms import CreateUser from .forms import CreateUser
from .tables import TenantsTable, TenantUsersTable, AddUsersTable from .tables import TenantsTable, TenantUsersTable, AddUsersTable
@ -51,7 +51,7 @@ PROJECT_INFO_FIELDS = ("name",
"description", "description",
"enabled") "enabled")
INDEX_URL = "horizon:syspanel:projects:index" INDEX_URL = "horizon:admin:projects:index"
class TenantContextMixin(object): class TenantContextMixin(object):
@ -76,7 +76,7 @@ class TenantContextMixin(object):
class IndexView(tables.DataTableView): class IndexView(tables.DataTableView):
table_class = TenantsTable table_class = TenantsTable
template_name = 'syspanel/projects/index.html' template_name = 'admin/projects/index.html'
def get_data(self): def get_data(self):
tenants = [] tenants = []
@ -91,7 +91,7 @@ class IndexView(tables.DataTableView):
class UsersView(tables.MultiTableView): class UsersView(tables.MultiTableView):
table_classes = (TenantUsersTable, AddUsersTable) table_classes = (TenantUsersTable, AddUsersTable)
template_name = 'syspanel/projects/users.html' template_name = 'admin/projects/users.html'
def _get_shared_data(self, *args, **kwargs): def _get_shared_data(self, *args, **kwargs):
tenant_id = self.kwargs["tenant_id"] tenant_id = self.kwargs["tenant_id"]
@ -129,7 +129,7 @@ class UsersView(tables.MultiTableView):
class TenantUsageView(usage.UsageView): class TenantUsageView(usage.UsageView):
table_class = usage.TenantUsageTable table_class = usage.TenantUsageTable
usage_class = usage.TenantUsage usage_class = usage.TenantUsage
template_name = 'syspanel/projects/usage.html' template_name = 'admin/projects/usage.html'
def get_data(self): def get_data(self):
super(TenantUsageView, self).get_data() super(TenantUsageView, self).get_data()
@ -138,7 +138,7 @@ class TenantUsageView(usage.UsageView):
class CreateProjectView(workflows.WorkflowView): class CreateProjectView(workflows.WorkflowView):
workflow_class = CreateProject workflow_class = CreateProject
template_name = "syspanel/projects/create.html" template_name = "admin/projects/create.html"
def get_initial(self): def get_initial(self):
initial = super(CreateProjectView, self).get_initial() initial = super(CreateProjectView, self).get_initial()
@ -159,7 +159,7 @@ class CreateProjectView(workflows.WorkflowView):
class UpdateProjectView(workflows.WorkflowView): class UpdateProjectView(workflows.WorkflowView):
workflow_class = UpdateProject workflow_class = UpdateProject
template_name = "syspanel/projects/update.html" template_name = "admin/projects/update.html"
def get_initial(self): def get_initial(self):
initial = super(UpdateProjectView, self).get_initial() initial = super(UpdateProjectView, self).get_initial()
@ -186,8 +186,8 @@ class UpdateProjectView(workflows.WorkflowView):
class CreateUserView(CreateView): class CreateUserView(CreateView):
form_class = CreateUser form_class = CreateUser
template_name = "syspanel/projects/create_user.html" template_name = "admin/projects/create_user.html"
success_url = reverse_lazy('horizon:syspanel:projects:index') success_url = reverse_lazy('horizon:admin:projects:index')
def get_initial(self): def get_initial(self):
default_role = api.keystone.get_default_role(self.request) default_role = api.keystone.get_default_role(self.request)

View File

@ -27,8 +27,8 @@ from horizon import exceptions
from horizon import workflows from horizon import workflows
from horizon import forms from horizon import forms
INDEX_URL = "horizon:syspanel:projects:index" INDEX_URL = "horizon:admin:projects:index"
ADD_USER_URL = "horizon:syspanel:projects:create_user" ADD_USER_URL = "horizon:admin:projects:create_user"
class UpdateProjectQuotaAction(workflows.Action): class UpdateProjectQuotaAction(workflows.Action):
@ -156,7 +156,7 @@ class UpdateProjectMembersAction(workflows.Action):
class UpdateProjectMembers(workflows.Step): class UpdateProjectMembers(workflows.Step):
action_class = UpdateProjectMembersAction action_class = UpdateProjectMembersAction
template_name = "syspanel/projects/_update_members.html" template_name = "admin/projects/_update_members.html"
def contribute(self, data, context): def contribute(self, data, context):
if data: if data:
@ -179,7 +179,7 @@ class CreateProject(workflows.Workflow):
finalize_button_name = _("Finish") finalize_button_name = _("Finish")
success_message = _('Created new project "%s".') success_message = _('Created new project "%s".')
failure_message = _('Unable to create project "%s".') failure_message = _('Unable to create project "%s".')
success_url = "horizon:syspanel:projects:index" success_url = "horizon:admin:projects:index"
default_steps = (CreateProjectInfo, default_steps = (CreateProjectInfo,
UpdateProjectMembers, UpdateProjectMembers,
UpdateProjectQuota) UpdateProjectQuota)
@ -268,7 +268,7 @@ class UpdateProject(workflows.Workflow):
finalize_button_name = _("Save") finalize_button_name = _("Save")
success_message = _('Modified project "%s".') success_message = _('Modified project "%s".')
failure_message = _('Unable to modify project "%s".') failure_message = _('Unable to modify project "%s".')
success_url = "horizon:syspanel:projects:index" success_url = "horizon:admin:projects:index"
default_steps = (UpdateProjectInfo, default_steps = (UpdateProjectInfo,
UpdateProjectMembers, UpdateProjectMembers,
UpdateProjectQuota) UpdateProjectQuota)

View File

@ -21,7 +21,7 @@
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
import horizon import horizon
from horizon.dashboards.syspanel import dashboard from horizon.dashboards.admin import dashboard
class Quotas(horizon.Panel): class Quotas(horizon.Panel):
@ -29,4 +29,4 @@ class Quotas(horizon.Panel):
slug = 'quotas' slug = 'quotas'
dashboard.Syspanel.register(Quotas) dashboard.Admin.register(Quotas)

View File

@ -3,7 +3,7 @@
{% block title %}Quotas{% endblock %} {% block title %}Quotas{% endblock %}
{% block page_header %} {% block page_header %}
{% url horizon:syspanel:quotas:index as refresh_link %} {% url horizon:admin:quotas:index as refresh_link %}
{# to make searchable false, just remove it from the include statement #} {# to make searchable false, just remove it from the include statement #}
{% include "horizon/common/_page_header.html" with title=_("Default Quotas") refresh_link=refresh_link searchable="true" %} {% include "horizon/common/_page_header.html" with title=_("Default Quotas") refresh_link=refresh_link searchable="true" %}
{% endblock page_header %} {% endblock page_header %}

View File

@ -23,5 +23,5 @@ from django.conf.urls.defaults import patterns, url
from .views import IndexView from .views import IndexView
urlpatterns = patterns('horizon.dashboards.syspanel.quotas.views', urlpatterns = patterns('horizon.dashboards.admin.quotas.views',
url(r'^$', IndexView.as_view(), name='index')) url(r'^$', IndexView.as_view(), name='index'))

Some files were not shown because too many files have changed in this diff Show More