mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 21:25:42 +00:00 
			
		
		
		
	initial implementation as described in #1463
This commit is contained in:
		| @@ -19,6 +19,14 @@ def inventreeInstanceName(): | ||||
|     return common.models.InvenTreeSetting.get_setting("INVENTREE_INSTANCE", "") | ||||
|  | ||||
|  | ||||
| def inventreeInstanceTitle(): | ||||
|     """ Returns the InstanceTitle for the current database """ | ||||
|     if common.models.InvenTreeSetting.get_setting("INVENTREE_INSTANCE_TITLE", False): | ||||
|         return common.models.InvenTreeSetting.get_setting("INVENTREE_INSTANCE", "") | ||||
|     else: | ||||
|         return 'InvenTree' | ||||
|  | ||||
|  | ||||
| def inventreeVersion(): | ||||
|     """ Returns the InvenTree version string """ | ||||
|     return INVENTREE_SW_VERSION | ||||
|   | ||||
| @@ -58,6 +58,13 @@ class InvenTreeSetting(models.Model): | ||||
|             'description': _('String descriptor for the server instance'), | ||||
|         }, | ||||
|  | ||||
|         'INVENTREE_INSTANCE_TITLE': { | ||||
|             'name': _('Use Instance Name'), | ||||
|             'description': _('Use the instance name in the Titel-Bar'), | ||||
|             'validator': bool, | ||||
|             'default': False, | ||||
|         }, | ||||
|  | ||||
|         'INVENTREE_COMPANY_NAME': { | ||||
|             'name': _('Company name'), | ||||
|             'description': _('Internal company name'), | ||||
|   | ||||
| @@ -71,6 +71,12 @@ def inventree_instance_name(*args, **kwargs): | ||||
|     return version.inventreeInstanceName() | ||||
|  | ||||
|  | ||||
| @register.simple_tag() | ||||
| def inventree_title(*args, **kwargs): | ||||
|     """ Return the title for the current instance - respecting the settings """ | ||||
|     return version.inventreeInstanceTitle() | ||||
|  | ||||
|  | ||||
| @register.simple_tag() | ||||
| def inventree_version(*args, **kwargs): | ||||
|     """ Return InvenTree version string """ | ||||
|   | ||||
| @@ -2,12 +2,13 @@ | ||||
| {% load i18n %} | ||||
| {% load static %} | ||||
| {% load inventree_extras %} | ||||
|  | ||||
| {% block page_title %} | ||||
| InvenTree | {% trans "Index" %} | ||||
| {% inventree_title %} | {% trans "Index" %} | ||||
| {% endblock %} | ||||
|  | ||||
| {% block content %} | ||||
| <h3>InvenTree</h3> | ||||
| <h3>{% inventree_title %} </h3> | ||||
| <hr> | ||||
|  | ||||
| <div class='col-sm-3' id='item-panel'> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user