Forráskód Böngészése

Fix error page style

Enrico Berti 13 éve
szülő
commit
5bad746f28

+ 3 - 3
apps/filebrowser/src/filebrowser/views_test.py

@@ -189,7 +189,7 @@ def test_view_avro():
 
 
     # we should fail to do a bad thing if they specify compression when it's not set.
     # we should fail to do a bad thing if they specify compression when it's not set.
     response = c.get('/filebrowser/view/test-avro-filebrowser/test-view2.avro?compression=gzip')
     response = c.get('/filebrowser/view/test-avro-filebrowser/test-view2.avro?compression=gzip')
-    assert_false(response.context.has_key('view'))
+    assert_true('Failed to decompress' in response.context['message'])
 
 
   finally:
   finally:
     try:
     try:
@@ -222,7 +222,7 @@ def test_view_gz():
 
 
     # offset should do nothing
     # offset should do nothing
     response = c.get('/filebrowser/view/test-gz-filebrowser/test-view.gz?compression=gzip&offset=1')
     response = c.get('/filebrowser/view/test-gz-filebrowser/test-view.gz?compression=gzip&offset=1')
-    assert_false(response.context.has_key('view'))
+    assert_true("We don't support" in response.context['message'])
 
 
     f = cluster.fs.open('/test-gz-filebrowser/test-view2.gz', "w")
     f = cluster.fs.open('/test-gz-filebrowser/test-view2.gz', "w")
     f.write("hello")
     f.write("hello")
@@ -234,7 +234,7 @@ def test_view_gz():
 
 
     # we should fail to do a bad thing if they specify compression when it's not set.
     # we should fail to do a bad thing if they specify compression when it's not set.
     response = c.get('/filebrowser/view/test-gz-filebrowser/test-view2.gz?compression=gzip')
     response = c.get('/filebrowser/view/test-gz-filebrowser/test-view2.gz?compression=gzip')
-    assert_false(response.context.has_key('view'))
+    assert_true("Failed to decompress" in response.context['message'])
 
 
   finally:
   finally:
     try:
     try:

+ 10 - 61
desktop/core/src/desktop/templates/popup_error.mako

@@ -13,79 +13,28 @@
 ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 ## See the License for the specific language governing permissions and
 ## See the License for the specific language governing permissions and
 ## limitations under the License.
 ## limitations under the License.
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<%!
+from desktop.views import commonheader, commonfooter
+%>
 
 
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
-	<meta name="viewport" content="width=device-width user-scalable=no initial-scale=1" />
-	<meta name="apple-mobile-web-app-capable" content="yes" />
-	<title>${title}</title>
-	<link rel="stylesheet" href="/static/ext/css/bootstrap.min.css" type="text/css" media="screen" title="no title" charset="utf-8" />
-	<link rel="stylesheet" href="/static/css/jhue.css" type="text/css" media="screen" title="no title" charset="utf-8" />
+${commonheader(title, "", "60px")}
 
 
-	<style type="text/css">
-      body {
-        padding-top: 60px;
-      }
-    </style>
-	<script src="/static/ext/js/jquery/jquery-1.7.min.js" type="text/javascript" charset="utf-8"></script>
-	<script src="/static/js/Source/jHue/jquery.showusername.js" type="text/javascript" charset="utf-8"></script>
-	<script src="/static/js/Source/jHue/jquery.contextmenu.js" type="text/javascript" charset="utf-8"></script>
-	<script src="/static/ext/js/jquery/plugins/jquery.simpleplaceholder.js" type="text/javascript" charset="utf-8"></script>
-
-	<script type="text/javascript" charset="utf-8">
-		$(document).ready(function(){
-			$("#username").showUsername();
-			$("input:text[placeholder]").simplePlaceholder();
-			$(".submitter").keydown(function(e){
-				if (e.keyCode==13){
-					$(this).closest("form").submit();
-				}
-			}).change(function(){
-				$(this).closest("form").submit();
-			});
-		});
-	</script>
-
-</head>
-<body>
-	<div class="topbar">
-		<div class="topbar-inner">
-			<div class="container-fluid">
-				<a class="brand" href="#">jHue</a>
-				<ul class="nav">
-					<li><a href="/beeswax">Beeswax</a></li>
-
-					<li><a href="/filebrowser/">File Browser</a></li>
-					<li><a href="/jobsub/">Job Designer</a></li>
-					<li><a href="/jobbrowser/jobs/">Job Browser</a></li>
-					<li><a href="/useradmin/">User Admin</a></li>
-					<li><a href="/shell/">Shell</a></li>
-					<li><a href="/help/">Help</a></li>
-					<li><a href="/about/">About</a></li>
-				</ul>
-				<p class="pull-right">Logged in as <strong><span id="username">xxx</span></strong> - <a href="/accounts/logout">Sign out</a></p>
-			</div>
-		</div>
-	</div>
 
 
 	<div class="container-fluid">
 	<div class="container-fluid">
-		<div class="alert-message block-message warning">
+		<div class="alert">
 			<p><strong>${message}</strong></p>
 			<p><strong>${message}</strong></p>
-			
+
 			% if detail:
 			% if detail:
 			<p>${detail or ""}</p>
 			<p>${detail or ""}</p>
 			% endif
 			% endif
-			
+
 			<div class="alert-actions">
 			<div class="alert-actions">
 				<br/>
 				<br/>
 				<a class="btn small" href="javascript:window.history.back(-1)">Go back</a>
 				<a class="btn small" href="javascript:window.history.back(-1)">Go back</a>
 			</div>
 			</div>
 		</div>
 		</div>
-		
+
 
 
 	</div>
 	</div>
-</body>
-</html>
+
+${commonfooter()}

+ 67 - 32
desktop/core/templates/error.html

@@ -15,58 +15,93 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 See the License for the specific language governing permissions and
 limitations under the License.
 limitations under the License.
 {% endcomment %}
 {% endcomment %}
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+{% load is_selected %}
+<!DOCTYPE html>
+<html lang="en">
 <head>
 <head>
-	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+	<meta charset="utf-8">
 	<title>Error</title>
 	<title>Error</title>
-	<link rel="stylesheet" href="/static/ext/css/bootstrap.min.css" type="text/css" media="screen" title="no title" charset="utf-8" />
-	<link rel="stylesheet" href="/static/css/jhue.css" type="text/css" media="screen" title="no title" charset="utf-8" />
-	
+	<meta name="viewport" content="width=device-width, initial-scale=1.0">
+	<meta name="description" content="">
+	<meta name="author" content="">
+
+	<link href="/static/ext/css/bootstrap.min.css" rel="stylesheet">
+	<link href="/static/ext/css/bootstrap-responsive.min.css" rel="stylesheet">
+	<link href="/static/css/jhue.css" rel="stylesheet">
+	<link href="/static/ext/css/fileuploader.css" rel="stylesheet">
+
+	<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
+	<!--[if lt IE 9]>
+	<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
+	<![endif]-->
+
 	<style type="text/css">
 	<style type="text/css">
-      body {
-        padding-top: 60px;
-      }
-    </style>
-	<script src="/static/ext/js/jquery/jquery-1.7.min.js" type="text/javascript" charset="utf-8"></script>
-	
+		body {
+			padding-top: 60px;
+		}
+	</style>
+
+	<script src="/static/ext/js/jquery/jquery-1.7.1.min.js"></script>
+	<script src="/static/js/Source/jHue/jquery.showusername.js"></script>
+	<script src="/static/js/Source/jHue/jquery.filechooser.js"></script>
+	<script src="/static/js/Source/jHue/jquery.contextmenu.js"></script>
+	<script src="/static/js/Source/jHue/jquery.selector.js"></script>
+	<script src="/static/js/Source/jHue/jquery.alert.js"></script>
+	<script src="/static/ext/js/jquery/plugins/jquery.simpleplaceholder.js"></script>
+	<script src="/static/ext/js/jquery/plugins/jquery.dataTables.1.8.2.min.js"></script>
+	<script src="/static/ext/js/bootstrap.min.js"></script>
+	<script src="/static/ext/js/fileuploader.js"></script>
 
 
 	<script type="text/javascript" charset="utf-8">
 	<script type="text/javascript" charset="utf-8">
 		$(document).ready(function(){
 		$(document).ready(function(){
+			$("#username").showUsername();
+			$("input:text[placeholder]").simplePlaceholder();
+			$(".submitter").keydown(function(e){
+				if (e.keyCode==13){
+					$(this).closest("form").submit();
+				}
+			}).change(function(){
+				$(this).closest("form").submit();
+			});
+			$("#checkConfig").load("/debug/check_config_ajax");
 		});
 		});
 	</script>
 	</script>
-	
 </head>
 </head>
 <body>
 <body>
-	<div class="topbar">
-		<div class="topbar-inner">
+
+	<div class="navbar navbar-fixed-top">
+		<div class="navbar-inner">
 			<div class="container-fluid">
 			<div class="container-fluid">
-				<a class="brand" href="#">jHue</a>
-				<ul class="nav">
-					<li><a href="/beeswax">Beeswax</a></li>
-					<li><a href="/filebrowser/">File Browser</a></li>
-					<li><a href="/jobsub/">Job Designer</a></li>
-					<li><a href="/jobbrowser/jobs/">Job Browser</a></li>
-					<li><a href="/useradmin/">User Admin</a></li>
-					<li><a href="/shell/">Shell</a></li>
-					<li><a href="/help/">Help</a></li>
-					<li><a href="/about/">About</a></li>
-				</ul>
+				<a class="brand" href="#">Hue 2</a>
+				<div class="nav-collapse">
+					<ul class="nav">
+						<li><a href="/beeswax/">Beeswax</a></li>
+						<li><a href="/filebrowser/">File Browser</a></li>
+						<li><a href="/jobsub/">Job Designer</a></li>
+						<li><a href="/jobbrowser/jobs/">Job Browser</a></li>
+						<li><a href="/useradmin/">User Admin</a></li>
+						<li><a href="/shell/">Shell</a></li>
+						<li><a href="/help/">Help</a></li>
+						<li><a href="/about/">About</a></li>
+						<li class="divider-vertical"></li>
+						<li id="checkConfig"><li>
+					</ul>
+					<p class="navbar-text pull-right">Logged in as <strong><span id="username">xxx</span></strong> - <a href="/accounts/logout/">Sign out</a></p>
+				</div>
 			</div>
 			</div>
 		</div>
 		</div>
 	</div>
 	</div>
-	
+
+
 	<div class="container-fluid">
 	<div class="container-fluid">
 		<h1>Error!</h1>
 		<h1>Error!</h1>
 		<pre>{{ error }}</pre>
 		<pre>{{ error }}</pre>
-		
+
 		<textarea style="width: 100%;" rows=80 readonly="readonly">
 		<textarea style="width: 100%;" rows=80 readonly="readonly">
 		{{ traceback }}
 		{{ traceback }}
 		</textarea>
 		</textarea>
-		
-		
+
+
 	</div>
 	</div>
 </body>
 </body>
 </html>
 </html>