diff options
-rwxr-xr-x | cli.js | 10 | ||||
-rw-r--r-- | zeitung/main.tex | 3 | ||||
-rw-r--r-- | zeitung/parts/studenttemplate.tex | 30 |
3 files changed, 29 insertions, 14 deletions
@@ -90,9 +90,11 @@ if ((idx = params.indexOf("-r")) > -1) { // Be aware, I'm a longtime rhyme primer db.dump().then((data) => { data.users.forEach(async (user) => { - hay = data.profile.filter((e) => e.user_id === user.id); + const curr = data.profile.filter((e) => e.user_id === user.id); + const next = data.profile.filter((e) => e.user_id === user.id - 1); const comments = user.comments; const chars = user.chars; + hay = curr; const obj = { id: user.id - 1, // Why tf tho name: `${user.name} ${user.middlename || ""} ${user.surname}`, @@ -109,6 +111,12 @@ if ((idx = params.indexOf("-r")) > -1) { obj.birthday = new Date(obj.birthday == "nichts" ? "1.1.2000" : obj.birthday).toLocaleDateString("de"); + // QR-Code.. DON'T ASK + hay = next; + obj.qrcode = answer("QR-Code Text (z.B. Social Media Links, random Text, whatever)"); + if (obj.qrcode === "nichts") obj.qrcode = ""; + hay = curr; + // 5head let textex = ""; Object.keys(obj).forEach((elem) => { diff --git a/zeitung/main.tex b/zeitung/main.tex index 1dc284a..6e0b0e0 100644 --- a/zeitung/main.tex +++ b/zeitung/main.tex @@ -14,7 +14,8 @@ \usepackage{background} \usepackage{changepage} \usepackage{tabularx} -\usepackage{pgf-pie} +\usepackage{pgf-pie,qrcode} +\usepackage{etoolbox} % Font % TODO: Colored emojis? (very hard) \setmainfont[Path=./fonts/]{tierra-nueva.otf}[BoldFont=tierra-nueva-bold.otf] diff --git a/zeitung/parts/studenttemplate.tex b/zeitung/parts/studenttemplate.tex index 148c1c8..ade08b6 100644 --- a/zeitung/parts/studenttemplate.tex +++ b/zeitung/parts/studenttemplate.tex @@ -25,27 +25,28 @@ \ifoddpage\else \def\ringx{-\paperwidth - 325pt} % ringwidth + 2 * ringx % Nope, idk anymore \fi -\AddToShipoutPictureBG*{ - \AtTextUpperLeft{ - \put(-\ringx + \ringoffset, -\ringy + \ringoffset){ - \dfincludegraphics[keepaspectratio=true, width=\ringimgwidth]{parts/generated/students/figures/bornerma.jpg} - } - \put(-\ringx, -\ringy){ - \includegraphics[keepaspectratio=true, width=\ringwidth]{ring.png} - } - } -} -% Frame +% Frame and QR-Code \def\framex{160pt} \def\framey{20pt} \def\framewidth{180pt} \def\frameimgwidth{160pt} \def\frameoffset{(\framewidth - \frameimgwidth) / 2} +\def\qrcodex{90pt} \ifoddpage\else \def\framex{540pt} % paperwidth - framewidth / 2 % Nope, idk anymore + \def\qrcodex{470pt} \fi -\AddToShipoutPictureBG*{ + +\AddToShipoutPictureFG*{ + \AtTextUpperLeft{ + \put(-\ringx + \ringoffset, -\ringy + \ringoffset){ + \dfincludegraphics[keepaspectratio=true, width=\ringimgwidth]{parts/generated/students/figures/bornerma.jpg} + } + \put(-\ringx, -\ringy){ + \includegraphics[keepaspectratio=true, width=\ringwidth]{ring.png} + } + } \AtTextLowerLeft{ \put(\textwidth - \framex + \frameoffset, \framey + \frameoffset + 8pt){ \dfincludegraphics[keepaspectratio=true, width=\frameimgwidth]{parts/generated/students/figures/child_\stdid.jpg} @@ -53,6 +54,11 @@ \put(\textwidth - \framex, \framey){ \oddflip[keepaspectratio=true, width=\framewidth]{rahmen.png} } + \put(\textwidth - \qrcodex, \framey - 25pt){ + \ifdefempty{\stdqrcode}{}{ + \qrcode[nolink, height=0.7in]{\stdqrcode} + } + } } } |