add block-error and block-empty components to centralize some bulma markup

This commit is contained in:
Matthew Irish 2018-10-09 23:37:28 -05:00
parent 7e1268e3ef
commit 439287b88f
6 changed files with 33 additions and 23 deletions

View file

@ -0,0 +1,2 @@
import OuterHTML from './outer-html';
export default OuterHTML.extend();

View file

@ -0,0 +1,2 @@
import OuterHTML from './outer-html';
export default OuterHTML.extend();

View 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>

View file

@ -0,0 +1,3 @@
<div class="box is-sideless has-background-white-bis has-text-grey has-text-centered">
{{yield}}
</div>

View file

@ -46,27 +46,19 @@
</div> </div>
{{/each}} {{/each}}
{{else}} {{else}}
<div class="box is-bottomless has-background-white-bis"> <BlockEmpty>
<div class="columns is-centered"> {{#if (eq baseKey.id '')}}
<div class="column is-half has-text-centered"> There are currently no {{pluralize options.item}} in this backend.
<div class="box is-shadowless has-background-white-bis"> {{else}}
<p class="has-text-grey"> {{#if filterIsFolder}}
{{#if (eq baseKey.id '')}} {{#if (eq filter baseKey.id)}}
There are currently no {{pluralize options.item}} in this backend. There are no {{pluralize options.item}} under <code>{{or filter}}</code>.
{{else}} {{else}}
{{#if filterIsFolder}} We couldn't find a folder matching <code>{{filter}}</code>.
{{#if (eq filter baseKey.id)}} {{/if}}
There are no {{pluralize options.item}} under <code>{{or filter}}</code>. {{/if}}
{{else}} {{/if}}
We couldn't find a folder matching <code>{{filter}}</code>. </BlockEmpty>
{{/if}}
{{/if}}
{{/if}}
</p>
</div>
</div>
</div>
</div>
{{/if}} {{/if}}
{{/with}} {{/with}}
{{#if (gt model.meta.lastPage 1) }} {{#if (gt model.meta.lastPage 1) }}

View file

@ -21,14 +21,14 @@
</h1> </h1>
</p.levelLeft> </p.levelLeft>
</PageHeader> </PageHeader>
<div class="box is-sideless has-background-white-bis has-text-grey has-text-centered"> <BlockError>
{{#if model.message}} {{#if model.message}}
<p>{{model.message}}</p> <p>{{model.message}}</p>
{{/if}} {{/if}}
{{#each model.errors as |error|}} {{#each model.errors as |error|}}
<p>{{error}}</p> <p>{{error}}</p>
{{/each}} {{/each}}
</div> </BlockError>
{{/if}} {{/if}}
</div> </div>
</section> </section>