mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-30 20:55:42 +00:00 
			
		
		
		
	Adds a template tag for testing if the server is running in demo mode
This commit is contained in:
		| @@ -89,6 +89,12 @@ def inventree_in_debug_mode(*args, **kwargs): | |||||||
|  |  | ||||||
|     return djangosettings.DEBUG |     return djangosettings.DEBUG | ||||||
|  |  | ||||||
|  | @register.simple_tag() | ||||||
|  | def inventree_demo_mode(*args, **kwargs): | ||||||
|  |     """ Return True if the server is running in DEMO mode """ | ||||||
|  |  | ||||||
|  |     return djangosettings.DEMO_MODE | ||||||
|  |  | ||||||
|  |  | ||||||
| @register.simple_tag() | @register.simple_tag() | ||||||
| def inventree_docker_mode(*args, **kwargs): | def inventree_docker_mode(*args, **kwargs): | ||||||
|   | |||||||
| @@ -87,24 +87,19 @@ | |||||||
|         </div> |         </div> | ||||||
|         <main class='col ps-md-2 pt-2 pe-2'> |         <main class='col ps-md-2 pt-2 pe-2'> | ||||||
|              |              | ||||||
|  |             {% block alerts %} | ||||||
|  |             <div class='notification-area' id='alerts'> | ||||||
|  |                 <!-- Div for displayed alerts --> | ||||||
|                 {% if server_restart_required %} |                 {% if server_restart_required %} | ||||||
|             <div class='notification-area' id='restart-required'> |  | ||||||
|                 <div id='alert-restart-server' class='alert alert-danger' role='alert'> |                 <div id='alert-restart-server' class='alert alert-danger' role='alert'> | ||||||
|                     <span class='fas fa-server'></span> |                     <span class='fas fa-server'></span> | ||||||
|                     <b>{% trans "Server Restart Required" %}</b> |                     <b>{% trans "Server Restart Required" %}</b> | ||||||
|                     <small> |                     <small> | ||||||
|                         <br> |                         <br> | ||||||
|                         {% trans "A configuration option has been changed which requires a server restart" %}. |                         {% trans "A configuration option has been changed which requires a server restart" %}. {% trans "Contact your system administrator for further information" %} | ||||||
|                         <br> |  | ||||||
|                         {% trans "Contact your system administrator for further information" %} |  | ||||||
|                     </small> |                     </small> | ||||||
|                 </div> |                 </div> | ||||||
|             </div> |  | ||||||
|                 {% endif %} |                 {% endif %} | ||||||
|  |  | ||||||
|             {% block alerts %} |  | ||||||
|             <div class='notification-area' id='alerts'> |  | ||||||
|                 <!-- Div for displayed alerts --> |  | ||||||
|             </div> |             </div> | ||||||
|             {% endblock %} |             {% endblock %} | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user