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
Marcus Eibrink-Lunzenauer
Stud.IP
Commits
3e839c5d
Commit
3e839c5d
authored
1 year ago
by
Viktoria Wiebe
Committed by
David Siegfried
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
add companion info for table of contents block with zero sub pages, fixes #2083
Closes #2083 Merge request
studip/studip!1705
parent
520df873
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/CoursewareTableOfContentsBlock.vue
+62
-51
62 additions, 51 deletions
.../components/courseware/CoursewareTableOfContentsBlock.vue
with
62 additions
and
51 deletions
resources/vue/components/courseware/CoursewareTableOfContentsBlock.vue
+
62
−
51
View file @
3e839c5d
...
@@ -10,61 +10,69 @@
...
@@ -10,61 +10,69 @@
@
closeEdit=
"initCurrentData"
@
closeEdit=
"initCurrentData"
>
>
<template
#content
>
<template
#content
>
<div
v-if=
"currentStyle !== 'tiles' && currentTitle !== ''"
class=
"cw-block-title"
>
{{
currentTitle
}}
</div>
<div
v-if=
"childElementsWithTasks.length > 0"
>
<ul
<div
v-if=
"currentStyle !== 'tiles' && currentTitle !== ''"
class=
"cw-block-title"
>
{{
currentTitle
}}
</div>
v-if=
"currentStyle === 'list-details' || currentStyle === 'list'"
<ul
:class=
"['cw-block-table-of-contents-' + currentStyle]"
v-if=
"currentStyle === 'list-details' || currentStyle === 'list'"
>
:class=
"['cw-block-table-of-contents-' + currentStyle]"
<li
v-for=
"child in childElementsWithTasks"
:key=
"child.id"
>
<router-link
:to=
"'/structural_element/' + child.id"
>
<div
class=
"cw-block-table-of-contents-title-box"
:class=
"[child.attributes.payload.color]"
>
{{
child
.
attributes
.
title
}}
<span
v-if=
"child.attributes.purpose === 'task'"
>
|
{{
child
.
solverName
}}
</span>
<p
v-if=
"currentStyle === 'list-details'"
>
{{
child
.
attributes
.
payload
.
description
}}
</p>
</div>
</router-link>
</li>
</ul>
<ul
v-if=
"currentStyle === 'tiles'"
class=
"cw-block-table-of-contents-tiles cw-tiles"
>
<li
v-for=
"child in childElementsWithTasks"
:key=
"child.id"
class=
"tile"
:class=
"[child.attributes.payload.color]"
>
>
<router-link
:to=
"'/structural_element/' + child.id"
:title=
"child.attributes.purpose === 'task' ? child.attributes.title + ' | ' + child.solverName : child.attributes.title"
>
<li
v-for=
"child in childElementsWithTasks"
:key=
"child.id"
>
<div
<router-link
:to=
"'/structural_element/' + child.id"
>
class=
"preview-image"
<div
class=
"cw-block-table-of-contents-title-box"
:class=
"[child.attributes.payload.color]"
>
:class=
"[hasImage(child) ? '' : 'default-image']"
{{
child
.
attributes
.
title
}}
:style=
"getChildStyle(child)"
<span
v-if=
"child.attributes.purpose === 'task'"
>
|
{{
child
.
solverName
}}
</span>
>
<p
v-if=
"currentStyle === 'list-details'"
>
{{
child
.
attributes
.
payload
.
description
}}
</p>
<div
v-if=
"child.attributes.purpose === 'task'"
class=
"overlay-text"
>
{{
child
.
solverName
}}
</div>
</div>
</div>
</router-link>
<div
class=
"description"
>
</li>
<header
</ul>
:class=
"[child.attributes.purpose !== '' ? 'description-icon-' + child.attributes.purpose : '']"
<ul
v-if=
"currentStyle === 'tiles'"
class=
"cw-block-table-of-contents-tiles cw-tiles"
>
<li
v-for=
"child in childElementsWithTasks"
:key=
"child.id"
class=
"tile"
:class=
"[child.attributes.payload.color]"
>
<router-link
:to=
"'/structural_element/' + child.id"
:title=
"child.attributes.purpose === 'task' ? child.attributes.title + ' | ' + child.solverName : child.attributes.title"
>
<div
class=
"preview-image"
:class=
"[hasImage(child) ? '' : 'default-image']"
:style=
"getChildStyle(child)"
>
>
{{
child
.
attributes
.
title
||
"
–
"
}}
<div
v-if=
"child.attributes.purpose === 'task'"
class=
"overlay-text"
>
{{
child
.
solverName
}}
</div>
</header>
<div
class=
"description-text-wrapper"
>
<p>
{{
child
.
attributes
.
payload
.
description
}}
</p>
</div>
</div>
<footer>
<div
class=
"description"
>
{{
countChildChildren
(
child
)
}}
<header
<translate
:class=
"[child.attributes.purpose !== '' ? 'description-icon-' + child.attributes.purpose : '']"
:translate-n=
"countChildChildren(child)"
translate-plural=
"Seiten"
>
>
Seite
{{
child
.
attributes
.
title
||
"
–
"
}}
</translate>
</header>
</footer>
<div
class=
"description-text-wrapper"
>
</div>
<p>
{{
child
.
attributes
.
payload
.
description
}}
</p>
</router-link>
</div>
</li>
<footer>
</ul>
{{
countChildChildren
(
child
)
}}
<translate
:translate-n=
"countChildChildren(child)"
translate-plural=
"Seiten"
>
Seite
</translate>
</footer>
</div>
</router-link>
</li>
</ul>
</div>
<courseware-companion-box
v-if=
"viewMode === 'edit' && childElementsWithTasks.length === 0"
:msgCompanion=
"$gettext('Es sind noch keine Unterseiten vorhanden. ' +
'Sobald Sie weitere Unterseiten anlegen, erscheinen diese automatisch hier im Inhaltsverzeichnis.')"
mood=
"pointing"
/>
</
template
>
</
template
>
<
template
v-if=
"canEdit"
#edit
>
<
template
v-if=
"canEdit"
#edit
>
<form
class=
"default"
@
submit.prevent=
""
>
<form
class=
"default"
@
submit.prevent=
""
>
...
@@ -89,6 +97,7 @@
...
@@ -89,6 +97,7 @@
<
script
>
<
script
>
import
CoursewareDefaultBlock
from
'
./CoursewareDefaultBlock.vue
'
;
import
CoursewareDefaultBlock
from
'
./CoursewareDefaultBlock.vue
'
;
import
CoursewareCompanionBox
from
'
./CoursewareCompanionBox.vue
'
;
import
{
blockMixin
}
from
'
./block-mixin.js
'
;
import
{
blockMixin
}
from
'
./block-mixin.js
'
;
import
{
mapActions
,
mapGetters
}
from
'
vuex
'
;
import
{
mapActions
,
mapGetters
}
from
'
vuex
'
;
...
@@ -97,6 +106,7 @@ export default {
...
@@ -97,6 +106,7 @@ export default {
mixins
:
[
blockMixin
],
mixins
:
[
blockMixin
],
components
:
{
components
:
{
CoursewareDefaultBlock
,
CoursewareDefaultBlock
,
CoursewareCompanionBox
,
},
},
props
:
{
props
:
{
block
:
Object
,
block
:
Object
,
...
@@ -117,6 +127,7 @@ export default {
...
@@ -117,6 +127,7 @@ export default {
taskById
:
'
courseware-tasks/byId
'
,
taskById
:
'
courseware-tasks/byId
'
,
userById
:
'
users/byId
'
,
userById
:
'
users/byId
'
,
groupById
:
'
status-groups/byId
'
,
groupById
:
'
status-groups/byId
'
,
viewMode
:
'
viewMode
'
,
}),
}),
structuralElement
()
{
structuralElement
()
{
return
this
.
structuralElementById
({
id
:
this
.
$route
.
params
.
id
});
return
this
.
structuralElementById
({
id
:
this
.
$route
.
params
.
id
});
...
...
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