open-vault/ui/lib/core/addon/components/field-group-show.hbs

40 lines
1.5 KiB
Handlebars

<div class="box is-fullwidth is-sideless is-paddingless is-marginless">
{{#each @model.fieldGroups as |fieldGroup|}}
{{#each-in fieldGroup as |group fields|}}
{{#if (or (eq group "default") (eq group "Options"))}}
{{#each fields as |attr|}}
{{#if (not (includes attr.options.fieldValue (array "id" "mutableId")))}}
<InfoTableRow
@alwaysRender={{@showAllFields}}
@label={{capitalize (or attr.options.label (humanize (dasherize attr.name)))}}
>
{{#if attr.options.sensitive}}
<span class="is-help">This value is sensitive and cannot be shown.</span>
{{else}}
{{get @model attr.name}}
{{/if}}
</InfoTableRow>
{{/if}}
{{/each}}
{{else}}
<div class="box {{unless @showAllFields 'is-shadowless'}} is-fullwidth is-sideless is-marginless">
<h2 class="title is-5">
{{group}}
</h2>
{{#each fields as |attr|}}
<InfoTableRow
@alwaysRender={{@showAllFields}}
@label={{capitalize (or attr.options.label (humanize (dasherize attr.name)))}}
>
{{#if attr.options.sensitive}}
<span class="is-help">This value is sensitive and cannot be shown.</span>
{{else}}
{{get @model attr.name}}
{{/if}}
</InfoTableRow>
{{/each}}
</div>
{{/if}}
{{/each-in}}
{{/each}}
</div>