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

Show content like box if not draft document

This commit is contained in:
McMatts 2018-04-17 16:09:28 +01:00
parent 22b6674edb
commit 94ca80f052
3 changed files with 27 additions and 32 deletions

View file

@ -32,8 +32,6 @@ export default Component.extend(TooltipMixin, {
deleteBlockId: '', deleteBlockId: '',
canEdit: computed('permissions', 'document.protection', function() { canEdit: computed('permissions', 'document.protection', function() {
let canEdit = this.get('document.protection') !== this.get('constants').ProtectionType.Lock && this.get('permissions.documentEdit'); let canEdit = this.get('document.protection') !== this.get('constants').ProtectionType.Lock && this.get('permissions.documentEdit');
// if (canEdit) this.setupAddWizard();
return canEdit; return canEdit;
}), }),
hasBlocks: computed('blocks', function() { hasBlocks: computed('blocks', function() {
@ -41,6 +39,12 @@ export default Component.extend(TooltipMixin, {
}), }),
mousetrap: null, mousetrap: null,
voteThanks: false, voteThanks: false,
showLikes: false,
didReceiveAttrs() {
this._super(...arguments);
this.set('showLikes', this.get('folder.allowLikes') && this.get('document.isLive'));
},
didRender() { didRender() {
this._super(...arguments); this._super(...arguments);
@ -116,20 +120,6 @@ export default Component.extend(TooltipMixin, {
}); });
}, },
// setupAddWizard() {
// schedule('afterRender', () => {
// $('.start-section:not(.start-section-empty-state)').off('.hoverIntent');
// $('.start-section:not(.start-section-empty-state)').hoverIntent({interval: 100, over: function() {
// // in
// $(this).find('.start-button').velocity("transition.slideDownIn", {duration: 300});
// }, out: function() {
// // out
// $(this).find('.start-button').velocity("transition.slideUpOut", {duration: 300});
// } });
// });
// },
addSection(model) { addSection(model) {
let sequence = 0; let sequence = 0;
let level = 1; let level = 1;

View file

@ -45,6 +45,11 @@ export default Model.extend({
return this.get('lifecycle') == constants.Lifecycle.Draft; return this.get('lifecycle') == constants.Lifecycle.Draft;
}), }),
isLive: computed('lifecycle', function () {
let constants = this.get('constants');
return this.get('lifecycle') == constants.Lifecycle.Live;
}),
lifecycleLabel: computed('lifecycle', function () { lifecycleLabel: computed('lifecycle', function () {
let constants = this.get('constants'); let constants = this.get('constants');
switch (this.get('lifecycle')) { switch (this.get('lifecycle')) {

View file

@ -24,22 +24,22 @@
</div> </div>
{{/if}} {{/if}}
{{#if folder.allowLikes}} {{#if showLikes}}
<div class=" d-flex justify-content-center"> <div class=" d-flex justify-content-center">
<div class="vote-box"> <div class="vote-box">
{{#unless voteThanks}} {{#unless voteThanks}}
<div class="prompt"> <div class="prompt">
{{folder.likes}} {{folder.likes}}
</div> </div>
<div class="buttons"> <div class="buttons">
<button type="button" class="btn btn-outline-success font-weight-bold" {{action 'onVote' 1}}>Yes, thanks!</button>&nbsp;&nbsp; <button type="button" class="btn btn-outline-success font-weight-bold" {{action 'onVote' 1}}>Yes, thanks!</button>&nbsp;&nbsp;
<button type="button" class="btn btn-outline-secondary font-weight-bold" {{action 'onVote' 2}}>Not really</button> <button type="button" class="btn btn-outline-secondary font-weight-bold" {{action 'onVote' 2}}>Not really</button>
</div> </div>
{{else}} {{else}}
<div class="ack">Thanks for the feedback!</div> <div class="ack">Thanks for the feedback!</div>
{{/unless}} {{/unless}}
</div> </div>
</div> </div>
{{/if}} {{/if}}
{{/if}} {{/if}}