Skip to content
Snippets Groups Projects
Commit cb1329ba authored by Yannis Barlas's avatar Yannis Barlas
Browse files

admin can unlock chapters

parent 71e408bf
No related branches found
No related tags found
No related merge requests found
......@@ -89,6 +89,7 @@ export class BookBuilder extends React.Component {
})
let roles = []
if (user.admin) roles.push('admin')
function addRole (role) {
roles = _.union(roles, [role])
......
......@@ -57,13 +57,14 @@ class EditingNotification extends React.Component {
const { chapter, modalContainer, update } = this.props
const { showModal } = this.state
const username = chapter.lock.editor.username
const isAdmin = this.isAdmin()
let message = username + ' is editing'
let hoverTitle, unlockModal
let toggle = noop
if (this.isAdmin()) {
toggle = this.toggle()
if (isAdmin) {
toggle = this.toggleModal
unlockModal = (
<UnlockModal
......@@ -81,10 +82,15 @@ class EditingNotification extends React.Component {
}
}
const inlineStyle = {
'cursor': isAdmin ? 'pointer' : 'default'
}
return (
<a id='bb-unlock'
className={styles.lEditing}
onClick={toggle}
style={inlineStyle}
title={hoverTitle}
>
<i
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment