diff --git a/docs/source/ref/run_tests.rst b/docs/source/ref/run_tests.rst index 7c1f5a8ee..1868554f5 100644 --- a/docs/source/ref/run_tests.rst +++ b/docs/source/ref/run_tests.rst @@ -107,6 +107,18 @@ You can build Horizon's documentation automatically by running:: The output is stored in ``./docs/build/html/``. +Updating the translation files +============================== + +You can update all of the translation files for both the ``horizon`` app and +``openstack_dashboard`` project with a single command: + + ./run_tests.sh --makemessages + +or, more compactly: + + ./run_tests.sh --m + Starting clean ============== diff --git a/horizon/dashboards/nova/images_and_snapshots/images/tabs.py b/horizon/dashboards/nova/images_and_snapshots/images/tabs.py new file mode 100644 index 000000000..685f819d7 --- /dev/null +++ b/horizon/dashboards/nova/images_and_snapshots/images/tabs.py @@ -0,0 +1,44 @@ +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright 2012 Nebula, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +from django.core.urlresolvers import reverse +from django.utils.translation import ugettext as _ + +from horizon import api +from horizon import exceptions +from horizon import tabs + + +class OverviewTab(tabs.Tab): + name = _("Overview") + slug = "overview" + template_name = "nova/images_and_snapshots/images/_detail_overview.html" + + def get_context_data(self, request): + image_id = self.tab_group.kwargs['image_id'] + try: + image = api.glance.image_get_meta(self.request, image_id) + except: + redirect = reverse('horizon:nova:images_and_snapshots:index') + exceptions.handle(request, + _('Unable to retrieve image details.'), + redirect=redirect) + return {'image': image} + + +class ImageDetailTabs(tabs.TabGroup): + slug = "image_details" + tabs = (OverviewTab,) diff --git a/horizon/dashboards/nova/images_and_snapshots/images/views.py b/horizon/dashboards/nova/images_and_snapshots/images/views.py index a7d958f0d..95c8801ed 100644 --- a/horizon/dashboards/nova/images_and_snapshots/images/views.py +++ b/horizon/dashboards/nova/images_and_snapshots/images/views.py @@ -29,8 +29,9 @@ from django.utils.translation import ugettext as _ from horizon import api from horizon import exceptions from horizon import forms -from horizon import views +from horizon import tabs from .forms import UpdateImageForm, LaunchForm +from .tabs import ImageDetailTabs LOG = logging.getLogger(__name__) @@ -170,16 +171,6 @@ class UpdateView(forms.ModalFormView): 'disk_format': self.object.get('disk_format', ''), } -class DetailView(views.APIView): +class DetailView(tabs.TabView): + tab_group_class = ImageDetailTabs template_name = 'nova/images_and_snapshots/images/detail.html' - - def get_data(self, request, context, *args, **kwargs): - image_id = kwargs['image_id'] - try: - image = api.glance.image_get_meta(self.request, kwargs['image_id']) - except: - redirect = reverse('horizon:nova:images_and_snapshots:index') - exceptions.handle(request, _('Unable to retrieve details for ' - 'instance "%s".') % image_id, - redirect=redirect) - return {'image': image} diff --git a/horizon/dashboards/nova/instances_and_volumes/volumes/tabs.py b/horizon/dashboards/nova/instances_and_volumes/volumes/tabs.py index 5f3dc1f6c..81d349ea9 100644 --- a/horizon/dashboards/nova/instances_and_volumes/volumes/tabs.py +++ b/horizon/dashboards/nova/instances_and_volumes/volumes/tabs.py @@ -42,6 +42,6 @@ class OverviewTab(tabs.Tab): return {'volume': volume} -class ImageDetailTabs(tabs.TabGroup): - slug = "image_details" +class VolumeDetailTabs(tabs.TabGroup): + slug = "volume_details" tabs = (OverviewTab,) diff --git a/horizon/dashboards/nova/instances_and_volumes/volumes/views.py b/horizon/dashboards/nova/instances_and_volumes/volumes/views.py index c33103c4a..491a6ace4 100644 --- a/horizon/dashboards/nova/instances_and_volumes/volumes/views.py +++ b/horizon/dashboards/nova/instances_and_volumes/volumes/views.py @@ -29,14 +29,14 @@ from horizon import tables from horizon import tabs from .forms import CreateForm, AttachForm, CreateSnapshotForm from .tables import AttachmentsTable -from .tabs import ImageDetailTabs +from .tabs import VolumeDetailTabs LOG = logging.getLogger(__name__) class DetailView(tabs.TabView): - tab_group_class = ImageDetailTabs + tab_group_class = VolumeDetailTabs template_name = 'nova/instances_and_volumes/volumes/detail.html' diff --git a/horizon/dashboards/nova/templates/nova/images_and_snapshots/images/_detail_overview.html b/horizon/dashboards/nova/templates/nova/images_and_snapshots/images/_detail_overview.html new file mode 100644 index 000000000..02b975e39 --- /dev/null +++ b/horizon/dashboards/nova/templates/nova/images_and_snapshots/images/_detail_overview.html @@ -0,0 +1,59 @@ +{% load i18n sizeformat %} + +

{% trans "Instance Overview" %}

+ +
+

{% trans "Info" %}

+
+ +
+ +
+

{% trans "Status" %}

+
+ +
+ +
+

{% trans "Specs" %}

+
+ +
+ +
+

{% trans "Custom Properties" %}

+
+ +
diff --git a/horizon/dashboards/nova/templates/nova/images_and_snapshots/images/detail.html b/horizon/dashboards/nova/templates/nova/images_and_snapshots/images/detail.html index 485131aba..301a75696 100644 --- a/horizon/dashboards/nova/templates/nova/images_and_snapshots/images/detail.html +++ b/horizon/dashboards/nova/templates/nova/images_and_snapshots/images/detail.html @@ -1,55 +1,16 @@ {% extends 'nova/base.html' %} -{% load i18n sizeformat %} +{% load i18n %} + {% block title %}{% trans "Image Detail "%}{% endblock %} {% block page_header %} - {% include "horizon/common/_page_header.html" with title="Image Detail: "|add:image.name %} + {% include "horizon/common/_page_header.html" with title="Image Detail" %} {% endblock page_header %} {% block dash_main %} - -{% endblock %} \ No newline at end of file +
+
+ {{ tab_group.render }} +
+
+{% endblock %} diff --git a/horizon/dashboards/nova/templates/nova/instances_and_volumes/instances/_detail_overview.html b/horizon/dashboards/nova/templates/nova/instances_and_volumes/instances/_detail_overview.html index 1a67793b3..aa89de27a 100644 --- a/horizon/dashboards/nova/templates/nova/instances_and_volumes/instances/_detail_overview.html +++ b/horizon/dashboards/nova/templates/nova/instances_and_volumes/instances/_detail_overview.html @@ -2,13 +2,20 @@

{% trans "Instance Overview" %}

+
+

{% trans "Info" %}

+
+ +
+

{% trans "Status" %}


@@ -60,7 +67,8 @@
diff --git a/horizon/dashboards/nova/templates/nova/instances_and_volumes/volumes/_detail_overview.html b/horizon/dashboards/nova/templates/nova/instances_and_volumes/volumes/_detail_overview.html index 2a5fa2a28..0b1c5d14e 100644 --- a/horizon/dashboards/nova/templates/nova/instances_and_volumes/volumes/_detail_overview.html +++ b/horizon/dashboards/nova/templates/nova/instances_and_volumes/volumes/_detail_overview.html @@ -6,10 +6,10 @@

{% trans "Info" %}


@@ -26,8 +26,8 @@

{% trans "Specs" %}


@@ -37,7 +37,7 @@