Skip to content

Commit

Permalink
Fix footer visibility conditions (#269)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffdaley authored Jul 24, 2023
1 parent 35258ed commit 19f2a73
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion web/app/components/document/sidebar.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@
</div>
</div>

{{#if this.isOwner}}
{{#if this.footerIsShown}}
<div class="sidebar-footer {{if this.editingIsDisabled 'locked'}}">
{{#if this.editingIsDisabled}}
<div class="px-3 -mb-1">
Expand Down
9 changes: 9 additions & 0 deletions web/app/components/document/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,15 @@ export default class DocumentSidebarComponent extends Component<DocumentSidebarC
}
}

/**
* Whether the footer is shown.
* True for editors who may need to see the "doc is locked" message,
* as well as approvers and owners who need doc-management controls.
*/
protected get footerIsShown() {
return this.isApprover || this.isOwner || this.isContributor;
}

/**
* Whether editing is enabled for basic metadata fields.
* Used in the template to make some logic more readable.
Expand Down

0 comments on commit 19f2a73

Please sign in to comment.