Compare commits

..

2 Commits

Author SHA1 Message Date
Deeman
6e3c5554aa fix(admin): enable bulk actions in grouped articles view
All checks were successful
CI / test (push) Successful in 54s
CI / tag (push) Successful in 3s
- dev_run.sh: also remove app.db-shm and app.db-wal on reset to fix
  SQLite disk I/O error from stale WAL/SHM files
- articles bulk: add checkboxes to grouped rows (data-ids holds all
  variant IDs); checking a group selects EN+DE together
- restore select-all checkbox in grouped <th>
- add toggleArticleGroupSelect() JS function
- fix htmx:afterSwap to re-check group checkboxes correctly

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-05 09:48:54 +01:00
Deeman
ad02140594 fix(quote): add missing required asterisk and error hint to step 4
All checks were successful
CI / test (push) Successful in 54s
CI / tag (push) Successful in 3s
Step 4 (Project Phase) required location_status server-side but had no
visual "*" indicator and no error message when submitting without a
selection. All other steps already had both.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 22:21:57 +01:00
7 changed files with 26 additions and 5 deletions

View File

@@ -48,7 +48,7 @@ PADDLE_ENVIRONMENT=${PADDLE_ENVIRONMENT:-sandbox}
# -- Preparation ------------------------------------------------------------- # -- Preparation -------------------------------------------------------------
info "Resetting database" info "Resetting database"
rm -f "$DATABASE_PATH" rm -f "$DATABASE_PATH" "${DATABASE_PATH}-shm" "${DATABASE_PATH}-wal"
ok "Removed $DATABASE_PATH" ok "Removed $DATABASE_PATH"
info "Running migrations" info "Running migrations"

View File

@@ -108,6 +108,15 @@ function toggleArticleSelect(id, checked) {
updateArticleBulkBar(); updateArticleBulkBar();
} }
function toggleArticleGroupSelect(checkbox) {
var ids = (checkbox.dataset.ids || '').split(',').map(Number).filter(Boolean);
ids.forEach(function(id) {
if (checkbox.checked) articleSelectedIds.add(id);
else articleSelectedIds.delete(id);
});
updateArticleBulkBar();
}
function clearArticleSelection() { function clearArticleSelection() {
articleSelectedIds.clear(); articleSelectedIds.clear();
document.querySelectorAll('.article-checkbox').forEach(function(cb) { cb.checked = false; }); document.querySelectorAll('.article-checkbox').forEach(function(cb) { cb.checked = false; });
@@ -152,7 +161,12 @@ function submitArticleBulk() {
document.body.addEventListener('htmx:afterSwap', function(evt) { document.body.addEventListener('htmx:afterSwap', function(evt) {
if (evt.detail.target.id === 'article-results') { if (evt.detail.target.id === 'article-results') {
document.querySelectorAll('.article-checkbox').forEach(function(cb) { document.querySelectorAll('.article-checkbox').forEach(function(cb) {
if (articleSelectedIds.has(Number(cb.dataset.id))) cb.checked = true; if (cb.dataset.ids) {
var ids = cb.dataset.ids.split(',').map(Number).filter(Boolean);
cb.checked = ids.length > 0 && ids.every(function(id) { return articleSelectedIds.has(id); });
} else {
cb.checked = articleSelectedIds.has(Number(cb.dataset.id));
}
}); });
} }
}); });

View File

@@ -1,5 +1,9 @@
<tr id="article-group-{{ g.url_path | replace('/', '-') | trim('-') }}"> <tr id="article-group-{{ g.url_path | replace('/', '-') | trim('-') }}">
<td></td> <td onclick="event.stopPropagation()">
<input type="checkbox" class="article-checkbox"
data-ids="{{ g.variants | map(attribute='id') | join(',') }}"
onchange="toggleArticleGroupSelect(this)">
</td>
<td style="max-width:260px"> <td style="max-width:260px">
<div style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500" title="{{ g.url_path }}">{{ g.title }}</div> <div style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500" title="{{ g.url_path }}">{{ g.title }}</div>
<div class="article-subtitle">{{ g.url_path }}</div> <div class="article-subtitle">{{ g.url_path }}</div>

View File

@@ -57,7 +57,7 @@
{% if not grouped %} {% if not grouped %}
<th style="width:32px"><input type="checkbox" id="article-select-all" onchange="document.querySelectorAll('.article-checkbox').forEach(cb => { cb.checked = this.checked; toggleArticleSelect(Number(cb.dataset.id), this.checked); })"></th> <th style="width:32px"><input type="checkbox" id="article-select-all" onchange="document.querySelectorAll('.article-checkbox').forEach(cb => { cb.checked = this.checked; toggleArticleSelect(Number(cb.dataset.id), this.checked); })"></th>
{% else %} {% else %}
<th style="width:32px"></th> <th style="width:32px"><input type="checkbox" id="article-select-all" onchange="document.querySelectorAll('.article-checkbox').forEach(cb => { cb.checked = this.checked; toggleArticleGroupSelect(cb); })"></th>
{% endif %} {% endif %}
<th>Title</th> <th>Title</th>
<th>{% if grouped %}Variants{% else %}Status{% endif %}</th> <th>{% if grouped %}Variants{% else %}Status{% endif %}</th>

View File

@@ -8,7 +8,8 @@
<p class="q-step-sub">{{ t.q4_subheading }}</p> <p class="q-step-sub">{{ t.q4_subheading }}</p>
<div class="q-field-group"> <div class="q-field-group">
<span class="q-label">{{ t.q4_phase_label }}</span> <span class="q-label">{{ t.q4_phase_label }} <span class="required">*</span></span>
{% if 'location_status' in errors %}<p class="q-error-hint">{{ t.q4_error_phase }}</p>{% endif %}
<div class="q-pills"> <div class="q-pills">
{% for val, label in [('still_searching', t.q4_phase_searching), ('location_found', t.q4_phase_found), ('converting_existing', t.q4_phase_converting), ('lease_signed', t.q4_phase_lease_signed), ('permit_not_filed', t.q4_phase_permit_not_filed), ('permit_pending', t.q4_phase_permit_pending), ('permit_granted', t.q4_phase_permit_granted)] %} {% for val, label in [('still_searching', t.q4_phase_searching), ('location_found', t.q4_phase_found), ('converting_existing', t.q4_phase_converting), ('lease_signed', t.q4_phase_lease_signed), ('permit_not_filed', t.q4_phase_permit_not_filed), ('permit_pending', t.q4_phase_permit_pending), ('permit_granted', t.q4_phase_permit_granted)] %}
<label><input type="radio" name="location_status" value="{{ val }}" {{ 'checked' if data.get('location_status') == val }}><span class="q-pill">{{ label }}</span></label> <label><input type="radio" name="location_status" value="{{ val }}" {{ 'checked' if data.get('location_status') == val }}><span class="q-pill">{{ label }}</span></label>

View File

@@ -428,6 +428,7 @@
"q4_phase_permit_not_filed": "Baugenehmigung noch nicht beantragt", "q4_phase_permit_not_filed": "Baugenehmigung noch nicht beantragt",
"q4_phase_permit_pending": "Baugenehmigung in Bearbeitung", "q4_phase_permit_pending": "Baugenehmigung in Bearbeitung",
"q4_phase_permit_granted": "Baugenehmigung erteilt", "q4_phase_permit_granted": "Baugenehmigung erteilt",
"q4_error_phase": "Bitte wähle Deine Projektphase aus.",
"q5_heading": "Zeitplan", "q5_heading": "Zeitplan",
"q5_subheading": "Wann möchtest Du beginnen?", "q5_subheading": "Wann möchtest Du beginnen?",
"q5_timeline_label": "Zeitplan", "q5_timeline_label": "Zeitplan",

View File

@@ -428,6 +428,7 @@
"q4_phase_permit_not_filed": "Permit not yet filed", "q4_phase_permit_not_filed": "Permit not yet filed",
"q4_phase_permit_pending": "Permit in progress", "q4_phase_permit_pending": "Permit in progress",
"q4_phase_permit_granted": "Permit approved", "q4_phase_permit_granted": "Permit approved",
"q4_error_phase": "Please select your project phase.",
"q5_heading": "Timeline", "q5_heading": "Timeline",
"q5_subheading": "When do you want to get started?", "q5_subheading": "When do you want to get started?",
"q5_timeline_label": "Timeline", "q5_timeline_label": "Timeline",