mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
Merge pull request #234 from YunoHost/display_text
[enh] support display_text
This commit is contained in:
commit
46e6ccf74e
2 changed files with 14 additions and 1 deletions
|
@ -339,12 +339,12 @@
|
||||||
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 = "";
|
||||||
|
|
||||||
|
|
||||||
// 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 +460,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