mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-20 13:56:30 +00:00
Merge branch 'master' of github.com:inventree/InvenTree into bom_items_purchase_price
This commit is contained in:
@ -12,13 +12,6 @@
|
||||
|
||||
<div class='panel panel-default panel-inventree'>
|
||||
|
||||
{% if part.variant_of %}
|
||||
<div class='alert alert-info alert-block'>
|
||||
{% object_link 'part-variants' part.variant_of.id part.variant_of.full_name as link %}
|
||||
{% blocktrans %}This part is a variant of {{link}}{% endblocktrans %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
{% include "part/part_thumb.html" %}
|
||||
@ -107,6 +100,15 @@
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='info-messages'>
|
||||
{% if part.variant_of %}
|
||||
<div class='alert alert-info alert-block'>
|
||||
{% object_link 'part-variants' part.variant_of.id part.variant_of.full_name as link %}
|
||||
{% blocktrans %}This part is a variant of {{link}}{% endblocktrans %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<table class="table table-striped">
|
||||
|
@ -1,8 +1,14 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
""" This module provides template tags for extra functionality
|
||||
over and above the built-in Django tags.
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.conf import settings as djangosettings
|
||||
|
||||
from django import template
|
||||
from django.urls import reverse
|
||||
from django.utils.safestring import mark_safe
|
||||
@ -68,6 +74,33 @@ def part_allocation_count(build, part, *args, **kwargs):
|
||||
return InvenTree.helpers.decimal2string(build.getAllocatedQuantity(part))
|
||||
|
||||
|
||||
@register.simple_tag()
|
||||
def inventree_in_debug_mode(*args, **kwargs):
|
||||
""" Return True if the server is running in DEBUG mode """
|
||||
|
||||
return djangosettings.DEBUG
|
||||
|
||||
|
||||
@register.simple_tag()
|
||||
def inventree_docker_mode(*args, **kwargs):
|
||||
""" Return True if the server is running as a Docker image """
|
||||
|
||||
return djangosettings.DOCKER
|
||||
|
||||
|
||||
@register.simple_tag()
|
||||
def inventree_db_engine(*args, **kwargs):
|
||||
""" Return the InvenTree database backend e.g. 'postgresql' """
|
||||
|
||||
db = djangosettings.DATABASES['default']
|
||||
|
||||
engine = db.get('ENGINE', _('Unknown database'))
|
||||
|
||||
engine = engine.replace('django.db.backends.', '')
|
||||
|
||||
return engine
|
||||
|
||||
|
||||
@register.simple_tag()
|
||||
def inventree_instance_name(*args, **kwargs):
|
||||
""" Return the InstanceName associated with the current database """
|
||||
|
Reference in New Issue
Block a user