mirror of
https://github.com/documize/community.git
synced 2025-07-28 17:49:41 +02:00
detecte non-block mode and hide messaging
This commit is contained in:
parent
03402d9e4d
commit
17b01c2de4
3 changed files with 44 additions and 38 deletions
|
@ -12,16 +12,20 @@
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
import NotifierMixin from '../../mixins/notifier';
|
import NotifierMixin from '../../mixins/notifier';
|
||||||
|
|
||||||
const {
|
|
||||||
computed,
|
|
||||||
} = Ember;
|
|
||||||
|
|
||||||
export default Ember.Component.extend(NotifierMixin, {
|
export default Ember.Component.extend(NotifierMixin, {
|
||||||
display: 'section', // which CSS to use
|
display: 'section', // which CSS to use
|
||||||
hasTemplates: false,
|
hasTemplates: false,
|
||||||
|
hasBlocks: false,
|
||||||
|
blockMode: false,
|
||||||
|
|
||||||
didReceiveAttrs() {
|
didReceiveAttrs() {
|
||||||
let blocks = this.get('blocks');
|
let blocks = this.get('blocks');
|
||||||
|
let blockMode = is.not.undefined(blocks);
|
||||||
|
|
||||||
|
this.set('blockMode', blockMode);
|
||||||
|
if (!blockMode) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.set('hasBlocks', blocks.get('length') > 0);
|
this.set('hasBlocks', blocks.get('length') > 0);
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{{document/page-wizard display='tab' document=model.document folder=model.folder sections=model.sections onCancel=(action 'onCancel') onAction=(action 'onAddSection')}}
|
{{document/page-wizard display='tab' document=model.document folder=model.folder sections=model.sections onCancel=(action 'onCancel') onAddSection=(action 'onAddSection')}}
|
||||||
|
|
|
@ -19,41 +19,43 @@
|
||||||
</li>
|
</li>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</ul>
|
</ul>
|
||||||
{{#if hasBlocks}}
|
{{#if blockMode}}
|
||||||
<div class="divider"></div>
|
{{#if hasBlocks}}
|
||||||
<div class="template-caption">Reusable content</div>
|
<div class="divider"></div>
|
||||||
<ul class="list">
|
<div class="template-caption">Reusable content</div>
|
||||||
{{#each blocks as |block|}}
|
<ul class="list">
|
||||||
<li class="item min-height">
|
{{#each blocks as |block|}}
|
||||||
<div class="icon">
|
<li class="item min-height">
|
||||||
<img class="img" src="/assets/img/section-saved.png" srcset="/assets/img/section-saved@2x.png" {{action 'onInsertBlock' block}}/>
|
<div class="icon">
|
||||||
<div class="actions">
|
<img class="img" src="/assets/img/section-saved.png" srcset="/assets/img/section-saved@2x.png" {{action 'onInsertBlock' block}}/>
|
||||||
{{#link-to 'document.block' folder.id folder.slug document.id document.slug block.id}}
|
<div class="actions">
|
||||||
<i class="material-icons">mode_edit</i>
|
{{#link-to 'document.block' folder.id folder.slug document.id document.slug block.id}}
|
||||||
{{/link-to}}
|
<i class="material-icons">mode_edit</i>
|
||||||
<i class="material-icons" id={{block.deleteId}}>delete</i>
|
{{/link-to}}
|
||||||
|
<i class="material-icons" id={{block.deleteId}}>delete</i>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="details" {{action 'onInsertBlock' block}}>
|
||||||
<div class="details" {{action 'onInsertBlock' block}}>
|
<div class='title'>
|
||||||
<div class='title'>
|
{{block.title}}
|
||||||
{{block.title}}
|
</div>
|
||||||
|
<div class='desc'>{{block.excerpt}}</div>
|
||||||
|
<div class='desc'>By {{block.firstname}} {{block.lastname}}, {{time-ago block.created}} (used: {{ block.used }})</div>
|
||||||
</div>
|
</div>
|
||||||
<div class='desc'>{{block.excerpt}}</div>
|
<div class="clearfix" />
|
||||||
<div class='desc'>By {{block.firstname}} {{block.lastname}}, {{time-ago block.created}} (used: {{ block.used }})</div>
|
{{#dropdown-dialog target=block.deleteId position="bottom left" button="Delete" color="flat-red" onAction=(action 'onDeleteBlock' block.id)}}
|
||||||
</div>
|
<p>
|
||||||
<div class="clearfix" />
|
Are you sure you want to delete block<br/>
|
||||||
{{#dropdown-dialog target=block.deleteId position="bottom left" button="Delete" color="flat-red" onAction=(action 'onDeleteBlock' block.id)}}
|
<span class="bold">{{block.title}}?</span>
|
||||||
<p>
|
</p>
|
||||||
Are you sure you want to delete block<br/>
|
{{/dropdown-dialog}}
|
||||||
<span class="bold">{{block.title}}?</span>
|
</li>
|
||||||
</p>
|
{{/each}}
|
||||||
{{/dropdown-dialog}}
|
</ul>
|
||||||
</li>
|
{{else}}
|
||||||
{{/each}}
|
<div class="divider"></div>
|
||||||
</ul>
|
<div class="template-caption">Reusable content appears below</div>
|
||||||
{{else}}
|
{{/if}}
|
||||||
<div class="divider"></div>
|
|
||||||
<div class="template-caption">Reusable content appears below</div>
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue