openvibers/openvibe.host Commits
Host: the promotions page says what will appear there and under which rules (#81)
Changes
@@@ -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; }@@@ -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>`;}
@@ -47,6 +47,9 @@
@@ -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 { 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 p { margin: .3rem 0; }
.hc-empty strong { color: var(--hs-fg); }
.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-more { margin: 1rem 0; }
.hc-links { margin: 1.25rem 0; color: var(--hs-muted); }
.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; }
.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; }
@@ -152,10 +152,18 @@ ${p.code ? `<p class="hc-code">Code <code>${esc(p.code)}</code></p>` : ''}
@@ -152,10 +152,18 @@ ${p.code ? `<p class="hc-code">Code <code>${esc(p.code)}</code></p>` : ''}
</li>`).join('')}</ul>`;
</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) {
function promos(list) {
return `<header class="hc-head"><p class="hc-eyebrow">OpenVibe.Host · hosting compared</p><h1>Hosting promotions</h1>
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>
<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>` : ''}
${list.some((p) => p.affiliate) ? `<p class="hc-disclosure">${esc(DISCLOSURE)}</p>` : ''}
<p class="hc-links">${link('/catalog', '← Compare plans')}</p>`;
<p class="hc-links">${link('/catalog', '← Compare plans')}</p>`;
}
}