diff --git a/README.md b/README.md index 8066927..2b15f34 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # Getting started + Before starting, make sure you have a working python and nodejs setup with pyenv and nvm. ```bash @@ -15,12 +16,19 @@ npm install npm start ``` -## References: - - We use JS code generation to work with queries/mutations in our graphql API: https://github.com/dotansimha/graphql-typed-document-node +## References -# TODO-old - * Larger pictures - * Compact GUI for max 768 vertical pixels - * Search right of in title - * Light on dark colors +- We use JS code generation to work with queries/mutations in our graphql API: https://github.com/dotansimha/graphql-typed-document-node + +## TODO + +- Log view +- Remove everything facebook related. Use gravatars. +- Light on dark colors + +## TODO-old + +- Larger pictures +- Compact GUI for max 768 vertical pixels + - Search right of in title diff --git a/frontend/package.json b/frontend/package.json index 967ffe9..cca7712 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -60,4 +60,4 @@ "node": ">=16", "npm": ">=7" } -} +} \ No newline at end of file diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index b72a4df..bebd471 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -10,11 +10,9 @@ import { Header } from "./components/Header"; import { Toast } from "./components/Toast"; import { ToastProvider } from "./components/ToastProvider"; -const baseUrl = import.meta.env.BASE_URL; - const App: React.FC = () => ( - +
diff --git a/frontend/src/components/Header.tsx b/frontend/src/components/Header.tsx index 5fb9378..ed5d47d 100644 --- a/frontend/src/components/Header.tsx +++ b/frontend/src/components/Header.tsx @@ -44,20 +44,20 @@ export const Header: React.FC = () => {
  • - + {" "} Logg - +
  • - + {" "} Statistikk - +
  • diff --git a/frontend/vite.config.js b/frontend/vite.config.js index 34824a0..1a99bb9 100644 --- a/frontend/vite.config.js +++ b/frontend/vite.config.js @@ -10,5 +10,5 @@ export default defineConfig({ __DEV__: process.env.NODE_ENV !== "production", }, envDir: "..", - build: { outDir: "../static/modern" }, + build: { outDir: "../static/modern", emptyOutDir: true }, }); diff --git a/main/urls.py b/main/urls.py index 3f3f460..444f5d3 100644 --- a/main/urls.py +++ b/main/urls.py @@ -1,6 +1,6 @@ from django.conf.urls import url from django.contrib.staticfiles.views import serve -from django.urls import path +from django.urls import include, path from rest_framework.routers import DefaultRouter from main.api.views import ProductViewSet @@ -17,10 +17,17 @@ from main.views.stats import ( ) from main.views.users import create_user, profile +spa_kwargs = {"path": "modern/index.html"} + +legacy_patterns = [ + path("", register, name="home-legacy"), + path("deposit", deposit, name="deposit-legacy"), +] + urlpatterns = [ - url(r"^$", register, name="home"), - url(r"^register/$", register, name="register"), - url(r"^deposit/$", deposit, name="deposit"), + path("", serve, kwargs=spa_kwargs, name="home"), + path("deposit", serve, kwargs=spa_kwargs, name="deposit"), + # TODO: migrate to SPA url(r"^log/$", log, name="log"), url(r"^log/all$", log, kwargs={"limit": None}, name="log-all"), # Users @@ -30,9 +37,9 @@ urlpatterns = [ url(r"^inventory/$", inventory, name="inventory"), url(r"^inventory/add/$", inventory_add, name="inventory-add"), url(r"^report$", report, name="report"), - # FIXME: Serve the modern stack from here until rest of views are ported - url(r"^modern/", serve, kwargs={"path": "modern/index.html"}, name="modern"), + path("legacy/", include(legacy_patterns)), ] + # Stats urlpatterns += [ url(r"^stats/$", stats_list, name="stats"), diff --git a/templates/base.html b/templates/base.html index 997a253..145bb58 100644 --- a/templates/base.html +++ b/templates/base.html @@ -26,8 +26,8 @@ - Tilbake + Tilbake