Skip to content

Node.js based forum software built for the modern web

feat: add guest-cta.tpl and lang strings

Barış Soner Uşaklı9da67474c221
diff --git a/install/package.json b/install/package.json
index 3dfb3c936a..2d40f2a9e6 100644
--- a/install/package.json
+++ b/install/package.json
@@ -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",
diff --git a/public/language/en-GB/topic.json b/public/language/en-GB/topic.json
index 47197c5235..d7533b80f3 100644
--- a/public/language/en-GB/topic.json
+++ b/public/language/en-GB/topic.json
@@ -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 💗"
+
}
diff --git a/src/views/partials/topic/guest-cta.tpl b/src/views/partials/topic/guest-cta.tpl
new file mode 100644
index 0000000000..506cabc82f
--- /dev/null
+++ b/src/views/partials/topic/guest-cta.tpl
@@ -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>
\ No newline at end of file