mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
[enh] support display_text
This commit is contained in:
parent
98744a822d
commit
d34da9cc7e
2 changed files with 15 additions and 0 deletions
|
@ -339,12 +339,14 @@
|
||||||
args[k].type = (typeof v.type !== 'undefined') ? v.type : 'string';
|
args[k].type = (typeof v.type !== 'undefined') ? v.type : 'string';
|
||||||
args[k].inputType = 'text';
|
args[k].inputType = 'text';
|
||||||
args[k].isPassword = false;
|
args[k].isPassword = false;
|
||||||
|
args[k].isDisplayText = false;
|
||||||
args[k].required = (typeof v.optional !== 'undefined' && v.optional == "true") ? '' : 'required';
|
args[k].required = (typeof v.optional !== 'undefined' && v.optional == "true") ? '' : 'required';
|
||||||
args[k].attributes = "";
|
args[k].attributes = "";
|
||||||
args[k].helpText = "";
|
args[k].helpText = "";
|
||||||
args[k].helpLink = "";
|
args[k].helpLink = "";
|
||||||
|
|
||||||
|
|
||||||
|
console.log(args[k]);
|
||||||
// Multilingual label
|
// Multilingual label
|
||||||
args[k].label = (typeof args[k].ask[y18n.locale] !== 'undefined') ?
|
args[k].label = (typeof args[k].ask[y18n.locale] !== 'undefined') ?
|
||||||
args[k].ask[y18n.locale] :
|
args[k].ask[y18n.locale] :
|
||||||
|
@ -460,6 +462,11 @@
|
||||||
args[k].isPassword = true;
|
args[k].isPassword = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (args[k].type == "display_text") {
|
||||||
|
args[k].isDisplayText = true;
|
||||||
|
args[k].label = args[k].label.split("\n");
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,13 @@
|
||||||
</div>
|
</div>
|
||||||
{{#manifest.arguments.install}}
|
{{#manifest.arguments.install}}
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
{{#if isDisplayText}}
|
||||||
|
<div class="col-sm-12">
|
||||||
|
{{#label}}
|
||||||
|
<p>{{.}}</p>
|
||||||
|
{{/label}}
|
||||||
|
</div>
|
||||||
|
{{else}}
|
||||||
<label for="{{name}}" class="col-sm-12">{{label}}</label>
|
<label for="{{name}}" class="col-sm-12">{{label}}</label>
|
||||||
|
|
||||||
|
|
||||||
|
@ -68,6 +75,7 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
{{/manifest.arguments.install}}
|
{{/manifest.arguments.install}}
|
||||||
<hr>
|
<hr>
|
||||||
|
|
Loading…
Reference in a new issue