-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ebf757f
commit 73e3f23
Showing
6 changed files
with
78 additions
and
66 deletions.
There are no files selected for viewing
113 changes: 60 additions & 53 deletions
113
packages/form-builder/addon/components/cfb-form-editor/question-usage.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,63 @@ | ||
<UkButton | ||
{{on "click" (fn (mut this.modalVisible) true)}} | ||
data-test-show-question-usage-modal-btn | ||
> | ||
{{t "caluma.form-builder.question.usage.button"}} | ||
</UkButton> | ||
{{#let this.forms.value as |forms|}} | ||
{{#if forms.length}} | ||
<a | ||
href="#" | ||
{{on "click" (fn (mut this.modalVisible) true)}} | ||
data-test-show-question-usage-modal-btn | ||
> | ||
{{this.title}} | ||
</a> | ||
{{else}} | ||
<span class="uk-text-muted">{{this.title}}</span> | ||
{{/if}} | ||
|
||
<UkModal | ||
@visible={{this.modalVisible}} | ||
@stack={{true}} | ||
@onHide={{fn (mut this.modalVisible) false}} | ||
data-test-question-usage-modal | ||
as |modal| | ||
> | ||
<modal.header> | ||
{{t "caluma.form-builder.question.usage.title"}} | ||
</modal.header> | ||
<modal.body> | ||
{{#if this.forms.isLoading}} | ||
<div class="uk-text-center"> | ||
<UkSpinner @ratio={{1}} /> | ||
</div> | ||
{{else}} | ||
<ul class="uk-list uk-list-divider" id="question-list"> | ||
{{#each this.forms.value as |form|}} | ||
<li data-test-question-form-item={{form.node.slug}}> | ||
<div class="uk-flex uk-flex-middle"> | ||
<span class="uk-width-expand"> | ||
<LinkTo @route="edit" @model={{form.node.slug}}> | ||
{{form.node.name}} | ||
</LinkTo> | ||
</span> | ||
<UkModal | ||
@visible={{this.modalVisible}} | ||
@stack={{true}} | ||
@onHide={{fn (mut this.modalVisible) false}} | ||
data-test-question-usage-modal | ||
as |modal| | ||
> | ||
<modal.header> | ||
{{this.title}} | ||
</modal.header> | ||
<modal.body> | ||
{{#if this.forms.isLoading}} | ||
<div class="uk-text-center"> | ||
<UkSpinner /> | ||
</div> | ||
{{else}} | ||
<ul class="uk-list uk-list-divider"> | ||
{{#each this.forms.value as |form|}} | ||
<li data-test-question-form-item={{form.node.slug}}> | ||
<div class="uk-flex uk-flex-middle"> | ||
<span class="uk-width-expand"> | ||
<LinkTo @route="edit" @model={{form.node.slug}}> | ||
{{form.node.name}} | ||
</LinkTo> | ||
</span> | ||
|
||
{{#if form.node.isArchived}} | ||
<UkBadge> | ||
{{t "caluma.form-builder.form.isArchived"}} | ||
</UkBadge> | ||
{{/if}} | ||
{{#if form.node.isArchived}} | ||
<UkBadge> | ||
{{t "caluma.form-builder.form.isArchived"}} | ||
</UkBadge> | ||
{{/if}} | ||
|
||
{{#unless form.node.isPublished}} | ||
<UkBadge class="uk-margin-small-left"> | ||
{{t "caluma.form-builder.question.usage.not-published"}} | ||
</UkBadge> | ||
{{/unless}} | ||
</div> | ||
<div class="uk-text-muted uk-text-small">{{form.node.slug}}</div> | ||
</li> | ||
{{else}} | ||
<li class="uk-text-muted"> | ||
{{t "caluma.form-builder.question.usage.no-forms-found"}} | ||
</li> | ||
{{/each}} | ||
</ul> | ||
{{/if}} | ||
</modal.body> | ||
</UkModal> | ||
{{#unless form.node.isPublished}} | ||
<UkBadge class="uk-margin-small-left"> | ||
{{t "caluma.form-builder.question.usage.not-published"}} | ||
</UkBadge> | ||
{{/unless}} | ||
</div> | ||
<div class="uk-text-muted uk-text-small">{{form.node.slug}}</div> | ||
</li> | ||
{{else}} | ||
<li class="uk-text-muted"> | ||
{{t "caluma.form-builder.question.usage.no-forms-found"}} | ||
</li> | ||
{{/each}} | ||
</ul> | ||
{{/if}} | ||
</modal.body> | ||
</UkModal> | ||
{{/let}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters