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,99 +30,107 @@ 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.col-12.col-sm-4.cp-anon-user',[
h('div.container',[ h('div.card',[
h('center', h('h1', Msg.features_title)), h('div.card-body',[
h('h3.text-center',Msg.features_anon)
]),
h('div.card-body.cp-pricing',[
h('div.text-center', '0€'),
h('div.text-center', Msg.features_noData),
]),
h('ul.list-group.list-group-flush',
['apps', 'core', 'file0', 'cryptdrive0', 'storage0'].map(function (f) {
return h('li.list-group-item', [
h('div.cp-check'),
h('div.cp-content', [
h('div.cp-feature', Msg['features_f_' + f]),
h('div.cp-note', Msg['features_f_' + f + '_note'])
])
]);
})
),
]), ]),
]), ]);
h('div.container',[ var registeredFeatures =
h('div.row.cp-container.cp-features-web.justify-content-sm-center',[ h('div.col-12.col-sm-4.cp-regis-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',[ h('h3.text-center',Msg.features_registered)
h('h3.text-center',Msg.features_anon) ]),
]), h('div.card-body.cp-pricing',[
h('div.card-body.cp-pricing',[ h('div.text-center', '0€'),
h('div.text-center', '0€'), h('div.text-center', Msg.features_noData),
h('div.text-center', Msg.features_noData), ]),
]), h('ul.list-group.list-group-flush', [
h('ul.list-group.list-group-flush', ['anon', 'social', 'file1', 'cryptdrive1', 'devices', 'storage1'].map(function (f) {
['apps', 'core', 'file0', 'cryptdrive0', 'storage0'].map(function (f) { return h('li.list-group-item', [
return h('li.list-group-item', [ h('div.cp-check'),
h('div.cp-check'), h('div.cp-content', [
h('div.cp-content', [ h('div.cp-feature', Msg['features_f_' + f]),
h('div.cp-feature', Msg['features_f_' + f]), h('div.cp-note', Msg['features_f_' + f + '_note'])
h('div.cp-note', Msg['features_f_' + f + '_note']) ])
]) ]);
]); }),
})
),
]),
]), ]),
h('div.col-12.col-sm-4.cp-regis-user',[ h('div.card-body',[
h('div.card',[ h('div.cp-features-register#cp-features-register', [
h('div.card-body',[ h('a', {
h('h3.text-center',Msg.features_registered) href: '/register/'
]), }, h('button.cp-features-register-button', Msg.features_f_register))
h('div.card-body.cp-pricing',[
h('div.text-center', '0€'),
h('div.text-center', Msg.features_noData),
]),
h('ul.list-group.list-group-flush', [
['anon', 'social', 'file1', 'cryptdrive1', 'devices', 'storage1'].map(function (f) {
return h('li.list-group-item', [
h('div.cp-check'),
h('div.cp-content', [
h('div.cp-feature', Msg['features_f_' + f]),
h('div.cp-note', Msg['features_f_' + f + '_note'])
])
]);
}),
]),
h('div.card-body',[
h('div.cp-features-register#cp-features-register', [
h('a', {
href: '/register/'
}, h('button.cp-features-register-button', Msg.features_f_register))
]),
h('div.cp-note', Msg.features_f_register_note)
]),
]), ]),
h('div.cp-note', Msg.features_f_register_note)
]), ]),
h('div.col-12.col-sm-4.cp-anon-user',[ ]),
h('div.card',[ ]);
h('div.card-body',[ var premiumFeatures =
h('h3.text-center',Msg.features_premium) h('div.col-12.col-sm-4.cp-anon-user',[
]), h('div.card',[
h('div.card-body.cp-pricing',[ h('div.card-body',[
h('div.text-center', h('a', { h('h3.text-center',Msg.features_premium)
href: accounts.upgradeURL, ]),
target: '_blank' h('div.card-body.cp-pricing',[
}, Msg._getKey('features_pricing', ['5', '10', '15']))), h('div.text-center', h('a', {
h('div.text-center', Msg.features_emailRequired), href: accounts.upgradeURL,
]), target: '_blank'
h('ul.list-group.list-group-flush', [ }, Msg._getKey('features_pricing', ['5', '10', '15']))),
['reg', 'storage2', 'support', 'supporter'].map(function (f) { h('div.text-center', Msg.features_emailRequired),
return h('li.list-group-item', [ ]),
h('div.cp-check'), h('ul.list-group.list-group-flush', [
h('div.cp-content', [ ['reg', 'storage2', 'support', 'supporter'].map(function (f) {
h('div.cp-feature', Msg['features_f_' + f]), return h('li.list-group-item', [
h('div.cp-note', Msg['features_f_' + f + '_note']) h('div.cp-check'),
]) h('div.cp-content', [
]); h('div.cp-feature', Msg['features_f_' + f]),
}), h('div.cp-note', Msg['features_f_' + f + '_note'])
]), ])
h('div.card-body',[ ]);
h('div.cp-features-register#cp-features-subscribe', [ }),
premiumButton ]),
]), h('div.card-body',[
LocalStore.isLoggedIn() ? undefined : h('div.cp-note', Msg.features_f_subscribe_note) h('div.cp-features-register#cp-features-subscribe', [
]), premiumButton
]), ]),
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