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
2fa10e47
Commit
2fa10e47
authored
2 years ago
by
Farbod Zamani
Committed by
David Siegfried
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
CW page metadata image fix
Closes #911 Merge request
studip/studip!1160
parent
fa13d788
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
+15
-5
15 additions, 5 deletions
...vue/components/courseware/CoursewareStructuralElement.vue
with
15 additions
and
5 deletions
resources/vue/components/courseware/CoursewareStructuralElement.vue
+
15
−
5
View file @
2fa10e47
...
@@ -293,18 +293,18 @@
...
@@ -293,18 +293,18 @@
<courseware-tab
:name=
"textEdit.image"
:index=
"2"
>
<courseware-tab
:name=
"textEdit.image"
:index=
"2"
>
<form
class=
"default"
@
submit.prevent=
""
>
<form
class=
"default"
@
submit.prevent=
""
>
<img
<img
v-if=
"
i
mage"
v-if=
"
showPreviewI
mage"
:src=
"image"
:src=
"image"
class=
"cw-structural-element-image-preview"
class=
"cw-structural-element-image-preview"
:alt=
"$gettext('Vorschaubild')"
:alt=
"$gettext('Vorschaubild')"
/>
/>
<label
v-if=
"
i
mage"
>
<label
v-if=
"
showPreviewI
mage"
>
<button
class=
"button"
@
click=
"deleteImage"
v-translate
>
Bild löschen
</button>
<button
class=
"button"
@
click=
"deleteImage"
v-translate
>
Bild löschen
</button>
</label>
</label>
<div
v-if=
"uploadFileError"
class=
"messagebox messagebox_error"
>
<div
v-if=
"uploadFileError"
class=
"messagebox messagebox_error"
>
{{ uploadFileError }}
{{ uploadFileError }}
</div>
</div>
<label
v-if=
"!
i
mage"
>
<label
v-if=
"!
showPreviewI
mage"
>
<translate>
Bild hochladen
</translate>
<translate>
Bild hochladen
</translate>
<input
ref=
"upload_image"
type=
"file"
accept=
"image/*"
@
change=
"checkUploadFile"
/>
<input
ref=
"upload_image"
type=
"file"
accept=
"image/*"
@
change=
"checkUploadFile"
/>
</label>
</label>
...
@@ -731,6 +731,7 @@ export default {
...
@@ -731,6 +731,7 @@ export default {
passsword
:
''
,
passsword
:
''
,
'
expire-date
'
:
''
'
expire-date
'
:
''
},
},
deletingPreviewImage
:
false
,
};
};
},
},
...
@@ -854,6 +855,10 @@ export default {
...
@@ -854,6 +855,10 @@ export default {
return
this
.
structuralElement
.
relationships
?.
image
?.
meta
?.[
'
download-url
'
]
??
null
;
return
this
.
structuralElement
.
relationships
?.
image
?.
meta
?.[
'
download-url
'
]
??
null
;
},
},
showPreviewImage
()
{
return
this
.
image
!==
null
&&
this
.
deletingPreviewImage
===
false
;
},
structuralElementLoaded
()
{
structuralElementLoaded
()
{
return
this
.
structuralElement
!==
null
&&
this
.
structuralElement
!==
{};
return
this
.
structuralElement
!==
null
&&
this
.
structuralElement
!==
{};
},
},
...
@@ -1341,6 +1346,7 @@ export default {
...
@@ -1341,6 +1346,7 @@ export default {
initCurrent
()
{
initCurrent
()
{
this
.
currentElement
=
_
.
cloneDeep
(
this
.
structuralElement
);
this
.
currentElement
=
_
.
cloneDeep
(
this
.
structuralElement
);
this
.
uploadFileError
=
''
;
this
.
uploadFileError
=
''
;
this
.
deletingPreviewImage
=
false
;
},
},
async
menuAction
(
action
)
{
async
menuAction
(
action
)
{
switch
(
action
)
{
switch
(
action
)
{
...
@@ -1452,8 +1458,9 @@ export default {
...
@@ -1452,8 +1458,9 @@ export default {
}
}
},
},
deleteImage
()
{
deleteImage
()
{
this
.
deleteImageForStructuralElement
(
this
.
currentElement
);
if
(
!
this
.
deletingPreviewImage
)
{
this
.
initCurrent
();
this
.
deletingPreviewImage
=
true
;
}
},
},
async
storeCurrentElement
()
{
async
storeCurrentElement
()
{
await
this
.
loadStructuralElement
(
this
.
currentElement
.
id
);
await
this
.
loadStructuralElement
(
this
.
currentElement
.
id
);
...
@@ -1484,6 +1491,9 @@ export default {
...
@@ -1484,6 +1491,9 @@ export default {
console
.
error
(
error
);
console
.
error
(
error
);
this
.
uploadFileError
=
this
.
$gettext
(
'
Fehler beim Hochladen der Datei.
'
);
this
.
uploadFileError
=
this
.
$gettext
(
'
Fehler beim Hochladen der Datei.
'
);
});
});
await
this
.
loadStructuralElement
(
this
.
currentElement
.
id
);
}
else
if
(
this
.
deletingPreviewImage
)
{
await
this
.
deleteImageForStructuralElement
(
this
.
currentElement
);
}
}
this
.
showElementEditDialog
(
false
);
this
.
showElementEditDialog
(
false
);
...
...
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