Skip to content

Commit

Permalink
Merge pull request #181 from fsinfuhh/staging
Browse files Browse the repository at this point in the history
  • Loading branch information
lilioid authored Nov 18, 2024
2 parents 4b542a2 + 2f4c659 commit 360d9c8
Show file tree
Hide file tree
Showing 11 changed files with 143 additions and 51 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,22 @@ pipenv run ./manage.py runserver

If you are interested you can see how we deploy this service on our kubernetes cluster via `kustomization.yml`.
The format is [kustomize](https://kustomize.io/).

## Developing

The dashboard application has been modularized and the default development configuration enables only those modules which can function in a local environment (i.e. no LDAP integration).

Once dependencies have been installed (with pipenv), you must start a database with the provided `/scripts/start_db.sh` script.
This will bring up a postgres database that is persistet into the projects repository (but gitignored).

Afterwards, a webserver can be brought up with either of the following commands:

```shell
# directly on your system
./manage.py migrate
./manage.py runserver

# in a podman container
podman build . -t mafiasi-dashboard
podman run -it --net=host -v (realpath .):/app/src/ --env-file .env.dev mafiasi-dashboard /app/src/manage.py runserver
```
6 changes: 6 additions & 0 deletions docker/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ server {
listen 8000;
server_name default_server;

# nginx currently does not know about the .mjs extensions mime type so we teach it here
include mime.types;
types {
application/javascript mjs;
}

client_max_body_size 1G;

location /static {
Expand Down
25 changes: 13 additions & 12 deletions locale/de_DE/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Mafiasi\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-17 16:04+0200\n"

"POT-Creation-Date: 2024-11-18 22:47+0100\n"
"PO-Revision-Date: 2024-09-03 23:52+0200\n"
"Last-Translator: Markus Neblung <[email protected]>\n"
"Language-Team: \n"
Expand Down Expand Up @@ -39,51 +40,51 @@ msgstr ""
"Bitte versuche es später nochmal. Falls das Problem bestehen bleibt, schaue "
"auf unsere <a href=\"%(problems_url)s\">Fehlermeldeseite</a>."

#: mafiasi/base/templates/base.html:47
#: mafiasi/base/templates/base.html:48
msgid "Disable surprise"
msgstr "Überraschung abschalten"

#: mafiasi/base/templates/base.html:57
#: mafiasi/base/templates/base.html:58
msgid "Groups"
msgstr "Gruppen"

#: mafiasi/base/templates/base.html:65
#: mafiasi/base/templates/base.html:66
#: mafiasi/mailinglist/templates/mailinglist/show_list.html:46
msgid "Settings"
msgstr "Einstellungen"

#: mafiasi/base/templates/base.html:68
#: mafiasi/base/templates/base.html:69
#, python-format
msgid "Logged in as %(username)s"
msgstr "Angemeldet als %(username)s"

#: mafiasi/base/templates/base.html:71
#: mafiasi/base/templates/base.html:72
msgid "Logout"
msgstr "Abmelden"

#: mafiasi/base/templates/base.html:77
#: mafiasi/base/templates/base.html:78
#: mafiasi/registration/templates/registration/request_account.html:38
#: mafiasi/registration/templates/registration/request_account.html:77
msgid "Register"
msgstr "Registrieren"

#: mafiasi/base/templates/base.html:79
#: mafiasi/base/templates/base.html:80
msgid "Login"
msgstr "Login"

#: mafiasi/base/templates/base.html:108
#: mafiasi/base/templates/base.html:109
msgid "Imprint"
msgstr "Impressum"

#: mafiasi/base/templates/base.html:110
#: mafiasi/base/templates/base.html:111
msgid "Data privacy statement"
msgstr "Datenschutzerklärung"

#: mafiasi/base/templates/base.html:112
#: mafiasi/base/templates/base.html:113
msgid "Technical info"
msgstr "Technik"

#: mafiasi/base/templates/base.html:114
#: mafiasi/base/templates/base.html:115
#: mafiasi/base/templates/base/problems.html:4
msgid "Problems?"
msgstr "Probleme?"
Expand Down
24 changes: 12 additions & 12 deletions locale/en_US/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Mafiasi\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-17 16:04+0200\n"
"POT-Creation-Date: 2024-11-18 22:47+0100\n"
"PO-Revision-Date: 2024-01-18 22:42+0100\n"
"Last-Translator: Markus Neblung <[email protected]>\n"
"Language-Team: \n"
Expand Down Expand Up @@ -31,51 +31,51 @@ msgid ""
"href=\"%(problems_url)s\">problem reporting page</a>."
msgstr ""

#: mafiasi/base/templates/base.html:47
#: mafiasi/base/templates/base.html:48
msgid "Disable surprise"
msgstr ""

#: mafiasi/base/templates/base.html:57
#: mafiasi/base/templates/base.html:58
msgid "Groups"
msgstr ""

#: mafiasi/base/templates/base.html:65
#: mafiasi/base/templates/base.html:66
#: mafiasi/mailinglist/templates/mailinglist/show_list.html:46
msgid "Settings"
msgstr ""

#: mafiasi/base/templates/base.html:68
#: mafiasi/base/templates/base.html:69
#, python-format
msgid "Logged in as %(username)s"
msgstr ""

#: mafiasi/base/templates/base.html:71
#: mafiasi/base/templates/base.html:72
msgid "Logout"
msgstr ""

#: mafiasi/base/templates/base.html:77
#: mafiasi/base/templates/base.html:78
#: mafiasi/registration/templates/registration/request_account.html:38
#: mafiasi/registration/templates/registration/request_account.html:77
msgid "Register"
msgstr ""

#: mafiasi/base/templates/base.html:79
#: mafiasi/base/templates/base.html:80
msgid "Login"
msgstr ""

#: mafiasi/base/templates/base.html:108
#: mafiasi/base/templates/base.html:109
msgid "Imprint"
msgstr ""

#: mafiasi/base/templates/base.html:110
#: mafiasi/base/templates/base.html:111
msgid "Data privacy statement"
msgstr ""

#: mafiasi/base/templates/base.html:112
#: mafiasi/base/templates/base.html:113
msgid "Technical info"
msgstr ""

#: mafiasi/base/templates/base.html:114
#: mafiasi/base/templates/base.html:115
#: mafiasi/base/templates/base/problems.html:4
msgid "Problems?"
msgstr ""
Expand Down
24 changes: 12 additions & 12 deletions locale/en_Uwu/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Mafiasi\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-17 16:04+0200\n"
"POT-Creation-Date: 2024-11-18 22:47+0100\n"
"PO-Revision-Date: 2024-01-09 22:14+0000\n"
"Last-Translator: kritzl <[email protected]>\n"
"Language-Team: \n"
Expand Down Expand Up @@ -42,51 +42,51 @@ msgstr ""
"again later. If the problem persists, see our <a "
"href=\"%(problems_url)s\">problem reporting page</a>."

#: mafiasi/base/templates/base.html:47
#: mafiasi/base/templates/base.html:48
msgid "Disable surprise"
msgstr "Me no like this mess ._."

#: mafiasi/base/templates/base.html:57
#: mafiasi/base/templates/base.html:58
msgid "Groups"
msgstr "frens"

#: mafiasi/base/templates/base.html:65
#: mafiasi/base/templates/base.html:66
#: mafiasi/mailinglist/templates/mailinglist/show_list.html:46
msgid "Settings"
msgstr "Change me >﹏<"

#: mafiasi/base/templates/base.html:68
#: mafiasi/base/templates/base.html:69
#, python-format
msgid "Logged in as %(username)s"
msgstr "U is %(username)s"

#: mafiasi/base/templates/base.html:71
#: mafiasi/base/templates/base.html:72
msgid "Logout"
msgstr "Bye bye 👋"

#: mafiasi/base/templates/base.html:77
#: mafiasi/base/templates/base.html:78
#: mafiasi/registration/templates/registration/request_account.html:38
#: mafiasi/registration/templates/registration/request_account.html:77
msgid "Register"
msgstr "Become fren <3"

#: mafiasi/base/templates/base.html:79
#: mafiasi/base/templates/base.html:80
msgid "Login"
msgstr "Get inside"

#: mafiasi/base/templates/base.html:108
#: mafiasi/base/templates/base.html:109
msgid "Imprint"
msgstr "Pawprint"

#: mafiasi/base/templates/base.html:110
#: mafiasi/base/templates/base.html:111
msgid "Data privacy statement"
msgstr "How me uses ur data"

#: mafiasi/base/templates/base.html:112
#: mafiasi/base/templates/base.html:113
msgid "Technical info"
msgstr "Complicated thingies"

#: mafiasi/base/templates/base.html:114
#: mafiasi/base/templates/base.html:115
#: mafiasi/base/templates/base/problems.html:4
msgid "Problems?"
msgstr "Problems?"
Expand Down
24 changes: 12 additions & 12 deletions locale/fr_FR/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Mafiasi\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-17 16:04+0200\n"
"POT-Creation-Date: 2024-11-18 22:47+0100\n"
"PO-Revision-Date: 2024-09-03 23:54+0200\n"
"Last-Translator: Markus Neblung <[email protected]>\n"
"Language-Team: \n"
Expand Down Expand Up @@ -39,51 +39,51 @@ msgstr ""
"problème persiste, consultez notre <a href=\"%(problems_url)s\"> page de "
"rapports d'incidents </a>."

#: mafiasi/base/templates/base.html:47
#: mafiasi/base/templates/base.html:48
msgid "Disable surprise"
msgstr "Désactiver la surprise"

#: mafiasi/base/templates/base.html:57
#: mafiasi/base/templates/base.html:58
msgid "Groups"
msgstr "Groupes"

#: mafiasi/base/templates/base.html:65
#: mafiasi/base/templates/base.html:66
#: mafiasi/mailinglist/templates/mailinglist/show_list.html:46
msgid "Settings"
msgstr "Paramètres"

#: mafiasi/base/templates/base.html:68
#: mafiasi/base/templates/base.html:69
#, python-format
msgid "Logged in as %(username)s"
msgstr "Connecté en tant que %(username)s"

#: mafiasi/base/templates/base.html:71
#: mafiasi/base/templates/base.html:72
msgid "Logout"
msgstr "Déconnecter"

#: mafiasi/base/templates/base.html:77
#: mafiasi/base/templates/base.html:78
#: mafiasi/registration/templates/registration/request_account.html:38
#: mafiasi/registration/templates/registration/request_account.html:77
msgid "Register"
msgstr "Enregistrez-Vous"

#: mafiasi/base/templates/base.html:79
#: mafiasi/base/templates/base.html:80
msgid "Login"
msgstr "Connectez-Vouz"

#: mafiasi/base/templates/base.html:108
#: mafiasi/base/templates/base.html:109
msgid "Imprint"
msgstr "Empreinte"

#: mafiasi/base/templates/base.html:110
#: mafiasi/base/templates/base.html:111
msgid "Data privacy statement"
msgstr "Politique de confidentialité"

#: mafiasi/base/templates/base.html:112
#: mafiasi/base/templates/base.html:113
msgid "Technical info"
msgstr "Information technique"

#: mafiasi/base/templates/base.html:114
#: mafiasi/base/templates/base.html:115
#: mafiasi/base/templates/base/problems.html:4
msgid "Problems?"
msgstr "Problèmes?"
Expand Down
20 changes: 20 additions & 0 deletions mafiasi/base/static/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,26 @@ body {
border-radius: 10px;
}

/* ------- Stabile Message ------*/
#stabile-message {
position: fixed;
bottom: 1vw;
left: auto;
right: 1vw;
margin: 0;
cursor: pointer;
user-select: none;

border: none;
padding: 10px 16px;
background: #23527c;
color: white;
border-radius: 4px;
letter-spacing: 0ch;
font-size: large;
font-style: normal;
}

/* ------- MISC -------*/
.clickable {
cursor: pointer;
Expand Down
10 changes: 10 additions & 0 deletions mafiasi/base/static/js/stabile_message.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
document.addEventListener("DOMContentLoaded", () => {
const dialog = document.getElementById("stabile-message");

// close dialog when clicked
const close = () => dialog.style.display = "none";
dialog.addEventListener("click", close);

// alternatively, also close dialog after 20 seconds
setTimeout(close, 20 * 1000);
})
6 changes: 6 additions & 0 deletions mafiasi/base/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{% load group_tags %}
{% load settings_value %}
{% load static %}
{% load stabile_message %}
{% value_from_settings BANNER_IMG as banner_img %}
{% value_from_settings FAVICON_PATH as favicon_path %}
<!DOCTYPE html>
Expand Down Expand Up @@ -129,11 +130,16 @@ <h2>{% block ptitle %}{% endblock %}</h2>
<script src="{% static 'js/snow.js' %}" type="module"></script>
{% endif %}

<aside id="stabile-message">
<span>{% stabile_message %}</span>
</aside>

<script src="{% static 'js/jquery-2.0.3.js' %}" type="text/javascript"></script>
<script src="{% static 'js/jquery-ui-1.12.1.custom.js' %}" type="text/javascript"></script>
<script src="{% static 'js/common.js' %}" type="text/javascript"></script>
<script src="{% static 'js/bootstrap.js' %}" type="text/javascript"></script>
<script src="{% static 'js/misc.js' %}" type="text/javascript"></script>
<script src="{% static 'js/stabile_message.mjs' %}" type="module"></script>
{% block js %}
{% endblock js %}
</body>
Expand Down
Loading

0 comments on commit 360d9c8

Please sign in to comment.