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
872a1a95
Commit
872a1a95
authored
2 years ago
by
Ron Lucke
Committed by
Jan-Hendrik Willms
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix #954
Closes #954 Merge request
studip/studip!597
parent
61865bdb
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
resources/assets/stylesheets/scss/courseware.scss
+13
-0
13 additions, 0 deletions
resources/assets/stylesheets/scss/courseware.scss
resources/vue/components/courseware/CoursewareTableOfContentsBlock.vue
+63
-19
63 additions, 19 deletions
.../components/courseware/CoursewareTableOfContentsBlock.vue
with
76 additions
and
19 deletions
resources/assets/stylesheets/scss/courseware.scss
+
13
−
0
View file @
872a1a95
...
...
@@ -4237,6 +4237,19 @@ cw tiles
&
.default-image
{
@include
background-icon
(
courseware
,
clickable
,
128
);
}
.overlay-text
{
padding
:
0
.25em
;
margin
:
0
.25em
;
background-color
:
rgba
(
255
,
255
,
255
,
0
.8
);
width
:
fit-content
;
max-width
:
100%
;
height
:
1
.25em
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
float
:
right
;
text-align
:
right
;
}
}
.description
{
height
:
220px
;
...
...
This diff is collapsed.
Click to expand it.
resources/vue/components/courseware/CoursewareTableOfContentsBlock.vue
+
63
−
19
View file @
872a1a95
...
...
@@ -14,33 +14,40 @@
v-if=
"currentStyle === 'list-details' || currentStyle === 'list'"
:class=
"['cw-block-table-of-contents-' + currentStyle]"
>
<li
v-for=
"child in childElements"
:key=
"child.id"
>
<li
v-for=
"child in childElements
WithTasks
"
: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'"
v-if=
"currentStyle === 'tiles'"
class=
"cw-block-table-of-contents-tiles cw-tiles"
>
<li
v-for=
"child in childElements"
v-for=
"child in childElements
WithTasks
"
:key=
"child.id"
class=
"tile"
:class=
"[child.attributes.payload.color]"
>
<router-link
:to=
"'/structural_element/' + child.id"
:title=
"child.attributes.title"
>
<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)"
></div>
>
<div
v-if=
"child.attributes.purpose === 'task'"
class=
"overlay-text"
>
{{
child
.
solverName
}}
</div>
</div>
<div
class=
"description"
>
<header>
{{
child
.
attributes
.
title
}}
</header>
<header
:class=
"[child.attributes.purpose !== '' ? 'description-icon-' + child.attributes.purpose : '']"
>
{{
child
.
attributes
.
title
||
"
–
"
}}
</header>
<div
class=
"description-text-wrapper"
>
<p>
{{
child
.
attributes
.
payload
.
description
}}
</p>
</div>
...
...
@@ -103,6 +110,10 @@ export default {
...
mapGetters
({
childrenById
:
'
courseware-structure/children
'
,
structuralElementById
:
'
courseware-structural-elements/byId
'
,
context
:
'
context
'
,
taskById
:
'
courseware-tasks/byId
'
,
userById
:
'
users/byId
'
,
groupById
:
'
status-groups/byId
'
,
}),
structuralElement
()
{
return
this
.
structuralElementById
({
id
:
this
.
$route
.
params
.
id
});
...
...
@@ -116,29 +127,42 @@ export default {
style
()
{
return
this
.
block
?.
attributes
?.
payload
?.
style
;
},
childSets
()
{
let
childSets
=
[];
let
childElements
=
this
.
childElements
;
while
(
childElements
.
length
>
0
)
{
let
set
=
[];
for
(
let
i
=
0
;
i
<
4
;
i
++
)
{
let
elem
=
childElements
.
shift
();
if
(
elem
!==
undefined
)
{
set
.
push
(
elem
);
childElementsWithTasks
()
{
let
children
=
[];
this
.
childElements
.
forEach
(
element
=>
{
if
(
element
.
relationships
.
task
.
data
)
{
let
solverName
=
this
.
getSolverName
(
element
.
relationships
.
task
.
data
.
id
);
if
(
solverName
)
{
element
.
solverName
=
solverName
;
children
.
push
(
element
);
}
}
else
{
children
.
push
(
element
);
}
childSets
.
push
(
set
);
}
});
return
child
Sets
;
return
child
ren
;
}
},
mounted
()
{
this
.
initCurrentData
();
this
.
childElements
.
forEach
(
element
=>
{
if
(
element
.
relationships
.
task
.
data
)
{
const
taskId
=
element
.
relationships
.
task
.
data
.
id
;
try
{
this
.
loadTask
({
taskId
:
taskId
,
});
}
catch
(
error
)
{
console
.
debug
(
error
);
}
}
});
},
methods
:
{
...
mapActions
({
updateBlock
:
'
updateBlockInContainer
'
,
loadTask
:
'
loadTask
'
,
}),
initCurrentData
()
{
this
.
currentTitle
=
this
.
title
;
...
...
@@ -169,11 +193,31 @@ export default {
}
},
countChildChildren
(
child
)
{
return
this
.
childrenById
(
child
.
id
).
length
;
return
this
.
childrenById
(
child
.
id
).
length
+
1
;
},
hasImage
(
child
)
{
return
child
.
relationships
?.
image
?.
data
!==
null
;
},
getSolverName
(
taskId
)
{
const
task
=
this
.
taskById
({
id
:
taskId
});
if
(
task
===
undefined
)
{
return
false
;
}
const
solver
=
task
.
relationships
.
solver
.
data
;
if
(
solver
.
type
===
'
users
'
)
{
const
user
=
this
.
userById
({
id
:
solver
.
id
});
return
user
.
attributes
[
'
formatted-name
'
];
}
if
(
solver
.
type
===
'
status-groups
'
)
{
const
group
=
this
.
groupById
({
id
:
solver
.
id
});
return
group
.
attributes
.
name
;
}
return
false
;
}
},
};
</
script
>
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