diff --git a/horizon/dashboards/nova/overview/urls.py b/horizon/dashboards/nova/overview/urls.py index 675d2dc75..fc372d5ae 100644 --- a/horizon/dashboards/nova/overview/urls.py +++ b/horizon/dashboards/nova/overview/urls.py @@ -19,10 +19,11 @@ # under the License. -from django.conf.urls.defaults import * +from django.conf.urls.defaults import url, patterns -from .views import ProjectOverview +from .views import ProjectOverview, WarningView urlpatterns = patterns('horizon.dashboards.nova.overview.views', url(r'^$', ProjectOverview.as_view(), name='index'), + url(r'^warning$', WarningView.as_view(), name='warning'), ) diff --git a/horizon/dashboards/nova/overview/views.py b/horizon/dashboards/nova/overview/views.py index ce50a4b73..7840b75d1 100644 --- a/horizon/dashboards/nova/overview/views.py +++ b/horizon/dashboards/nova/overview/views.py @@ -18,6 +18,8 @@ # License for the specific language governing permissions and limitations # under the License. +from django.views.generic import TemplateView + from horizon import usage @@ -29,3 +31,7 @@ class ProjectOverview(usage.UsageView): def get_data(self): super(ProjectOverview, self).get_data() return self.usage.get_instances() + + +class WarningView(TemplateView): + template_name = "nova/_warning.html" diff --git a/horizon/dashboards/nova/templates/nova/_warning.html b/horizon/dashboards/nova/templates/nova/_warning.html new file mode 100644 index 000000000..ee8cfec85 --- /dev/null +++ b/horizon/dashboards/nova/templates/nova/_warning.html @@ -0,0 +1,26 @@ +{% load i18n %} + +
diff --git a/horizon/dashboards/nova/templates/nova/base.html b/horizon/dashboards/nova/templates/nova/base.html index b6f359ab7..7b2daf8ea 100644 --- a/horizon/dashboards/nova/templates/nova/base.html +++ b/horizon/dashboards/nova/templates/nova/base.html @@ -1,4 +1,20 @@ {% extends 'base.html' %} +{% load i18n %} + +{% block content %} +{% if request.user.is_admin %} +