Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Stud.IP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jan-Hendrik Willms
Stud.IP
Commits
fa13d788
Commit
fa13d788
authored
2 years ago
by
Ron Lucke
Committed by
Marcus Eibrink-Lunzenauer
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix #1610
Closes #1610 Merge request
studip/studip!1101
parent
e625dd14
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
resources/vue/components/courseware/CoursewareStructuralElement.vue
+32
-10
32 additions, 10 deletions
...vue/components/courseware/CoursewareStructuralElement.vue
with
32 additions
and
10 deletions
resources/vue/components/courseware/CoursewareStructuralElement.vue
+
32
−
10
View file @
fa13d788
...
@@ -356,7 +356,7 @@
...
@@ -356,7 +356,7 @@
<label>
<label>
<translate>
Position der neuen Seite
</translate>
<translate>
Position der neuen Seite
</translate>
<select
v-model=
"newChapterParent"
>
<select
v-model=
"newChapterParent"
>
<option
v-if=
"!isRoot"
value=
"sibling"
>
<option
v-if=
"!isRoot
&& canEditParent
"
value=
"sibling"
>
<translate>
Neben der aktuellen Seite
</translate>
<translate>
Neben der aktuellen Seite
</translate>
</option>
</option>
<option
value=
"descendant"
><translate>
Unterhalb der aktuellen Seite
</translate></option>
<option
value=
"descendant"
><translate>
Unterhalb der aktuellen Seite
</translate></option>
...
@@ -941,6 +941,16 @@ export default {
...
@@ -941,6 +941,16 @@ export default {
return
this
.
structuralElement
.
attributes
[
'
can-edit
'
];
return
this
.
structuralElement
.
attributes
[
'
can-edit
'
];
},
},
canEditParent
()
{
if
(
this
.
isRoot
)
{
return
false
;
}
const
parentId
=
this
.
structuralElement
.
relationships
.
parent
.
data
.
id
;
const
parent
=
this
.
structuralElementById
({
id
:
parentId
});
return
parent
.
attributes
[
'
can-edit
'
];
},
isRoot
()
{
isRoot
()
{
return
this
.
structuralElement
.
relationships
.
parent
.
data
===
null
;
return
this
.
structuralElement
.
relationships
.
parent
.
data
===
null
;
},
},
...
@@ -1591,7 +1601,7 @@ export default {
...
@@ -1591,7 +1601,7 @@ export default {
console
.
debug
(
error
);
console
.
debug
(
error
);
});
});
},
},
async
createElement
()
{
createElement
()
{
let
title
=
this
.
newChapterName
;
// this is the title of the new element
let
title
=
this
.
newChapterName
;
// this is the title of the new element
let
parent_id
=
this
.
currentId
;
// new page is descandant as default
let
parent_id
=
this
.
currentId
;
// new page is descandant as default
let
writeApproval
=
this
.
currentElement
.
attributes
[
'
write-approval
'
];
let
writeApproval
=
this
.
currentElement
.
attributes
[
'
write-approval
'
];
...
@@ -1607,7 +1617,7 @@ export default {
...
@@ -1607,7 +1617,7 @@ export default {
readApproval
=
[];
readApproval
=
[];
}
}
this
.
showElementAddDialog
(
false
);
this
.
showElementAddDialog
(
false
);
await
this
.
createStructuralElement
({
this
.
createStructuralElement
({
attributes
:
{
attributes
:
{
title
:
title
,
title
:
title
,
'
write-approval
'
:
writeApproval
,
'
write-approval
'
:
writeApproval
,
...
@@ -1615,14 +1625,26 @@ export default {
...
@@ -1615,14 +1625,26 @@ export default {
},
},
parentId
:
parent_id
,
parentId
:
parent_id
,
currentId
:
this
.
currentId
,
currentId
:
this
.
currentId
,
})
.
then
(()
=>
{
let
newElement
=
this
.
$store
.
getters
[
'
courseware-structural-elements/lastCreated
'
];
this
.
companionSuccess
({
info
:
this
.
$gettextInterpolate
(
this
.
$gettext
(
'
Die Seite %{ pageTitle } wurde erfolgreich angelegt.
'
),
{
pageTitle
:
newElement
.
attributes
.
title
}
)
});
})
.
catch
(
e
=>
{
let
errorMessage
=
this
.
$gettext
(
'
Es ist ein Fehler aufgetreten. Die Seite konnte nicht erstellt werden.
'
);
if
(
e
.
status
===
403
)
{
errorMessage
=
this
.
$gettext
(
'
Die Seite konnte nicht erstellt werden. Sie haben nicht die notwendigen Schreibrechte.
'
);
}
this
.
companionError
({
info
:
errorMessage
});
});
});
let
newElement
=
this
.
$store
.
getters
[
'
courseware-structural-elements/lastCreated
'
];
this
.
companionSuccess
({
info
:
this
.
$gettextInterpolate
(
this
.
$gettext
(
'
Die Seite %{ pageTitle } wurde erfolgreich angelegt.
'
),
{
pageTitle
:
newElement
.
attributes
.
title
}
)
});
this
.
newChapterName
=
''
;
this
.
newChapterName
=
''
;
},
},
containerComponent
(
container
)
{
containerComponent
(
container
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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