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
475ef82e
Commit
475ef82e
authored
Apr 25, 2019
by
Leonardo Piccioni de Almeida
Browse files
Start changing base API URL.
parent
4b34e924
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
50 deletions
+51
-50
courses_legacy/administration/static/js/factories/timtec-models.js
...egacy/administration/static/js/factories/timtec-models.js
+15
-15
courses_legacy/static/js/admin/factories/timtec-models.js
courses_legacy/static/js/admin/factories/timtec-models.js
+15
-15
courses_legacy/templates/base.html
courses_legacy/templates/base.html
+21
-20
No files found.
courses_legacy/administration/static/js/factories/timtec-models.js
View file @
475ef82e
...
...
@@ -102,7 +102,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
'
}
...
...
@@ -116,7 +116,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
'
}
...
...
@@ -129,7 +129,7 @@
* list of fields that reflects Course model in Django
*/
app
.
factory
(
'
Course
'
,
[
'
$resource
'
,
'
getRestOptions
'
,
function
(
$resource
,
getRestOptions
)
{
var
Course
=
$resource
(
'
/api/course/:id
'
,
{
'
id
'
:
'
@id
'
});
var
Course
=
$resource
(
BASE_API_URL
+
'
/api/course/:id
'
,
{
'
id
'
:
'
@id
'
});
Course
.
prototype
.
isDraft
=
function
()
{
return
this
.
status
===
'
draft
'
;
};
Course
.
prototype
.
isListed
=
function
()
{
return
this
.
status
===
'
listed
'
;
};
...
...
@@ -150,7 +150,7 @@
};
getRestOptions
(
'
/api
/course
'
).
success
(
function
(
data
)
{
getRestOptions
(
BASE_API_URL
+
'
/course
'
).
success
(
function
(
data
)
{
Course
.
fields
=
angular
.
copy
(
data
.
actions
.
POST
);
});
...
...
@@ -175,7 +175,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
))
{
...
...
@@ -194,7 +194,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
;
...
...
@@ -217,7 +217,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
);
SimpleLesson
.
prototype
.
countVideos
=
function
()
{
return
(
this
.
units
||
[]).
reduce
(
function
(
c
,
u
){
return
u
.
video
?
c
+
1
:
c
;
...
...
@@ -235,19 +235,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
'
}
});
});
...
...
@@ -256,13 +256,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
'
},
});
});
...
...
@@ -292,7 +292,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
,
...
...
@@ -325,7 +325,7 @@
*/
app
.
factory
(
'
UserSearch
'
,
[
'
$http
'
,
function
(
$http
){
return
function
(
val
,
course_id
)
{
return
$http
.
get
(
'
/api
/user_search
'
,
{
return
$http
.
get
(
BASE_API_URL
+
'
/user_search
'
,
{
params
:
{
name
:
val
,
sensor
:
false
...
...
@@ -353,7 +353,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
'
}
});
});
...
...
courses_legacy/static/js/admin/factories/timtec-models.js
View file @
475ef82e
...
...
@@ -102,7 +102,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
'
}
...
...
@@ -116,7 +116,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
'
}
...
...
@@ -129,7 +129,7 @@
* list of fields that reflects Course model in Django
*/
app
.
factory
(
'
Course
'
,
[
'
$resource
'
,
'
getRestOptions
'
,
function
(
$resource
,
getRestOptions
)
{
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
'
;
};
...
...
@@ -150,7 +150,7 @@
};
getRestOptions
(
'
/api
/course
'
).
success
(
function
(
data
)
{
getRestOptions
(
BASE_API_URL
+
'
/course
'
).
success
(
function
(
data
)
{
Course
.
fields
=
angular
.
copy
(
data
.
actions
.
POST
);
});
...
...
@@ -175,7 +175,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
))
{
...
...
@@ -194,7 +194,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
;
...
...
@@ -217,7 +217,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
);
SimpleLesson
.
prototype
.
countVideos
=
function
()
{
return
(
this
.
units
||
[]).
reduce
(
function
(
c
,
u
){
return
u
.
video
?
c
+
1
:
c
;
...
...
@@ -235,19 +235,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
'
}
});
});
...
...
@@ -256,13 +256,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
'
},
});
});
...
...
@@ -292,7 +292,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
,
...
...
@@ -325,7 +325,7 @@
*/
app
.
factory
(
'
UserSearch
'
,
[
'
$http
'
,
function
(
$http
){
return
function
(
val
,
course_id
)
{
return
$http
.
get
(
'
/api
/user_search
'
,
{
return
$http
.
get
(
BASE_API_URL
+
'
/user_search
'
,
{
params
:
{
name
:
val
,
sensor
:
false
...
...
@@ -353,7 +353,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
'
}
});
});
...
...
courses_legacy/templates/base.html
View file @
475ef82e
...
...
@@ -12,18 +12,19 @@
<title>
{% block title %}{{ site.name }}{% endblock %}
</title>
<link
rel=
'stylesheet'
type=
'text/css'
href=
"https://unpkg.com/font-awesome@4.7
.0
/css/font-awesome.min.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"https://unpkg.com/bootstrap@3.
3.6
/dist/css/bootstrap.min.css"
/>
<link
rel=
'stylesheet'
type=
'text/css'
href=
"https://unpkg.com/font-awesome@4.7/css/font-awesome.min.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"https://unpkg.com/bootstrap@3.
4.1
/dist/css/bootstrap.min.css"
/>
<!--<link rel='stylesheet' href="{% static 'angular-loading-bar/src/loading-bar.css' %}" type='text/css' media='all' />-->
<link
rel=
"stylesheet"
type=
"text/css"
href=
"https://unpkg.com/ui-select@0.19
.4
/dist/select.min.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"https://unpkg.com/ui-select@0.19/dist/select.min.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/styles.bundle.css"
/>
{% compress css %}
<link
rel=
'stylesheet'
href=
"{% static 'scss/main-paralapraca.scss' %}"
type=
'text/x-scss'
media=
'screen,projection,print'
/>
{% endcompress %}
<script>
window
.
BASE_API_URL
=
'
/legacy/api
'
;
window
.
STATIC_URL
=
'
{{ STATIC_URL }}
'
;
window
.
MEDIA_URL
=
'
{{ MEDIA_URL }}
'
;
window
.
DEBUG
=
'
{{ DEBUG }}
'
;
...
...
@@ -34,23 +35,23 @@
<!-- All -->
<script
type=
"text/javascript"
src=
"https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.min.js"
></script>
<script
type=
"text/javascript"
src=
"https://unpkg.com/jquery@1.
9.1
/jquery.min.js"
></script>
<script
type=
"text/javascript"
src=
"https://code.jquery.com/ui/1.1
0.3
/jquery-ui.min.js"
></script>
<script
type=
"text/javascript"
src=
"https://unpkg.com/bootstrap@3.
3.6
/dist/js/bootstrap.min.js"
></script>
<script
type=
"text/javascript"
src=
"https://unpkg.com/jquery@1.
12/dist
/jquery.min.js"
></script>
<script
type=
"text/javascript"
src=
"https://code.jquery.com/ui/1.1
2.1
/jquery-ui.min.js"
></script>
<script
type=
"text/javascript"
src=
"https://unpkg.com/bootstrap@3.
4.1
/dist/js/bootstrap.min.js"
></script>
<!-- Angular -->
<script
src=
"https://unpkg.com/angular@1.
5.6
/angular.min.js"
></script>
<script
src=
"https://unpkg.com/angular-animate@1.
5.6
/angular-animate.min.js"
></script>
<script
src=
"https://unpkg.com/angular-resource@1.
5.6
/angular-resource.min.js"
></script>
<script
src=
"https://unpkg.com/angular-route@1.
5.6
/angular-route.min.js"
></script>
<script
src=
"https://unpkg.com/angular-sanitize@1.
5.6
/angular-sanitize.min.js"
></script>
<script
src=
"https://unpkg.com/angular-touch@1.
5.6
/angular-touch.min.js"
></script>
<script
src=
"
//ajax.googleapis.com/ajax/libs/angularjs/1.5.6
/angular-cookies.js"
></script>
<script
src=
"https://
cdnjs.cloudflare.com/ajax/libs
/angular-gettext
/
2.4
.1
/angular-gettext.min.js"
></script>
<script
src=
"https://
cdnjs.cloudflare.com/ajax/libs
/angular-i18n
/
1.
3.2
/angular-locale_pt-br.
min.
js"
></script>
<!--
<script type="text/javascript" src="https://unpkg.com/angular-bootstrap@0.12.2/ui-bootstrap.min.js"></script>
-->
<script
src=
"https://unpkg.com/angular@1.
7
/angular.min.js"
></script>
<script
src=
"https://unpkg.com/angular-animate@1.
7
/angular-animate.min.js"
></script>
<script
src=
"https://unpkg.com/angular-resource@1.
7
/angular-resource.min.js"
></script>
<script
src=
"https://unpkg.com/angular-route@1.
7
/angular-route.min.js"
></script>
<script
src=
"https://unpkg.com/angular-sanitize@1.
7
/angular-sanitize.min.js"
></script>
<script
src=
"https://unpkg.com/angular-touch@1.
7
/angular-touch.min.js"
></script>
<script
src=
"
https://unpkg.com/angular-cookies@1.7
/angular-cookies.
min.
js"
></script>
<script
src=
"https://
unpkg.com
/angular-gettext
@
2.4
/dist
/angular-gettext.min.js"
></script>
<script
src=
"https://
unpkg.com
/angular-i18n
@
1.
7
/angular-locale_pt-br.js"
></script>
<script
type=
"text/javascript"
src=
"https://unpkg.com/angular-bootstrap@0.12.2/ui-bootstrap.min.js"
></script>
<script
src=
"https://unpkg.com/angular-ui-bootstrap@2.5.6/dist/ui-bootstrap-tpls.js"
></script>
<script
src=
"https://unpkg.com/angular-local-storage@0.7.1/dist/angular-local-storage.min.js"
></script>
<script
src=
"https://cdnjs.cloudflare.com/ajax/libs/angular-loading-bar/0.9.0/loading-bar.min.js"
></script>
...
...
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