diff --git a/.gitignore b/.gitignore index 05b9dca..b3c1f1e 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ db.sqlite3 venv node_modules bower_components -staticfiles \ No newline at end of file +staticfiles +static/dist/ \ No newline at end of file diff --git a/README.md b/README.md index d7b3042..157f762 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,26 @@ Kassa helps you register purchased membership cards and memberships. It's a tool for volunteers and bar employees at The Norwegian Student Society. ## TODO +* replace nunjucks with something that is maintained +* autoprefixer +* bootstrap 4.x * Loading state on submit buttons * Galtinn/LDAP auth ## Installation - apt install libldap2-dev libsasl2-dev # pyldap deps - python3 -m venv venv - . venv/bin/activate - pip install -U pip wheel - pip install -r requirements.txt - python manage.py migrate +```shell script +apt install libldap2-dev libsasl2-dev # pyldap deps +python3 -m venv venv +. venv/bin/activate +pip install -U pip wheel +pip install -r requirements.txt +python manage.py migrate +``` +### Development tasks +```shell script +npm run build:templates # regenerate nunjucks templates +``` ## Configuration Create a user in Galtinn with the following permissions: * galtinn | User | Can view User @@ -22,14 +31,20 @@ Create a user in Galtinn with the following permissions: * galtinn | Order | Can view Order Fetch GALTINN_API_KEY: +```shell script curl -H "Content-Type: application/json" -X POST -d '{"username":"apiuser","password":"test"}' GALTINN_API_URL/auth/obtain-token/ +``` If developing you can disable calls to Tekstmelding in local_settings.py: - TEKSTMELDING_ENABLED = False +```python +TEKSTMELDING_ENABLED = False +``` ## LDAP - sudo docker run -e LDAP_DOMAIN=neuf.no -e LDAP_ORGANISATION="Neuf" -e LDAP_ADMIN_PASSWORD="toor" -p 389:389 -d nikolaik/openldap - ldapadd -D "cn=admin,dc=neuf,dc=no" -w "toor" -f test/testdata.ldif # Testdata - # Verify import - ldapsearch -x -b dc=neuf,dc=no - # Login with test@example.com:test \ No newline at end of file +```shell script +sudo docker run -e LDAP_DOMAIN=neuf.no -e LDAP_ORGANISATION="Neuf" -e LDAP_ADMIN_PASSWORD="toor" -p 389:389 -d nikolaik/openldap +ldapadd -D "cn=admin,dc=neuf,dc=no" -w "toor" -f test/testdata.ldif # Testdata +# Verify import +ldapsearch -x -b dc=neuf,dc=no +# Login with test@example.com:test +``` diff --git a/apps/kassa/context_processors.py b/apps/kassa/context_processors.py new file mode 100644 index 0000000..35dfa6a --- /dev/null +++ b/apps/kassa/context_processors.py @@ -0,0 +1,5 @@ +from django.conf import settings + + +def sentry(request): + return {'SENTRY_DSN': settings.SENTRY_DSN or '', 'SENTRY_ENVIRONMENT': settings.SENTRY_ENVIRONMENT} diff --git a/apps/kassa/templates/base.html b/apps/kassa/templates/base.html index 1d5559d..467226e 100644 --- a/apps/kassa/templates/base.html +++ b/apps/kassa/templates/base.html @@ -1,18 +1,14 @@ -{% load staticfiles raven %} +{% load static %} - -
+ +