From d34da9cc7ebedec5005ef69cf9c45f84e426332a Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Sun, 31 Mar 2019 04:13:40 +0200 Subject: [PATCH] [enh] support display_text --- src/js/yunohost/controllers/apps.js | 7 +++++++ src/views/app/app_install.ms | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/src/js/yunohost/controllers/apps.js b/src/js/yunohost/controllers/apps.js index b68a06aa..ba44a5e6 100644 --- a/src/js/yunohost/controllers/apps.js +++ b/src/js/yunohost/controllers/apps.js @@ -339,12 +339,14 @@ args[k].type = (typeof v.type !== 'undefined') ? v.type : 'string'; args[k].inputType = 'text'; args[k].isPassword = false; + args[k].isDisplayText = false; args[k].required = (typeof v.optional !== 'undefined' && v.optional == "true") ? '' : 'required'; args[k].attributes = ""; args[k].helpText = ""; args[k].helpLink = ""; + console.log(args[k]); // Multilingual label args[k].label = (typeof args[k].ask[y18n.locale] !== 'undefined') ? args[k].ask[y18n.locale] : @@ -460,6 +462,11 @@ args[k].isPassword = true; } + if (args[k].type == "display_text") { + args[k].isDisplayText = true; + args[k].label = args[k].label.split("\n"); + } + }); } diff --git a/src/views/app/app_install.ms b/src/views/app/app_install.ms index 4d4bc075..3a28ded8 100644 --- a/src/views/app/app_install.ms +++ b/src/views/app/app_install.ms @@ -39,6 +39,13 @@ {{#manifest.arguments.install}}
+ {{#if isDisplayText}} +
+ {{#label}} +

{{.}}

+ {{/label}} +
+ {{else}} @@ -68,6 +75,7 @@ {{/if}}
+ {{/if}} {{/manifest.arguments.install}}