diff --git a/README.md b/README.md index 847c8a1f..299127f0 100644 --- a/README.md +++ b/README.md @@ -1,31 +1,71 @@ +# BMA - Bornhack Media Archive + [![Run Tox CI](https://github.com/bornhack/bma/actions/workflows/tox.yml/badge.svg?branch=develop)](https://github.com/bornhack/bma/actions/workflows/tox.yml) [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) [![codecov](https://codecov.io/gh/bornhack/bma/graph/badge.svg?token=AN3NmaCDAr)](https://codecov.io/gh/bornhack/bma) [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/bornhack/bma/develop.svg)](https://results.pre-commit.ci/latest/github/bornhack/bma/develop) -# bma -BornHack Media Archive +## What: + +The BornHack Media Archive is a site for sharing pictures, videos, audio and documents from BornHack events. + +It uses the BornHack website oauth2 provider for login (i.e. you log in with your BornHack.dk account), Django as a framework and PostgreSQL as a database. + +## Setup: +> โš ๏ธ Note! The server is using database functions **not** compatible with SQLite! Use PostgreSQL instead ๐Ÿ˜ + +BMA uses BornHack OIDC for authorization, so start by creating an oauth app on the BornHack instance you wish to use as auth server. This can be bornhack.dk or a local dev instance: + +1. Login to the BornHack instance and go to: `/o/applications`. + +2. Register a new app. + +3. Choose client type: `public` and grant type: `authorization code`. + +4. Enter your redirect uri's: "*BMA_BASEURL/accounts/oidc/bornhack/login/callback/*" e.g: + + >`http://127.0.0.1:8001/accounts/oidc/bornhack/login/callback/` + + โš ๏ธ For local development, make sure it's HTTP not HTTPS! -## What -The BornHack Media Archive is a site for sharing pictures and video from BornHack events. It uses the BornHack website oauth2 provider for login. +5. Choose algorithm: `RSA with SHA-2 256`, make a note of `Client id`and `Client secret`, then save โœ… -## How -> Note! The server is using database functions not compatible with sqlite. Use postgresql instead. +6. Then copy `bma/environment_settings.py.dist` to `bma/environment_settings.py` and either edit it directly, or use .env file or environment variables to configure. + >โš ๏ธ Note: If it's a local dev, you might have more success making a copy of `bma/environment_settings.py.ci` and renaming it to: `bma/environment_settings.py` - The other template contains Jinja code, which Python doesn't like ๐Ÿ˜• -* BMA uses BornHack OIDC for auth. Start by creating an oauth app on the BornHack instance you wish to use as auth server. This can be bornhack.dk or a local dev instance: - * login to the BornHack instance and go to the url `/o/applications`. - * register a new app. - * client type `public` - * grant type `authorization code` - * redirect uri's `BMA_BASEURL/accounts/oidc/bornhack/login/callback/` eg. `http://127.0.0.1:8001/accounts/oidc/bornhack/login/callback/`. - * Algorithm `RSA with SHA-2 256` +7. Enter the `Client id` and `Client secret` from earlier: + + ``` + BORNHACK_OIDC_CLIENT_ID = "client_id" + BORNHACK_OIDC_CLIENT_SECRET = "client_secret" + ``` + +8. And make sure the OIDC server URL is configured correctly: + + ```` + BORNHACK_OIDC_SERVER_URL = "http://bornhack.dk/o/.well-known/openid-configuration" + ```` + +9. Now run `manage.py migrate` (or `make init`) -* Then copy `bma/environment_settings.py.dist` to `bma/environment_settings.py` and either edit it directly, or use .env file or environment variables to configure. -* Run `manage.py migrate` * If you get a database error about missing 'gist', you need to run `create extension btree_gist;` on your postgresql instance. -* Run `manage.py createsuperuser` to create a local database-based superuser in the BMA instance + +10. Run `manage.py createsuperuser` (`make manage createsuperuser`) to create a local database-based superuser in the BMA instance + +11. Now run `manage.py runserver`or `make run`, tada! ๐ŸŽ‰ It should now be possible to login to BMA using a BornHack account. -To use the CLI app for uploading or BMA workers make sure the url of the autocreated oauth application for the user matches the BMA instance (for localhost dev change https to http). +โš ๏ธ To use the CLI app for uploading or BMA workers, **make sure** the url of the autocreated oauth application for the user matches the BMA instance (for localhost dev change https to http). +โš ๏ธ Make also sure you've added your user to the appropriate groups and have been given the neccesary permissions - otherwise file uploading or job grinding will not work! + +## Contribute: + + Bornhack Media Archive is still under development, so please submit any issues you come across! or a pull-request if you're *that* clever๐Ÿ˜‰ + + #### Contributers: + + + + \ No newline at end of file diff --git a/src/albums/templates/album_list.html b/src/albums/templates/album_list.html index 05fdbbd0..9c3f8a1b 100644 --- a/src/albums/templates/album_list.html +++ b/src/albums/templates/album_list.html @@ -2,22 +2,19 @@ {% load django_bootstrap5 %} {% load render_table from django_tables2 %} {% block title %}Album list{% endblock title %} - {% block main_content %} -
- +
-
- {% include "includes/album_filters.html" %} -
+ -
+

Albums

{% include "includes/album_list_table.html" %} -
- -
+ + {% endblock main_content %} diff --git a/src/albums/templates/includes/album_filters.html b/src/albums/templates/includes/album_filters.html index 411167c9..2fd660d2 100644 --- a/src/albums/templates/includes/album_filters.html +++ b/src/albums/templates/includes/album_filters.html @@ -2,7 +2,7 @@ {% load django_bootstrap5 %}
Filter Albums - +

Showing {{ filter.qs.count }} of {{ albums.count }} albums

diff --git a/src/albums/templates/includes/album_toolbar.html b/src/albums/templates/includes/album_toolbar.html index 21500f59..1dc99848 100644 --- a/src/albums/templates/includes/album_toolbar.html +++ b/src/albums/templates/includes/album_toolbar.html @@ -2,7 +2,7 @@