2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-08-08 04:40:57 +00:00

[P-UI] Home page (#5344)

* Add new start page

* [FR/P-UI] Home/Start page - widgets

* load widgets dynamic

* code cleanup

* remove lodash

* refactor and rename to WidgetLayout

* Add CSS serving

* removed unneeded complexity

* clean up UI; switch to menu for controls

* change signature

* added hotkey

* removed hover

* removed dummy widget

* Add translations

* fix test

* uses real data for getting started

* adapted style for GettingStartedCard

* added placeholder usage to GettingStartedCard
This commit is contained in:
Matthias Mair
2023-08-09 14:32:53 +02:00
committed by GitHub
parent 62362455b8
commit ebbc27047b
23 changed files with 3301 additions and 729 deletions

View File

@@ -22,6 +22,7 @@ def spa_bundle():
manifest_data = json.load(manifest.open())
index = manifest_data.get("index.html")
css_index = manifest_data.get("index.css")
dynmanic_files = index.get("dynamicImports", [])
imports_files = "".join(
@@ -32,5 +33,6 @@ def spa_bundle():
)
return mark_safe(
f"""<script type="module" src="{settings.STATIC_URL}web/{index['file']}"></script>{imports_files}"""
f"""<link rel="stylesheet" href="{settings.STATIC_URL}web/{css_index['file']}" />
<script type="module" src="{settings.STATIC_URL}web/{index['file']}"></script>{imports_files}"""
)

View File

@@ -1,7 +1,7 @@
"""URLs for web app."""
from django.conf import settings
from django.shortcuts import redirect
from django.urls import path, re_path
from django.urls import include, path, re_path
from django.views.decorators.csrf import ensure_csrf_cookie
from django.views.generic import TemplateView
@@ -20,8 +20,12 @@ spa_view = ensure_csrf_cookie(TemplateView.as_view(template_name="web/index.html
urlpatterns = [
path('platform/', include([
path("assets/<path:path>", RedirectAssetView.as_view()),
re_path(r"^(?P<path>.*)/$", spa_view),
path("set-password?uid=<uid>&token=<token>", spa_view, name="password_reset_confirm"),
path("", spa_view),]
)),
re_path(r'^platform', spa_view, name='platform'),
path("assets/<path:path>", RedirectAssetView.as_view()),
re_path(r"^(?P<path>.*)/$", spa_view),
path("set-password?uid=<uid>&token=<token>", spa_view, name="password_reset_confirm"),
path("", spa_view),
]