فهرست منبع

HUE-1930 [core] Alert users with older browsers to upgrade instead of showing a blank page

Added unsupported browser page
Enrico Berti 11 سال پیش
والد
کامیت
1581777b2

+ 6 - 0
desktop/core/src/desktop/templates/common_header.mako

@@ -119,6 +119,12 @@ from django.utils.translation import ugettext as _
 
   </script>
 
+  <!--[if lt IE 9]>
+  <script type="text/javascript">
+    location.href = "${ url('desktop.views.unsupported') }";
+  </script>
+  <![endif]-->
+
   <script src="/static/js/hue.utils.js"></script>
   <script src="/static/ext/js/jquery/jquery-2.0.2.min.js"></script>
   <script src="/static/js/jquery.migration.js"></script>

+ 98 - 0
desktop/core/src/desktop/templates/unsupported.mako

@@ -0,0 +1,98 @@
+## Licensed to Cloudera, Inc. under one
+## or more contributor license agreements.    See the NOTICE file
+## distributed with this work for additional information
+## regarding copyright ownership.  Cloudera, Inc. licenses this file
+## to you 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.utils.translation import ugettext as _
+%>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="utf-8">
+  <title>${_('Hue - Unsupported browser')}</title>
+
+  <meta name="viewport" content="width=device-width, initial-scale=1.0">
+  <meta name="description" content="">
+  <meta name="author" content="">
+
+  <style type="text/css">
+    body {
+      padding-top: 80px;
+      margin: 0;
+      font-family: Arial, Helvetica, sans-serif;
+      font-size: 13px;
+      line-height: 20px;
+      color: #444444;
+      text-align: center;
+    }
+
+    #logo {
+      display: block;
+      margin-left: auto;
+      margin-right: auto;
+      margin-bottom: 10px;
+      background: #FFF url("/static/art/hue-login-logo-ellie.png") 50% 14px no-repeat;
+      width: 130px;
+      height: 130px;
+    }
+
+    .header {
+      background-color: #338BB8;
+      position: fixed;
+      top: 0;
+      width: 100%;
+      text-align: left;
+      padding: 4px;
+    }
+
+    .footer {
+      position: fixed;
+      bottom: 0;
+      background-color: #338BB8;
+      color: #FFF;
+      font-size: 10px;
+      width: 100%;
+      text-align: center;
+      height: 6px;
+    }
+
+    a {
+      color: #338bb8;
+      text-decoration: none;
+      font-weight: bold;
+    }
+
+    a:hover {
+      text-decoration: underline;
+    }
+  </style>
+</head>
+
+<body>
+<div class="header">
+  <img src="/static/art/hue-logo-mini-white.png"/>
+</div>
+
+<div class="footer"></div>
+
+<div id="logo"></div>
+
+<h3>${_('It looks like you are running an older browser. What about upgrading to the latest')}</h3>
+
+<a href="http://www.google.com/chrome/‎">Google Chrome</a> |
+<a href="http://www.mozilla.org/firefox/‎">Mozilla Firefox</a> |
+<a href="http://windows.microsoft.com/en-us/internet-explorer/browser-ie‎">Microsoft Internet Explorer</a>
+
+</body>
+</html>

+ 3 - 0
desktop/core/src/desktop/urls.py

@@ -70,6 +70,9 @@ dynamic_patterns += patterns('desktop.views',
   # Jasmine
   (r'^jasmine', 'jasmine'),
 
+  # Unsupported browsers
+  (r'^boohoo$','unsupported'),
+
   # Top level web page!
   (r'^$', 'index'),
 )

+ 4 - 0
desktop/core/src/desktop/views.py

@@ -238,6 +238,10 @@ def threads(request):
 def jasmine(request):
   return render('jasmine.mako', request, None)
 
+@login_notrequired
+def unsupported(request):
+  return render('unsupported.mako', request, None)
+
 def index(request):
   if request.user.is_superuser and request.COOKIES.get('hueLandingPage') != 'home':
     return redirect(reverse('about:index'))