Rifiniture (M8): avvisi su striscia, notifiche di Windows e Telegram con controllo dello spazio su disco; «Esporta l'elenco» della libreria; avvisi e ricette sospese in Attività; guida per il wiki in docs/guida
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Mzbb6zeFTjT6Rp8b92AVkA
This commit is contained in:
50 files changed
+3980
-28
No files matched your search
@@ -1,5 +1,6 @@
|
||||
// Libreria (mockup 01, spec §4.6): every entry by publication day, filters by kind, account, period and provenance,
|
||||
// search by account name and caption, tile size, multiple selection to export or delete, viewer on click.
|
||||
// «Esporta l'elenco» in the tools row exports what the filter shows (spec §4.8: CSV with «;», UTF-8 with BOM).
|
||||
|
||||
import { api, download, withCarried } from '../core/api.js';
|
||||
import { caps } from '../core/context.js';
|
||||
@@ -91,6 +92,8 @@ export default {
|
||||
const size = local.get('libreria.tessere', 160);
|
||||
const slider = h('input.cursore', { type: 'range', min: '96', max: '300', step: '4', value: String(size), 'aria-label': t('libreria.grandezza') });
|
||||
const selectButton = h('button.btn', { type: 'button', 'aria-pressed': 'false' }, icon('circle-check'), h('span', t('libreria.seleziona')));
|
||||
// Icon only, like the tile size: the row of the mockup has no room for one more label.
|
||||
const exportButton = h('button.btn.nudo.piccolo.solo-icona.solo-largo', { type: 'button', title: t('libreria.esportaAiuto'), 'aria-label': t('libreria.esporta') }, icon('file-down'));
|
||||
// Probable duplicates after a download wait for Alberto (spec §9.5): a short link to their review.
|
||||
const duplicates = h('a.btn.nudo.piccolo.doppioni-link', { href: withCarried('/doppioni'), hidden: true });
|
||||
api('/api/duplicates/count', { signal: page.signal }).then((counts) => {
|
||||
@@ -104,6 +107,7 @@ export default {
|
||||
filtersButton,
|
||||
h('div.destra',
|
||||
duplicates,
|
||||
exportButton,
|
||||
h('div.grandezza.solo-largo', { title: t('libreria.grandezza') }, icon('grid-3x3', 's'), slider, icon('square', 's')),
|
||||
selectButton)));
|
||||
|
||||
@@ -287,6 +291,7 @@ export default {
|
||||
}
|
||||
|
||||
selectButton.addEventListener('click', () => setSelecting(!mosaic.selecting));
|
||||
exportButton.addEventListener('click', () => exportFiltered());
|
||||
|
||||
async function exportSelected() {
|
||||
try {
|
||||
@@ -297,6 +302,18 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
async function exportFiltered() {
|
||||
exportButton.disabled = true;
|
||||
try {
|
||||
await download('/api/entries/export', { query: apiQuery(state, today()) }, 'febe-elementi.csv');
|
||||
toast(t(filtersActive() ? 'libreria.esportatoFiltro' : 'libreria.esportato'));
|
||||
} catch (error) {
|
||||
showError(error);
|
||||
} finally {
|
||||
exportButton.disabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
async function deleteSelected() {
|
||||
const ids = [...mosaic.selected];
|
||||
const removed = await confirmDelete(ids);
|
||||
|
||||
Reference in new issue
Block a user