1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-23 23:29:42 +02:00

Move add section into section toolbar

This commit is contained in:
sauls8t 2019-01-23 15:46:27 +00:00
parent 0707bdd3d6
commit c69020f1e6
6 changed files with 32 additions and 34 deletions

View file

@ -45,7 +45,6 @@ export default Component.extend(ModalMixin, Notifer, {
// get categories // get categories
this.get('categorySvc').getAll(this.get('space.id')).then((c) => { this.get('categorySvc').getAll(this.get('space.id')).then((c) => {
this.set('category', c); this.set('category', c);
// get summary of documents and users for each category in space // get summary of documents and users for each category in space
this.get('categorySvc').getSummary(this.get('space.id')).then((s) => { this.get('categorySvc').getSummary(this.get('space.id')).then((s) => {
c.forEach((cat) => { c.forEach((cat) => {

View file

@ -47,12 +47,20 @@
width: 5px; width: 5px;
display: inline-block; display: inline-block;
} }
> i.add-section {
color: map-get($yellow-shades, 500);
&:hover {
color: map-get($yellow-shades, 700);
}
}
} }
} }
.start-section { .start-section {
@extend .no-select; @extend .no-select;
text-align: right; text-align: center;
margin: 0.5rem 0; margin: 0.5rem 0;
display: block; display: block;

View file

@ -28,7 +28,8 @@
onDeletePage=(action "onDeletePage") onDeletePage=(action "onDeletePage")
onSavePageAsBlock=(action "onSavePageAsBlock") onSavePageAsBlock=(action "onSavePageAsBlock")
onPageLevelChange=(action onPageLevelChange) onPageLevelChange=(action onPageLevelChange)
onPageSequenceChange=(action onPageSequenceChange)}} onPageSequenceChange=(action onPageSequenceChange)
onShowSectionWizard=(action onShowSectionWizard)}}
<div class="wysiwyg"> <div class="wysiwyg">
{{section/base-renderer page=page}} {{section/base-renderer page=page}}

View file

@ -12,6 +12,10 @@
<div class="section-heading no-print" id="page-toolbar-{{ page.id }}"> <div class="section-heading no-print" id="page-toolbar-{{ page.id }}">
<div class="section-toolbar"> <div class="section-toolbar">
{{#if canEdit}} {{#if canEdit}}
<i class="add-section dicon {{constants.Icon.Plus}}" {{action "onShowSectionWizard" page}}>
{{#attach-tooltip showDelay=1000}}Insert section above{{/attach-tooltip}}
</i>
<div class="gap"/>
<i class="dicon {{constants.Icon.Edit}}" {{action "onEdit"}} /> <i class="dicon {{constants.Icon.Edit}}" {{action "onEdit"}} />
{{/if}} {{/if}}
{{#if hasMenuPermissions}} {{#if hasMenuPermissions}}

View file

@ -1,14 +1,6 @@
{{#if hasPages}} {{#if hasPages}}
{{#each pages key="id" as |item|}} {{#each pages key="id" as |item|}}
{{#if canEdit}} {{ui/ui-spacer size=100}}
<div class="start-section">
<i class="dicon {{constants.Icon.Plus}}" {{action "onShowSectionWizard" item.page}}>
{{#attach-tooltip showDelay=1000}}Insert section here{{/attach-tooltip}}
</i>
</div>
{{else}}
{{ui/ui-spacer size=100}}
{{/if}}
{{document/document-page {{document/document-page
roles=roles roles=roles
pages=pages pages=pages
@ -27,17 +19,9 @@
onDeletePage=(action "onDeletePage") onDeletePage=(action "onDeletePage")
onSavePageAsBlock=(action "onSavePageAsBlock") onSavePageAsBlock=(action "onSavePageAsBlock")
onPageLevelChange=(action onPageLevelChange) onPageLevelChange=(action onPageLevelChange)
onPageSequenceChange=(action onPageSequenceChange)}} onPageSequenceChange=(action onPageSequenceChange)
onShowSectionWizard=(action "onShowSectionWizard")}}
{{/each}} {{/each}}
{{#if canEdit}}
<div class="start-section">
<i class="dicon {{constants.Icon.Plus}}" {{action "onShowSectionWizard"}}>
{{#attach-tooltip showDelay=1000}}Insert section here{{/attach-tooltip}}
</i>
</div>
{{/if}}
{{#if showLikes}} {{#if showLikes}}
<div class="vote-box no-print"> <div class="vote-box no-print">
{{#if voteThanks}} {{#if voteThanks}}
@ -53,14 +37,14 @@
{{/if}} {{/if}}
</div> </div>
{{/if}} {{/if}}
{{else}} {{/if}}
{{#if canEdit}}
<div class="start-section"> {{#if canEdit}}
<i class="dicon {{constants.Icon.Plus}}" {{action "onShowSectionWizard"}}> <div class="start-section">
{{#attach-tooltip showDelay=1000}}Insert section here{{/attach-tooltip}} <i class="dicon {{constants.Icon.Plus}}" {{action "onShowSectionWizard"}}>
</i> {{#attach-tooltip showDelay=1000}}Insert section here{{/attach-tooltip}}
</div> </i>
{{/if}} </div>
{{/if}} {{/if}}
{{#if canEdit}} {{#if canEdit}}

View file

@ -1,8 +1,10 @@
{{#if categories}} {{#if categories}}
{{#each categories as |cat|}} {{#each categories as |cat|}}
<div class="category"> {{#if cat}}
<i class="dicon {{constants.Icon.Category}}" /> <div class="category">
<div class="name">{{cat}}</div> <i class="dicon {{constants.Icon.Category}}" />
</div> <div class="name">{{cat}}</div>
</div>
{{/if}}
{{/each}} {{/each}}
{{/if}} {{/if}}