openvibers/openvibe.host Commits

Host: the promotions page says what will appear there and under which rules (#81)

OP OpenVibers committed 12 Oct 2026 · f4af86c8d9 · 2 files, +12 −1

With no promotion running, `/catalog/promos` showed a single line. It now explains what will appear there and under which rules: the offer, code and end date as the provider states them, linked to the provider's page; the day it was checked; ended offers dropped; affiliate links marked and never reordering. It links to the plan comparison and the providers. Provider pages keep their short empty line.

The catalog-public and perf-budget tests pass.

Changes

ddiff --git a/public/css/catalog.css b/public/css/catalog.css
iindex d9268fe..70a70bd 100644
---- a/public/css/catalog.css
++++ b/public/css/catalog.css
@@@ -47,6 +47,9 @@
.hc-empty { padding: 1.5rem; border: 1px dashed var(--hs-line); border-radius: 12px; text-align: center; color: var(--hs-muted); }
.hc-empty p { margin: .3rem 0; }
.hc-empty strong { color: var(--hs-fg); }
++.hc-empty-rich { text-align: left; max-width: 46rem; }
++.hc-rules { margin: .4rem 0 .8rem; padding-left: 1.2rem; }
++.hc-rules li { margin: .25rem 0; }
.hc-more { margin: 1rem 0; }
.hc-links { margin: 1.25rem 0; color: var(--hs-muted); }
.hc-disclosure { margin: 1.25rem 0; padding: .7rem .9rem; border-radius: 8px; background: var(--hs-card); border-left: 3px solid var(--hs-warn); color: var(--hs-muted); font-size: 14px; }
ddiff --git a/server/render/catalog.js b/server/render/catalog.js
iindex de6b74a..a469440 100644
---- a/server/render/catalog.js
++++ b/server/render/catalog.js
@@@ -152,10 +152,18 @@ ${p.code ? `<p class="hc-code">Code <code>${esc(p.code)}</code></p>` : ''}
</li>`).join('')}</ul>`;
}
++// With nothing running, the page says what will appear here and under which rules, rather than one bare line.
++const PROMO_RULES = `<div class="hc-empty hc-empty-rich"><p><strong>No promotion is running right now.</strong></p>
++<p>When a provider runs one, it is listed here with:</p>
++<ul class="hc-rules"><li>the offer, code and end date exactly as the provider states them, linked to the provider's own page;</li>
++<li>the day it was checked, and nothing after it ends: an ended offer drops off by itself;</li>
++<li>affiliate links marked beside the link, never changing the order.</li></ul>
++<p>${link('/catalog', 'Compare every plan')} · ${link('/providers', 'See the providers')}</p></div>`;
++
function promos(list) {
return `<header class="hc-head"><p class="hc-eyebrow">OpenVibe.Host · hosting compared</p><h1>Hosting promotions</h1>
<p class="hc-lede">Offers running now, with their codes and end dates as the provider states them. An ended offer drops off by itself.</p></header>
--${promoCards(list)}
++${list.length ? promoCards(list) : PROMO_RULES}
${list.some((p) => p.affiliate) ? `<p class="hc-disclosure">${esc(DISCLOSURE)}</p>` : ''}
<p class="hc-links">${link('/catalog', '← Compare plans')}</p>`;
}