diff --git a/.forgejo/workflows/deployment-pull-request.yaml b/.forgejo/workflows/deployment-pull-request.yaml new file mode 100644 index 0000000..bef68b9 --- /dev/null +++ b/.forgejo/workflows/deployment-pull-request.yaml @@ -0,0 +1,22 @@ +name: deployment-on-pull-request +on: + pull_request: + pull_request_target: + types: + - opened + - reopened + - synchronize + +jobs: + deployment: + runs-on: docker + container: + image: node:bookworm + steps: + - uses: actions/checkout@v4 + - name: Build inventory + uses: https://codeberg.org/umglurf/kaniko-action@main + with: + cache: false + push: 'false' + context: /workspace/snoopy/in-c4/ diff --git a/.forgejo/workflows/deployment.yaml b/.forgejo/workflows/deployment.yaml new file mode 100644 index 0000000..391e59c --- /dev/null +++ b/.forgejo/workflows/deployment.yaml @@ -0,0 +1,24 @@ +name: deployment +on: + push: + branches: + - 'main' + +jobs: + deployment: + runs-on: docker + container: + image: node:bookworm + steps: + - uses: actions/checkout@v4 + - name: Build inventory + uses: https://codeberg.org/umglurf/kaniko-action@main + with: + cache: true + cache_repo: git.koeln.ccc.de/${{ github.repository }}/cache + push: 'true' + context: /workspace/snoopy/in-c4/ + credentials: | + git.koeln.ccc.de=snoopy:${{ secrets.REGISTRY_WRITE }} + destinations: | + git.koeln.ccc.de/${{ github.repository }}/in-c4:latest diff --git a/.gitignore b/.gitignore index 53c9ebf..03899e1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -/inventory.sqlite3 +/data/* *.pyc diff --git a/database.py b/database.py index 44a3006..7759e10 100644 --- a/database.py +++ b/database.py @@ -2,7 +2,7 @@ from sqlalchemy import create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker -SQLALCHEMY_DATABASE_URL = "sqlite:///./inventory.sqlite3" +SQLALCHEMY_DATABASE_URL = "sqlite:///./data/inventory.sqlite3" engine = create_engine( SQLALCHEMY_DATABASE_URL, connect_args={"check_same_thread": False}, echo=True diff --git a/static/80x80.svg b/static/80x80.svg deleted file mode 100644 index d0124e9..0000000 --- a/static/80x80.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/static/c4.css b/static/c4.css new file mode 100644 index 0000000..abeae82 --- /dev/null +++ b/static/c4.css @@ -0,0 +1,122 @@ +body { + color: #f0f0f0; + background-color: #333; +} + +h1, h1 a { + color: #dfaa37; /* C4 Yellow */ +} + +#search.failed { + color: #200; + background-color: #ec6d5f; +} + +#map { + border: 1px solid #202020; + background-color: #4d4d4d; + max-width: 1440px; + max-height: 50vh; + aspect-ratio: 2 / 1; + box-shadow: 0px 6px 12px #000c; +} + +#mapnote { + background-color: #ccc; + color: #333; + border-color: #202020; + padding: 0.25em 0.5em; + position: relative; + top: -1px; + box-shadow: 0px 6px 12px #000c; +} + +#mapnote:empty { + display: none; +} + +#itemcount { + display: inline-block; + margin-right: 1ch; +} + +.result { + background-color: #202020; + border-color: #4d4d4d; +} + +.result:focus { + background-color: #202020; + border-color: #dfaa37; + outline-color: #dfaa37; +} + +.result a { + color: #dfaa37; +} + +.note { + background-color: #333; + font-size: smaller; +} + +#knowntypes button { + color: #220; + background-color: #dfaa37; + border: 1px solid #220; + border-radius: 4px; + padding: 0.2em 0.4em; + margin: 0.2em; + font-weight: bolder; + cursor: pointer; +} + +#knowntypes button:hover, #knowntypes button:focus { + background-color: #f5c251; +} + +.btn { + box-shadow: 0 3px 6px -1px rgba(0,0,0,0.3); +} + +.btn.primary { + color: #220; + background-color: #dfaa37; +} + +.btn.primary:hover,.btn.primary:focus { + background-color: #f5c251; +} + +.btn.grn { + color: #020; + background-color: #9f6; +} + +.btn.grn:hover ,.btn.grn:focus { + background-color: #3f0; +} + +.btn.red { + color: #200; + background-color: #ec6d5f; +} + +.btn.red:hover, .btn.red:focus { + background-color: #ff7667; +} + +@keyframes blinker { + 0% { opacity: 1; } + 40% { opacity: 1; } + 90% { opacity: 0; } + 100% { opacity: 1; } +} + +#mapgrid { + outline: 2px solid #333; + background-color: #dfaa37; + border-radius: min(4px, 25%); + animation: blinker 1s infinite; +} + diff --git a/static/form.html b/static/form.html index d894279..44d5c16 100644 --- a/static/form.html +++ b/static/form.html @@ -3,6 +3,7 @@