1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-24 07:39:43 +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: '',
canEdit: computed('permissions', 'document.protection', function() {
let canEdit = this.get('document.protection') !== this.get('constants').ProtectionType.Lock && this.get('permissions.documentEdit');
// if (canEdit) this.setupAddWizard();
return canEdit;
}),
hasBlocks: computed('blocks', function() {
@ -41,6 +39,12 @@ export default Component.extend(TooltipMixin, {
}),
mousetrap: null,
voteThanks: false,
showLikes: false,
didReceiveAttrs() {
this._super(...arguments);
this.set('showLikes', this.get('folder.allowLikes') && this.get('document.isLive'));
},
didRender() {
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) {
let sequence = 0;
let level = 1;

View file

@ -45,6 +45,11 @@ export default Model.extend({
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 () {
let constants = this.get('constants');
switch (this.get('lifecycle')) {

View file

@ -24,22 +24,22 @@
</div>
{{/if}}
{{#if folder.allowLikes}}
<div class=" d-flex justify-content-center">
<div class="vote-box">
{{#unless voteThanks}}
<div class="prompt">
{{folder.likes}}
</div>
<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-secondary font-weight-bold" {{action 'onVote' 2}}>Not really</button>
</div>
{{else}}
<div class="ack">Thanks for the feedback!</div>
{{/unless}}
</div>
</div>
{{#if showLikes}}
<div class=" d-flex justify-content-center">
<div class="vote-box">
{{#unless voteThanks}}
<div class="prompt">
{{folder.likes}}
</div>
<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-secondary font-weight-bold" {{action 'onVote' 2}}>Not really</button>
</div>
{{else}}
<div class="ack">Thanks for the feedback!</div>
{{/unless}}
</div>
</div>
{{/if}}
{{/if}}