Merge branch 'variable-features' into staging

This commit is contained in:
ansuz 2021-01-19 04:09:02 +05:30
commit 4dfb91b1e0

View file

@ -28,7 +28,7 @@ define([
// Msg.features_f_cryptdrive0 = "";
// Msg.features_f_cryptdrive0_note = "";
// Msg.features_f_storage0 = "";
Msg.features_f_storage0_note = "Documents are deleted after 3 months of inactivity";
Msg.features_f_storage0_note = "Documents are deleted after {0} days of inactivity";
// Registered column
Msg.features_registered = "Registered"; //
// Msg.features_f_anon = "";
@ -36,14 +36,12 @@ define([
Msg.features_f_social = "Social Features";
Msg.features_f_social_note = "Add contacts for secure collaboration, create a profile, fine-grained access controls";
// Msg.features_f_file1 = "";
// XXX add instance limit
Msg.features_f_file1_note = "Store files in your CryptDrive: images, PDFs, videos, and more. Share them with your contacts or embed them in your documents. (up to 25MB)";
Msg.features_f_file1_note = "Store files in your CryptDrive: images, PDFs, videos, and more. Share them with your contacts or embed them in your documents. (up to {0}MB)";
// Msg.features_f_cryptdrive1 = "";
// Msg.features_f_cryptdrive1_note = "";
// Msg.features_f_devices = "";
// Msg.features_f_devices_note = "";
// XXX add instance limit
Msg.features_f_storage1 = "Permanent Storage (1GB)";
Msg.features_f_storage1 = "Permanent Storage ({0}GB)";
Msg.features_f_storage1_note = "Documents stored in your CryptDrive are never deleted for inactivity";
// Premium column
Msg.features_premium = "Premium";
@ -51,7 +49,7 @@ define([
// Msg.features_f_reg = ""
Msg.features_f_reg_note = "With additional benefits";
// Msg.features_f_storage2 = ""
Msg.features_f_storage2_note = "From 5GB to 50GB depending on the plan. Increased limit of 150MB for file uploads.";
Msg.features_f_storage2_note = "From 5GB to 50GB depending on the plan. Increased limit of {0}MB for file uploads.";
// Msg.features_f_support = ""
Msg.features_f_support_note = "Priority response from the administration team via email and built in ticket system.";
Msg.features_f_supporter = "Support privacy";
@ -69,6 +67,53 @@ define([
rel: 'noopener noreferrer'
}, h('button.cp-features-register-button', Msg.features_f_subscribe));
var groupItemTemplate = function (title, content) {
return h('li.list-group-item', [
h('div.cp-check'),
h('div.cp-content', [
h('div.cp-feature', title),
h('div.cp-note', content),
])
]);
};
var defaultGroupItem = function (key) {
return groupItemTemplate(
Msg['features_f_' + key],
Msg['features_f_' + key + '_note']
);
};
var SPECIAL_GROUP_ITEMS = {};
SPECIAL_GROUP_ITEMS.storage0 = function (f) {
return groupItemTemplate(
Msg['features_f_' + f],
Msg._getKey('features_f_' + f + '_note', [Config.inactiveTime])
);
};
SPECIAL_GROUP_ITEMS.file1 = function (f) {
return groupItemTemplate(
Msg['features_f_' + f],
Msg._getKey('features_f_' + f + '_note', [Config.maxUploadSize / 1024 / 1024])
);
};
SPECIAL_GROUP_ITEMS.storage1 = function (f) {
return groupItemTemplate(
Msg._getKey('features_f_' + f, [Config.defaultStorageLimit / 1024 / 1024]),
Msg['features_f_' + f + '_note']
);
};
SPECIAL_GROUP_ITEMS.storage2 = function (f) {
return groupItemTemplate(
Msg['features_f_' + f],
Msg._getKey('features_f_' + f + '_note', [Config.premiumUploadSize / 1024 / 1024])
);
};
var groupItem = function (key) {
return (SPECIAL_GROUP_ITEMS[key] || defaultGroupItem)(key);
};
var anonymousFeatures =
h('div.col-12.col-sm-4.cp-anon-user',[
h('div.card',[
@ -79,17 +124,7 @@ define([
h('div.text-center', '0€'),
h('div.text-center', Msg.features_noData),
]),
h('ul.list-group.list-group-flush',
['apps', 'file0', 'core', '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('ul.list-group.list-group-flush', ['apps', 'file0', 'core', 'cryptdrive0', 'storage0'].map(groupItem)),
]),
]);
@ -103,17 +138,7 @@ define([
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('ul.list-group.list-group-flush', ['anon', 'social', 'file1', 'cryptdrive1', 'devices', 'storage1'].map(groupItem)),
h('div.card-body',[
h('div.cp-features-register#cp-features-register', [
h('a', {
@ -136,19 +161,7 @@ define([
}, Msg._getKey('features_pricing', ['5', '10', '15']))),
h('div.text-center', Msg.features_emailRequired),
]),
h('ul.list-group.list-group-flush', [
['reg', 'storage2', 'support', 'supporter'].map(function (f) {
console.log('features_f_' + f);
console.log('features_f_' + f + '_note');
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('ul.list-group.list-group-flush', ['reg', 'storage2', 'support', 'supporter'].map(groupItem)),
h('div.card-body',[
h('div.cp-features-register#cp-features-subscribe', [
premiumButton