mirror of
https://github.com/inventree/InvenTree.git
synced 2025-08-06 20:11:37 +00:00
Render filter options as a template
- This allows the values to be seen by the translation layer - Also means that whenever a new option is added, it will be automatically available to the front-end!
This commit is contained in:
@@ -7,10 +7,22 @@ from InvenTree import version
|
||||
from InvenTree.helpers import decimal2string
|
||||
|
||||
from common.models import InvenTreeSetting
|
||||
from InvenTree.status_codes import OrderStatus, StockStatus, BuildStatus
|
||||
|
||||
register = template.Library()
|
||||
|
||||
|
||||
@register.simple_tag(takes_context=True)
|
||||
def load_status_codes(context):
|
||||
|
||||
context['order_status_codes'] = OrderStatus.list()
|
||||
context['stock_status_codes'] = StockStatus.list()
|
||||
context['build_status_codes'] = BuildStatus.list()
|
||||
|
||||
# Need to return something as the result is rendered to the page
|
||||
return ''
|
||||
|
||||
|
||||
@register.simple_tag()
|
||||
def decimal(x, *args, **kwargs):
|
||||
""" Simplified rendering of a decimal number """
|
||||
|
Reference in New Issue
Block a user