diff --git a/nodejs-project/nodejs-project/src/views/main_views.js b/nodejs-project/nodejs-project/src/views/main_views.js index 9415223f..5b5a4df6 100644 --- a/nodejs-project/nodejs-project/src/views/main_views.js +++ b/nodejs-project/nodejs-project/src/views/main_views.js @@ -1095,6 +1095,38 @@ const template = (titlePrefix, ...elements) => { exports.template = template; +exports.tribeAccessDeniedView = (tribe) => { + const tribeName = tribe && !tribe.isAnonymous ? tribe.title : ""; + return template( + i18n.tribeContentAccessDenied, + div({ class: "div-center" }, + h2(i18n.tribeContentAccessDenied), + p(i18n.tribeContentAccessDeniedMsg), + tribeName ? p({ class: "tribe-access-name" }, tribeName) : null, + div({ class: "visit-btn-centered" }, + a({ href: "/tribes", class: "filter-btn" }, i18n.tribeViewTribes) + ) + ) + ); +}; + +exports.inviteRequiredView = (kind, tribe) => { + const msg = kind === 'pad' ? (i18n.tribePadInviteRequired || 'You do not have access to the pad. Ask for an invitation to access the content.') + : kind === 'chat' ? (i18n.tribeChatInviteRequired || 'You do not have access to the chat. Ask for an invitation to access the content.') + : (i18n.tribeContentAccessDeniedMsg); + const backHref = tribe ? `/tribe/${encodeURIComponent(tribe.id)}?section=${kind === 'chat' ? 'chats' : 'pads'}` : (kind === 'chat' ? '/chats' : '/pads'); + return template( + i18n.tribeContentAccessDenied, + div({ class: "div-center" }, + h2(i18n.tribeContentAccessDenied), + p(msg), + div({ class: "visit-btn-centered" }, + a({ href: backHref, class: "filter-btn" }, i18n.walletBack || "Back") + ) + ) + ); +}; + const thread = (messages) => { let lookingForTarget = true; let shallowest = Infinity;