Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
9f2e96d4
Commit
9f2e96d4
authored
Sep 06, 2017
by
Sofiya Semenova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ed-1260 Course teams unable to save changes to dates
parent
c9f75f6b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
3 deletions
+7
-3
cms/static/js/factories/settings.js
+2
-1
cms/static/js/models/settings/course_details.js
+1
-1
cms/static/js/spec/views/settings/main_spec.js
+2
-0
cms/templates/settings.html
+2
-1
No files found.
cms/static/js/factories/settings.js
View file @
9f2e96d4
...
...
@@ -2,7 +2,7 @@ define([
'jquery'
,
'js/models/settings/course_details'
,
'js/views/settings/main'
],
function
(
$
,
CourseDetailsModel
,
MainView
)
{
'use strict'
;
return
function
(
detailsUrl
,
showMinGradeWarning
)
{
return
function
(
detailsUrl
,
showMinGradeWarning
,
showCertificateAvailableDate
)
{
var
model
;
// highlighting labels when fields are focused in
$
(
'form :input'
)
...
...
@@ -15,6 +15,7 @@ define([
model
=
new
CourseDetailsModel
();
model
.
urlRoot
=
detailsUrl
;
model
.
showCertificateAvailableDate
=
showCertificateAvailableDate
;
model
.
fetch
({
success
:
function
(
model
)
{
var
editor
=
new
MainView
({
...
...
cms/static/js/models/settings/course_details.js
View file @
9f2e96d4
...
...
@@ -60,7 +60,7 @@ define(['backbone', 'underscore', 'gettext', 'js/models/validation_helpers', 'js
if
(
newattrs
.
end_date
&&
newattrs
.
enrollment_end
&&
newattrs
.
end_date
<
newattrs
.
enrollment_end
)
{
errors
.
enrollment_end
=
gettext
(
'The enrollment end date cannot be after the course end date.'
);
}
if
(
!
this
.
get
(
'self_paced'
)
&&
newattrs
.
end_date
&&
newattrs
.
certificate_available_date
&&
if
(
this
.
showCertificateAvailableDate
&&
newattrs
.
end_date
&&
newattrs
.
certificate_available_date
&&
newattrs
.
certificate_available_date
<
newattrs
.
end_date
)
{
errors
.
certificate_available_date
=
gettext
(
'The certificate available date must be later than the course end date.'
...
...
cms/static/js/spec/views/settings/main_spec.js
View file @
9f2e96d4
...
...
@@ -350,10 +350,12 @@ define([
AjaxHelpers
.
respondWithJson
(
requests
,
expectedJson
);
});
it
(
'should disallow save with a certificate available date before end date'
,
function
()
{
this
.
model
.
showCertificateAvailableDate
=
true
;
$
(
'#course-end-date'
).
val
(
'01/01/2030'
).
trigger
(
'change'
);
expect
(
this
.
view
.
$
(
'.message-error'
)).
toExist
();
});
it
(
'should allow save with a certificate available date before end date for self-paced course'
,
function
()
{
this
.
model
.
showCertificateAvailableDate
=
false
;
this
.
model
.
set
(
'self_paced'
,
true
);
$
(
'#course-end-date'
).
val
(
'01/01/2030'
).
trigger
(
'change'
);
expect
(
this
.
view
.
$
(
'.message-error'
)).
not
.
toExist
();
...
...
cms/templates/settings.html
View file @
9f2e96d4
...
...
@@ -38,7 +38,8 @@ CMS.URL.UPLOAD_ASSET = '${upload_asset_url | n, js_escaped_string}'
require(["js/factories/settings"], function(SettingsFactory) {
SettingsFactory(
"${details_url | n, js_escaped_string}",
${show_min_grade_warning | n, dump_js_escaped_json}
${show_min_grade_warning | n, dump_js_escaped_json},
${can_show_certificate_available_date_field(context_course) | n, dump_js_escaped_json}
);
});
</
%
block>
...
...
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