Plak je kwak, en upload er een foto van.
This webapp lets your members add all the locations they sticked a sticker of your association.
- Clone this repository
- Copy
sample.envto.env. This can be done in two ways:- Manually through the file explorer
- In the terminal through
cp sample.env .env
- Fill in all the empty credentials in the newly created
.envfile. These can be found in our Bitwarden - Install uv
- Install all the correct versions of the dependencies using
uv sync - The program uses a Postgres database. For this database to work you need to install Postgres locally on your machine. Additionally, you need to install the PostGIS extension for Postgres locally. This can be done by opening the 'PgAdmin4' program and navigating to your database and then to the 'stickers' table. Using the query tool on your 'stickers' table, execute the following query: 'CREATE EXTENSION postgis;'. This will install PostGIS locally.
- To update your database table, run
uv run alembic upgrade head
Running this program works by running the flask app.
This is done through uv. Firstly, your terminal needs to be in the server subfolder using cd .\server\. Then run the flask app using the following command:
uv run server.pyUpgrading to a new board year is done with the following steps (see PR #34 for an example of this upgrade):
In home.html:
- Add a new option inside
<select id="boardYearInputSelect" name="boardYearInputSelect">, by duplicating the last option. Then change this new option to<option value="<current-board-number>" selected>B<current-board-number></option>and remove theselectedtag from the one second-to-last option item.
In general.css:
- Add a new variable called
--board-<previous-board-number>-colorand set its value to the current value of--board-color - Set the value of
--board-colorequal to the new current board color
In home.css:
- Change the background of
#boardYearInputSelect option:nth-child(<previous-board-number>), .marker-B<previous-board-number>frombackground: var(--board-<previous-board-number>-color);tobackground: var(--board-<current-board-number>-color);. Add a new declaration#boardYearInputSelect option:nth-child(<current-board-number>), .marker-B<current-board-number>with the valuebackground: var(--board-color);.
In /img/markers:
- Create a new svg by copying a
marker-<board-number>.svgfile and call this new filemarker-<current-board-number>.svg. Open the text content of this new svg file and search (ctrl+f) for#. This should return two results offill="#<hex-color>". Replace both these hex colors with the new current board color.
In /img:
- Similarly to
4., openfavicon.svgand search (ctrl+f) for#. This should return one result offill="#<hex-color>". Replace this hex color with the new current board color. Convert thisfavicon.svgto anfavicon.icoand replace the current favicon with this newfavicon.ico. This conversion can be done with online services, such as Picflow Svg to Ico (these online services do differ in quality, so check if the result for example has the transparant background the current favicon has). Do note that browser sometimes do not update the favicon image on a reload. Opening an incognito window or clearing the browser cache can help in this case.