diff --git a/web/scripts/dev_run.sh b/web/scripts/dev_run.sh index 8aa8a8f..5a1ec1d 100755 --- a/web/scripts/dev_run.sh +++ b/web/scripts/dev_run.sh @@ -48,7 +48,7 @@ PADDLE_ENVIRONMENT=${PADDLE_ENVIRONMENT:-sandbox} # -- Preparation ------------------------------------------------------------- info "Resetting database" -rm -f "$DATABASE_PATH" +rm -f "$DATABASE_PATH" "${DATABASE_PATH}-shm" "${DATABASE_PATH}-wal" ok "Removed $DATABASE_PATH" info "Running migrations" diff --git a/web/src/padelnomics/admin/templates/admin/articles.html b/web/src/padelnomics/admin/templates/admin/articles.html index 5d744ca..bf9990d 100644 --- a/web/src/padelnomics/admin/templates/admin/articles.html +++ b/web/src/padelnomics/admin/templates/admin/articles.html @@ -108,6 +108,15 @@ function toggleArticleSelect(id, checked) { 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() { articleSelectedIds.clear(); document.querySelectorAll('.article-checkbox').forEach(function(cb) { cb.checked = false; }); @@ -152,7 +161,12 @@ function submitArticleBulk() { document.body.addEventListener('htmx:afterSwap', function(evt) { if (evt.detail.target.id === 'article-results') { 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)); + } }); } }); diff --git a/web/src/padelnomics/admin/templates/admin/partials/article_group_row.html b/web/src/padelnomics/admin/templates/admin/partials/article_group_row.html index c4f3c5f..1110395 100644 --- a/web/src/padelnomics/admin/templates/admin/partials/article_group_row.html +++ b/web/src/padelnomics/admin/templates/admin/partials/article_group_row.html @@ -1,5 +1,9 @@ - + + +
{{ g.title }}
{{ g.url_path }}
diff --git a/web/src/padelnomics/admin/templates/admin/partials/article_results.html b/web/src/padelnomics/admin/templates/admin/partials/article_results.html index 4f8a14a..3aa1048 100644 --- a/web/src/padelnomics/admin/templates/admin/partials/article_results.html +++ b/web/src/padelnomics/admin/templates/admin/partials/article_results.html @@ -57,7 +57,7 @@ {% if not grouped %} {% else %} - + {% endif %} Title {% if grouped %}Variants{% else %}Status{% endif %}