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
4946fbcd
Commit
4946fbcd
authored
Aug 14, 2013
by
Diana Huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change registration button based on number of modes.
parent
03b60503
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
7 deletions
+22
-7
lms/djangoapps/courseware/views.py
+16
-6
lms/templates/courseware/mktg_course_about.html
+6
-1
No files found.
lms/djangoapps/courseware/views.py
View file @
4946fbcd
...
...
@@ -25,6 +25,7 @@ from courseware.masquerade import setup_masquerade
from
courseware.model_data
import
ModelDataCache
from
.module_render
import
toc_for_course
,
get_module_for_descriptor
,
get_module
from
courseware.models
import
StudentModule
,
StudentModuleHistory
from
course_modes.models
import
CourseMode
from
django_comment_client.utils
import
get_discussion_title
...
...
@@ -600,9 +601,14 @@ def course_about(request, course_id):
'registered'
:
registered
,
'course_target'
:
course_target
,
'show_courseware_link'
:
show_courseware_link
})
@ensure_csrf_cookie
@cache_if_anonymous
def
mktg_course_about
(
request
,
course_id
):
"""
This is the button that gets put into an iframe on the Drupal site
"""
try
:
course
=
get_course_with_access
(
request
.
user
,
course_id
,
'see_exists'
)
...
...
@@ -610,7 +616,7 @@ def mktg_course_about(request, course_id):
# if a course does not exist yet, display a coming
# soon button
return
render_to_response
(
'courseware/mktg_coming_soon.html'
,
{
'course_id'
:
course_id
})
{
'course_id'
:
course_id
})
registered
=
registered_for_course
(
course
,
request
.
user
)
...
...
@@ -623,13 +629,17 @@ def mktg_course_about(request, course_id):
show_courseware_link
=
(
has_access
(
request
.
user
,
course
,
'load'
)
or
settings
.
MITX_FEATURES
.
get
(
'ENABLE_LMS_MIGRATION'
))
course_modes
=
CourseMode
.
modes_for_course
(
course
.
id
)
return
render_to_response
(
'courseware/mktg_course_about.html'
,
{
'course'
:
course
,
'registered'
:
registered
,
'allow_registration'
:
allow_registration
,
'course_target'
:
course_target
,
'show_courseware_link'
:
show_courseware_link
})
{
'course'
:
course
,
'registered'
:
registered
,
'allow_registration'
:
allow_registration
,
'course_target'
:
course_target
,
'show_courseware_link'
:
show_courseware_link
,
'course_modes'
:
course_modes
,
})
def
render_notifications
(
request
,
course
,
notifications
):
...
...
lms/templates/courseware/mktg_course_about.html
View file @
4946fbcd
...
...
@@ -52,7 +52,12 @@
<div
class=
"action is-registered"
>
${_("You Are Registered")}
</div>
%endif
%elif allow_registration:
<a
class=
"action action-register register"
href=
"#"
>
${_("Register for")}
<strong>
${course.display_number_with_default | h}
</strong></a>
<a
class=
"action action-register register"
href=
"#"
>
${_("Register for")}
<strong>
${course.display_number_with_default | h}
</strong>
%if len(course_modes) > 1:
<br
/>
and choose your student track
%endif
</a>
%else:
<div
class=
"action registration-closed is-disabled"
>
${_("Registration Is Closed")}
</div>
%endif
...
...
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