From 2bc01319047b4a26885208b415d24f99d3a63048 Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 18 Oct 2021 15:43:14 +0200 Subject: [PATCH] Add early access message on pad creation screen --- customize.dist/src/less2/include/creation.less | 3 +++ www/common/common-ui-elements.js | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/customize.dist/src/less2/include/creation.less b/customize.dist/src/less2/include/creation.less index b15863c57..1449a341a 100644 --- a/customize.dist/src/less2/include/creation.less +++ b/customize.dist/src/less2/include/creation.less @@ -115,6 +115,9 @@ } } } + .cp-creation-early { + max-width: 80%; + } .cp-creation-create { justify-content: center; diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 12e77708b..8bd4c07ea 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -2302,6 +2302,10 @@ define([ //$creation.append(h('h2.cp-creation-title', Messages.newButtonTitle)); var newPadH3Title = Messages._getKey('creation_new',[Messages.type[type]]); + var early = common.checkRestrictedApp(type); + var domain = Config.httpUnsafeOrigin || 'CryptPad'; + if (/^http/.test(domain)) { domain = domain.replace(/^https?\:\/\//, ''); } + var title = h('div.cp-creation-title', [ UI.getFileIcon({type: type})[0], h('div.cp-creation-title-text', [ @@ -2310,6 +2314,12 @@ define([ ]) ]); $creation.append(title); + + if (early === 1) { + $creation.append(h('div.cp-creation-early.alert.alert-warning', Messages._getKey('premiumAccess', [ + domain + ]))); + } //var colorClass = 'cp-icon-color-'+type; //$creation.append(h('h2.cp-creation-title.'+colorClass, Messages.newButtonTitle));