# Code Request — Version UI in Server Matrix Body **Filed by:** Chronicler #88 **Date:** 2026-04-14 **Priority:** Medium **Context:** Pre-launch, defer until stable --- ## Background Chronicler #88 added modpack version tracking infrastructure today: - `current_version` column on `server_config` - `server_version_history` table (version, who, when) - `POST /admin/servers/:id/set-version` route - `GET /admin/servers/:id/version-history` route - Helper JS functions `saveVersion()`, `toggleVersionForm()`, `hideVersionForm()` in `servers/index.ejs` The UI addition to `_matrix_body.ejs` kept breaking EJS due to single quotes inside ternary expressions inside HTML attributes. The file was reverted to clean state. This task is to add the version UI properly. --- ## What To Add At the bottom of each server card in `_matrix_body.ejs` (there are TWO loops — TX1 and NC1), add a version display section BEFORE the closing ``. The tricky part: avoid single quotes inside `<%= %>` tags that are inside HTML attributes. Use a local variable assignment instead: ```ejs <% var currentVersion = config && config.current_version ? config.current_version : null; %>
📦 Installed Version
<%= currentVersion || 'Not set' %>
``` --- ## Key Rule **Never put single quotes inside `<%= %>` tags that are inside HTML attribute values.** Use `<% var x = ...; %>` to assign first, then `<%= x %>` in the attribute. --- ## Validation After adding, run this on the Dev Panel to verify EJS compiles: ```bash cd /opt/mod-builds/firefrost-services/services/arbiter-3.0 node -e "const ejs = require('ejs'); const fs = require('fs'); try { ejs.compile(fs.readFileSync('src/views/admin/servers/_matrix_body.ejs', 'utf8')); console.log('EJS OK'); } catch(e) { console.log('ERROR:', e.message); }" ``` Must print `EJS OK` before committing. --- ## Files To Edit - `services/arbiter-3.0/src/views/admin/servers/_matrix_body.ejs` Do NOT touch `_server_card.ejs` or `index.ejs` — those are fine. --- **Fire + Frost + Foundation** 💙🔥❄️