Prechádzať zdrojové kódy

HUE-1911 [core] banner_top_html is escaped

Removed escaping
Added custom banner to login page too
Enrico Berti 11 rokov pred
rodič
commit
7dd9a0c

+ 1 - 1
desktop/core/src/desktop/templates/common_header.mako

@@ -244,7 +244,7 @@ from django.utils.translation import ugettext as _
 
 % if conf.CUSTOM.BANNER_TOP_HTML.get():
   <div id="banner-top" class="banner">
-    ${ conf.CUSTOM.BANNER_TOP_HTML.get() }
+    ${ conf.CUSTOM.BANNER_TOP_HTML.get() | n,unicode }
   </div>
 % endif
 

+ 32 - 4
desktop/core/src/desktop/templates/login.mako

@@ -36,11 +36,32 @@ from django.utils.translation import ugettext as _
   <link href="/static/css/hue3.css" rel="stylesheet">
 
   <style type="text/css">
-    body {
-      display: none;
-      padding-top: 80px;
-    }
+    % if conf.CUSTOM.BANNER_TOP_HTML.get():
+      body {
+        display: none;
+        padding-top: 120px;
+      }
+      .banner {
+        height: 40px;
+        width: 100%;
+        padding: 0;
+        position: fixed;
+        top: 0;
+        background-color: #F9F9F9;
+        z-index: 1033;
+      }
+      .navigator {
+        top: 30px!important;
+      }
+    % else:
+      body {
+        display: none;
+        padding-top: 80px;
+      }
+    % endif
+  </style>
 
+  <style type="text/css">
     #logo {
       display: block;
       margin-left: auto;
@@ -105,6 +126,13 @@ from django.utils.translation import ugettext as _
 
 <body>
 
+% if conf.CUSTOM.BANNER_TOP_HTML.get():
+  <div id="banner-top" class="banner">
+    ${ conf.CUSTOM.BANNER_TOP_HTML.get() | n,unicode }
+  </div>
+% endif
+
+
 <div class="footer"></div>
 
 <div class="navigator">