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 { ...@@ -89,6 +89,7 @@ export class BookBuilder extends React.Component {
}) })
let roles = [] let roles = []
if (user.admin) roles.push('admin')
function addRole (role) { function addRole (role) {
roles = _.union(roles, [role]) roles = _.union(roles, [role])
......
...@@ -57,13 +57,14 @@ class EditingNotification extends React.Component { ...@@ -57,13 +57,14 @@ class EditingNotification extends React.Component {
const { chapter, modalContainer, update } = this.props const { chapter, modalContainer, update } = this.props
const { showModal } = this.state const { showModal } = this.state
const username = chapter.lock.editor.username const username = chapter.lock.editor.username
const isAdmin = this.isAdmin()
let message = username + ' is editing' let message = username + ' is editing'
let hoverTitle, unlockModal let hoverTitle, unlockModal
let toggle = noop let toggle = noop
if (this.isAdmin()) { if (isAdmin) {
toggle = this.toggle() toggle = this.toggleModal
unlockModal = ( unlockModal = (
<UnlockModal <UnlockModal
...@@ -81,10 +82,15 @@ class EditingNotification extends React.Component { ...@@ -81,10 +82,15 @@ class EditingNotification extends React.Component {
} }
} }
const inlineStyle = {
'cursor': isAdmin ? 'pointer' : 'default'
}
return ( return (
<a id='bb-unlock' <a id='bb-unlock'
className={styles.lEditing} className={styles.lEditing}
onClick={toggle} onClick={toggle}
style={inlineStyle}
title={hoverTitle} title={hoverTitle}
> >
<i <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