mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
initial implementation as described in #1463
This commit is contained in:
parent
623d0366fc
commit
d49977bed3
@ -19,6 +19,14 @@ def inventreeInstanceName():
|
|||||||
return common.models.InvenTreeSetting.get_setting("INVENTREE_INSTANCE", "")
|
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():
|
def inventreeVersion():
|
||||||
""" Returns the InvenTree version string """
|
""" Returns the InvenTree version string """
|
||||||
return INVENTREE_SW_VERSION
|
return INVENTREE_SW_VERSION
|
||||||
|
@ -58,6 +58,13 @@ class InvenTreeSetting(models.Model):
|
|||||||
'description': _('String descriptor for the server instance'),
|
'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': {
|
'INVENTREE_COMPANY_NAME': {
|
||||||
'name': _('Company name'),
|
'name': _('Company name'),
|
||||||
'description': _('Internal company name'),
|
'description': _('Internal company name'),
|
||||||
|
@ -71,6 +71,12 @@ def inventree_instance_name(*args, **kwargs):
|
|||||||
return version.inventreeInstanceName()
|
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()
|
@register.simple_tag()
|
||||||
def inventree_version(*args, **kwargs):
|
def inventree_version(*args, **kwargs):
|
||||||
""" Return InvenTree version string """
|
""" Return InvenTree version string """
|
||||||
|
@ -2,12 +2,13 @@
|
|||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% load static %}
|
{% load static %}
|
||||||
{% load inventree_extras %}
|
{% load inventree_extras %}
|
||||||
|
|
||||||
{% block page_title %}
|
{% block page_title %}
|
||||||
InvenTree | {% trans "Index" %}
|
{% inventree_title %} | {% trans "Index" %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h3>InvenTree</h3>
|
<h3>{% inventree_title %} </h3>
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
<div class='col-sm-3' id='item-panel'>
|
<div class='col-sm-3' id='item-panel'>
|
||||||
|
Loading…
Reference in New Issue
Block a user