Parcourir la source

A little cleanup from #222

Jeremy Stretch il y a 8 ans
Parent
commit
f617828712

+ 3 - 0
netbox/netbox/configuration.example.py

@@ -73,5 +73,8 @@ TIME_FORMAT = 'g:i a'
 SHORT_TIME_FORMAT = 'H:i:s'
 DATETIME_FORMAT = 'N j, Y g:i a'
 SHORT_DATETIME_FORMAT = 'Y-m-d H:i'
+
+# Optionally display a persistent banner at the top and/or bottom of every page. To display the same content in both
+# banners, define BANNER_TOP and set BANNER_BOTTOM = BANNER_TOP.
 BANNER_TOP = ''
 BANNER_BOTTOM = ''

+ 1 - 1
netbox/netbox/settings.py

@@ -38,9 +38,9 @@ TIME_FORMAT = getattr(configuration, 'TIME_FORMAT', 'g:i a')
 SHORT_TIME_FORMAT = getattr(configuration, 'SHORT_TIME_FORMAT', 'H:i:s')
 DATETIME_FORMAT = getattr(configuration, 'DATETIME_FORMAT', 'N j, Y g:i a')
 SHORT_DATETIME_FORMAT = getattr(configuration, 'SHORT_DATETIME_FORMAT', 'Y-m-d H:i')
-CSRF_TRUSTED_ORIGINS = ALLOWED_HOSTS
 BANNER_TOP = getattr(configuration, 'BANNER_TOP', False)
 BANNER_BOTTOM = getattr(configuration, 'BANNER_BOTTOM', False)
+CSRF_TRUSTED_ORIGINS = ALLOWED_HOSTS
 
 # Attempt to import LDAP configuration if it has been defined
 LDAP_IGNORE_CERT_ERRORS = False

+ 3 - 0
netbox/project-static/css/base.css

@@ -295,6 +295,9 @@ ul.rack_near_face li.empty:hover a {
 .dark_gray:hover { background-color: #2c3e50; }
 
 /* Misc */
+.banner-bottom {
+    margin-bottom: 50px;
+}
 .panel table {
     margin-bottom: 0;
 }

+ 3 - 4
netbox/templates/_base.html

@@ -227,8 +227,8 @@
         {% if settings.BANNER_TOP %}
             <div class="alert alert-info text-center" role="alert">
 				{{ settings.BANNER_TOP|safe }}
-        </div>
-        	{% endif %}
+            </div>
+        {% endif %}
         {% if settings.MAINTENANCE_MODE %}
             <div class="alert alert-warning text-center" role="alert">
                 <h4><i class="fa fa-exclamation-triangle"></i> Maintenance Mode</h4>
@@ -244,9 +244,8 @@
 	    	</div>
 	    {% endfor %}
 		{% block content %}{% endblock %}
-		<div class="push"></div>
  		{% if settings.BANNER_BOTTOM %}
-        	<div class="alert alert-info text-center" role="alert" style="margin-bottom:50px">
+        	<div class="alert alert-info text-center banner-bottom" role="alert">
                  {{ settings.BANNER_BOTTOM|safe }}
             </div>
         {% endif %}