mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-04 07:05:41 +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
 | 
					# Disable CUI parts if CUI tests are disabled
 | 
				
			||||||
if TESTING and '--exclude-tag=cui' in sys.argv:
 | 
					if TESTING and '--exclude-tag=cui' in sys.argv:
 | 
				
			||||||
    ENABLE_CLASSIC_FRONTEND = False
 | 
					    ENABLE_CLASSIC_FRONTEND = False
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ENABLE_PLATFORM_FRONTEND = get_boolean_setting(
 | 
					ENABLE_PLATFORM_FRONTEND = get_boolean_setting(
 | 
				
			||||||
    'INVENTREE_PLATFORM_FRONTEND', 'platform_frontend', True
 | 
					    'INVENTREE_PLATFORM_FRONTEND', 'platform_frontend', True
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -667,3 +667,15 @@ def admin_url(user, table, pk):
 | 
				
			|||||||
            pass
 | 
					            pass
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return url
 | 
					    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 += [
 | 
					urlpatterns += [
 | 
				
			||||||
    re_path(
 | 
					    re_path(
 | 
				
			||||||
        r'^.*$',
 | 
					        r'^.*$',
 | 
				
			||||||
        RedirectView.as_view(
 | 
					        RedirectView.as_view(
 | 
				
			||||||
            url='/index/'
 | 
					            url='/index/'
 | 
				
			||||||
            if settings.ENABLE_CLASSIC_FRONTEND
 | 
					            if settings.ENABLE_CLASSIC_FRONTEND
 | 
				
			||||||
            else settings.FRONTEND_URL_BASE,
 | 
					            else f'/{settings.FRONTEND_URL_BASE}/',
 | 
				
			||||||
            permanent=False,
 | 
					            permanent=False,
 | 
				
			||||||
        ),
 | 
					        ),
 | 
				
			||||||
        name='index',
 | 
					        name='index',
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,8 +2,9 @@
 | 
				
			|||||||
{% load i18n %}
 | 
					{% load i18n %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% inventree_customize 'hide_pui_banner' as hidden %}
 | 
					{% 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'>
 | 
					<div class='alert alert-block alert-warning'>
 | 
				
			||||||
    {% if mode == 'admin' %}
 | 
					    {% if mode == 'admin' %}
 | 
				
			||||||
    {% trans "Platform UI - the new UI for InvenTree - provides more modern administration options." %}
 | 
					    {% trans "Platform UI - the new UI for InvenTree - provides more modern administration options." %}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user