ci: use Gitea API for releases #2

Closed
adrianbonpin wants to merge 56 commits from feat/ismis-helper into prod
Showing only changes of commit 161f540e40 - Show all commits
+9 -6
View File
@@ -185,7 +185,8 @@
if (header.program) page.drawText(compactProgram(header.program), { x: 338, y, size: 9, font, color: black }); if (header.program) page.drawText(compactProgram(header.program), { x: 338, y, size: 9, font, color: black });
if (yearLevelText) { if (yearLevelText) {
const w = font.widthOfTextAtSize(yearLevelText, 9); const w = font.widthOfTextAtSize(yearLevelText, 9);
page.drawText(yearLevelText, { x: margin + contentWidth - w, y, size: 9, font, color: black }); // Right-aligned to the content edge, nudged left ~12pt (~1rem).
page.drawText(yearLevelText, { x: margin + contentWidth - w - 12, y, size: 9, font, color: black });
} }
if (header.studentId || header.fullName || header.program || yearLevelText) y -= 14.5; if (header.studentId || header.fullName || header.program || yearLevelText) y -= 14.5;
@@ -209,7 +210,7 @@
const widths = {}; const widths = {};
for (const c of cols) { for (const c of cols) {
const key = c.label.toUpperCase().replace(/\s+/g, '_'); const key = c.label.toUpperCase().replace(/\s+/g, '_');
widths[key] = bold.widthOfTextAtSize(c.label, headerSize); widths[key] = font.widthOfTextAtSize(c.label, headerSize);
} }
return { return {
GROUP: cols[0].x, GROUP: cols[0].x,
@@ -236,7 +237,8 @@
} }
function drawRow(cells, isHeader) { function drawRow(cells, isHeader) {
const f = isHeader ? bold : font; // Header labels and data all use the body font (header is not bold).
const f = font;
const size = isHeader ? headerSize : cellSize; const size = isHeader ? headerSize : cellSize;
const linesPerCol = rowLines(cells); const linesPerCol = rowLines(cells);
@@ -288,8 +290,9 @@
let ty = y; let ty = y;
for (const line of lines) { for (const line of lines) {
if (c.key === 'units') { if (c.key === 'units') {
// Center unit values under the UNITS header, matching the reference.
const w = f.widthOfTextAtSize(line, size); const w = f.widthOfTextAtSize(line, size);
page.drawText(line, { x: c.x + c.w - w, y: ty, size, font: f, color: black }); page.drawText(line, { x: c.x + (c.w - w) / 2, y: ty, size, font: f, color: black });
} else if (c.key === 'status') { } else if (c.key === 'status') {
page.drawText(line, { x: c.x + 35, y: ty, size, font: f, color: black }); page.drawText(line, { x: c.x + 35, y: ty, size, font: f, color: black });
} else { } else {
@@ -336,12 +339,12 @@
} }
y -= 12; y -= 12;
if (data.totalUnits) { if (data.totalUnits) {
// Total sits under the UNITS column, right-aligned within it. // Total sits under the UNITS column, centered within it (matches reference).
const unitsCol = cols[4]; const unitsCol = cols[4];
const w = bold.widthOfTextAtSize(data.totalUnits, 8); const w = bold.widthOfTextAtSize(data.totalUnits, 8);
// Short underline above the total, spanning the UNITS column. // Short underline above the total, spanning the UNITS column.
hline(unitsCol.x, unitsCol.x + unitsCol.w, y + 9); hline(unitsCol.x, unitsCol.x + unitsCol.w, y + 9);
page.drawText(data.totalUnits, { x: unitsCol.x + unitsCol.w - w, y, size: 8, font: bold, color: black }); page.drawText(data.totalUnits, { x: unitsCol.x + (unitsCol.w - w) / 2, y, size: 8, font: bold, color: black });
y -= 12; y -= 12;
} }
hline(margin, margin + contentWidth, y); hline(margin, margin + contentWidth, y);