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
42ce67b2
Commit
42ce67b2
authored
3 years ago
by
Ron Lucke
Browse files
Options
Downloads
Patches
Plain Diff
Biest #277
parent
6dbd486b
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
+8
-9
8 additions, 9 deletions
resources/assets/stylesheets/scss/courseware.scss
resources/vue/components/courseware/CoursewareManagerCopySelector.vue
+67
-9
67 additions, 9 deletions
...e/components/courseware/CoursewareManagerCopySelector.vue
with
75 additions
and
18 deletions
resources/assets/stylesheets/scss/courseware.scss
+
8
−
9
View file @
42ce67b2
...
@@ -4196,18 +4196,17 @@ vSelect end
...
@@ -4196,18 +4196,17 @@ vSelect end
margin
:
0
;
margin
:
0
;
list-style
:
none
;
list-style
:
none
;
}
}
button
{
.cw-manager-copy-selector-course
{
width
:
100%
;
border
:
solid
thin
$content-color-40
;
background-color
:
$white
;
padding
:
1em
;
margin-bottom
:
4px
;
color
:
$base-color
;
color
:
$base-color
;
cursor
:
pointer
;
cursor
:
pointer
;
outline
:
none
;
line-height
:
2em
;
&
:hover
{
&
:hover
{
color
:
$white
;
color
:
$active-color
;
background-color
:
$base-color
;
}
img
{
vertical-align
:
text-bottom
;
}
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
resources/vue/components/courseware/CoursewareManagerCopySelector.vue
+
67
−
9
View file @
42ce67b2
<
template
>
<
template
>
<div
class=
"cw-manager-copy-selector"
>
<div
class=
"cw-manager-copy-selector"
>
<div
v-if=
"sourceEmpty"
class=
"cw-manager-copy-selector-source"
>
<div
v-if=
"sourceEmpty"
class=
"cw-manager-copy-selector-source"
>
<button
class=
"
huge
button"
@
click=
"selectSource('own'); loadOwnCourseware()"
><translate>
Aus meine Inhalte kopieren
</translate></button>
<button
class=
"button"
@
click=
"selectSource('own'); loadOwnCourseware()"
><translate>
Aus meine Inhalte kopieren
</translate></button>
<button
class=
"
huge
button"
@
click=
"selectSource('remote')"
><translate>
Aus Veranstaltung kopieren
</translate></button>
<button
class=
"button"
@
click=
"selectSource('remote')"
><translate>
Aus Veranstaltung kopieren
</translate></button>
</div>
</div>
<div
v-else
>
<div
v-else
>
<button
class=
"button"
@
click=
"reset"
><translate>
Quelle auswählen
</translate></button>
<button
class=
"button"
@
click=
"reset"
><translate>
Quelle auswählen
</translate></button>
<button
v-show=
"!sourceOwn && hasRemoteCid"
class=
"button"
@
click=
"selectNewCourse"
><translate>
Veranstaltung auswählen
</translate></button>
<div
v-if=
"sourceRemote"
>
<div
v-if=
"sourceRemote"
>
<h2
v-if=
"!hasRemoteCid"
><translate>
Veranstaltungen
</translate></h2>
<h2
v-if=
"!hasRemoteCid"
><translate>
Veranstaltungen
</translate></h2>
<ul
v-if=
"!hasRemoteCid"
>
<ul
v-if=
"!hasRemoteCid"
>
<li
v-for=
"course in courses"
:key=
"course.id"
>
<li
v-for=
"semester in semesterMap"
:key=
"semester.id"
>
<button
class=
"hugebutton"
@
click=
"loadRemoteCourseware(course.id)"
>
{{
course
.
attributes
.
title
}}
</button>
<h3>
{{
semester
.
attributes
.
title
}}
</h3>
<ul>
<li
v-for=
"course in coursesBySemester(semester)"
:key=
"course.id"
class=
"cw-manager-copy-selector-course"
@
click=
"loadRemoteCourseware(course.id)"
>
<studip-icon
:shape=
"getCourseIcon(course)"
/>
{{
course
.
attributes
.
title
}}
</li>
</ul>
</li>
</li>
</ul>
</ul>
<courseware-manager-element
<courseware-manager-element
v-if=
"hasRemoteCid"
v-if=
"
remoteId !== '' &&
hasRemoteCid"
type=
"remote"
type=
"remote"
:currentElement=
"remoteElement"
:currentElement=
"remoteElement"
@
selectElement=
"setRemoteId"
@
selectElement=
"setRemoteId"
@
loadSelf=
"loadSelf"
@
loadSelf=
"loadSelf"
/>
/>
<courseware-companion-box
v-if=
"remoteId === '' && hasRemoteCid"
:msgCompanion=
"$gettext('In dieser Veranstaltung wurden noch keine Inhalte angelegt')"
mood=
"sad"
/>
</div>
</div>
<div
v-if=
"sourceOwn"
>
<div
v-if=
"sourceOwn"
>
<courseware-manager-element
<courseware-manager-element
...
@@ -61,12 +79,14 @@ export default {
...
@@ -61,12 +79,14 @@ export default {
ownCoursewareInstance
:
{},
ownCoursewareInstance
:
{},
ownId
:
''
,
ownId
:
''
,
ownElement
:
{},
ownElement
:
{},
semesterMap
:
[],
}},
}},
computed
:
{
computed
:
{
...
mapGetters
({
...
mapGetters
({
userId
:
'
userId
'
,
userId
:
'
userId
'
,
structuralElementById
:
'
courseware-structural-elements/byId
'
,
structuralElementById
:
'
courseware-structural-elements/byId
'
,
semesterById
:
'
semesters/byId
'
,
}),
}),
sourceEmpty
()
{
sourceEmpty
()
{
return
this
.
source
===
''
;
return
this
.
source
===
''
;
...
@@ -80,12 +100,16 @@ export default {
...
@@ -80,12 +100,16 @@ export default {
hasRemoteCid
()
{
hasRemoteCid
()
{
return
this
.
remoteCid
!==
''
;
return
this
.
remoteCid
!==
''
;
},
},
loadedCourses
()
{
return
this
.
courses
.
sort
((
a
,
b
)
=>
a
.
attributes
.
title
>
b
.
attributes
.
title
);
}
},
},
methods
:
{
methods
:
{
...
mapActions
({
...
mapActions
({
loadUsersCourses
:
'
loadUsersCourses
'
,
loadUsersCourses
:
'
loadUsersCourses
'
,
loadStructuralElement
:
'
loadStructuralElement
'
,
loadStructuralElement
:
'
loadStructuralElement
'
,
loadRemoteCoursewareStructure
:
'
loadRemoteCoursewareStructure
'
,
loadRemoteCoursewareStructure
:
'
loadRemoteCoursewareStructure
'
,
loadSemester
:
'
semesters/loadById
'
,
}),
}),
selectSource
(
source
)
{
selectSource
(
source
)
{
this
.
source
=
source
;
this
.
source
=
source
;
...
@@ -96,7 +120,7 @@ export default {
...
@@ -96,7 +120,7 @@ export default {
if
(
this
.
remoteCoursewareInstance
!==
null
)
{
if
(
this
.
remoteCoursewareInstance
!==
null
)
{
this
.
setRemoteId
(
this
.
remoteCoursewareInstance
.
relationships
.
root
.
data
.
id
);
this
.
setRemoteId
(
this
.
remoteCoursewareInstance
.
relationships
.
root
.
data
.
id
);
}
else
{
}
else
{
console
.
debug
(
'
can not load
'
)
;
this
.
remoteId
=
''
;
}
}
},
},
...
@@ -105,14 +129,17 @@ export default {
...
@@ -105,14 +129,17 @@ export default {
if
(
this
.
ownCoursewareInstance
!==
null
)
{
if
(
this
.
ownCoursewareInstance
!==
null
)
{
this
.
setOwnId
(
this
.
ownCoursewareInstance
.
relationships
.
root
.
data
.
id
);
this
.
setOwnId
(
this
.
ownCoursewareInstance
.
relationships
.
root
.
data
.
id
);
}
else
{
}
else
{
console
.
debug
(
'
can not load
'
)
;
this
.
ownId
=
''
;
}
}
},
},
reset
()
{
reset
()
{
this
.
selectSource
(
''
);
this
.
selectSource
(
''
);
this
.
remoteCid
=
''
;
this
.
remoteCid
=
''
;
},
},
selectNewCourse
()
{
this
.
remoteCid
=
''
;
this
.
remoteId
=
''
;
},
async
setRemoteId
(
target
)
{
async
setRemoteId
(
target
)
{
this
.
remoteId
=
target
;
this
.
remoteId
=
target
;
await
this
.
loadStructuralElement
(
this
.
remoteId
);
await
this
.
loadStructuralElement
(
this
.
remoteId
);
...
@@ -131,11 +158,42 @@ export default {
...
@@ -131,11 +158,42 @@ export default {
},
},
loadSelf
(
data
)
{
loadSelf
(
data
)
{
this
.
$emit
(
'
loadSelf
'
,
data
);
this
.
$emit
(
'
loadSelf
'
,
data
);
},
loadSemesterMap
()
{
let
view
=
this
;
let
semesters
=
[];
this
.
courses
.
every
(
course
=>
{
let
semId
=
course
.
relationships
[
'
start-semester
'
].
data
.
id
;
if
(
!
semesters
.
includes
(
semId
))
{
semesters
.
push
(
semId
);
}
return
true
;
});
semesters
.
every
(
semester
=>
{
view
.
loadSemester
({
id
:
semester
}).
then
(
()
=>
{
view
.
semesterMap
.
push
(
view
.
semesterById
({
id
:
semester
}));
view
.
semesterMap
.
sort
((
a
,
b
)
=>
a
.
attributes
.
start
<
b
.
attributes
.
start
);
});
return
true
;
});
},
coursesBySemester
(
semester
)
{
return
this
.
loadedCourses
.
filter
(
course
=>
{
return
course
.
relationships
[
'
start-semester
'
].
data
.
id
===
semester
.
id
}
);
},
getCourseIcon
(
course
)
{
if
(
course
.
attributes
[
'
course-type
'
]
===
99
)
{
return
'
studygroup
'
;
}
return
'
seminar
'
;
}
}
},
},
async
mounted
()
{
async
mounted
()
{
this
.
courses
=
await
this
.
loadUsersCourses
(
this
.
userId
);
this
.
courses
=
await
this
.
loadUsersCourses
(
this
.
userId
);
this
.
loadSemesterMap
();
}
}
}
}
</
script
>
</
script
>
\ No newline at end of file
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