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
00fef41c
Commit
00fef41c
authored
6 years ago
by
Bruno Martin
Browse files
Options
Download
Email Patches
Plain Diff
refactor API services url to be configurable
parent
530bf560
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
60 additions
and
60 deletions
+60
-60
courses_legacy/static/js/admin/admin.js
courses_legacy/static/js/admin/admin.js
+3
-3
courses_legacy/static/js/admin/course-permissions/controllers.js
..._legacy/static/js/admin/course-permissions/controllers.js
+1
-1
courses_legacy/static/js/admin/lesson/admin.lesson.controllers.js
...legacy/static/js/admin/lesson/admin.lesson.controllers.js
+2
-2
courses_legacy/static/js/admin/lesson/admin.lesson.services.js
...es_legacy/static/js/admin/lesson/admin.lesson.services.js
+2
-2
courses_legacy/static/js/admin/messages/services.js
courses_legacy/static/js/admin/messages/services.js
+6
-6
courses_legacy/static/js/admin/new-course/controllers.js
courses_legacy/static/js/admin/new-course/controllers.js
+7
-7
courses_legacy/static/js/admin/profile-admin/profile.services.js
..._legacy/static/js/admin/profile-admin/profile.services.js
+1
-1
courses_legacy/static/js/admin/users-admin/controllers.js
courses_legacy/static/js/admin/users-admin/controllers.js
+1
-1
courses_legacy/static/js/admin/users-admin/services.js
courses_legacy/static/js/admin/users-admin/services.js
+2
-2
courses_legacy/static/js/core-services.js
courses_legacy/static/js/core-services.js
+12
-12
courses_legacy/static/js/core/services.js
courses_legacy/static/js/core/services.js
+4
-4
courses_legacy/static/js/course_material/services.js
courses_legacy/static/js/course_material/services.js
+3
-3
courses_legacy/static/js/lesson/services.js
courses_legacy/static/js/lesson/services.js
+8
-8
courses_legacy/static/js/main-nav/services.js
courses_legacy/static/js/main-nav/services.js
+1
-1
courses_legacy/static/js/notes/services.js
courses_legacy/static/js/notes/services.js
+3
-3
courses_legacy/static/js/profile/profile.services.js
courses_legacy/static/js/profile/profile.services.js
+1
-1
courses_legacy/static/js/reports/services.js
courses_legacy/static/js/reports/services.js
+3
-3
No files found.
courses_legacy/static/js/admin/admin.js
View file @
00fef41c
...
...
@@ -186,7 +186,7 @@
*/
app
.
factory
(
'
CourseDataFactory
'
,
[
'
$rootScope
'
,
'
$q
'
,
'
$resource
'
,
function
(
$rootScope
,
$q
,
$resource
)
{
var
Course
=
$resource
(
'
/api
/course/:courseSlug/
'
,{
'
courseSlug
'
:
courseSlug
});
var
Course
=
$resource
(
BASE_API_URL
+
'
/course/:courseSlug/
'
,{
'
courseSlug
'
:
courseSlug
});
var
deferred
=
$q
.
defer
();
var
antiCache
=
{
ie
:
(
new
Date
()).
getTime
().
toString
(
16
)
...
...
@@ -214,7 +214,7 @@
'
method
'
:
'
PUT
'
}
};
var
LessonList
=
$resource
(
'
/api
/lessons/:id
'
,
{
'
id
'
:
'
@id
'
},
resourceConfig
);
var
LessonList
=
$resource
(
BASE_API_URL
+
'
/lessons/:id
'
,
{
'
id
'
:
'
@id
'
},
resourceConfig
);
var
deferred
=
$q
.
defer
();
LessonList
.
query
(
function
(
lessons
){
...
...
@@ -241,7 +241,7 @@
'
method
'
:
'
PUT
'
}
};
return
$resource
(
'
/api
/lessons/:id
'
,
{
'
id
'
:
'
@id
'
},
resourceConfig
);
return
$resource
(
BASE_API_URL
+
'
/lessons/:id
'
,
{
'
id
'
:
'
@id
'
},
resourceConfig
);
}
]);
})(
angular
);
This diff is collapsed.
Click to expand it.
courses_legacy/static/js/admin/course-permissions/controllers.js
View file @
00fef41c
...
...
@@ -132,7 +132,7 @@
};
$scope
.
getUsers
=
function
(
val
)
{
return
$http
.
get
(
'
/api
/user_search
'
,
{
return
$http
.
get
(
BASE_API_URL
+
'
/user_search
'
,
{
params
:
{
name
:
val
,
sensor
:
false
...
...
This diff is collapsed.
Click to expand it.
courses_legacy/static/js/admin/lesson/admin.lesson.controllers.js
View file @
00fef41c
...
...
@@ -387,7 +387,7 @@
}
Upload
.
upload
({
url
:
'
/api
/activity_image
'
+
id
,
url
:
BASE_API_URL
+
'
/activity_image
'
+
id
,
method
:
upload_method
,
data
:
{
image
:
$scope
.
image_up
},
}).
then
(
function
(
response
){
...
...
@@ -402,7 +402,7 @@
$scope
.
deleteThumb
=
function
()
{
if
(
$scope
.
course
.
id
)
{
Upload
.
upload
({
url
:
'
/api
/activity_image/
'
+
$scope
.
currentActivity
.
id
,
url
:
BASE_API_URL
+
'
/activity_image/
'
+
$scope
.
currentActivity
.
id
,
method
:
'
PUT
'
,
data
:
{
image
:
''
},
}).
then
(
function
(
response
){
...
...
This diff is collapsed.
Click to expand it.
courses_legacy/static/js/admin/lesson/admin.lesson.services.js
View file @
00fef41c
...
...
@@ -4,7 +4,7 @@
var
app
=
angular
.
module
(
'
admin.lesson.services
'
,
[]);
app
.
factory
(
'
Unit
'
,
[
'
$resource
'
,
function
(
$resource
){
return
$resource
(
'
/api
/unit/:id/
'
);
return
$resource
(
BASE_API_URL
+
'
/unit/:id/
'
);
}]);
/**
...
...
@@ -13,7 +13,7 @@
*/
app
.
factory
(
'
SimpleLesson
'
,
[
'
$resource
'
,
function
(
$resource
){
var
resourceConfig
=
{};
var
SimpleLesson
=
$resource
(
'
/api/simple_lessons/:id
'
,
{
'
id
'
:
'
@id
'
},
resourceConfig
);
var
SimpleLesson
=
$resource
(
'
/
legacy/
api/simple_lessons/:id
'
,
{
'
id
'
:
'
@id
'
},
resourceConfig
);
return
SimpleLesson
;
}]);
...
...
This diff is collapsed.
Click to expand it.
courses_legacy/static/js/admin/messages/services.js
View file @
00fef41c
...
...
@@ -4,33 +4,33 @@
var
module
=
angular
.
module
(
'
messages.services
'
,
[
'
ngRoute
'
,
'
ngResource
'
]);
module
.
factory
(
'
Message
'
,
function
(
$resource
){
return
$resource
(
'
/api
/professor_message/:messageId
'
,
{},
{
return
$resource
(
BASE_API_URL
+
'
/professor_message/:messageId
'
,
{},
{
update
:
{
method
:
'
PUT
'
}
});
});
module
.
factory
(
'
MessageGlobal
'
,
function
(
$resource
){
return
$resource
(
'
/api
/professor_message_global/:messageId
'
,
{},
{
return
$resource
(
BASE_API_URL
+
'
/professor_message_global/:messageId
'
,
{},
{
update
:
{
method
:
'
PUT
'
}
});
});
module
.
factory
(
'
MessageRead
'
,
function
(
$resource
){
return
$resource
(
'
/api
/professor_message_read/:message
'
,
{},
{
return
$resource
(
BASE_API_URL
+
'
/professor_message_read/:message
'
,
{},
{
});
});
module
.
factory
(
'
User
'
,
function
(
$resource
){
return
$resource
(
'
/api
/user/:userId
'
,
{},
{
return
$resource
(
BASE_API_URL
+
'
/user/:userId
'
,
{},
{
});
});
module
.
factory
(
'
Group
'
,
function
(
$resource
){
return
$resource
(
'
/api
/group/:groupId
'
,
{},
{
return
$resource
(
BASE_API_URL
+
'
/group/:groupId
'
,
{},
{
});
});
module
.
factory
(
'
Student
'
,
function
(
$resource
){
return
$resource
(
'
/api
/course_student/
'
,
{},
{});
return
$resource
(
BASE_API_URL
+
'
/course_student/
'
,
{},
{});
});
})(
angular
);
This diff is collapsed.
Click to expand it.
courses_legacy/static/js/admin/new-course/controllers.js
View file @
00fef41c
...
...
@@ -89,7 +89,7 @@
var
fu
=
new
FormUpload
();
fu
.
addField
(
'
thumbnail
'
,
$scope
.
thumbfile
);
// return a new promise that file will be uploaded
return
fu
.
sendTo
(
'
/api
/coursethumbs/
'
+
$scope
.
course
.
id
)
return
fu
.
sendTo
(
BASE_API_URL
+
'
/coursethumbs/
'
+
$scope
.
course
.
id
)
.
then
(
function
(){
$scope
.
alert
.
success
(
'
A imagem atualizada.
'
);
});
...
...
@@ -105,7 +105,7 @@
var
fu
=
new
FormUpload
();
fu
.
addField
(
'
home_thumbnail
'
,
$scope
.
home_thumbfile
);
// return a new promise that file will be uploaded
return
fu
.
sendTo
(
'
/api
/coursethumbs/
'
+
$scope
.
course
.
id
)
return
fu
.
sendTo
(
BASE_API_URL
+
'
/coursethumbs/
'
+
$scope
.
course
.
id
)
.
then
(
function
(){
$scope
.
alert
.
success
(
'
A imagem atualizada.
'
);
});
...
...
@@ -113,7 +113,7 @@
};
$scope
.
export_course
=
function
()
{
$window
.
open
(
'
/admin/course/
'
+
$scope
.
course_id
+
'
/export/
'
,
'
_blank
'
,
''
);
$window
.
open
(
'
/
legacy/
admin/course/
'
+
$scope
.
course_id
+
'
/export/
'
,
'
_blank
'
,
''
);
};
$scope
.
saveCourse
=
function
()
{
...
...
@@ -155,7 +155,7 @@
$scope
.
course
.
$delete
()
.
then
(
function
(){
document
.
location
.
href
=
'
/admin/courses
'
;
document
.
location
.
href
=
'
/
legacy/
admin/courses
'
;
});
};
...
...
@@ -217,7 +217,7 @@
if
(
course_professor_picture_file
){
// return a new promise that file will be uploaded
fu
.
sendTo
(
'
legacy/api
/course_professor_picture/
'
+
course_professor
.
id
)
fu
.
sendTo
(
BASE_API_URL
+
'
/course_professor_picture/
'
+
course_professor
.
id
)
.
then
(
function
(
response
){
course_professor
.
get_picture_url
=
'
/media/
'
+
response
.
data
.
picture
;
course_professor
.
picture
=
'
/media/
'
+
response
.
data
.
picture
;
...
...
@@ -234,7 +234,7 @@
course_professor
.
$update
({
id
:
course_professor
.
id
},
function
(){
if
(
course_professor_picture_file
){
// return a new promise that file will be uploaded
fu
.
sendTo
(
'
legacy/api
/course_professor_picture/
'
+
course_professor
.
id
)
fu
.
sendTo
(
BASE_API_URL
+
'
/course_professor_picture/
'
+
course_professor
.
id
)
.
then
(
function
(
response
){
course_professor
.
get_picture_url
=
'
/media/
'
+
response
.
data
.
picture
;
course_professor
.
picture
=
'
/media/
'
+
response
.
data
.
picture
;
...
...
@@ -339,7 +339,7 @@
};
$scope
.
getUsers
=
function
(
val
)
{
return
$http
.
get
(
'
/api
/user_search
'
,
{
return
$http
.
get
(
BASE_API_URL
+
'
/user_search
'
,
{
params
:
{
name
:
val
,
sensor
:
false
...
...
This diff is collapsed.
Click to expand it.
courses_legacy/static/js/admin/profile-admin/profile.services.js
View file @
00fef41c
...
...
@@ -3,7 +3,7 @@
var
module
=
angular
.
module
(
'
profile-admin.services
'
,
[
'
ngResource
'
]);
module
.
factory
(
'
UserProfile
'
,
function
(
$resource
){
return
$resource
(
'
/api
/profile/:userId
'
,
{},
{
return
$resource
(
BASE_API_URL
+
'
/profile/:userId
'
,
{},
{
});
});
...
...
This diff is collapsed.
Click to expand it.
courses_legacy/static/js/admin/users-admin/controllers.js
View file @
00fef41c
...
...
@@ -180,7 +180,7 @@
};
$scope
.
getUsers
=
function
(
val
)
{
return
$http
.
get
(
'
/api
/user_search
'
,
{
return
$http
.
get
(
BASE_API_URL
+
'
/user_search
'
,
{
params
:
{
name
:
val
,
sensor
:
false
...
...
This diff is collapsed.
Click to expand it.
courses_legacy/static/js/admin/users-admin/services.js
View file @
00fef41c
...
...
@@ -5,13 +5,13 @@
var
module
=
angular
.
module
(
'
users-admin.services
'
,
[
'
ngResource
'
]);
module
.
factory
(
'
UserAdmin
'
,
function
(
$resource
){
return
$resource
(
'
/api
/user_admin/:user_id
'
,
{},
{
return
$resource
(
BASE_API_URL
+
'
/user_admin/:user_id
'
,
{},
{
update
:
{
method
:
'
PUT
'
}
});
});
module
.
factory
(
'
GroupAdmin
'
,
function
(
$resource
){
return
$resource
(
'
/api
/group_admin/:id
'
,
{},
{
return
$resource
(
BASE_API_URL
+
'
/group_admin/:id
'
,
{},
{
update
:
{
method
:
'
PUT
'
}
});
});
...
...
This diff is collapsed.
Click to expand it.
courses_legacy/static/js/core-services.js
View file @
00fef41c
...
...
@@ -86,7 +86,7 @@
*/
app
.
factory
(
'
CourseProfessor
'
,
[
'
$resource
'
,
function
(
$resource
)
{
return
$resource
(
'
/api
/course_professor/:id
'
,
{
'
id
'
:
'
@id
'
},
{
return
$resource
(
BASE_API_URL
+
'
/course_professor/:id
'
,
{
'
id
'
:
'
@id
'
},
{
'
update
'
:
{
'
method
'
:
'
PUT
'
}
...
...
@@ -100,7 +100,7 @@
*/
app
.
factory
(
'
CourseAuthor
'
,
[
'
$resource
'
,
function
(
$resource
)
{
return
$resource
(
'
/api
/course_author/:id
'
,
{
'
id
'
:
'
@id
'
},
{
return
$resource
(
BASE_API_URL
+
'
/course_author/:id
'
,
{
'
id
'
:
'
@id
'
},
{
'
update
'
:
{
'
method
'
:
'
PUT
'
}
...
...
@@ -112,7 +112,7 @@
* Provide a Course class.
*/
app
.
factory
(
'
Course
'
,
[
'
$resource
'
,
function
(
$resource
)
{
var
Course
=
$resource
(
'
/api
/course/:id
'
,
{
'
id
'
:
'
@id
'
});
var
Course
=
$resource
(
BASE_API_URL
+
'
/course/:id
'
,
{
'
id
'
:
'
@id
'
});
Course
.
prototype
.
isDraft
=
function
()
{
return
this
.
status
===
'
draft
'
;
};
Course
.
prototype
.
isListed
=
function
()
{
return
this
.
status
===
'
listed
'
;
};
...
...
@@ -153,7 +153,7 @@
'
method
'
:
'
PUT
'
}
};
var
Professor
=
$resource
(
'
/api
/user/:id
'
,
{
'
id
'
:
'
@id
'
},
resourceConfig
);
var
Professor
=
$resource
(
BASE_API_URL
+
'
/user/:id
'
,
{
'
id
'
:
'
@id
'
},
resourceConfig
);
Professor
.
prototype
.
getName
=
function
()
{
var
name
=
this
.
name
;
if
(
!
name
&&
(
this
.
first_name
||
this
.
last_name
))
{
...
...
@@ -172,7 +172,7 @@
var
resourceConfig
=
{
'
update
'
:
{
'
method
'
:
'
PUT
'
}
};
var
Lesson
=
$resource
(
'
/api
/lessons/:id
'
,
{
'
id
'
:
'
@id
'
},
resourceConfig
);
var
Lesson
=
$resource
(
BASE_API_URL
+
'
/lessons/:id
'
,
{
'
id
'
:
'
@id
'
},
resourceConfig
);
Lesson
.
prototype
.
countVideos
=
function
()
{
return
(
this
.
units
||
[]).
reduce
(
function
(
c
,
u
){
return
u
.
video
?
c
+
1
:
c
;
...
...
@@ -190,19 +190,19 @@
}]);
app
.
factory
(
'
CourseStudent
'
,
function
(
$resource
){
return
$resource
(
'
/api
/course_student/:id
'
,
return
$resource
(
BASE_API_URL
+
'
/course_student/:id
'
,
{
'
id
'
:
'
@id
'
},
{
'
update
'
:
{
'
method
'
:
'
PUT
'
}
});
});
app
.
factory
(
'
CertificationProcess
'
,
function
(
$resource
){
return
$resource
(
'
/api
/certification_process/:certificateId
'
,
return
$resource
(
BASE_API_URL
+
'
/certification_process/:certificateId
'
,
{
'
certificateId
'
:
'
@id
'
},
{
'
update
'
:
{
'
method
'
:
'
PUT
'
}
});
});
app
.
factory
(
'
CourseCertification
'
,
function
(
$resource
){
return
$resource
(
'
/api
/course_certification/:link_hash
'
,
return
$resource
(
BASE_API_URL
+
'
/course_certification/:link_hash
'
,
{
'
link_hash
'
:
'
@id
'
},
{
'
update
'
:
{
method
:
'
PUT
'
}
});
...
...
@@ -212,13 +212,13 @@
* Basic model class to Evaluation
*/
app
.
factory
(
'
Evaluation
'
,
function
(
$resource
){
return
$resource
(
'
/api
/evaluation/:id
'
,
{
'
id
'
:
'
@id
'
},
{
return
$resource
(
BASE_API_URL
+
'
/evaluation/:id
'
,
{
'
id
'
:
'
@id
'
},
{
'
update
'
:
{
'
method
'
:
'
PUT
'
}
});
});
app
.
factory
(
'
CertificateTemplate
'
,
function
(
$resource
){
return
$resource
(
'
/api
/certificate_template/:course
'
,
{},
{
return
$resource
(
BASE_API_URL
+
'
/certificate_template/:course
'
,
{},
{
'
update
'
:
{
'
method
'
:
'
PUT
'
},
});
});
...
...
@@ -229,7 +229,7 @@
*/
app
.
factory
(
'
StudentSearch
'
,
[
'
$http
'
,
function
(
$http
){
return
function
(
val
,
course_id
)
{
return
$http
.
get
(
'
/api
/student_search
'
,
{
return
$http
.
get
(
BASE_API_URL
+
'
/student_search
'
,
{
params
:
{
name
:
val
,
course
:
course_id
,
...
...
@@ -258,7 +258,7 @@
app
.
factory
(
'
Class
'
,
function
(
$resource
){
return
$resource
(
'
/api
/course_classes/:id
'
,
{
'
id
'
:
'
@id
'
},
{
return
$resource
(
BASE_API_URL
+
'
/course_classes/:id
'
,
{
'
id
'
:
'
@id
'
},
{
'
update
'
:
{
'
method
'
:
'
PUT
'
}
});
});
...
...
This diff is collapsed.
Click to expand it.
courses_legacy/static/js/core/services.js
View file @
00fef41c
...
...
@@ -4,24 +4,24 @@
var
app
=
angular
.
module
(
'
core.services
'
,
[]);
app
.
factory
(
'
Course
'
,
function
(
$resource
){
return
$resource
(
'
/api
/course/:courseId
'
,
{},
{
return
$resource
(
BASE_API_URL
+
'
/course/:courseId
'
,
{},
{
update
:
{
method
:
'
PUT
'
}
});
});
app
.
factory
(
'
CarouselCourse
'
,
function
(
$resource
){
return
$resource
(
'
/api
/course_carousel/:courseId
'
,
{},
{
return
$resource
(
BASE_API_URL
+
'
/course_carousel/:courseId
'
,
{},
{
});
});
app
.
factory
(
'
FlatPage
'
,
function
(
$resource
){
return
$resource
(
'
/api
/flatpage/:flatpageId
'
,
{},
{
return
$resource
(
BASE_API_URL
+
'
/flatpage/:flatpageId
'
,
{},
{
update
:
{
method
:
'
PUT
'
}
});
});
app
.
factory
(
'
Twitter
'
,
function
(
$resource
){
return
$resource
(
'
/api
/twitter/
'
,
{},
{
return
$resource
(
BASE_API_URL
+
'
/twitter/
'
,
{},
{
});
});
...
...
This diff is collapsed.
Click to expand it.
courses_legacy/static/js/course_material/services.js
View file @
00fef41c
...
...
@@ -6,15 +6,15 @@
angular
.
module
(
'
courseMaterial.services
'
,
[
'
ngRoute
'
,
'
ngResource
'
]).
factory
(
'
CourseMaterial
'
,
function
(
$resource
){
return
$resource
(
'
/api
/course_material/:course/
'
,
{},
{
return
$resource
(
BASE_API_URL
+
'
/course_material/:course/
'
,
{},
{
update
:
{
method
:
'
PUT
'
}
});
}).
factory
(
'
CourseMaterialFile
'
,
function
(
$resource
){
return
$resource
(
'
/api
/course_material_file/:id/
'
,
{},
{
return
$resource
(
BASE_API_URL
+
'
/course_material_file/:id/
'
,
{},
{
});
}).
factory
(
'
Course
'
,
function
(
$resource
){
return
$resource
(
'
/api
/course/:id
'
);
return
$resource
(
BASE_API_URL
+
'
/course/:id
'
);
});
})(
angular
);
This diff is collapsed.
Click to expand it.
courses_legacy/static/js/lesson/services.js
View file @
00fef41c
...
...
@@ -4,13 +4,13 @@
var
app
=
angular
.
module
(
'
lesson.services
'
,
[]);
app
.
factory
(
'
Answer
'
,
function
(
$resource
){
return
$resource
(
'
/api
/answer/:activityId
'
,
{},
{
return
$resource
(
BASE_API_URL
+
'
/answer/:activityId
'
,
{},
{
update
:
{
method
:
'
PUT
'
}
});
});
app
.
factory
(
'
Progress
'
,
[
'
$resource
'
,
function
(
$resource
){
var
Progress
=
$resource
(
'
/api
/student_progress/:unit
'
,
{},
{
var
Progress
=
$resource
(
BASE_API_URL
+
'
/student_progress/:unit
'
,
{},
{
'
update
'
:
{
method
:
'
PUT
'
}
});
...
...
@@ -23,11 +23,11 @@
}]);
app
.
factory
(
'
Lesson
'
,
[
'
$resource
'
,
function
(
$resource
){
return
$resource
(
'
/api
/lessons/:id/
'
);
return
$resource
(
BASE_API_URL
+
'
/lessons/:id/
'
);
}]);
app
.
factory
(
'
Unit
'
,
[
'
$resource
'
,
function
(
$resource
){
return
$resource
(
'
/api
/unit/:id/
'
);
return
$resource
(
BASE_API_URL
+
'
/unit/:id/
'
);
}]);
/**
...
...
@@ -36,7 +36,7 @@
*/
app
.
factory
(
'
SimpleLesson
'
,
[
'
$resource
'
,
function
(
$resource
){
var
resourceConfig
=
{};
var
SimpleLesson
=
$resource
(
'
/api
/simple_lessons/:id
'
,
{
'
id
'
:
'
@id
'
},
resourceConfig
);
var
SimpleLesson
=
$resource
(
BASE_API_URL
+
'
/simple_lessons/:id
'
,
{
'
id
'
:
'
@id
'
},
resourceConfig
);
return
SimpleLesson
;
}]);
...
...
@@ -68,15 +68,15 @@
]);
app
.
factory
(
'
Student
'
,
function
(
$resource
)
{
return
$resource
(
'
/api
/course_student/
'
,
{},
{});
return
$resource
(
BASE_API_URL
+
'
/course_student/
'
,
{},
{});
});
app
.
factory
(
'
CourseCertification
'
,
function
(
$resource
)
{
return
$resource
(
'
/api
/course_certification/
'
,
{},
{});
return
$resource
(
BASE_API_URL
+
'
/course_certification/
'
,
{},
{});
});
app
.
factory
(
'
ClassActivity
'
,
function
(
$resource
)
{
return
$resource
(
'
/api
/course_class_activities/
'
,
{},
{});
return
$resource
(
BASE_API_URL
+
'
/course_class_activities/
'
,
{},
{});
});
app
.
factory
(
'
resolveActivityTemplate
'
,
[
'
STATIC_URL
'
,
function
(
STATIC_URL
)
{
...
...
This diff is collapsed.
Click to expand it.
courses_legacy/static/js/main-nav/services.js
View file @
00fef41c
...
...
@@ -4,7 +4,7 @@
var
module
=
angular
.
module
(
'
main-nav.services
'
,
[
'
ngRoute
'
,
'
ngResource
'
]);
module
.
factory
(
'
Message
'
,
function
(
$resource
){
return
$resource
(
'
/api
/professor_message/:messageId
'
,
{},
{
return
$resource
(
BASE_API_URL
+
'
/professor_message/:messageId
'
,
{},
{
});
});
...
...
This diff is collapsed.
Click to expand it.
courses_legacy/static/js/notes/services.js
View file @
00fef41c
...
...
@@ -4,17 +4,17 @@
/* Services */
angular
.
module
(
'
notes.services
'
,
[
'
ngResource
'
]).
factory
(
'
Note
'
,
function
(
$resource
){
return
$resource
(
'
/api
/note/:note_id
'
,
{},
{
return
$resource
(
BASE_API_URL
+
'
/note/:note_id
'
,
{},
{
update
:
{
method
:
'
PUT
'
},
get
:
{
method
:
'
GET
'
,
isArray
:
true
}
});
}).
factory
(
'
CourseUserNotes
'
,
function
(
$resource
){
return
$resource
(
'
/api
/user_notes/:course_slug
'
,
{},
{
return
$resource
(
BASE_API_URL
+
'
/user_notes/:course_slug
'
,
{},
{
});
}).
factory
(
'
UserNotes
'
,
function
(
$resource
){
return
$resource
(
'
/api
/user_notes/
'
,
{},
{
return
$resource
(
BASE_API_URL
+
'
/user_notes/
'
,
{},
{
});
});
})(
angular
);
This diff is collapsed.
Click to expand it.
courses_legacy/static/js/profile/profile.services.js
View file @
00fef41c
...
...
@@ -3,7 +3,7 @@
var
module
=
angular
.
module
(
'
profile.services
'
,
[
'
ngResource
'
]);
module
.
factory
(
'
UserProfile
'
,
function
(
$resource
){
return
$resource
(
'
/api
/profile/:userId
'
,
{},
{
return
$resource
(
BASE_API_URL
+
'
/profile/:userId
'
,
{},
{
});
});
...
...
This diff is collapsed.
Click to expand it.
courses_legacy/static/js/reports/services.js
View file @
00fef41c
...
...
@@ -4,13 +4,13 @@
/* Services */
angular
.
module
(
'
reports.services
'
,
[
'
ngResource
'
]).
factory
(
'
CourseUserReport
'
,
function
(
$resource
){
return
$resource
(
'
/api
/reports
'
,
{},
{
return
$resource
(
BASE_API_URL
+
'
/reports
'
,
{},
{
});
}).
factory
(
'
LessonsUserProgress
'
,
function
(
$resource
){
return
$resource
(
'
/api
/lessons_user_progress/:courseId
'
,
{},
{
return
$resource
(
BASE_API_URL
+
'
/lessons_user_progress/:courseId
'
,
{},
{
});
}).
factory
(
'
CourseStats
'
,
function
(
$resource
){
return
$resource
(
'
/api
/course_stats/:courseId
'
,
{},
{
return
$resource
(
BASE_API_URL
+
'
/course_stats/:courseId
'
,
{},
{
});
}).
factory
(
'
GeneralSummary
'
,
function
(
$resource
){
return
$resource
(
'
/paralapraca/api/summary
'
,
{},
{
...
...
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