4 Commits

Author SHA1 Message Date
Gitea CI
b0672d7fde Bump version: 0.2.1 → 0.2.2 2025-11-19 18:06:39 +00:00
fa21264ef3 Merge pull request 'small bugfix and color change' (#21) from dev into main
Reviewed-on: #21
2025-11-19 17:59:28 +00:00
0f934a6671 chore: switch colors
All checks were successful
Docker Build (PR) / Build Docker image (pull_request) Successful in 4m55s
2025-11-19 18:57:22 +01:00
d697c3e268 fix: allow only one instance of mediatype to be present 2025-11-19 18:57:09 +01:00
3 changed files with 29 additions and 7 deletions

View File

@@ -240,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;
@@ -537,8 +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 hsl(142, 71%, 45%); border: 1px solid hsl(142, 82%, 30%);
background-color: 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;

View File

@@ -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++;
@@ -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();
} }
} }

View File

@@ -1,6 +1,6 @@
[project] [project]
name = "semapform" name = "semapform"
version = "0.2.1" version = "0.2.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.1" current_version = "0.2.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}"