add block-error and block-empty components to centralize some bulma markup
This commit is contained in:
parent
7e1268e3ef
commit
439287b88f
2
ui/app/components/block-empty.js
Normal file
2
ui/app/components/block-empty.js
Normal file
|
@ -0,0 +1,2 @@
|
|||
import OuterHTML from './outer-html';
|
||||
export default OuterHTML.extend();
|
2
ui/app/components/block-error.js
Normal file
2
ui/app/components/block-error.js
Normal file
|
@ -0,0 +1,2 @@
|
|||
import OuterHTML from './outer-html';
|
||||
export default OuterHTML.extend();
|
11
ui/app/templates/components/block-empty.hbs
Normal file
11
ui/app/templates/components/block-empty.hbs
Normal file
|
@ -0,0 +1,11 @@
|
|||
<div class="box is-bottomless has-background-white-bis">
|
||||
<div class="columns is-centered">
|
||||
<div class="column is-half has-text-centered">
|
||||
<div class="box is-shadowless has-background-white-bis">
|
||||
<p class="has-text-grey">
|
||||
{{yield}}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
3
ui/app/templates/components/block-error.hbs
Normal file
3
ui/app/templates/components/block-error.hbs
Normal file
|
@ -0,0 +1,3 @@
|
|||
<div class="box is-sideless has-background-white-bis has-text-grey has-text-centered">
|
||||
{{yield}}
|
||||
</div>
|
|
@ -46,27 +46,19 @@
|
|||
</div>
|
||||
{{/each}}
|
||||
{{else}}
|
||||
<div class="box is-bottomless has-background-white-bis">
|
||||
<div class="columns is-centered">
|
||||
<div class="column is-half has-text-centered">
|
||||
<div class="box is-shadowless has-background-white-bis">
|
||||
<p class="has-text-grey">
|
||||
{{#if (eq baseKey.id '')}}
|
||||
There are currently no {{pluralize options.item}} in this backend.
|
||||
{{else}}
|
||||
{{#if filterIsFolder}}
|
||||
{{#if (eq filter baseKey.id)}}
|
||||
There are no {{pluralize options.item}} under <code>{{or filter}}</code>.
|
||||
{{else}}
|
||||
We couldn't find a folder matching <code>{{filter}}</code>.
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<BlockEmpty>
|
||||
{{#if (eq baseKey.id '')}}
|
||||
There are currently no {{pluralize options.item}} in this backend.
|
||||
{{else}}
|
||||
{{#if filterIsFolder}}
|
||||
{{#if (eq filter baseKey.id)}}
|
||||
There are no {{pluralize options.item}} under <code>{{or filter}}</code>.
|
||||
{{else}}
|
||||
We couldn't find a folder matching <code>{{filter}}</code>.
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</BlockEmpty>
|
||||
{{/if}}
|
||||
{{/with}}
|
||||
{{#if (gt model.meta.lastPage 1) }}
|
||||
|
|
|
@ -21,14 +21,14 @@
|
|||
</h1>
|
||||
</p.levelLeft>
|
||||
</PageHeader>
|
||||
<div class="box is-sideless has-background-white-bis has-text-grey has-text-centered">
|
||||
<BlockError>
|
||||
{{#if model.message}}
|
||||
<p>{{model.message}}</p>
|
||||
{{/if}}
|
||||
{{#each model.errors as |error|}}
|
||||
<p>{{error}}</p>
|
||||
{{/each}}
|
||||
</div>
|
||||
</BlockError>
|
||||
{{/if}}
|
||||
</div>
|
||||
</section>
|
||||
|
|
Loading…
Reference in a new issue