feat: add guest-cta.tpl and lang strings

This commit is contained in:
Barış Soner Uşaklı
2026-02-12 11:51:14 -05:00
parent 1dcbcd7ca6
commit 9da67474c2
3 changed files with 30 additions and 3 deletions

View File

@@ -107,10 +107,10 @@
"nodebb-plugin-spam-be-gone": "2.3.2",
"nodebb-plugin-web-push": "0.7.6",
"nodebb-rewards-essentials": "1.0.2",
"nodebb-theme-harmony": "2.2.7",
"nodebb-theme-harmony": "2.2.8",
"nodebb-theme-lavender": "7.1.19",
"nodebb-theme-peace": "2.2.49",
"nodebb-theme-persona": "14.2.1",
"nodebb-theme-persona": "14.2.2",
"nodebb-widget-essentials": "7.0.42",
"nodemailer": "8.0.1",
"nprogress": "0.2.0",

View File

@@ -264,5 +264,10 @@
"thumb-image": "Topic thumbnail image",
"announcers": "Shares",
"announcers-x": "Shares (%1)"
"announcers-x": "Shares (%1)",
"guest-cta.title": "Hello! It looks like you're interested in this conversation, but you don't have an account yet.",
"guest-cta.message": "Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.",
"guest-cta.closing": "With your input, this post could be even better 💗"
}

View File

@@ -0,0 +1,22 @@
<div id="guest-cta-alert" class="alert alert-warning alert-dismissible fade show guest-cta-alert" role="alert">
<p><strong>[[topic:guest-cta.title]]</strong></p>
<p>[[topic:guest-cta.message]]</p>
<p>[[topic:guest-cta.closing]]</p>
<a href="{config.relative_path}/register" class="fw-semibold btn btn-sm btn-warning">[[global:register]]</a>
<a href="{config.relative_path}/login" class="fw-semibold btn btn-sm btn-info">[[global:login]]</a>
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
<script>
(() => {
const alertEl = document.getElementById('guest-cta-alert');
if (alertEl) {
if (sessionStorage.getItem('guestAlertDismissed')) {
alertEl.remove();
return;
}
alertEl.addEventListener('close.bs.alert', function () {
sessionStorage.setItem('guestAlertDismissed', 'true');
});
}
})();
</script>