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
2839ad87
Commit
2839ad87
authored
Aug 19, 2014
by
Ben McMorran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PR cleanup
parent
46932ee0
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
21 additions
and
22 deletions
+21
-22
cms/djangoapps/contentstore/views/course.py
+2
-1
cms/static/js/index.js
+1
-1
cms/static/js/spec/views/pages/course_rerun_spec.js
+12
-12
cms/static/js/spec/views/pages/index_spec.js
+2
-3
cms/static/js/views/course_rerun.js
+2
-2
cms/static/js/views/pages/course_outline.js
+1
-1
common/djangoapps/course_action_state/migrations/0002_add_rerun_display_name.py
+1
-2
No files found.
cms/djangoapps/contentstore/views/course.py
View file @
2839ad87
...
...
@@ -240,6 +240,7 @@ def course_rerun_handler(request, course_key_string):
GET
html: return html page with form to rerun a course for the given course id
"""
# Only global staff (PMs) are able to rerun courses during the soft launch
if
not
GlobalStaff
()
.
has_user
(
request
.
user
):
raise
PermissionDenied
()
course_key
=
CourseKey
.
from_string
(
course_key_string
)
...
...
@@ -407,7 +408,7 @@ def course_listing(request):
def
_get_rerun_link_for_item
(
course_key
):
return
'/course_rerun/{}/{}/{}'
.
format
(
course_key
.
org
,
course_key
.
course
,
course_key
.
run
)
return
reverse_course_url
(
'course_rerun_handler'
,
course_key
)
@login_required
...
...
cms/static/js/index.js
View file @
2839ad87
...
...
@@ -7,7 +7,7 @@ define(["domReady", "jquery", "underscore", "js/utils/cancel_on_escape"],
url
:
$
(
this
).
data
(
'dismiss-link'
),
type
:
'DELETE'
,
success
:
function
(
result
)
{
window
.
location
.
reload
()
window
.
location
.
reload
()
;
}
});
};
...
...
cms/static/js/spec/views/pages/course_rerun_spec.js
View file @
2839ad87
define
([
"jquery"
,
"js/spec_helpers/create_sinon"
,
"js/spec_helpers/view_helpers"
,
"js/views/course_rerun"
],
function
(
$
,
create_sinon
,
view_helpers
,
CourseRerun
Page
)
{
function
(
$
,
create_sinon
,
view_helpers
,
CourseRerun
Utils
)
{
describe
(
"Create course rerun page"
,
function
()
{
var
selectors
=
{
courseOrg
:
'.rerun-course-org'
,
...
...
@@ -30,7 +30,7 @@ define(["jquery", "js/spec_helpers/create_sinon", "js/spec_helpers/view_helpers"
view_helpers
.
installMockAnalytics
();
window
.
source_course_key
=
'test_course_key'
;
appendSetFixtures
(
mockCreateCourseRerunHTML
);
CourseRerun
Page
.
onReady
();
CourseRerun
Utils
.
onReady
();
});
afterEach
(
function
()
{
...
...
@@ -38,33 +38,33 @@ define(["jquery", "js/spec_helpers/create_sinon", "js/spec_helpers/view_helpers"
delete
window
.
source_course_key
;
});
describe
(
"
validateRequiredField
"
,
function
()
{
it
(
"
ha
s a message for an empty string"
,
function
()
{
var
message
=
CourseRerun
Page
.
validateRequiredField
(
''
);
describe
(
"
Field validation
"
,
function
()
{
it
(
"
return
s a message for an empty string"
,
function
()
{
var
message
=
CourseRerun
Utils
.
validateRequiredField
(
''
);
expect
(
message
).
not
.
toBe
(
''
);
});
it
(
"does not
have
a message for a non empty string"
,
function
()
{
var
message
=
CourseRerun
Page
.
validateRequiredField
(
'edX'
);
it
(
"does not
return
a message for a non empty string"
,
function
()
{
var
message
=
CourseRerun
Utils
.
validateRequiredField
(
'edX'
);
expect
(
message
).
toBe
(
''
);
});
});
describe
(
"
setNewCourseFieldInErr
"
,
function
()
{
describe
(
"
Error messages
"
,
function
()
{
var
setErrorMessage
=
function
(
selector
,
message
)
{
var
element
=
$
(
selector
).
parent
();
CourseRerun
Page
.
setNewCourseFieldInErr
(
element
,
message
);
CourseRerun
Utils
.
setNewCourseFieldInErr
(
element
,
message
);
return
element
;
};
it
(
"
can show
an error message"
,
function
()
{
it
(
"
shows
an error message"
,
function
()
{
var
element
=
setErrorMessage
(
selectors
.
courseOrg
,
'error message'
);
expect
(
element
).
toHaveClass
(
classes
.
error
);
expect
(
element
.
children
(
selectors
.
errorField
)).
not
.
toHaveClass
(
classes
.
hidden
);
expect
(
element
.
children
(
selectors
.
errorField
)).
toContainText
(
'error message'
);
});
it
(
"
can hide
an error message"
,
function
()
{
it
(
"
hides
an error message"
,
function
()
{
var
element
=
setErrorMessage
(
selectors
.
courseOrg
,
''
);
expect
(
element
).
not
.
toHaveClass
(
classes
.
error
);
expect
(
element
.
children
(
selectors
.
errorField
)).
toHaveClass
(
classes
.
hidden
);
...
...
@@ -93,7 +93,7 @@ define(["jquery", "js/spec_helpers/create_sinon", "js/spec_helpers/view_helpers"
});
});
it
(
"
can save
course reruns"
,
function
()
{
it
(
"
saves
course reruns"
,
function
()
{
var
requests
=
create_sinon
.
requests
(
this
);
window
.
source_course_key
=
'test_course_key'
;
fillInFields
(
'DemoX'
,
'DM101'
,
'2014'
,
'Demo course'
);
...
...
cms/static/js/spec/views/pages/index_spec.js
View file @
2839ad87
define
([
"jquery"
,
"js/spec_helpers/create_sinon"
,
"js/spec_helpers/view_helpers"
,
"js/index"
],
function
(
$
,
create_sinon
,
view_helpers
,
Index
Page
)
{
function
(
$
,
create_sinon
,
view_helpers
,
Index
Utils
)
{
describe
(
"Course listing page"
,
function
()
{
var
mockIndexPageHTML
=
readFixtures
(
'mock/mock-index-page.underscore'
);
beforeEach
(
function
()
{
view_helpers
.
installMockAnalytics
();
appendSetFixtures
(
mockIndexPageHTML
);
Index
Page
.
onReady
();
Index
Utils
.
onReady
();
});
afterEach
(
function
()
{
...
...
@@ -14,7 +14,6 @@ define(["jquery", "js/spec_helpers/create_sinon", "js/spec_helpers/view_helpers"
delete
window
.
source_course_key
;
});
it
(
"can dismiss notifications"
,
function
()
{
var
requests
=
create_sinon
.
requests
(
this
);
$
(
'.dismiss-button'
).
click
();
...
...
cms/static/js/views/course_rerun.js
View file @
2839ad87
...
...
@@ -41,7 +41,7 @@ define(["domReady", "jquery", "underscore"],
},
function
(
data
)
{
if
(
data
.
url
!==
undefined
)
{
window
.
location
=
data
.
url
window
.
location
=
data
.
url
;
}
else
if
(
data
.
ErrMsg
!==
undefined
)
{
$
(
'.wrapper-error'
).
addClass
(
'is-shown'
).
removeClass
(
'is-hidden'
);
$
(
'#course_rerun_error'
).
html
(
'<p>'
+
data
.
ErrMsg
+
'</p>'
);
...
...
@@ -64,7 +64,7 @@ define(["domReady", "jquery", "underscore"],
$
(
'#course_rerun_error'
).
html
(
''
);
$
(
'wrapper-error'
).
removeClass
(
'is-shown'
).
addClass
(
'is-hidden'
);
$
(
'.rerun-course-save'
).
off
(
'click'
);
window
.
location
.
href
=
'/course/'
window
.
location
.
href
=
'/course/'
;
};
var
validateRequiredField
=
function
(
msg
)
{
...
...
cms/static/js/views/pages/course_outline.js
View file @
2839ad87
...
...
@@ -25,7 +25,7 @@ define(["jquery", "underscore", "gettext", "js/views/pages/base_page", "js/views
self
.
outlineView
.
handleAddEvent
(
event
);
});
this
.
model
.
on
(
'change'
,
this
.
setCollapseExpandVisibility
,
this
);
$
(
'.dismiss-button'
).
bind
(
'click'
,
this
.
dismissNotification
)
$
(
'.dismiss-button'
).
bind
(
'click'
,
this
.
dismissNotification
)
;
},
setCollapseExpandVisibility
:
function
()
{
...
...
common/djangoapps/course_action_state/migrations/0002_add_rerun_display_name.py
View file @
2839ad87
...
...
@@ -73,4 +73,4 @@ class Migration(SchemaMigration):
}
}
complete_apps
=
[
'course_action_state'
]
\ No newline at end of file
complete_apps
=
[
'course_action_state'
]
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