From 87e6970a540587cbf9814aa554a4d04fec9c4106 Mon Sep 17 00:00:00 2001 From: Gabriel Hurley Date: Mon, 6 Feb 2012 18:05:33 -0800 Subject: [PATCH] Renamed all user-facing cases of "tenant" to "project". This required a little more refactoring than expected because I wanted to make the url slug also say "project", which required changing the panel slug, which in turn required changing the name of the panel directory, and then it seemed silly not to make the template directory match. Fixed bug 909495. Change-Id: I9da3b544b46f507a223a44c256d0008c8674ab3b --- docs/source/contributing.rst | 13 ++++++++++ docs/source/glossary.rst | 5 ++++ .../floating_ips/tables.py | 2 +- .../dashboards/nova/networks/tables.py | 2 +- .../images_and_snapshots/images/_launch.html | 2 +- .../horizon/dashboards/settings/dashboard.py | 4 +-- .../settings/{tenant => project}/__init__.py | 0 .../settings/{tenant => project}/forms.py | 4 +-- .../settings/{tenant => project}/panel.py | 4 +-- .../settings/{tenant => project}/urls.py | 2 +- .../settings/{tenant => project}/views.py | 4 +-- .../settings/{tenant => project}/_openrc.html | 6 ++--- .../{tenant => project}/openrc.sh.template | 0 .../{tenant => project}/settings.html | 4 +-- .../horizon/dashboards/settings/user/views.py | 1 - .../horizon/dashboards/syspanel/dashboard.py | 2 +- .../{tenants => projects}/__init__.py | 0 .../syspanel/{tenants => projects}/forms.py | 8 +++--- .../syspanel/{tenants => projects}/panel.py | 4 +-- .../syspanel/{tenants => projects}/tables.py | 26 +++++++++---------- .../syspanel/{tenants => projects}/tests.py | 6 ++--- .../syspanel/{tenants => projects}/urls.py | 0 .../syspanel/{tenants => projects}/views.py | 20 +++++++------- .../{tenants => projects}/_add_user.html | 8 +++--- .../{tenants => projects}/_create.html | 10 +++---- .../{tenants => projects}/_quotas.html | 6 ++--- .../{tenants => projects}/_update.html | 10 +++---- .../{tenants => projects}/add_user.html | 6 ++--- .../{tenants => projects}/create.html | 6 ++--- .../syspanel/{tenants => projects}/index.html | 6 ++--- .../{tenants => projects}/quotas.html | 6 ++--- .../{tenants => projects}/update.html | 6 ++--- .../syspanel/{tenants => projects}/usage.csv | 0 .../templates/syspanel/projects/usage.html | 14 ++++++++++ .../syspanel/{tenants => projects}/users.html | 4 +-- .../templates/syspanel/tenants/_delete.html | 9 ------- .../templates/syspanel/tenants/usage.html | 8 ------ .../templates/syspanel/users/_create.html | 2 +- .../templates/syspanel/users/_update.html | 4 +-- .../dashboards/syspanel/users/forms.py | 4 +-- .../dashboards/syspanel/users/tables.py | 2 +- horizon/horizon/tests/base_tests.py | 4 +-- horizon/horizon/usage/tables.py | 2 +- 43 files changed, 125 insertions(+), 111 deletions(-) rename horizon/horizon/dashboards/settings/{tenant => project}/__init__.py (100%) rename horizon/horizon/dashboards/settings/{tenant => project}/forms.py (94%) rename horizon/horizon/dashboards/settings/{tenant => project}/panel.py (93%) rename horizon/horizon/dashboards/settings/{tenant => project}/urls.py (91%) rename horizon/horizon/dashboards/settings/{tenant => project}/views.py (85%) rename horizon/horizon/dashboards/settings/templates/settings/{tenant => project}/_openrc.html (60%) rename horizon/horizon/dashboards/settings/templates/settings/{tenant => project}/openrc.sh.template (100%) rename horizon/horizon/dashboards/settings/templates/settings/{tenant => project}/settings.html (59%) rename horizon/horizon/dashboards/syspanel/{tenants => projects}/__init__.py (100%) rename horizon/horizon/dashboards/syspanel/{tenants => projects}/forms.py (95%) rename horizon/horizon/dashboards/syspanel/{tenants => projects}/panel.py (95%) rename horizon/horizon/dashboards/syspanel/{tenants => projects}/tables.py (84%) rename horizon/horizon/dashboards/syspanel/{tenants => projects}/tests.py (94%) rename horizon/horizon/dashboards/syspanel/{tenants => projects}/urls.py (100%) rename horizon/horizon/dashboards/syspanel/{tenants => projects}/views.py (91%) rename horizon/horizon/dashboards/syspanel/templates/syspanel/{tenants => projects}/_add_user.html (58%) rename horizon/horizon/dashboards/syspanel/templates/syspanel/{tenants => projects}/_create.html (56%) rename horizon/horizon/dashboards/syspanel/templates/syspanel/{tenants => projects}/_quotas.html (67%) rename horizon/horizon/dashboards/syspanel/templates/syspanel/{tenants => projects}/_update.html (56%) rename horizon/horizon/dashboards/syspanel/templates/syspanel/{tenants => projects}/add_user.html (59%) rename horizon/horizon/dashboards/syspanel/templates/syspanel/{tenants => projects}/create.html (64%) rename horizon/horizon/dashboards/syspanel/templates/syspanel/{tenants => projects}/index.html (52%) rename horizon/horizon/dashboards/syspanel/templates/syspanel/{tenants => projects}/quotas.html (60%) rename horizon/horizon/dashboards/syspanel/templates/syspanel/{tenants => projects}/update.html (64%) rename horizon/horizon/dashboards/syspanel/templates/syspanel/{tenants => projects}/usage.csv (100%) create mode 100644 horizon/horizon/dashboards/syspanel/templates/syspanel/projects/usage.html rename horizon/horizon/dashboards/syspanel/templates/syspanel/{tenants => projects}/users.html (72%) delete mode 100644 horizon/horizon/dashboards/syspanel/templates/syspanel/tenants/_delete.html delete mode 100644 horizon/horizon/dashboards/syspanel/templates/syspanel/tenants/usage.html diff --git a/docs/source/contributing.rst b/docs/source/contributing.rst index a72bb9ebd..738a8bfa9 100644 --- a/docs/source/contributing.rst +++ b/docs/source/contributing.rst @@ -126,3 +126,16 @@ Be sure to generate the documentation before submitting a patch for review. Unexpected warnings often appear when building the documentation, and slight reST syntax errors frequently cause links or cross-references not to work correctly. + +Conventions +----------- + +Simply by convention, we have a few rules about naming: + + * The term "project" is used in place of Keystone's "tenant" terminology + in all user-facing text. The term "tenant" is still used in API code to + make things more obvious for developers. + + * The term "dashboard" refers to a top-level dashboard class, and "panel" to + the sub-items within a dashboard. Referring to a panel as a dashboard is + both confusing and incorrect. diff --git a/docs/source/glossary.rst b/docs/source/glossary.rst index cca874009..36bf635ea 100644 --- a/docs/source/glossary.rst +++ b/docs/source/glossary.rst @@ -17,3 +17,8 @@ Panel A Python class representing a sub-navigation item (e.g. "instances") which contains all the necessary logic (views, forms, tests, etc.) for that interface. + +Project + + Used in user-facing text in place of the term "Tenant" which is Keystone's + word. diff --git a/horizon/horizon/dashboards/nova/access_and_security/floating_ips/tables.py b/horizon/horizon/dashboards/nova/access_and_security/floating_ips/tables.py index 723b99bab..04ffcf58a 100644 --- a/horizon/horizon/dashboards/nova/access_and_security/floating_ips/tables.py +++ b/horizon/horizon/dashboards/nova/access_and_security/floating_ips/tables.py @@ -31,7 +31,7 @@ LOG = logging.getLogger(__name__) class AllocateIP(tables.LinkAction): name = "allocate" - verbose_name = _("Allocate IP To Tenant") + verbose_name = _("Allocate IP To Project") attrs = {"class": "ajax-modal btn small"} url = "horizon:nova:access_and_security:floating_ips:allocate" diff --git a/horizon/horizon/dashboards/nova/networks/tables.py b/horizon/horizon/dashboards/nova/networks/tables.py index d26b6b6cc..5eb7a5195 100644 --- a/horizon/horizon/dashboards/nova/networks/tables.py +++ b/horizon/horizon/dashboards/nova/networks/tables.py @@ -39,7 +39,7 @@ class NetworksTable(tables.DataTable): used = tables.Column('used', verbose_name=_('Used')) available = tables.Column('available', verbose_name=_('Available')) total = tables.Column('total', verbose_name=_('Total')) - #tenant = tables.Column('tenant', verbose_name=_('Tenant')) + #tenant = tables.Column('tenant', verbose_name=_('Project')) def get_object_id(self, datum): return datum['id'] diff --git a/horizon/horizon/dashboards/nova/templates/nova/images_and_snapshots/images/_launch.html b/horizon/horizon/dashboards/nova/templates/nova/images_and_snapshots/images/_launch.html index 3e882ac6d..42fb4c179 100644 --- a/horizon/horizon/dashboards/nova/templates/nova/images_and_snapshots/images/_launch.html +++ b/horizon/horizon/dashboards/nova/templates/nova/images_and_snapshots/images/_launch.html @@ -15,7 +15,7 @@

{% trans "Description:" %}

-

{% trans "Specify the details for launching an instance. Also please make note of the table below; all tenants have quotas which define the limit of resources they are allowed to provision." %}

+

{% trans "Specify the details for launching an instance. Also please make note of the table below; all projects have quotas which define the limit of resources they are allowed to provision." %}

diff --git a/horizon/horizon/dashboards/settings/dashboard.py b/horizon/horizon/dashboards/settings/dashboard.py index 416e62e9f..715c66036 100644 --- a/horizon/horizon/dashboards/settings/dashboard.py +++ b/horizon/horizon/dashboards/settings/dashboard.py @@ -20,9 +20,9 @@ import horizon class Settings(horizon.Dashboard): - name = "Settings" + name = _("Settings") slug = "settings" - panels = ('user', 'tenant') + panels = ('user', 'project') default_panel = 'user' nav = False diff --git a/horizon/horizon/dashboards/settings/tenant/__init__.py b/horizon/horizon/dashboards/settings/project/__init__.py similarity index 100% rename from horizon/horizon/dashboards/settings/tenant/__init__.py rename to horizon/horizon/dashboards/settings/project/__init__.py diff --git a/horizon/horizon/dashboards/settings/tenant/forms.py b/horizon/horizon/dashboards/settings/project/forms.py similarity index 94% rename from horizon/horizon/dashboards/settings/tenant/forms.py rename to horizon/horizon/dashboards/settings/project/forms.py index e41137eb2..515109e5d 100644 --- a/horizon/horizon/dashboards/settings/tenant/forms.py +++ b/horizon/horizon/dashboards/settings/project/forms.py @@ -32,7 +32,7 @@ LOG = logging.getLogger(__name__) class DownloadOpenRCForm(forms.SelfHandlingForm): - tenant = forms.ChoiceField(label=_("Select a Tenant")) + tenant = forms.ChoiceField(label=_("Select a Project")) @classmethod def _instantiate(cls, request, *args, **kwargs): @@ -58,7 +58,7 @@ class DownloadOpenRCForm(forms.SelfHandlingForm): 'tenant_id': data['tenant']} response = shortcuts.render(request, - 'settings/tenant/openrc.sh.template', + 'settings/project/openrc.sh.template', context, content_type="text/plain") response['Content-Disposition'] = 'attachment; filename=openrc.sh' diff --git a/horizon/horizon/dashboards/settings/tenant/panel.py b/horizon/horizon/dashboards/settings/project/panel.py similarity index 93% rename from horizon/horizon/dashboards/settings/tenant/panel.py rename to horizon/horizon/dashboards/settings/project/panel.py index f6d9326a1..ff9d905d0 100644 --- a/horizon/horizon/dashboards/settings/tenant/panel.py +++ b/horizon/horizon/dashboards/settings/project/panel.py @@ -19,8 +19,8 @@ from horizon.dashboards.settings import dashboard class TenantPanel(horizon.Panel): - name = "Tenant Settings" - slug = 'tenant' + name = "Project Settings" + slug = 'project' dashboard.Settings.register(TenantPanel) diff --git a/horizon/horizon/dashboards/settings/tenant/urls.py b/horizon/horizon/dashboards/settings/project/urls.py similarity index 91% rename from horizon/horizon/dashboards/settings/tenant/urls.py rename to horizon/horizon/dashboards/settings/project/urls.py index 4609a3eeb..41f01c288 100644 --- a/horizon/horizon/dashboards/settings/tenant/urls.py +++ b/horizon/horizon/dashboards/settings/project/urls.py @@ -17,5 +17,5 @@ from django.conf.urls.defaults import patterns, url -urlpatterns = patterns('horizon.dashboards.settings.tenant.views', +urlpatterns = patterns('horizon.dashboards.settings.project.views', url(r'^$', 'index', name='index')) diff --git a/horizon/horizon/dashboards/settings/tenant/views.py b/horizon/horizon/dashboards/settings/project/views.py similarity index 85% rename from horizon/horizon/dashboards/settings/tenant/views.py rename to horizon/horizon/dashboards/settings/project/views.py index 4c0d542ba..369a658d5 100644 --- a/horizon/horizon/dashboards/settings/tenant/views.py +++ b/horizon/horizon/dashboards/settings/project/views.py @@ -15,7 +15,7 @@ # under the License. from django import shortcuts -from horizon.dashboards.settings.tenant.forms import DownloadOpenRCForm +from .forms import DownloadOpenRCForm def index(request): @@ -26,4 +26,4 @@ def index(request): context = {'form': form} - return shortcuts.render(request, 'settings/tenant/settings.html', context) + return shortcuts.render(request, 'settings/project/settings.html', context) diff --git a/horizon/horizon/dashboards/settings/templates/settings/tenant/_openrc.html b/horizon/horizon/dashboards/settings/templates/settings/project/_openrc.html similarity index 60% rename from horizon/horizon/dashboards/settings/templates/settings/tenant/_openrc.html rename to horizon/horizon/dashboards/settings/templates/settings/project/_openrc.html index 9c54edc02..2b086609f 100644 --- a/horizon/horizon/dashboards/settings/templates/settings/tenant/_openrc.html +++ b/horizon/horizon/dashboards/settings/templates/settings/project/_openrc.html @@ -2,7 +2,7 @@ {% load i18n %} {% block form_id %}openrc_download_form{% endblock %} -{% block form_action %}{% url horizon:settings:tenant:index %}{% endblock %} +{% block form_action %}{% url horizon:settings:project:index %}{% endblock %} {% block modal_id %}language_settings_modal{% endblock %} {% block modal-header %}{% trans "Download RC File" %}{% endblock %} @@ -15,12 +15,12 @@

{% trans "Description:" %}

-

{% trans 'Download the RC file for the selected tenant, then type "source openrc" in the terminal to configure your environment to communicate with OpenStack.' %}

+

{% trans 'Download the RC file for the selected project, then type "source openrc" in the terminal to configure your environment to communicate with OpenStack.' %}

{% endblock %} {% block modal-footer %} - {% if hide %}{% trans "Cancel" %}{% endif %} + {% if hide %}{% trans "Cancel" %}{% endif %} {% endblock %} diff --git a/horizon/horizon/dashboards/settings/templates/settings/tenant/openrc.sh.template b/horizon/horizon/dashboards/settings/templates/settings/project/openrc.sh.template similarity index 100% rename from horizon/horizon/dashboards/settings/templates/settings/tenant/openrc.sh.template rename to horizon/horizon/dashboards/settings/templates/settings/project/openrc.sh.template diff --git a/horizon/horizon/dashboards/settings/templates/settings/tenant/settings.html b/horizon/horizon/dashboards/settings/templates/settings/project/settings.html similarity index 59% rename from horizon/horizon/dashboards/settings/templates/settings/tenant/settings.html rename to horizon/horizon/dashboards/settings/templates/settings/project/settings.html index c9ae1ef74..6cc270a37 100644 --- a/horizon/horizon/dashboards/settings/templates/settings/tenant/settings.html +++ b/horizon/horizon/dashboards/settings/templates/settings/project/settings.html @@ -3,9 +3,9 @@ {% block title %}OpenRC Download{% endblock %} {% block page_header %} - {% include "horizon/common/_page_header.html" with title=_("Tenant Settings") %} + {% include "horizon/common/_page_header.html" with title=_("Project Settings") %} {% endblock page_header %} {% block settings_main %} - {% include "settings/tenant/_openrc.html" %} + {% include "settings/project/_openrc.html" %} {% endblock %} diff --git a/horizon/horizon/dashboards/settings/user/views.py b/horizon/horizon/dashboards/settings/user/views.py index 434f72587..e5aa3090a 100644 --- a/horizon/horizon/dashboards/settings/user/views.py +++ b/horizon/horizon/dashboards/settings/user/views.py @@ -15,7 +15,6 @@ # under the License. from django import shortcuts -from horizon.dashboards.settings.tenant.forms import DownloadOpenRCForm def index(request): diff --git a/horizon/horizon/dashboards/syspanel/dashboard.py b/horizon/horizon/dashboards/syspanel/dashboard.py index 3b73b7fd2..ad18f112a 100644 --- a/horizon/horizon/dashboards/syspanel/dashboard.py +++ b/horizon/horizon/dashboards/syspanel/dashboard.py @@ -23,7 +23,7 @@ class Syspanel(horizon.Dashboard): name = "Admin" # Appears in navigation slug = "syspanel" panels = {_("System Panel"): ('overview', 'instances', 'services', - 'flavors', 'images', 'tenants', 'users', + 'flavors', 'images', 'projects', 'users', 'quotas',)} default_panel = 'overview' roles = ('admin',) diff --git a/horizon/horizon/dashboards/syspanel/tenants/__init__.py b/horizon/horizon/dashboards/syspanel/projects/__init__.py similarity index 100% rename from horizon/horizon/dashboards/syspanel/tenants/__init__.py rename to horizon/horizon/dashboards/syspanel/projects/__init__.py diff --git a/horizon/horizon/dashboards/syspanel/tenants/forms.py b/horizon/horizon/dashboards/syspanel/projects/forms.py similarity index 95% rename from horizon/horizon/dashboards/syspanel/tenants/forms.py rename to horizon/horizon/dashboards/syspanel/projects/forms.py index 640105c29..3d741eb27 100644 --- a/horizon/horizon/dashboards/syspanel/tenants/forms.py +++ b/horizon/horizon/dashboards/syspanel/projects/forms.py @@ -52,7 +52,7 @@ class AddUser(forms.SelfHandlingForm): messages.success(request, _('Successfully added user to tenant.')) except: exceptions.handle(request, _('Unable to add user to tenant.')) - return shortcuts.redirect('horizon:syspanel:tenants:users', + return shortcuts.redirect('horizon:syspanel:projects:users', tenant_id=data['tenant_id']) @@ -76,7 +76,7 @@ class CreateTenant(forms.SelfHandlingForm): % data['name']) except: exceptions.handle(request, _('Unable to create tenant.')) - return shortcuts.redirect('horizon:syspanel:tenants:index') + return shortcuts.redirect('horizon:syspanel:projects:index') class UpdateTenant(forms.SelfHandlingForm): @@ -102,7 +102,7 @@ class UpdateTenant(forms.SelfHandlingForm): % data['name']) except: exceptions.handle(request, _('Unable to update tenant.')) - return shortcuts.redirect('horizon:syspanel:tenants:index') + return shortcuts.redirect('horizon:syspanel:projects:index') class UpdateQuotas(forms.SelfHandlingForm): @@ -138,4 +138,4 @@ class UpdateQuotas(forms.SelfHandlingForm): % data['tenant_id']) except: exceptions.handle(request, _('Unable to update quotas.')) - return shortcuts.redirect('horizon:syspanel:tenants:index') + return shortcuts.redirect('horizon:syspanel:projects:index') diff --git a/horizon/horizon/dashboards/syspanel/tenants/panel.py b/horizon/horizon/dashboards/syspanel/projects/panel.py similarity index 95% rename from horizon/horizon/dashboards/syspanel/tenants/panel.py rename to horizon/horizon/dashboards/syspanel/projects/panel.py index 692a93eec..e602d6573 100644 --- a/horizon/horizon/dashboards/syspanel/tenants/panel.py +++ b/horizon/horizon/dashboards/syspanel/projects/panel.py @@ -23,8 +23,8 @@ from horizon.dashboards.syspanel import dashboard class Tenants(horizon.Panel): - name = "Tenants" - slug = 'tenants' + name = "Projects" + slug = 'projects' dashboard.Syspanel.register(Tenants) diff --git a/horizon/horizon/dashboards/syspanel/tenants/tables.py b/horizon/horizon/dashboards/syspanel/projects/tables.py similarity index 84% rename from horizon/horizon/dashboards/syspanel/tenants/tables.py rename to horizon/horizon/dashboards/syspanel/projects/tables.py index 8fdd84b9d..6dd3d0bf2 100644 --- a/horizon/horizon/dashboards/syspanel/tenants/tables.py +++ b/horizon/horizon/dashboards/syspanel/projects/tables.py @@ -15,39 +15,39 @@ LOG = logging.getLogger(__name__) class ModifyQuotasLink(tables.LinkAction): name = "quotas" verbose_name = _("Modify Quotas") - url = "horizon:syspanel:tenants:quotas" + url = "horizon:syspanel:projects:quotas" attrs = {"class": "ajax-modal"} class ViewMembersLink(tables.LinkAction): name = "users" verbose_name = _("Modify Users") - url = "horizon:syspanel:tenants:users" + url = "horizon:syspanel:projects:users" class UsageLink(tables.LinkAction): name = "usage" verbose_name = _("View Usage") - url = "horizon:syspanel:tenants:usage" + url = "horizon:syspanel:projects:usage" class EditLink(tables.LinkAction): name = "update" - verbose_name = _("Edit Tenant") - url = "horizon:syspanel:tenants:update" + verbose_name = _("Edit Project") + url = "horizon:syspanel:projects:update" attrs = {"class": "ajax-modal"} class CreateLink(tables.LinkAction): name = "create" - verbose_name = _("Create New Tenant") - url = "horizon:syspanel:tenants:create" + verbose_name = _("Create New Project") + url = "horizon:syspanel:projects:create" attrs = {"class": "ajax-modal btn small"} class DeleteTenantsAction(tables.DeleteAction): - data_type_singular = _("Tenant") - data_type_plural = _("Tenants") + data_type_singular = _("Project") + data_type_plural = _("Projects") def delete(self, request, obj_id): api.keystone.tenant_delete(request, obj_id) @@ -76,7 +76,7 @@ class TenantsTable(tables.DataTable): class Meta: name = "tenants" - verbose_name = _("Tenants") + verbose_name = _("Projects") row_actions = (EditLink, UsageLink, ViewMembersLink, ModifyQuotasLink, DeleteTenantsAction) table_actions = (TenantFilterAction, CreateLink, DeleteTenantsAction) @@ -98,15 +98,15 @@ class RemoveUserAction(tables.BatchAction): class TenantUsersTable(UsersTable): class Meta: name = "tenant_users" - verbose_name = _("Users For Tenant") + verbose_name = _("Users For Project") table_actions = (RemoveUserAction,) row_actions = (RemoveUserAction,) class AddUserAction(tables.LinkAction): name = "add_user" - verbose_name = _("Add To Tenant") - url = "horizon:syspanel:tenants:add_user" + verbose_name = _("Add To Project") + url = "horizon:syspanel:projects:add_user" classes = ('ajax-modal',) def get_link_url(self, user): diff --git a/horizon/horizon/dashboards/syspanel/tenants/tests.py b/horizon/horizon/dashboards/syspanel/projects/tests.py similarity index 94% rename from horizon/horizon/dashboards/syspanel/tenants/tests.py rename to horizon/horizon/dashboards/syspanel/projects/tests.py index 3a3db4359..55c1504d5 100644 --- a/horizon/horizon/dashboards/syspanel/tenants/tests.py +++ b/horizon/horizon/dashboards/syspanel/projects/tests.py @@ -22,7 +22,7 @@ from horizon import api from horizon import test -INDEX_URL = reverse('horizon:syspanel:tenants:index') +INDEX_URL = reverse('horizon:syspanel:projects:index') class FakeResource(object): @@ -60,7 +60,7 @@ class TenantsViewTests(test.BaseAdminViewTests): res = self.client.get(INDEX_URL) - self.assertTemplateUsed(res, 'syspanel/tenants/index.html') + self.assertTemplateUsed(res, 'syspanel/projects/index.html') self.assertItemsEqual(res.context['table'].data, self.tenants) def test_modify_quota(self): @@ -78,7 +78,7 @@ class TenantsViewTests(test.BaseAdminViewTests): self.mox.ReplayAll() - url = reverse('horizon:syspanel:tenants:quotas', + url = reverse('horizon:syspanel:projects:quotas', args=(self.TEST_TENANT,)) data = {"method": "UpdateQuotas", "tenant_id": self.TEST_TENANT, diff --git a/horizon/horizon/dashboards/syspanel/tenants/urls.py b/horizon/horizon/dashboards/syspanel/projects/urls.py similarity index 100% rename from horizon/horizon/dashboards/syspanel/tenants/urls.py rename to horizon/horizon/dashboards/syspanel/projects/urls.py diff --git a/horizon/horizon/dashboards/syspanel/tenants/views.py b/horizon/horizon/dashboards/syspanel/projects/views.py similarity index 91% rename from horizon/horizon/dashboards/syspanel/tenants/views.py rename to horizon/horizon/dashboards/syspanel/projects/views.py index 59fdf42a2..ff4a010bd 100644 --- a/horizon/horizon/dashboards/syspanel/tenants/views.py +++ b/horizon/horizon/dashboards/syspanel/projects/views.py @@ -41,7 +41,7 @@ LOG = logging.getLogger(__name__) class IndexView(tables.DataTableView): table_class = TenantsTable - template_name = 'syspanel/tenants/index.html' + template_name = 'syspanel/projects/index.html' def get_data(self): tenants = [] @@ -63,12 +63,12 @@ class IndexView(tables.DataTableView): class CreateView(forms.ModalFormView): form_class = CreateTenant - template_name = 'syspanel/tenants/create.html' + template_name = 'syspanel/projects/create.html' class UpdateView(forms.ModalFormView): form_class = UpdateTenant - template_name = 'syspanel/tenants/update.html' + template_name = 'syspanel/projects/update.html' context_object_name = 'tenant' def get_object(self, *args, **kwargs): @@ -79,7 +79,7 @@ class UpdateView(forms.ModalFormView): LOG.exception('Error fetching tenant with id "%s"' % tenant_id) messages.error(self.request, _('Unable to update tenant: %s') % e.message) - raise http.Http404("Tenant with ID %s not found." % tenant_id) + raise http.Http404("Project with ID %s not found." % tenant_id) def get_initial(self): return {'id': self.object.id, @@ -90,7 +90,7 @@ class UpdateView(forms.ModalFormView): class UsersView(tables.MultiTableView): table_classes = (TenantUsersTable, AddUsersTable) - template_name = 'syspanel/tenants/users.html' + template_name = 'syspanel/projects/users.html' def get_data(self, *args, **kwargs): tenant_id = self.kwargs["tenant_id"] @@ -99,7 +99,7 @@ class UsersView(tables.MultiTableView): self.all_users = api.keystone.user_list(self.request) self.tenant_users = api.keystone.user_list(self.request, tenant_id) except: - redirect = reverse("horizon:syspanel:tenants:index") + redirect = reverse("horizon:syspanel:projects:index") exceptions.handle(self.request, _("Unable to retrieve users."), redirect=redirect) @@ -121,7 +121,7 @@ class UsersView(tables.MultiTableView): class AddUserView(forms.ModalFormView): form_class = AddUser - template_name = 'syspanel/tenants/add_user.html' + template_name = 'syspanel/projects/add_user.html' context_object_name = 'tenant' def get_object(self, *args, **kwargs): @@ -138,7 +138,7 @@ class AddUserView(forms.ModalFormView): try: roles = api.keystone.role_list(self.request) except: - redirect = reverse("horizon:syspanel:tenants:users", + redirect = reverse("horizon:syspanel:projects:users", args=(self.kwargs["tenant_id"],)) exceptions.handle(self.request, _("Unable to retrieve roles."), @@ -156,7 +156,7 @@ class AddUserView(forms.ModalFormView): class QuotasView(forms.ModalFormView): form_class = UpdateQuotas - template_name = 'syspanel/tenants/quotas.html' + template_name = 'syspanel/projects/quotas.html' context_object_name = 'tenant' def get_object(self, *args, **kwargs): @@ -181,7 +181,7 @@ class QuotasView(forms.ModalFormView): class TenantUsageView(usage.UsageView): table_class = usage.TenantUsageTable usage_class = usage.TenantUsage - template_name = 'syspanel/tenants/usage.html' + template_name = 'syspanel/projects/usage.html' def get_data(self): super(TenantUsageView, self).get_data() diff --git a/horizon/horizon/dashboards/syspanel/templates/syspanel/tenants/_add_user.html b/horizon/horizon/dashboards/syspanel/templates/syspanel/projects/_add_user.html similarity index 58% rename from horizon/horizon/dashboards/syspanel/templates/syspanel/tenants/_add_user.html rename to horizon/horizon/dashboards/syspanel/templates/syspanel/projects/_add_user.html index 3ccae3aa0..3fdb78a7d 100644 --- a/horizon/horizon/dashboards/syspanel/templates/syspanel/tenants/_add_user.html +++ b/horizon/horizon/dashboards/syspanel/templates/syspanel/projects/_add_user.html @@ -2,10 +2,10 @@ {% load i18n %} {% block form_id %}add_user_form{% endblock %} -{% block form_action %}{% url horizon:syspanel:tenants:add_user tenant_id user_id %}{% endblock %} +{% block form_action %}{% url horizon:syspanel:projects:add_user tenant_id user_id %}{% endblock %} {% block modal_id %}add_user_modal{% endblock %} -{% block modal-header %}{% trans "Add User To Tenant" %}{% endblock %} +{% block modal-header %}{% trans "Add User To Project" %}{% endblock %} {% block modal-body %}
@@ -15,11 +15,11 @@

{% trans "Description" %}:

-

{% trans "Select the user role for the tenant." %}

+

{% trans "Select the user role for the project." %}

{% endblock %} {% block modal-footer %} - {% trans "Cancel" %} + {% trans "Cancel" %} {% endblock %} diff --git a/horizon/horizon/dashboards/syspanel/templates/syspanel/tenants/_create.html b/horizon/horizon/dashboards/syspanel/templates/syspanel/projects/_create.html similarity index 56% rename from horizon/horizon/dashboards/syspanel/templates/syspanel/tenants/_create.html rename to horizon/horizon/dashboards/syspanel/templates/syspanel/projects/_create.html index 7438fbcf0..e6d21a09e 100644 --- a/horizon/horizon/dashboards/syspanel/templates/syspanel/tenants/_create.html +++ b/horizon/horizon/dashboards/syspanel/templates/syspanel/projects/_create.html @@ -2,10 +2,10 @@ {% load i18n %} {% block form_id %}create_tenant_form{% endblock %} -{% block form_action %}{% url horizon:syspanel:tenants:create %}{% endblock %} +{% block form_action %}{% url horizon:syspanel:projects:create %}{% endblock %} {% block modal_id %}create_tenant_modal{% endblock %} -{% block modal-header %}{% trans "Create Tenant" %}{% endblock %} +{% block modal-header %}{% trans "Create Project" %}{% endblock %} {% block modal-body %}
@@ -15,11 +15,11 @@

{% trans "Description" %}:

-

{% trans "From here you can create a new tenant (aka project) to organize users." %}

+

{% trans "From here you can create a new project to organize users." %}

{% endblock %} {% block modal-footer %} - - {% trans "Cancel" %} + + {% trans "Cancel" %} {% endblock %} diff --git a/horizon/horizon/dashboards/syspanel/templates/syspanel/tenants/_quotas.html b/horizon/horizon/dashboards/syspanel/templates/syspanel/projects/_quotas.html similarity index 67% rename from horizon/horizon/dashboards/syspanel/templates/syspanel/tenants/_quotas.html rename to horizon/horizon/dashboards/syspanel/templates/syspanel/projects/_quotas.html index 5bee2b78e..2c546bcad 100644 --- a/horizon/horizon/dashboards/syspanel/templates/syspanel/tenants/_quotas.html +++ b/horizon/horizon/dashboards/syspanel/templates/syspanel/projects/_quotas.html @@ -2,7 +2,7 @@ {% load i18n %} {% block form_id %}quota_update_form{% endblock %} -{% block form_action %}{% url horizon:syspanel:tenants:quotas tenant.id %}{% endblock %} +{% block form_action %}{% url horizon:syspanel:projects:quotas tenant.id %}{% endblock %} {% block modal-header %}{% trans "Update Quota" %}{% endblock %} @@ -14,11 +14,11 @@

{% trans "Description" %}:

-

{% blocktrans with tenant_id=tenant.id %}From here you can edit quotas (max limits) for the tenant {{ tenant_id }}.{% endblocktrans %}

+

{% blocktrans with tenant_id=tenant.id %}From here you can edit quotas (max limits) for the project {{ tenant.name }}.{% endblocktrans %}

{% endblock %} {% block modal-footer %} - {% trans "Cancel" %} + {% trans "Cancel" %} {% endblock %} diff --git a/horizon/horizon/dashboards/syspanel/templates/syspanel/tenants/_update.html b/horizon/horizon/dashboards/syspanel/templates/syspanel/projects/_update.html similarity index 56% rename from horizon/horizon/dashboards/syspanel/templates/syspanel/tenants/_update.html rename to horizon/horizon/dashboards/syspanel/templates/syspanel/projects/_update.html index 748efc81b..b96e6ef87 100644 --- a/horizon/horizon/dashboards/syspanel/templates/syspanel/tenants/_update.html +++ b/horizon/horizon/dashboards/syspanel/templates/syspanel/projects/_update.html @@ -2,10 +2,10 @@ {% load i18n %} {% block form_id %}{% endblock %} -{% block form_action %}{% url horizon:syspanel:tenants:update tenant.id %}{% endblock %} +{% block form_action %}{% url horizon:syspanel:projects:update tenant.id %}{% endblock %} {% block modal_id %}update_tenant_modal{% endblock %} -{% block modal-header %}{% trans "Update Tenant" %}{% endblock %} +{% block modal-header %}{% trans "Update Project" %}{% endblock %} {% block modal-body %}
@@ -15,11 +15,11 @@

{% trans "Description" %}:

-

{% trans "From here you can edit a tenant." %}

+

{% trans "From here you can edit a project." %}

{% endblock %} {% block modal-footer %} - - {% trans "Cancel" %} + + {% trans "Cancel" %} {% endblock %} diff --git a/horizon/horizon/dashboards/syspanel/templates/syspanel/tenants/add_user.html b/horizon/horizon/dashboards/syspanel/templates/syspanel/projects/add_user.html similarity index 59% rename from horizon/horizon/dashboards/syspanel/templates/syspanel/tenants/add_user.html rename to horizon/horizon/dashboards/syspanel/templates/syspanel/projects/add_user.html index 781698d24..2d0313dcd 100644 --- a/horizon/horizon/dashboards/syspanel/templates/syspanel/tenants/add_user.html +++ b/horizon/horizon/dashboards/syspanel/templates/syspanel/projects/add_user.html @@ -1,11 +1,11 @@ {% extends 'syspanel/base.html' %} {% load i18n %} -{% block title %}{% trans "Add User To Tenant" %}{% endblock %} +{% block title %}{% trans "Add User To Project" %}{% endblock %} {% block page_header %} - {% include "horizon/common/_page_header.html" with title=_("Add User To Tenant") %} + {% include "horizon/common/_page_header.html" with title=_("Add User To Project") %} {% endblock page_header %} {% block syspanel_main %} - {% include 'syspanel/tenants/_add_user.html' %} + {% include 'syspanel/projects/_add_user.html' %} {% endblock %} diff --git a/horizon/horizon/dashboards/syspanel/templates/syspanel/tenants/create.html b/horizon/horizon/dashboards/syspanel/templates/syspanel/projects/create.html similarity index 64% rename from horizon/horizon/dashboards/syspanel/templates/syspanel/tenants/create.html rename to horizon/horizon/dashboards/syspanel/templates/syspanel/projects/create.html index 97da2da52..63a0251ca 100644 --- a/horizon/horizon/dashboards/syspanel/templates/syspanel/tenants/create.html +++ b/horizon/horizon/dashboards/syspanel/templates/syspanel/projects/create.html @@ -1,11 +1,11 @@ {% extends 'syspanel/base.html' %} {% load i18n %} -{% block title %}Create Tenant{% endblock %} +{% block title %}Create Project{% endblock %} {% block page_header %} - {% include "horizon/common/_page_header.html" with title=_("Create Tenant") %} + {% include "horizon/common/_page_header.html" with title=_("Create Project") %} {% endblock page_header %} {% block syspanel_main %} - {% include 'syspanel/tenants/_create.html' %} + {% include 'syspanel/projects/_create.html' %} {% endblock %} diff --git a/horizon/horizon/dashboards/syspanel/templates/syspanel/tenants/index.html b/horizon/horizon/dashboards/syspanel/templates/syspanel/projects/index.html similarity index 52% rename from horizon/horizon/dashboards/syspanel/templates/syspanel/tenants/index.html rename to horizon/horizon/dashboards/syspanel/templates/syspanel/projects/index.html index cd46a0ec3..8e758afe4 100644 --- a/horizon/horizon/dashboards/syspanel/templates/syspanel/tenants/index.html +++ b/horizon/horizon/dashboards/syspanel/templates/syspanel/projects/index.html @@ -1,11 +1,11 @@ {% extends 'syspanel/base.html' %} {% load i18n %} -{% block title %}Tenants{% endblock %} +{% block title %}Projects{% endblock %} {% block page_header %} - {% url horizon:syspanel:tenants:index as refresh_link %} + {% url horizon:syspanel:projects:index as refresh_link %} {# to make searchable false, just remove it from the include statement #} - {% include "horizon/common/_page_header.html" with title=_("Tenants") refresh_link=refresh_link searchable="true" %} + {% include "horizon/common/_page_header.html" with title=_("Projects") refresh_link=refresh_link searchable="true" %} {% endblock page_header %} {% block syspanel_main %} diff --git a/horizon/horizon/dashboards/syspanel/templates/syspanel/tenants/quotas.html b/horizon/horizon/dashboards/syspanel/templates/syspanel/projects/quotas.html similarity index 60% rename from horizon/horizon/dashboards/syspanel/templates/syspanel/tenants/quotas.html rename to horizon/horizon/dashboards/syspanel/templates/syspanel/projects/quotas.html index 6ef34117b..df7653b2f 100644 --- a/horizon/horizon/dashboards/syspanel/templates/syspanel/tenants/quotas.html +++ b/horizon/horizon/dashboards/syspanel/templates/syspanel/projects/quotas.html @@ -1,11 +1,11 @@ {% extends 'syspanel/base.html' %} {% load i18n %} -{% block title %}Modify Tenant Quotas{% endblock %} +{% block title %}Modify Project Quotas{% endblock %} {% block page_header %} - {% include "horizon/common/_page_header.html" with title=_("Update Tenant") %} + {% include "horizon/common/_page_header.html" with title=_("Update Project") %} {% endblock page_header %} {% block syspanel_main %} - {% include 'syspanel/tenants/_quotas.html' with form=form %} + {% include 'syspanel/projects/_quotas.html' with form=form %} {% endblock %} diff --git a/horizon/horizon/dashboards/syspanel/templates/syspanel/tenants/update.html b/horizon/horizon/dashboards/syspanel/templates/syspanel/projects/update.html similarity index 64% rename from horizon/horizon/dashboards/syspanel/templates/syspanel/tenants/update.html rename to horizon/horizon/dashboards/syspanel/templates/syspanel/projects/update.html index f7196ba91..c15f919d4 100644 --- a/horizon/horizon/dashboards/syspanel/templates/syspanel/tenants/update.html +++ b/horizon/horizon/dashboards/syspanel/templates/syspanel/projects/update.html @@ -1,11 +1,11 @@ {% extends 'syspanel/base.html' %} {% load i18n %} -{% block title %}Update Tenant{% endblock %} +{% block title %}Update Project{% endblock %} {% block page_header %} - {% include "horizon/common/_page_header.html" with title=_("Update Tenant") %} + {% include "horizon/common/_page_header.html" with title=_("Update Project") %} {% endblock page_header %} {% block syspanel_main %} - {% include 'syspanel/tenants/_update.html' %} + {% include 'syspanel/projects/_update.html' %} {% endblock %} diff --git a/horizon/horizon/dashboards/syspanel/templates/syspanel/tenants/usage.csv b/horizon/horizon/dashboards/syspanel/templates/syspanel/projects/usage.csv similarity index 100% rename from horizon/horizon/dashboards/syspanel/templates/syspanel/tenants/usage.csv rename to horizon/horizon/dashboards/syspanel/templates/syspanel/projects/usage.csv diff --git a/horizon/horizon/dashboards/syspanel/templates/syspanel/projects/usage.html b/horizon/horizon/dashboards/syspanel/templates/syspanel/projects/usage.html new file mode 100644 index 000000000..cc874f4c9 --- /dev/null +++ b/horizon/horizon/dashboards/syspanel/templates/syspanel/projects/usage.html @@ -0,0 +1,14 @@ +{% extends 'syspanel/base.html' %} +{% load i18n sizeformat %} +{% block title %}{% trans "Project Usage Overview" %}{% endblock %} + +{% block page_header %} + +{% endblock %} + +{% block syspanel_main %} + {% include "horizon/common/_usage_summary.html" %} + {{ table.render }} +{% endblock %} diff --git a/horizon/horizon/dashboards/syspanel/templates/syspanel/tenants/users.html b/horizon/horizon/dashboards/syspanel/templates/syspanel/projects/users.html similarity index 72% rename from horizon/horizon/dashboards/syspanel/templates/syspanel/tenants/users.html rename to horizon/horizon/dashboards/syspanel/templates/syspanel/projects/users.html index 86014f195..a0db7fbea 100644 --- a/horizon/horizon/dashboards/syspanel/templates/syspanel/tenants/users.html +++ b/horizon/horizon/dashboards/syspanel/templates/syspanel/projects/users.html @@ -1,10 +1,10 @@ {% extends 'syspanel/base.html' %} {% load i18n %} -{% block title %}Tenant Users{% endblock %} +{% block title %}Project Users{% endblock %} {% block page_header %} {% endblock %} diff --git a/horizon/horizon/dashboards/syspanel/templates/syspanel/tenants/_delete.html b/horizon/horizon/dashboards/syspanel/templates/syspanel/tenants/_delete.html deleted file mode 100644 index 19243f838..000000000 --- a/horizon/horizon/dashboards/syspanel/templates/syspanel/tenants/_delete.html +++ /dev/null @@ -1,9 +0,0 @@ -{% load i18n %} - - {% csrf_token %} - {% for hidden in form.hidden_fields %} - {{ hidden }} - {% endfor %} - - - diff --git a/horizon/horizon/dashboards/syspanel/templates/syspanel/tenants/usage.html b/horizon/horizon/dashboards/syspanel/templates/syspanel/tenants/usage.html deleted file mode 100644 index b7bf16aaf..000000000 --- a/horizon/horizon/dashboards/syspanel/templates/syspanel/tenants/usage.html +++ /dev/null @@ -1,8 +0,0 @@ -{% extends 'syspanel/base.html' %} -{% load i18n sizeformat %} -{% block title %}{% trans "Tenant Usage Overview" %}{% endblock %} - -{% block syspanel_main %} - {% include "horizon/common/_usage_summary.html" %} - {{ table.render }} -{% endblock %} diff --git a/horizon/horizon/dashboards/syspanel/templates/syspanel/users/_create.html b/horizon/horizon/dashboards/syspanel/templates/syspanel/users/_create.html index 5336f22de..c2abff834 100644 --- a/horizon/horizon/dashboards/syspanel/templates/syspanel/users/_create.html +++ b/horizon/horizon/dashboards/syspanel/templates/syspanel/users/_create.html @@ -14,7 +14,7 @@

{% trans "Description" %}:

-

{% trans "From here you can create a new user and assign them to a tenant (aka project)." %}

+

{% trans "From here you can create a new user and assign them to a project." %}

{% endblock %} diff --git a/horizon/horizon/dashboards/syspanel/templates/syspanel/users/_update.html b/horizon/horizon/dashboards/syspanel/templates/syspanel/users/_update.html index 630f99f35..7f0d2f941 100644 --- a/horizon/horizon/dashboards/syspanel/templates/syspanel/users/_update.html +++ b/horizon/horizon/dashboards/syspanel/templates/syspanel/users/_update.html @@ -1,7 +1,7 @@ {% extends "horizon/common/_modal_form.html" %} {% load i18n %} -{% block form_id %}update_tenant_form{% endblock %} +{% block form_id %}update_user_form{% endblock %} {% block form_action %}{% url horizon:syspanel:users:update user.id %}{% endblock %} {% block modal-header %}{% trans "Update User" %}{% endblock %} @@ -14,7 +14,7 @@

{% trans "Description" %}:

-

{% trans "From here you can edit users by changing their usernames, emails, passwords, and tenants." %}

+

{% trans "From here you can edit the user by changing their username, email, password, and default project." %}

{% endblock %} diff --git a/horizon/horizon/dashboards/syspanel/users/forms.py b/horizon/horizon/dashboards/syspanel/users/forms.py index 08f9aa1b0..5f258e369 100644 --- a/horizon/horizon/dashboards/syspanel/users/forms.py +++ b/horizon/horizon/dashboards/syspanel/users/forms.py @@ -53,7 +53,7 @@ class CreateUserForm(BaseUserForm): password = forms.CharField(label=_("Password"), widget=forms.PasswordInput(render_value=False), required=False) - tenant_id = forms.ChoiceField(label=_("Primary Tenant")) + tenant_id = forms.ChoiceField(label=_("Primary Project")) def handle(self, request, data): try: @@ -92,7 +92,7 @@ class UpdateUserForm(BaseUserForm): password = forms.CharField(label=_("Password"), widget=forms.PasswordInput(render_value=False), required=False) - tenant_id = forms.ChoiceField(label=_("Primary Tenant")) + tenant_id = forms.ChoiceField(label=_("Primary Project")) def handle(self, request, data): updated = [] diff --git a/horizon/horizon/dashboards/syspanel/users/tables.py b/horizon/horizon/dashboards/syspanel/users/tables.py index 6d6228239..6781ed1a1 100644 --- a/horizon/horizon/dashboards/syspanel/users/tables.py +++ b/horizon/horizon/dashboards/syspanel/users/tables.py @@ -128,7 +128,7 @@ class UsersTable(tables.DataTable): email = tables.Column(_('email')) # Default tenant is not returned from Keystone currently. #default_tenant = tables.Column(_('default_tenant'), - # verbose_name="Default Tenant") + # verbose_name="Default Project") enabled = tables.Column(_('enabled'), status=True, status_choices=STATUS_CHOICES) diff --git a/horizon/horizon/tests/base_tests.py b/horizon/horizon/tests/base_tests.py index 5c15c221b..cb653dfb4 100644 --- a/horizon/horizon/tests/base_tests.py +++ b/horizon/horizon/tests/base_tests.py @@ -104,7 +104,7 @@ class HorizonTests(test.TestCase): '', '', '', - '', + '', '', '']) self.assertEqual(syspanel.get_absolute_url(), "/syspanel/") @@ -120,7 +120,7 @@ class HorizonTests(test.TestCase): settings_dash.register(MyPanel) self.assertQuerysetEqual(settings_dash.get_panels(), ['', - '', + '', '']) def test_panels(self): diff --git a/horizon/horizon/usage/tables.py b/horizon/horizon/usage/tables.py index c62761e9e..fc80274c7 100644 --- a/horizon/horizon/usage/tables.py +++ b/horizon/horizon/usage/tables.py @@ -23,7 +23,7 @@ class BaseUsageTable(tables.DataTable): class GlobalUsageTable(BaseUsageTable): - tenant = tables.Column('tenant_id', verbose_name=_("Tenant ID")) + tenant = tables.Column('tenant_id', verbose_name=_("Project ID")) disk_hours = tables.Column('disk_gb_hours', verbose_name=_("Disk GB Hours"))
{% trans "Quota Name" %}