diff --git a/horizon/dashboards/nova/overview/urls.py b/horizon/dashboards/nova/overview/urls.py index 675d2dc7556..fc372d5ae87 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 ce50a4b73ac..7840b75d11a 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 00000000000..ee8cfec85a8 --- /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 b6f359ab7a7..7b2daf8ea61 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 %} +
+
+

+ {% trans "Caution" %}: + {% trans "You are acting as an admin user in the project dashboard." %} +

+ {% trans "Learn More" %} +
+
+{% endif %} +{{ block.super }} +{% endblock %} {% block sidebar %} {% include 'horizon/common/_sidebar.html' %} diff --git a/openstack_dashboard/static/dashboard/less/horizon.less b/openstack_dashboard/static/dashboard/less/horizon.less index 2acf300c93f..8975dd41d80 100644 --- a/openstack_dashboard/static/dashboard/less/horizon.less +++ b/openstack_dashboard/static/dashboard/less/horizon.less @@ -1193,3 +1193,25 @@ label.log-length { .split_five div.control-group select { width: 120px; } + +.warning { + background-color: @errorBackground; + border-bottom: 1px solid @red; + padding: 5px 10px; + .warning-text { + text-align: center; + h3, a { + display: inline-block; + } + h3 { + vertical-align: bottom; + } + } +} +#admin_warning_detail { + ul { + list-style: circle; + padding-left: 20px; + margin-bottom: 10px; + } +}