Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frontent v1.5 #911

Merged
merged 136 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
136 commits
Select commit Hold shift + click to select a range
6f50871
migrated the app component to utilise tailwind
CommanderStorm Dec 9, 2023
90c1e70
migrated all toasts to tailwind
CommanderStorm Dec 10, 2023
899481a
changed the author meta tag
CommanderStorm Dec 10, 2023
bb44ea8
migrated our icons to utilise heroicons instead of spectrecss icons
CommanderStorm Dec 10, 2023
ee601b7
migrated part of the header of the details page to tailwind
CommanderStorm Dec 10, 2023
1f0f226
replaced a few icons with heroicons
CommanderStorm Dec 10, 2023
26266e9
migrated all modals to tailwind
CommanderStorm Dec 10, 2023
913f614
switched from `vue/static-class-names-order` to `prettier-plugin-tail…
CommanderStorm Dec 11, 2023
5b608cf
footer
CommanderStorm Dec 11, 2023
1b3a590
tested a different sharing option
CommanderStorm Dec 13, 2023
cfb99cd
added tum colors
CommanderStorm Dec 17, 2023
7a1443e
tum colors
CommanderStorm Dec 17, 2023
937614f
formatting
CommanderStorm Dec 18, 2023
9f6964c
migrated the serach box
CommanderStorm Dec 18, 2023
79931e2
basic button component
CommanderStorm Dec 18, 2023
f097180
search bar
CommanderStorm Dec 18, 2023
69c719a
colors
CommanderStorm Dec 18, 2023
7885c3f
tmp
CommanderStorm Dec 20, 2023
62833b6
updated lockfile
CommanderStorm Dec 21, 2023
d658421
lowered min-height
CommanderStorm Dec 22, 2023
d2632fe
lockfile
CommanderStorm Dec 22, 2023
0eded70
simplified the tailwind config
CommanderStorm Dec 22, 2023
f54ef56
preferences
CommanderStorm Dec 23, 2023
f59b392
migrated the 404 page to tailwind
CommanderStorm Dec 26, 2023
eecd355
made sure that spectre is only included where nessesary
CommanderStorm Dec 26, 2023
e1d30f7
general cleanup
CommanderStorm Dec 26, 2023
db5a5fa
formatting
CommanderStorm Dec 26, 2023
90f0ce4
front page
CommanderStorm Dec 26, 2023
5e63a88
better aria-labels
CommanderStorm Dec 26, 2023
1014d37
fixed a few error messages
CommanderStorm Jan 2, 2024
fb72cfe
made sure to utilise the defineModal makro instead of defining this m…
CommanderStorm Jan 2, 2024
df3e454
formatting fixes
CommanderStorm Jan 3, 2024
22bed80
fixed preferences
CommanderStorm Jan 3, 2024
6fcc6f6
Update styling and class names across various components
CommanderStorm Jan 3, 2024
051bc7b
removed (now) unused code for styling toasts
CommanderStorm Jan 3, 2024
26b09a2
migrated the buildings to tailwind
CommanderStorm Jan 3, 2024
8e48aba
card
CommanderStorm Jan 3, 2024
88d40e6
made sure that buttons have focus rings
CommanderStorm Jan 3, 2024
da8acb0
fixed a bit arbitrary spacing in the header
CommanderStorm Jan 4, 2024
2b2d1bb
unified the focus handling
CommanderStorm Jan 4, 2024
732b341
Update focus handling and UI elements in multiple components
CommanderStorm Jan 4, 2024
ff1dcea
spacing changes
CommanderStorm Jan 4, 2024
880c0a9
migrated the room-overview to tailwind
CommanderStorm Jan 4, 2024
f300266
spectre.css removal
CommanderStorm Jan 4, 2024
db02699
removed more of spectre
CommanderStorm Jan 4, 2024
42cca87
removed legacy css from a few sites
CommanderStorm Jan 5, 2024
47082b2
migrated the search page to use tailwind instead
CommanderStorm Jan 5, 2024
8654747
formatting changes
CommanderStorm Jan 5, 2024
788873d
improved the search page
CommanderStorm Jan 6, 2024
997a5f6
fixed the search bar
CommanderStorm Jan 7, 2024
d165ac4
extracted breadcrums to a distinct component
CommanderStorm Jan 7, 2024
4f61b42
migrated all icons
CommanderStorm Jan 7, 2024
619ae19
minor refactoring
CommanderStorm Jan 7, 2024
50d3bb5
fixed the focussiong of top action buttons on the details page
CommanderStorm Jan 7, 2024
2b3c1f2
details
CommanderStorm Jan 7, 2024
8fe0024
header
CommanderStorm Jan 7, 2024
878e6d9
improved the tabbing on the details page a bit
CommanderStorm Jan 11, 2024
10519a1
renamed the button component to btn to get better intellisense
CommanderStorm Jan 12, 2024
872550d
added `min-width: 0` as argued by https://www.youtube.com/watch?v=cH8…
CommanderStorm Jan 12, 2024
76cf0a7
migrated all usages of `thumb-building.webp` to use an icon
CommanderStorm Jan 12, 2024
e2b1310
checkbox addition
CommanderStorm Jan 13, 2024
0d4553f
implemented a slider
CommanderStorm Jan 19, 2024
ddde8f4
fixed a few build erros
CommanderStorm Jan 19, 2024
d483129
made sure that our sources look less out of place
CommanderStorm Jan 25, 2024
6b41c08
fixed card
CommanderStorm Jan 27, 2024
3b1a7a0
fixed card
CommanderStorm Jan 27, 2024
a25b6cf
implemented a listbox for selecting rf images
CommanderStorm Jan 28, 2024
1e3cabb
tabbing
CommanderStorm Jan 28, 2024
488dfdd
fixed a few typscript errors
CommanderStorm Jan 29, 2024
742898c
formatting fixes
CommanderStorm Jan 29, 2024
3e1c695
fixed the tab switcher being very "creative"
CommanderStorm Jan 29, 2024
14c7c80
ficed the hover on mobile and the gird columns
CommanderStorm Jan 29, 2024
76afc26
improved design
CommanderStorm Jan 29, 2024
2dacd57
link buttons
CommanderStorm Jan 29, 2024
c69bf67
removed unnessesary aria tags
CommanderStorm Jan 29, 2024
2813807
fixed rooom listbox
CommanderStorm Jan 29, 2024
064b8b3
fixed css for the building selector
CommanderStorm Jan 30, 2024
d310e4c
improved btn accessibility
CommanderStorm Jan 30, 2024
23f4a23
fixed how most of the darkmode looks
CommanderStorm Feb 27, 2024
059b422
fixed spacing in the feedback form
CommanderStorm Feb 27, 2024
1db57ea
changed the `SelectionSwitch` to not be on/off
CommanderStorm Feb 28, 2024
2bf1863
made sure that lists are indented if renderered via the `/about` route
CommanderStorm Mar 3, 2024
98dde19
generic sources
CommanderStorm Mar 3, 2024
dfd8f92
fine-tuning
CommanderStorm Mar 3, 2024
4c498d8
fixed the spinner
CommanderStorm Mar 4, 2024
c3c1d5c
worked on the details table
CommanderStorm Mar 4, 2024
d40bff5
fine-tuned the modals
CommanderStorm Mar 4, 2024
98750df
misc
CommanderStorm Mar 4, 2024
84d0ccd
Merge branch 'main' into chore/further-tailwind
CommanderStorm Mar 5, 2024
34a0187
rebase
CommanderStorm Mar 5, 2024
8dde656
Merge branch 'main' into chore/further-tailwind
CommanderStorm Mar 5, 2024
5450289
changed how the h5/h6 and links are styled
CommanderStorm Mar 6, 2024
d086fb8
made sure that my address and phone number is no longer publicly acce…
CommanderStorm Mar 6, 2024
c27b8af
made sure that the feedback text is not larger
CommanderStorm Mar 6, 2024
9a8e5ce
made sure that the links are item-links are styled less bad
CommanderStorm Mar 6, 2024
f63da5d
made sure that disabled state of the sitemaps is communcated more cle…
CommanderStorm Mar 6, 2024
982d252
made sure that images in the Sideshow are handled better
CommanderStorm Mar 6, 2024
9e29b7d
made sure that checkboxes use the tum accent colors instead of the de…
CommanderStorm Mar 6, 2024
f7d5486
fixed the info card popping up a breakpoint earlier than it should
CommanderStorm Mar 6, 2024
1e9a39b
made the inputs on the feedback page use the same colors as the rest
CommanderStorm Mar 6, 2024
ffe498f
made sure that the copy button works appropriately
CommanderStorm Mar 6, 2024
76f589c
made sure that the breadcumbs are wrapping correctly
CommanderStorm Mar 6, 2024
5e2e74a
made sure that buildings are wrapping correctly
CommanderStorm Mar 6, 2024
e9fe5d7
made the AppSearchBar able to handle larger text
CommanderStorm Mar 6, 2024
3839f1a
added a Toast on the main page to call for feedback
CommanderStorm Mar 6, 2024
6f2a73e
made sure that all tumBlue is used where appropriate
CommanderStorm Mar 6, 2024
eae59fc
made sure that the search page is reactive
CommanderStorm Mar 7, 2024
f3f9009
fixed the index'es feedback page form opener translation
CommanderStorm Mar 7, 2024
b919400
made sure that the api route can handle the darkmode gracefully
CommanderStorm Mar 7, 2024
b658f53
made sure that the theme and language are persistent across different…
CommanderStorm Mar 7, 2024
31b7c7a
misc cleanup
CommanderStorm Mar 7, 2024
7b1d644
Merge branch 'main' into chore/further-tailwind
CommanderStorm Mar 7, 2024
a84822c
rebasing
CommanderStorm Mar 7, 2024
8f0dc03
misc fixes
CommanderStorm Mar 7, 2024
31b7b4b
misc fixes
CommanderStorm Mar 7, 2024
91b84bf
refactored the CTA-toast to be shown on every page
CommanderStorm Mar 7, 2024
24ba834
refactored the browser warning to only use `alert()` to prevent a bro…
CommanderStorm Mar 7, 2024
a6b4af2
removed unused file
CommanderStorm Mar 7, 2024
770ef73
class -> selector as by docs
CommanderStorm Mar 7, 2024
4c3dc53
made timing the theme less likely
CommanderStorm Mar 7, 2024
ac9aaab
tmp
CommanderStorm Mar 7, 2024
de91337
reducing to useDark
CommanderStorm Mar 7, 2024
3f57e53
minified the svg file size and removed now unused file
CommanderStorm Mar 7, 2024
8a07bf7
finalised the darkmode work
CommanderStorm Mar 7, 2024
ee1f7e7
migrated from `swagger-ui-dist` to `swagger-ui` for reduced transfer …
CommanderStorm Mar 7, 2024
13ea6a5
linting fixes
CommanderStorm Mar 7, 2024
c91e81d
fixed typing errors
CommanderStorm Mar 7, 2024
d7f7ba0
fixed the outdated browser wrning coming up too often
CommanderStorm Mar 7, 2024
8a3c5e3
fixed the e2e tests
CommanderStorm Mar 7, 2024
e538777
changed the mounted logging cal to only log with info level
CommanderStorm Mar 7, 2024
a5ae923
changed how height/width for fixed images is configured
CommanderStorm Mar 7, 2024
f299067
fixed a typo
CommanderStorm Mar 7, 2024
646ee91
made sure that the feedback cycle handles loading and error states be…
CommanderStorm Mar 7, 2024
21d7246
deaciveted the `TokenBasedModal` as this is likely not working due to…
CommanderStorm Mar 7, 2024
737c6f7
linting fix
CommanderStorm Mar 7, 2024
492ab82
Merge branch 'main' into chore/further-tailwind
CommanderStorm Mar 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions webclient/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,7 @@ module.exports = {
"error",
["script-setup", "composition"], // "script-setup", "composition", "composition-vue2", or "options"
],
"vue/multi-word-component-names": [
"error",
{
ignores: ["[...slug]", "api", "index", "search", "[id]", "[name]"],
},
],
"vue/multi-word-component-names": "off",
"vue/component-name-in-template-casing": ["error", "PascalCase", { registeredComponentsOnly: false }],
"vue/custom-event-name-casing": ["error", "camelCase"],
"vue/define-macros-order": "error",
Expand Down Expand Up @@ -71,7 +66,7 @@ module.exports = {
"vue/prefer-separate-static-class": "error",
"vue/require-macro-variable-name": "error",
"vue/require-typed-ref": "error",
"vue/static-class-names-order": "error", // we may want to disable this rule if it does not work well with tailwind
"vue/static-class-names-order": "off",
"vue/v-for-delimiter-style": "error",
"vue/no-constant-condition": "error",
},
Expand Down
13 changes: 6 additions & 7 deletions webclient/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ pnpm install

## Run

Ensure that _NavigaTUM-server_ is running in the background:
Ensure that _NavigaTUM-server_ is running in the background.
By default, the webclient will connect to the server on `https://nav.tum.de`.
If you want to connect to a local version instead, change `VITE_APP_URL` in [`env/.env`](./env/.env) to `http://localhost:3003`.

To get a local server running, please:

- either via following the [guide to local development](../server/README.md), or
- via [docker](https://docs.docker.com/)
Expand All @@ -42,9 +46,6 @@ Ensure that _NavigaTUM-server_ is running in the background:
docker run -it --rm -p 8080:8080 --network navigatum-net -e MIELI_SEARCH_ADDR=search ghcr.io/tum-dev/navigatum-server:main /bin/navigatum-main-api
```

By default, the webclient will connect to the server on `http://localhost:8080`.
If you want to connect to the public API instead, change `VITE_APP_URL` in [`env/.env`](./env/.env) to `https://nav.tum.de`.

```sh
pnpm run dev
```
Expand Down Expand Up @@ -87,7 +88,7 @@ If you serve the release build with a webserver (such as Nginx) you need to sele

The language-selector is working in development and this differentialtion is only happening in the build.
For the theme we can not do so for some reason (If you know of a better way, hit us up).
To test a different theme, you can change `$theme` [here](./src/assets/variables.scss) and `theme='...'` [here](./index.html). Values are `light` and `dark`.
To test a different theme, you can change `theme='...'` [here](./index.html). Values are `light` and `dark`.

## Architecture

Expand All @@ -104,9 +105,7 @@ webclient
│ ├── api_types/ # 🠔 code generated via openapi.yaml for typechecking reasons
│ ├── assets/ # 🠔 Static assets such as icons
│ │ ├── md/ # 🠔 Static pages written in markdown. Served at `/about/<filename>`.
│ │ ├── variables.scss # 🠔 Include-script for Spectre.CSS
│ │ ├── main.scss # 🠔 Sass CSS code for all non-view parts
│ │ ├── spectre-all.scss # 🠔 Include-script for Spectre.CSS
│ │ └── logos # 🠔 The Logos used by the app
│ ├── components/ # 🠔 Vue components, which are used in views.
│ ├── pages/ # 🠔 The views are parts of App.vue, which are loaded dynamically based on our routes.
Expand Down
14 changes: 2 additions & 12 deletions webclient/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,8 @@ set -e # fail on first error
mkdir -p ../dist
rm -fr ../dist

for THEME in light dark
do
# make sure we are really only building the right theme
sed -i "s/\$theme: .*/\$theme: \"${THEME}\";/" src/assets/variables.scss
sed -i "s/<html class=\"[^\"]*\"/<html class=\"${THEME}\"/" index.html

echo "Building ${THEME}"
npm run build-only
mv dist/index.html dist/${THEME}.html
rsync -r dist/* ../dist
done

npm run build
rsync -r dist/* ../dist

# compress data (only using gzip, because brotli on ngnix is a royal pain)
gzip --force --keep --recursive ../dist
16 changes: 14 additions & 2 deletions webclient/cypress.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
import type { mount } from "cypress/vue";
import type { Router } from "vue-router";
import type { Component } from "vue";
import type { VueTestUtils } from "cypress/vue";
import { ComponentPublicInstance } from "vue";

type Options = Pick<typeof VueTestUtils, "config">["config"] & { router?: Router };
export type OptionsParam = Options | Record<string, never>;
declare global {
namespace Cypress {
interface Chainable {
mount: mount;
mount<Props extends NonNullable<unknown>>(
component: Component,
options?: OptionsParam,
): Cypress.Chainable<{
wrapper: VueWrapper<ComponentPublicInstance<Props>>;
component: VueWrapper<ComponentPublicInstance<Props>>["vm"];
}>;
}
}
}
36 changes: 24 additions & 12 deletions webclient/cypress/e2e/feedback.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,45 @@ describe("Check if opening the feedback form works from every subview", () => {
it("main page", () => {
cy.intercept("GET", "/api/get/root?lang=de", { fixture: "get/root.de.json" });
cy.visit("http://localhost:3000/");
cy.contains("Standorte");
cy.contains("Sites");

cy.get('[data-cy="main-footer"]').scrollIntoView();
checkFeedbackForm('[data-cy="open-feedback-footer"]');
cy.get("footer").scrollIntoView();
cy.contains("Send Feedback").should("not.exist");
cy.intercept("POST", "/api/feedback/get_token", { statusCode: 201, fixture: "feedback/get_token.json" });
cy.get("footer").contains("Feedback").click({ scrollBehavior: false });
cy.contains("Send Feedback").should("exist");
});
it("search page", () => {
cy.intercept("GET", "/api/search?q=fsmb&limit_buildings=10&limit_rooms=30&limit_all=30&lang=de", {
fixture: "search/fsmb.long.de.json",
});
cy.visit("http://localhost:3000/search?q=fsmb");

checkFeedbackForm('[data-cy="open-feedback-search"]');
cy.contains("Send Feedback").should("not.exist");
cy.intercept("POST", "/api/feedback/get_token", { statusCode: 201, fixture: "feedback/get_token.json" });
cy.get("footer").contains("Feedback").click();
cy.contains("Send Feedback").should("exist");
});
it("details page (general feedback)", () => {
cy.intercept("GET", "/api/get/mi?lang=de", { fixture: "get/mi.de.json" });
cy.visit("http://localhost:3000/view/mi");
cy.get('[data-cy="open-feedback-details"]').should("exist", { timeout: 10_000 }); // wait for the site to be interactive

checkFeedbackForm('[data-cy="open-feedback-details"]');
cy.contains("Send Feedback").should("not.exist");
cy.intercept("POST", "/api/feedback/get_token", { statusCode: 201, fixture: "feedback/get_token.json" });
cy.get("footer").contains("Feedback").click();
cy.contains("Send Feedback").should("exist");
});
});
it("details page (general feedback)", () => {
cy.intercept("GET", "/api/get/mi?lang=de", { fixture: "get/mi.de.json" });
cy.visit("http://localhost:3000/view/mi");
cy.get('[data-cy="open-feedback-details"]').should("exist", { timeout: 10_000 }); // wait for the site to be interactive

function checkFeedbackForm(selector_which_should_open_the_modal: string) {
cy.get('[data-cy="feedback-modal"]').should("not.exist");
cy.intercept("POST", "/api/feedback/get_token", { statusCode: 201, fixture: "feedback/get_token.json" });
cy.get(selector_which_should_open_the_modal).click({ scrollBehavior: false });
cy.get('[data-cy="feedback-modal"]').should("exist");
}
cy.contains("Send Feedback").should("not.exist");
cy.intercept("POST", "/api/feedback/get_token", { statusCode: 201, fixture: "feedback/get_token.json" });
cy.get('[data-cy="open-feedback-details"]').click({ scrollBehavior: false });
cy.contains("Send Feedback").should("exist");
});
});

export {};
2 changes: 1 addition & 1 deletion webclient/cypress/e2e/frontpage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe("Check if navigating from the frontpage works as expected", () => {
it("navigating to an initally hidden entry", () => {
cy.intercept("GET", "/api/get/root?lang=de", { fixture: "get/root.de.json" });
cy.visit("http://localhost:3000/");
cy.contains("mehr").click();
cy.contains("more").click();
cy.intercept("GET", "/api/get/garching-interims?lang=de", { fixture: "get/garching-interims.de.json" });
cy.contains("Interims").click();
cy.url().should("include", "/site/");
Expand Down
2 changes: 1 addition & 1 deletion webclient/cypress/e2e/search.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe("Check if the search page works as expected", () => {
cy.get("input").clear();
cy.get("input").type("fsmpic{enter}");
cy.url().should("include", "/search?q=fsmpic");
cy.contains("5502.U1.234M");
cy.contains("5101.EG.257");

//go back
cy.go(-1);
Expand Down
5 changes: 2 additions & 3 deletions webclient/cypress/support/component-index.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<!doctype html>
<html>
<html class="scroll-smooth">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<title>Components App</title>
<link rel="stylesheet" href="./src/assets/main.scss" />
<link rel="stylesheet" href="./src/assets/spectre-all.scss" />
</head>
<body>
<body class="relative">
<div data-cy-root></div>
<script type="module" src="/src/main.ts" defer></script>
</body>
Expand Down
19 changes: 13 additions & 6 deletions webclient/cypress/support/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import { createPinia } from "pinia"; // or Vuex
import { createI18n } from "vue-i18n";
import { mount } from "cypress/vue";
import { createMemoryHistory, createRouter } from "vue-router";
import type { Router } from "vue-router";
import type { Component } from "vue";
import { routes } from "../../src/router";
import type { OptionsParam } from "../../cypress";

// We recommend that you pull this out
// into a constants file that you share with
Expand All @@ -16,7 +19,7 @@ const i18nOptions = {
warnHtmlMessage: true,
};

Cypress.Commands.add("mount", (component, options = {}) => {
Cypress.Commands.add("mount", (component: Component, options: OptionsParam = {}) => {
options.global = options.global || {};
options.global.plugins = options.global.plugins || [];
options.global.plugins = options.global.plugins || [];
Expand All @@ -32,11 +35,15 @@ Cypress.Commands.add("mount", (component, options = {}) => {
}

// Add router plugin
options.global.plugins.push({
install(app) {
app.use(options.router);
},
});
if (options.router !== undefined) {
options.global.plugins.push({
install(app) {
app.use(options.router as Router);
},
});
}

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
return mount(component, options);
});
2 changes: 1 addition & 1 deletion webclient/env/.env.production
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VITE_APP_URL=
VITE_APP_URL=https://nav.tum.de
27 changes: 11 additions & 16 deletions webclient/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!doctype html>
<html class="light" lang="de" prefix="og: https://ogp.me/ns#">
<html class="scroll-smooth" lang="de" prefix="og: https://ogp.me/ns#">
<head>
<script type="application/ld+json">
{
Expand Down Expand Up @@ -34,7 +34,7 @@
name="description"
content="Finde Räume, Gebäude und andere Orte an der TUM mit Exzellenz. Eine moderne Alternative zum RoomFinder, entwickelt von Studierenden."
/>
<meta name="author" content="@octycs and @CommanderStorm" />
<meta name="author" content="OpenSource @ TUM e.V. partnering with TUM IT Management" />
<meta name="copyright" content="GNU General Public License v3.0. Images may be licensed differently." />
<meta name="robots" content="index, follow" />
<meta name="rating" content="safe for kids" />
Expand All @@ -55,31 +55,26 @@
<meta property="og:site_name" content="NavigaTUM" />

<link rel="stylesheet" href="./src/assets/main.scss" />
<link rel="stylesheet" href="./src/assets/spectre-all.scss" />

<link rel="icon" href="/favicon.ico" />
<link rel="canonical" href="https://nav.tum.de" />
<title>NavigaTUM</title>
<!-- Title isupdated by JS later during pageload -->
</head>
<body>
<body class="relative">
<noscript>
<div id="content-header" class="container grid-lg">
<div class="columns">
<div class="column col-lg-11 col-mx-auto">
<div class="toast toast-error">
JavaScript is required to use this application, as our main functionality (search bar, map) depends on
this.<br />
We do not think that there is a graceful fallback or any option for progressive enhancement, but are
planning on adding ServerSideRendering in the future.<br />
Please enable JavaScript in your browser.
</div>
</div>
<div class="mx-auto mt-16 max-w-3xl">
<div class="bg-red-300 rounded-sm p-1.5 text-red-950">
JavaScript is required to use this application, as our main functionality (search bar, map) depends on
this.<br />
We do not think that there is a graceful fallback or any option for progressive enhancement, but are planning
on adding ServerSideRendering in the future.<br />
Please enable JavaScript in your browser.
</div>
</div>
</noscript>
<!-- BEGIN of Vue.js template code -->
<div id="app"></div>
<div id="app" class="bg-zinc-50"></div>
<!-- END of Vue.js template code -->

<script type="module" src="/src/main.ts" defer></script>
Expand Down
23 changes: 8 additions & 15 deletions webclient/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,6 @@ http {
# Do not show the version of nginx running on the server
server_tokens off;

# theme detection
map $cookie_theme $THEME {
default "light";

"dark" "dark";
"light" "light";
}

# we allow other sites to fetch from us as we don't have any login/.. functionality => no cookies
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS' always;
Expand Down Expand Up @@ -78,20 +70,21 @@ http {
}

location / {
add_header Cache-Control no-cache; # disable caching, as we do not want to have theme/language related issues
expires 1h;
add_header Cache-Control "public";
# we allow other sites to fetch from us as we don't have any login/.. functionality => no cookies
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS' always;
expires 360s; # 360s=5min
try_files /$THEME.html /404.html;
add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS' always
expires 1h;
try_files /index.html /404.html;
}
location = /api {
add_header Cache-Control no-cache; # disable caching, as we do not want to have theme/language related issues
add_header Cache-Control "public";
# we allow other sites to fetch from us as we don't have any login/.. functionality => no cookies
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS' always;
expires 360s; # 360s=5min
try_files /$THEME.html /404.html;
expires 1h;
try_files /index.html /404.html;
}

location /assets/ {
Expand Down
Loading
Loading