feat: přidáno URL pole pro bloky – klikatelný odkaz v PDF
Some checks failed
Build & Push Docker / build (push) Has been cancelled
Some checks failed
Build & Push Docker / build (push) Has been cancelled
- Block model: nové volitelné pole 'url' (Optional[str]) - Frontend: URL input v modálu pro přidání/editaci bloku - PDF generátor: c.linkURL() – celý blok je klikatelný odkaz - sample.json: ukázkový blok s URL - index.html: dokumentace URL pole - .github/copilot-instructions.md: přidány Copilot instrukce
This commit is contained in:
@@ -193,6 +193,7 @@ const App = {
|
||||
document.getElementById('modalBlockEnd').value = block.end || '';
|
||||
document.getElementById('modalBlockResponsible').value = block.responsible || '';
|
||||
document.getElementById('modalBlockNotes').value = block.notes || '';
|
||||
document.getElementById('modalBlockUrl').value = block.url || '';
|
||||
|
||||
this._populateTypeSelect(block.type_id);
|
||||
this._populateDaySelect(block.date);
|
||||
@@ -222,6 +223,7 @@ const App = {
|
||||
document.getElementById('modalBlockEnd').value = end || '10:00';
|
||||
document.getElementById('modalBlockResponsible').value = '';
|
||||
document.getElementById('modalBlockNotes').value = '';
|
||||
document.getElementById('modalBlockUrl').value = '';
|
||||
|
||||
this._populateTypeSelect(null);
|
||||
this._populateDaySelect(date);
|
||||
@@ -312,6 +314,7 @@ const App = {
|
||||
const end = document.getElementById('modalBlockEnd').value;
|
||||
const responsible = document.getElementById('modalBlockResponsible').value.trim() || null;
|
||||
const notes = document.getElementById('modalBlockNotes').value.trim() || null;
|
||||
const url = document.getElementById('modalBlockUrl').value.trim() || null;
|
||||
|
||||
const timeRe = /^\d{2}:\d{2}$/;
|
||||
if (!title) { this.toast('Zadejte název bloku', 'error'); return; }
|
||||
@@ -324,7 +327,7 @@ const App = {
|
||||
if (idx !== -1) {
|
||||
const existing = this.state.blocks[idx];
|
||||
Object.assign(this.state.blocks[idx], {
|
||||
date, title, type_id, start, end, responsible, notes,
|
||||
date, title, type_id, start, end, responsible, notes, url,
|
||||
series_id: existing.series_id || null
|
||||
});
|
||||
}
|
||||
@@ -336,14 +339,14 @@ const App = {
|
||||
const series_id = this.uid();
|
||||
const dates = this.getDates();
|
||||
for (const d of dates) {
|
||||
this.state.blocks.push({ id: this.uid(), date: d, title, type_id, start, end, responsible, notes, series_id });
|
||||
this.state.blocks.push({ id: this.uid(), date: d, title, type_id, start, end, responsible, notes, url, series_id });
|
||||
}
|
||||
document.getElementById('blockModal').classList.add('hidden');
|
||||
this.renderCanvas();
|
||||
this.toast(`Blok přidán do ${dates.length} dnů`, 'success');
|
||||
return;
|
||||
} else {
|
||||
this.state.blocks.push({ id: this.uid(), date, title, type_id, start, end, responsible, notes, series_id: null });
|
||||
this.state.blocks.push({ id: this.uid(), date, title, type_id, start, end, responsible, notes, url, series_id: null });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user