Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
editoria
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yannis Barlas
editoria
Commits
cb1329ba
Commit
cb1329ba
authored
8 years ago
by
Yannis Barlas
Browse files
Options
Downloads
Patches
Plain Diff
admin can unlock chapters
parent
71e408bf
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/components/BookBuilder/BookBuilder.jsx
+1
-0
1 addition, 0 deletions
app/components/BookBuilder/BookBuilder.jsx
app/components/BookBuilder/Chapter/EditingNotification.jsx
+8
-2
8 additions, 2 deletions
app/components/BookBuilder/Chapter/EditingNotification.jsx
with
9 additions
and
2 deletions
app/components/BookBuilder/BookBuilder.jsx
+
1
−
0
View file @
cb1329ba
...
@@ -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
])
...
...
This diff is collapsed.
Click to expand it.
app/components/BookBuilder/Chapter/EditingNotification.jsx
+
8
−
2
View file @
cb1329ba
...
@@ -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
.
toggle
Modal
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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment