2021-06-07 18:11:46 +00:00
|
|
|
{{#each @model.fieldGroups as |fieldGroup|}}
|
|
|
|
{{#each-in fieldGroup as |group fields|}}
|
|
|
|
{{#if (eq group "default")}}
|
|
|
|
{{#each fields as |attr|}}
|
2021-12-17 03:44:29 +00:00
|
|
|
{{! template-lint-configure simple-unless "warn" }}
|
2021-06-07 18:11:46 +00:00
|
|
|
{{#unless (and (not-eq @mode "create") (eq attr.name "name"))}}
|
2021-12-17 03:44:29 +00:00
|
|
|
<FormField data-test-field={{true}} @attr={{attr}} @model={{@model}} />
|
2021-06-07 18:11:46 +00:00
|
|
|
{{/unless}}
|
|
|
|
{{/each}}
|
|
|
|
{{else}}
|
2021-12-17 03:44:29 +00:00
|
|
|
<ToggleButton
|
2021-06-07 18:11:46 +00:00
|
|
|
@class="is-block"
|
2021-12-17 03:44:29 +00:00
|
|
|
@toggleAttr={{camelize (concat "show" group)}}
|
|
|
|
@toggleTarget={{@model}}
|
2021-06-07 18:11:46 +00:00
|
|
|
@openLabel={{concat "Hide " group}}
|
|
|
|
@closedLabel={{group}}
|
2021-12-17 03:44:29 +00:00
|
|
|
@data-test-toggle-group={{group}}
|
2021-06-07 18:11:46 +00:00
|
|
|
/>
|
2021-12-17 03:44:29 +00:00
|
|
|
{{#if (get @model (camelize (concat "show" group)))}}
|
2021-06-07 18:11:46 +00:00
|
|
|
<div class="box is-marginless">
|
|
|
|
{{#each fields as |attr|}}
|
2021-12-17 03:44:29 +00:00
|
|
|
<FormField data-test-field={{true}} @attr={{attr}} @model={{@model}} />
|
2021-06-07 18:11:46 +00:00
|
|
|
{{/each}}
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
{{/if}}
|
|
|
|
{{/each-in}}
|
2021-12-17 03:44:29 +00:00
|
|
|
{{/each}}
|