Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Which JavaScript files does Portal need to run?
The important JavaScript files can be found in `/portal/static/js/`!
This is mostly Mithril.js.
## `/portal/static/js/components`
[TODO] furtherly explain the components
This is where the frontend components are located. The components are divided into two categories: `pages` and `pieces`. **Mithril.js** uses `pages` to render the main content of the website, while `pieces` are used to render smaller components that are used in multiple places. `pieces` then are embedded into `pages`.
This could help you around
+ [Mithril.js documentation](https://mithril.js.org/)
+ [Convert plain HTML to Mithril](https://arthurclemens.github.io/mithril-template-converter/index.html)
### `/portal/static/js/components/pages`
Generally, everything having its own tab in the Navbar is a `page`. They are the first components that are rendered when the website is loaded.
+ `Base.mjs`
+ `Fachschaftssitzung.mjs`
+ `FsServices.mjs`
+ `Login.mjs`
+ `M.mjs`
+ `Start.mjs`
+ `UniServices.mjs`
+ `Unlock.mjs`
### `/portal/static/js/components/pieces`
These are the smaller components that are embedded in multiple places.
+ `AccountRequired.mjs`
+ `Agenda.mjs`
+ `BoxedButton.mjs`
+ `ButtonAndTextLink.mjs`
+ `Nav.mjs`
+ `NavPageLink.mjs`
+ `PasswordinVault.mjs`
+ `ServiceLink.mjs`
+ `Toast.mjs`
+ `UnlockRequired`
## `/portal/static/js/model`
### `/portal/static/js/model/Service.mjs`
This renders an individual service.
### `/portal/static/js/model/Services.mjs`
This renders the list of our services.
## `/portal/static/js/account.mjs`
Here, after the login, a session token is created and stored in the `LocalStorage`.
It also responsible for ensuring the validity and non-expiry of the session token.
Users get logged in and logged out here.
## `/portal/static/js/gitlab.mjs`
Arcane magic. We get our Fachschaftssitzung protocols here.
Also, there's some yapping about the Same Origin Policy, might be interesting, but misses a TL;DR.
## `/portal/static/js/portal.mjs`
This is the main file that initializes the Mithril.js app and sets up the routing.