mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-03 22:55:43 +00:00 
			
		
		
		
	Merge branch 'master' into plugins-install
This commit is contained in:
		@@ -85,6 +85,7 @@ ENABLE_CLASSIC_FRONTEND = get_boolean_setting(
 | 
			
		||||
# Disable CUI parts if CUI tests are disabled
 | 
			
		||||
if TESTING and '--exclude-tag=cui' in sys.argv:
 | 
			
		||||
    ENABLE_CLASSIC_FRONTEND = False
 | 
			
		||||
 | 
			
		||||
ENABLE_PLATFORM_FRONTEND = get_boolean_setting(
 | 
			
		||||
    'INVENTREE_PLATFORM_FRONTEND', 'platform_frontend', True
 | 
			
		||||
)
 | 
			
		||||
 
 | 
			
		||||
@@ -667,3 +667,15 @@ def admin_url(user, table, pk):
 | 
			
		||||
            pass
 | 
			
		||||
 | 
			
		||||
    return url
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@register.simple_tag()
 | 
			
		||||
def cui_enabled():
 | 
			
		||||
    """Return True if the CUI is enabled."""
 | 
			
		||||
    return settings.ENABLE_CLASSIC_FRONTEND
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@register.simple_tag()
 | 
			
		||||
def pui_enabled():
 | 
			
		||||
    """Return True if the PUI is enabled."""
 | 
			
		||||
    return settings.ENABLE_PLATFORM_FRONTEND
 | 
			
		||||
 
 | 
			
		||||
@@ -506,14 +506,14 @@ urlpatterns.append(
 | 
			
		||||
    )
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
# Send any unknown URLs to the parts page
 | 
			
		||||
# Send any unknown URLs to the index page
 | 
			
		||||
urlpatterns += [
 | 
			
		||||
    re_path(
 | 
			
		||||
        r'^.*$',
 | 
			
		||||
        RedirectView.as_view(
 | 
			
		||||
            url='/index/'
 | 
			
		||||
            if settings.ENABLE_CLASSIC_FRONTEND
 | 
			
		||||
            else settings.FRONTEND_URL_BASE,
 | 
			
		||||
            else f'/{settings.FRONTEND_URL_BASE}/',
 | 
			
		||||
            permanent=False,
 | 
			
		||||
        ),
 | 
			
		||||
        name='index',
 | 
			
		||||
 
 | 
			
		||||
@@ -2,8 +2,9 @@
 | 
			
		||||
{% load i18n %}
 | 
			
		||||
 | 
			
		||||
{% inventree_customize 'hide_pui_banner' as hidden %}
 | 
			
		||||
{% pui_enabled as pui %}
 | 
			
		||||
 | 
			
		||||
{% if not hidden %}
 | 
			
		||||
{% if pui and not hidden %}
 | 
			
		||||
<div class='alert alert-block alert-warning'>
 | 
			
		||||
    {% if mode == 'admin' %}
 | 
			
		||||
    {% trans "Platform UI - the new UI for InvenTree - provides more modern administration options." %}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user