Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
MOOC packages by hacklab
django-courses-legacy
Commits
ae535a6e
Commit
ae535a6e
authored
5 years ago
by
Bruno Martin
Browse files
Options
Download
Email Patches
Plain Diff
fix courses lists getting course Student
parent
546b7ad9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
courses_legacy/static/js/my-courses/controllers.js
courses_legacy/static/js/my-courses/controllers.js
+12
-0
No files found.
courses_legacy/static/js/my-courses/controllers.js
View file @
ae535a6e
...
...
@@ -5,9 +5,11 @@
app
.
controller
(
'
CourseListByPositionController
'
,
[
'
$scope
'
,
'
Course
'
,
'
CourseStudent
'
,
function
(
$scope
,
Course
,
CourseStudent
,
)
{
function
compare_by_position
(
a
,
b
)
{
...
...
@@ -27,6 +29,16 @@
Course
.
query
({},
function
(
courses
)
{
courses
.
sort
(
compare_by_position
);
$scope
.
courses
=
courses
;
CourseStudent
.
query
({},
function
(
course_students
){
$scope
.
course_students
=
course_students
angular
.
forEach
(
$scope
.
courses
,
function
(
course
)
{
angular
.
forEach
(
$scope
.
course_students
,
function
(
course_student
)
{
if
(
course
.
id
===
course_student
.
course
.
id
)
{
course
.
course_student
=
course_student
;
}
});
});
});
});
}
]);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment