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
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Model registry
Analyze
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
Uni Osnabrück
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
Show 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 @@
<label>
<translate>
Position der neuen Seite
</translate>
<select
v-model=
"newChapterParent"
>
<option
v-if=
"!isRoot"
value=
"sibling"
>
<option
v-if=
"!isRoot
&& canEditParent
"
value=
"sibling"
>
<translate>
Neben der aktuellen Seite
</translate>
</option>
<option
value=
"descendant"
><translate>
Unterhalb der aktuellen Seite
</translate></option>
...
...
@@ -941,6 +941,16 @@ export default {
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
()
{
return
this
.
structuralElement
.
relationships
.
parent
.
data
===
null
;
},
...
...
@@ -1591,7 +1601,7 @@ export default {
console
.
debug
(
error
);
});
},
async
createElement
()
{
createElement
()
{
let
title
=
this
.
newChapterName
;
// this is the title of the new element
let
parent_id
=
this
.
currentId
;
// new page is descandant as default
let
writeApproval
=
this
.
currentElement
.
attributes
[
'
write-approval
'
];
...
...
@@ -1607,7 +1617,7 @@ export default {
readApproval
=
[];
}
this
.
showElementAddDialog
(
false
);
await
this
.
createStructuralElement
({
this
.
createStructuralElement
({
attributes
:
{
title
:
title
,
'
write-approval
'
:
writeApproval
,
...
...
@@ -1615,14 +1625,26 @@ export default {
},
parentId
:
parent_id
,
currentId
:
this
.
currentId
,
});
})
.
then
(()
=>
{
let
newElement
=
this
.
$store
.
getters
[
'
courseware-structural-elements/lastCreated
'
];
this
.
companionSuccess
({
info
:
this
.
$gettextInterpolate
(
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
});
});
this
.
newChapterName
=
''
;
},
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