From 6ca376a675efacbfa250c27f3be30ecba3cba7f0 Mon Sep 17 00:00:00 2001 From: bruno Date: Wed, 8 Jul 2026 10:53:32 -0400 Subject: [PATCH] fix: JS syntax error in renderCardDetail breaking all interactivity Root cause: operator precedence bug with stray ')' in: '...+(card.priority||"Medium")===p?"selected":"")+'>... The ')+' created an unmatched parenthesis, causing SyntaxError that stopped ALL JS event handlers (dblclick, drag-drop, buttons). Fix: replaced string concatenation with template literals ('') throughout renderCardDetail, eliminating escape/quoting issues. --- app/templates/board.html | 56 ++++++++++++++++++++++++++-------------- 1 file changed, 37 insertions(+), 19 deletions(-) diff --git a/app/templates/board.html b/app/templates/board.html index e316545..d5b5e16 100644 --- a/app/templates/board.html +++ b/app/templates/board.html @@ -253,25 +253,43 @@ function renderCardDetail(owner, repo, data) { const issue = data.issue || {}, comments = data.comments || [], checklists = data.checklists || [], card = data.card || {}; window._issueData = {owner, repo, issue, comments, checklists, card}; - let h = ''; - h += '
'+issue.state+' '+escHtml(issue.title||'')+'
'; - h += '
'; - (issue.labels||[]).forEach(l => h += ''+escHtml(l.name)+''); - if (issue.milestone) h += '📅 '+escHtml(issue.milestone.title)+''; - if (issue.assignee) h += '👤 '+escHtml(issue.assignee.login)+''; - h += '
'; - h += '
'; - h += '

Description

'+escHtml(issue.body||'')+'
'; - h += renderChecklists(owner, repo, issue.number, checklists); - h += '

Commentaires ('+comments.length+')

'; - comments.forEach(c => h += '
'+escHtml(c.user?.login||'')+''+(c.created_at||'').substr(0,10)+'
'+escHtml(c.body||'')+'
'); - h += '
'; - h += '
🔗 Ouvrir dans Gitea'; - h += ''; - h += '
'; - return h; + + const labelsHtml = (issue.labels || []).map(l => + `${escHtml(l.name)}` + ).join(''); + + const prio = card.priority || 'Medium'; + const prioOpts = ['Low','Medium','High','Urgent'].map(p => + `` + ).join(''); + + return ` +
${issue.state} ${escHtml(issue.title||'')}
+
+ ${labelsHtml} + ${issue.milestone ? '📅 '+escHtml(issue.milestone.title)+'' : ''} + ${issue.assignee ? '👤 '+escHtml(issue.assignee.login)+'' : ''} +
+
+ + +
+

Description

${escHtml(issue.body||'')}
+ ${renderChecklists(owner, repo, issue.number, checklists)} +

Commentaires (${comments.length})

+ ${comments.map(c => ` +
+ + ${escHtml(c.user?.login||'')} + ${(c.created_at||'').substr(0,10)} +
${escHtml(c.body||'')}
+
`).join('')} +
+
+ 🔗 Ouvrir dans Gitea + + +
`; } function renderChecklists(owner, repo, issueId, checklists) {