Hide pad creation screen features if it is disabled in app config

pull/1/head
yflory 7 years ago
parent b01d00f74a
commit db0d2e161c

@ -803,7 +803,7 @@ define(function () {
// Properties about creation data // Properties about creation data
out.creation_owners = "Propriétaires"; out.creation_owners = "Propriétaires";
out.creation_ownedByOther = "Possédé par un autre utilisateur"; out.creation_ownedByOther = "Possédé par un autre utilisateur";
out.creation_noOwner = "Pad de propriétaire"; out.creation_noOwner = "Pas de propriétaire";
out.creation_expiration = "Date d'expiration"; out.creation_expiration = "Date d'expiration";
out.creation_propertiesTitle = "Disponibilité"; out.creation_propertiesTitle = "Disponibilité";
out.creation_appMenuName = "Mode avancé (Ctrl + E)"; out.creation_appMenuName = "Mode avancé (Ctrl + E)";

@ -933,14 +933,21 @@ define([
content: $('<div>').append(UI.getIcon(p)).html() + Messages.type[p] content: $('<div>').append(UI.getIcon(p)).html() + Messages.type[p]
}); });
}); });
pads_options.push({ if (Config.displayCreationScreen) {
tag: 'a', pads_options.push({
attributes: { tag: 'a',
id: 'cp-app-toolbar-creation-advanced', attributes: {
href: origin id: 'cp-app-toolbar-creation-advanced',
}, href: origin
content: '<span class="fa fa-plus-circle"></span> ' + Messages.creation_appMenuName },
}); content: '<span class="fa fa-plus-circle"></span> ' + Messages.creation_appMenuName
});
$(window).keydown(function (e) {
if (e.which === 69 && e.ctrlKey) {
Common.createNewPadModal();
}
});
}
var dropdownConfig = { var dropdownConfig = {
text: '', // Button initial text text: '', // Button initial text
options: pads_options, // Entries displayed in the menu options: pads_options, // Entries displayed in the menu

@ -9,6 +9,7 @@ define([
'/common/common-hash.js', '/common/common-hash.js',
'/customize/messages.js', '/customize/messages.js',
'/common/hyperscript.js', '/common/hyperscript.js',
'/customize/application_config.js',
'/bower_components/file-saver/FileSaver.min.js', '/bower_components/file-saver/FileSaver.min.js',
'css!/bower_components/bootstrap/dist/css/bootstrap.min.css', 'css!/bower_components/bootstrap/dist/css/bootstrap.min.css',
@ -24,7 +25,8 @@ define([
Util, Util,
Hash, Hash,
Messages, Messages,
h h,
AppConfig
) )
{ {
var saveAs = window.saveAs; var saveAs = window.saveAs;
@ -65,6 +67,10 @@ define([
] ]
}; };
if (!AppConfig.dislayCreationScreen) {
delete categories.creation;
}
var create = {}; var create = {};
// Account settings // Account settings

Loading…
Cancel
Save