List premium features only with subscriptions

pull/1/head
Alexander Dietrich 5 years ago
parent e58dfbabd4
commit c500549048

@ -4,8 +4,9 @@ define([
'/customize/messages.js', '/customize/messages.js',
'/customize/application_config.js', '/customize/application_config.js',
'/common/outer/local-store.js', '/common/outer/local-store.js',
'/customize/pages.js' '/customize/pages.js',
], function ($, h, Msg, AppConfig, LocalStore, Pages) { '/api/config',
], function ($, h, Msg, AppConfig, LocalStore, Pages, Config) {
var origin = encodeURIComponent(window.location.hostname); var origin = encodeURIComponent(window.location.hostname);
var accounts = { var accounts = {
donateURL: 'https://accounts.cryptpad.fr/#/donate?on=' + origin, donateURL: 'https://accounts.cryptpad.fr/#/donate?on=' + origin,
@ -29,15 +30,8 @@ define([
sessionStorage.redirectTo = '/features.html'; sessionStorage.redirectTo = '/features.html';
window.location.href = '/login/'; window.location.href = '/login/';
});*/ });*/
return h('div#cp-main', [
Pages.infopageTopbar(), var anonymousFeatures =
h('div.container-fluid.cp_cont_features',[
h('div.container',[
h('center', h('h1', Msg.features_title)),
]),
]),
h('div.container',[
h('div.row.cp-container.cp-features-web.justify-content-sm-center',[
h('div.col-12.col-sm-4.cp-anon-user',[ h('div.col-12.col-sm-4.cp-anon-user',[
h('div.card',[ h('div.card',[
h('div.card-body',[ h('div.card-body',[
@ -59,7 +53,8 @@ define([
}) })
), ),
]), ]),
]), ]);
var registeredFeatures =
h('div.col-12.col-sm-4.cp-regis-user',[ h('div.col-12.col-sm-4.cp-regis-user',[
h('div.card',[ h('div.card',[
h('div.card-body',[ h('div.card-body',[
@ -89,7 +84,8 @@ define([
h('div.cp-note', Msg.features_f_register_note) h('div.cp-note', Msg.features_f_register_note)
]), ]),
]), ]),
]), ]);
var premiumFeatures =
h('div.col-12.col-sm-4.cp-anon-user',[ h('div.col-12.col-sm-4.cp-anon-user',[
h('div.card',[ h('div.card',[
h('div.card-body',[ h('div.card-body',[
@ -120,8 +116,21 @@ define([
LocalStore.isLoggedIn() ? undefined : h('div.cp-note', Msg.features_f_subscribe_note) LocalStore.isLoggedIn() ? undefined : h('div.cp-note', Msg.features_f_subscribe_note)
]), ]),
]), ]),
]);
var availableFeatures =
Config.allowSubscriptions ?
[anonymousFeatures, registeredFeatures, premiumFeatures] :
[anonymousFeatures, registeredFeatures];
return h('div#cp-main', [
Pages.infopageTopbar(),
h('div.container-fluid.cp_cont_features',[
h('div.container',[
h('center', h('h1', Msg.features_title)),
]), ]),
]), ]),
h('div.container', [
h('div.row.cp-container.cp-features-web.justify-content-sm-center', availableFeatures),
]), ]),
Pages.infopageFooter() Pages.infopageFooter()
]); ]);

Loading…
Cancel
Save