Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
f76a8d2efc
|
|||
|
51f5aefcaa
|
|||
|
5c4a2a8ffc
|
|||
|
0f934a6671
|
|||
|
d697c3e268
|
|||
|
1ad010d079
|
|||
|
85ba0bf07c
|
|||
|
36b968998e
|
@@ -19,19 +19,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
fetch-tags: true
|
fetch-tags: true
|
||||||
- name: Install uv
|
|
||||||
uses: astral-sh/setup-uv@v5
|
|
||||||
- name: Set up Python
|
|
||||||
run: uv python install
|
|
||||||
with:
|
|
||||||
python-version-file: "pyproject.toml"
|
|
||||||
- name: Install the project dependencies
|
|
||||||
run: |
|
|
||||||
uv sync --all-groups
|
|
||||||
uv add pip
|
|
||||||
uv export --format requirements.txt -o requirements.txt
|
|
||||||
# uv run python -m pip install --upgrade pip
|
|
||||||
# uv run python -m pip install -r requirements.txt
|
|
||||||
|
|
||||||
- name: Derive lowercase repo name
|
- name: Derive lowercase repo name
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -18,12 +18,39 @@ on:
|
|||||||
- "major"
|
- "major"
|
||||||
- "minor"
|
- "minor"
|
||||||
- "patch"
|
- "patch"
|
||||||
|
pull_request:
|
||||||
|
types: [closed]
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
# Only run on merged PRs with [release-*] or manual workflow_dispatch
|
||||||
|
if: |
|
||||||
|
github.event_name == 'workflow_dispatch' ||
|
||||||
|
(github.event_name == 'pull_request' && github.event.pull_request.merged == true && contains(github.event.pull_request.title, '[release-'))
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Determine bump type
|
||||||
|
id: bump_type
|
||||||
|
run: |
|
||||||
|
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
|
||||||
|
echo "type=${{ github.event.inputs.bump }}" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
# Extract bump type from PR title: [release-patch], [release-minor], [release-major]
|
||||||
|
PR_TITLE="${{ github.event.pull_request.title }}"
|
||||||
|
if [[ "$PR_TITLE" =~ \[release-major\] ]]; then
|
||||||
|
echo "type=major" >> $GITHUB_OUTPUT
|
||||||
|
elif [[ "$PR_TITLE" =~ \[release-minor\] ]]; then
|
||||||
|
echo "type=minor" >> $GITHUB_OUTPUT
|
||||||
|
elif [[ "$PR_TITLE" =~ \[release-patch\] ]]; then
|
||||||
|
echo "type=patch" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "type=patch" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4.2.2
|
uses: actions/checkout@v4.2.2
|
||||||
with:
|
with:
|
||||||
@@ -52,7 +79,7 @@ jobs:
|
|||||||
id: bump
|
id: bump
|
||||||
run: |
|
run: |
|
||||||
uv tool install bump-my-version
|
uv tool install bump-my-version
|
||||||
uv tool run bump-my-version bump ${{ github.event.inputs.bump }}
|
uv tool run bump-my-version bump ${{ steps.bump_type.outputs.type }}
|
||||||
# echo the version to github env, the version is shown by using uv tool run bump-my-version show current_version
|
# echo the version to github env, the version is shown by using uv tool run bump-my-version show current_version
|
||||||
echo "VERSION<<EOF" >> $GITHUB_ENV
|
echo "VERSION<<EOF" >> $GITHUB_ENV
|
||||||
echo "$(uv tool run bump-my-version show current_version)" >> $GITHUB_ENV
|
echo "$(uv tool run bump-my-version show current_version)" >> $GITHUB_ENV
|
||||||
@@ -77,12 +104,12 @@ jobs:
|
|||||||
echo "tag=$prev" >> "$GITHUB_OUTPUT"
|
echo "tag=$prev" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- name: Compute lowercased image repo
|
- name: Compute lowercased image repo
|
||||||
if: ${{ github.event.inputs.docker_release == 'true' }}
|
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.docker_release == 'true' || github.event_name == 'pull_request' }}
|
||||||
run: |
|
run: |
|
||||||
echo "IMAGE_REPO=${{ secrets.REGISTRY }}/$(echo '${{ github.repository }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
|
echo "IMAGE_REPO=${{ secrets.REGISTRY }}/$(echo '${{ github.repository }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Docker meta
|
- name: Docker meta
|
||||||
if: ${{ github.event.inputs.docker_release == 'true' }}
|
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.docker_release == 'true' || github.event_name == 'pull_request' }}
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
@@ -92,12 +119,13 @@ jobs:
|
|||||||
type=raw,value=${{ env.VERSION }}
|
type=raw,value=${{ env.VERSION }}
|
||||||
|
|
||||||
- name: Build and push Docker image
|
- name: Build and push Docker image
|
||||||
if: ${{ github.event.inputs.docker_release == 'true' }}
|
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.docker_release == 'true' || github.event_name == 'pull_request' }}
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
push: true
|
push: true
|
||||||
|
no-cache: true
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
|
||||||
@@ -118,7 +146,7 @@ jobs:
|
|||||||
GITHUB_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||||
|
|
||||||
- name: Create Gitea Release
|
- name: Create Gitea Release
|
||||||
if: ${{ github.event.inputs.github_release == 'true' }}
|
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.github_release == 'true' || github.event_name == 'pull_request' }}
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
with:
|
with:
|
||||||
tag_name: v${{ env.VERSION }}
|
tag_name: v${{ env.VERSION }}
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ body {
|
|||||||
|
|
||||||
/* Layout */
|
/* Layout */
|
||||||
.container {
|
.container {
|
||||||
max-width: 1200px;
|
max-width: 1250px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
padding: 0 20px;
|
padding: 0 20px;
|
||||||
}
|
}
|
||||||
@@ -165,6 +165,7 @@ h2 {
|
|||||||
input[type="text"],
|
input[type="text"],
|
||||||
input[type="email"],
|
input[type="email"],
|
||||||
input[type="number"],
|
input[type="number"],
|
||||||
|
input[type="date"],
|
||||||
select,
|
select,
|
||||||
textarea {
|
textarea {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -178,6 +179,14 @@ textarea {
|
|||||||
font-family: inherit;
|
font-family: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Normalize date input appearance */
|
||||||
|
input[type="date"] {
|
||||||
|
-webkit-appearance: none;
|
||||||
|
appearance: none;
|
||||||
|
font-family: inherit;
|
||||||
|
/* Ensure text is legible and consistent */
|
||||||
|
}
|
||||||
|
|
||||||
textarea {
|
textarea {
|
||||||
resize: vertical;
|
resize: vertical;
|
||||||
min-height: 80px;
|
min-height: 80px;
|
||||||
@@ -231,6 +240,13 @@ input[type="radio"] { accent-color: var(--control-accent); }
|
|||||||
}
|
}
|
||||||
[data-theme="dark"] .btn-secondary:hover { background: #1f2b3f; }
|
[data-theme="dark"] .btn-secondary:hover { background: #1f2b3f; }
|
||||||
|
|
||||||
|
/* Generic disabled button state */
|
||||||
|
.btn:disabled {
|
||||||
|
opacity: 0.55;
|
||||||
|
cursor: not-allowed;
|
||||||
|
filter: grayscale(0.15);
|
||||||
|
}
|
||||||
|
|
||||||
.actions {
|
.actions {
|
||||||
margin-top: 16px;
|
margin-top: 16px;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -528,7 +544,8 @@ input[type="radio"] { accent-color: var(--control-accent); }
|
|||||||
top: 20px;
|
top: 20px;
|
||||||
right: 20px;
|
right: 20px;
|
||||||
background: var(--card-bg);
|
background: var(--card-bg);
|
||||||
border: 1px solid #22c55e;
|
border: 1px solid hsl(142, 82%, 30%);
|
||||||
|
background-color: hsl(142, 71%, 45%);
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
box-shadow: 0 10px 40px rgba(0,0,0,0.2);
|
box-shadow: 0 10px 40px rgba(0,0,0,0.2);
|
||||||
padding: 16px 20px;
|
padding: 16px 20px;
|
||||||
|
|||||||
@@ -84,7 +84,7 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-field">
|
<div class="form-field">
|
||||||
<label for="classname">Lehrveranstaltungsname</label>
|
<label for="classname">Veranstaltungsname</label>
|
||||||
<input type="text" name="classname" id="classname" required>
|
<input type="text" name="classname" id="classname" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-field">
|
<div class="form-field">
|
||||||
@@ -103,13 +103,13 @@
|
|||||||
|
|
||||||
<h2>Medien</h2>
|
<h2>Medien</h2>
|
||||||
<div class="media-controls">
|
<div class="media-controls">
|
||||||
<button type="button" class="btn btn-secondary" onclick="addMediaType('monografie')">
|
<button type="button" id="btn-monografie" class="btn btn-secondary" onclick="addMediaType('monografie')" title="Monografie Sektion hinzufügen">
|
||||||
<span class="mdi mdi-book"></span> + Monografie
|
<span class="mdi mdi-book"></span> + Monografie
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="btn btn-secondary" onclick="addMediaType('zeitschriftenartikel')">
|
<button type="button" id="btn-zeitschriftenartikel" class="btn btn-secondary" onclick="addMediaType('zeitschriftenartikel')" title="Zeitschriftenartikel Sektion hinzufügen">
|
||||||
<span class="mdi mdi-newspaper"></span> + Zeitschriftenartikel
|
<span class="mdi mdi-newspaper"></span> + Zeitschriftenartikel
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="btn btn-secondary" onclick="addMediaType('herausgeberwerk')">
|
<button type="button" id="btn-herausgeberwerk" class="btn btn-secondary" onclick="addMediaType('herausgeberwerk')" title="Herausgeberwerk Sektion hinzufügen">
|
||||||
<span class="mdi mdi-book-multiple"></span> + Herausgeberwerk
|
<span class="mdi mdi-book-multiple"></span> + Herausgeberwerk
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -173,6 +173,9 @@
|
|||||||
|
|
||||||
// Media management functions (global scope for onclick handlers)
|
// Media management functions (global scope for onclick handlers)
|
||||||
function addMediaType(type) {
|
function addMediaType(type) {
|
||||||
|
const btn = document.getElementById('btn-' + type);
|
||||||
|
// Prevent duplicate sections of same type
|
||||||
|
if (btn && btn.disabled) { return; }
|
||||||
const container = document.getElementById('media-sections');
|
const container = document.getElementById('media-sections');
|
||||||
const sectionId = 'section-' + sectionCounter++;
|
const sectionId = 'section-' + sectionCounter++;
|
||||||
|
|
||||||
@@ -188,7 +191,7 @@
|
|||||||
title = 'Monografie';
|
title = 'Monografie';
|
||||||
tableHtml = '<table class="data-table media-table" id="table-' + sectionId + '">' +
|
tableHtml = '<table class="data-table media-table" id="table-' + sectionId + '">' +
|
||||||
'<tr>' +
|
'<tr>' +
|
||||||
'<th>Autor (Nachname, Vorname)</th>' +
|
'<th>Autor<br>(Nachname, Vorname)</th>' +
|
||||||
'<th>Jahr</th>' +
|
'<th>Jahr</th>' +
|
||||||
'<th>Auflage</th>' +
|
'<th>Auflage</th>' +
|
||||||
'<th>Titel</th>' +
|
'<th>Titel</th>' +
|
||||||
@@ -202,7 +205,7 @@
|
|||||||
title = 'Zeitschriftenartikel';
|
title = 'Zeitschriftenartikel';
|
||||||
tableHtml = '<table class="data-table media-table" id="table-' + sectionId + '">' +
|
tableHtml = '<table class="data-table media-table" id="table-' + sectionId + '">' +
|
||||||
'<tr>' +
|
'<tr>' +
|
||||||
'<th>Autor (Nachname, Vorname)</th>' +
|
'<th>Autor<br>(Nachname, Vorname)</th>' +
|
||||||
'<th>Jahr</th>' +
|
'<th>Jahr</th>' +
|
||||||
'<th>Band</th>' +
|
'<th>Band</th>' +
|
||||||
'<th>Titel des Artikels</th>' +
|
'<th>Titel des Artikels</th>' +
|
||||||
@@ -217,11 +220,11 @@
|
|||||||
title = 'Herausgeberwerk';
|
title = 'Herausgeberwerk';
|
||||||
tableHtml = '<table class="data-table media-table" id="table-' + sectionId + '">' +
|
tableHtml = '<table class="data-table media-table" id="table-' + sectionId + '">' +
|
||||||
'<tr>' +
|
'<tr>' +
|
||||||
'<th>Herausgeber (Nachname, Vorname)</th>' +
|
'<th>Herausgeber<br>(Nachname, Vorname)</th>' +
|
||||||
'<th>Titel des Werks</th>' +
|
'<th>Titel des Werks</th>' +
|
||||||
'<th>Jahr</th>' +
|
'<th>Jahr</th>' +
|
||||||
'<th>Auflage</th>' +
|
'<th>Auflage</th>' +
|
||||||
'<th>Autor des Artikels (Nachname, Vorname)</th>' +
|
'<th>Autor des Artikels<br>(Nachname, Vorname)</th>' +
|
||||||
'<th>Titel des Artikels</th>' +
|
'<th>Titel des Artikels</th>' +
|
||||||
'<th>Signatur</th>' +
|
'<th>Signatur</th>' +
|
||||||
'<th>Seiten von</th>' +
|
'<th>Seiten von</th>' +
|
||||||
@@ -243,6 +246,11 @@
|
|||||||
'</button>';
|
'</button>';
|
||||||
|
|
||||||
container.appendChild(section);
|
container.appendChild(section);
|
||||||
|
// Disable button for this type until section removed
|
||||||
|
if (btn) {
|
||||||
|
btn.disabled = true;
|
||||||
|
btn.title = 'Sektion bereits hinzugefügt – entfernen zum erneuten Hinzufügen';
|
||||||
|
}
|
||||||
|
|
||||||
// Add first row automatically
|
// Add first row automatically
|
||||||
addMediaRow(sectionId, type);
|
addMediaRow(sectionId, type);
|
||||||
@@ -314,6 +322,7 @@
|
|||||||
const section = document.getElementById(sectionId);
|
const section = document.getElementById(sectionId);
|
||||||
if (section) {
|
if (section) {
|
||||||
if (confirm('Möchten Sie diese Sektion wirklich entfernen?')) {
|
if (confirm('Möchten Sie diese Sektion wirklich entfernen?')) {
|
||||||
|
const type = section.getAttribute('data-type');
|
||||||
// Clean up tracking for removed rows
|
// Clean up tracking for removed rows
|
||||||
const rows = section.querySelectorAll('tr[id]');
|
const rows = section.querySelectorAll('tr[id]');
|
||||||
rows.forEach(row => {
|
rows.forEach(row => {
|
||||||
@@ -323,6 +332,12 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
section.remove();
|
section.remove();
|
||||||
|
// Re-enable button for this media type
|
||||||
|
const btn = document.getElementById('btn-' + type);
|
||||||
|
if (btn) {
|
||||||
|
btn.disabled = false;
|
||||||
|
btn.title = 'Sektion hinzufügen';
|
||||||
|
}
|
||||||
updateSubmitButton();
|
updateSubmitButton();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "semapform"
|
name = "semapform"
|
||||||
version = "0.2.0"
|
version = "0.1.2"
|
||||||
description = "Add your description here"
|
description = "Add your description here"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.13"
|
requires-python = ">=3.13"
|
||||||
@@ -15,7 +15,7 @@ dependencies = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[tool.bumpversion]
|
[tool.bumpversion]
|
||||||
current_version = "0.2.0"
|
current_version = "0.1.2"
|
||||||
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
|
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
|
||||||
serialize = ["{major}.{minor}.{patch}"]
|
serialize = ["{major}.{minor}.{patch}"]
|
||||||
search = "{current_version}"
|
search = "{current_version}"
|
||||||
|
|||||||
Reference in New Issue
Block a user