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
e852574a
Commit
e852574a
authored
May 06, 2013
by
John Jarvis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding 404 handling for courses that do not exist
parent
bf5ac6c2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
12 deletions
+25
-12
lms/djangoapps/courseware/views.py
+11
-2
lms/templates/courseware/mktg_course_about.html
+14
-10
No files found.
lms/djangoapps/courseware/views.py
View file @
e852574a
...
...
@@ -534,7 +534,15 @@ def course_about(request, course_id):
@ensure_csrf_cookie
@cache_if_anonymous
def
mktg_course_about
(
request
,
course_id
):
course
=
get_course_with_access
(
request
.
user
,
course_id
,
'see_exists'
)
coming_soon
=
False
try
:
course
=
get_course_with_access
(
request
.
user
,
course_id
,
'see_exists'
)
except
:
Http404
as
e
:
# if a course does not exist yet, display a coming
# soon button
coming_soon
=
True
registered
=
registered_for_course
(
course
,
request
.
user
)
if
has_access
(
request
.
user
,
course
,
'load'
):
...
...
@@ -549,7 +557,8 @@ def mktg_course_about(request, course_id):
{
'course'
:
course
,
'registered'
:
registered
,
'course_target'
:
course_target
,
'show_courseware_link'
:
show_courseware_link
})
'show_courseware_link'
:
show_courseware_link
'coming_soon'
:
coming_soon
})
...
...
lms/templates/courseware/mktg_course_about.html
View file @
e852574a
...
...
@@ -63,18 +63,22 @@
<ul
class=
"list-actions register"
>
<li
class=
"item"
>
%if user.is_authenticated():
%if registered:
<!-- signed in, registered -->
<a
class=
"action action-register is-registered"
href=
"${course_target}"
>
Registered for
<strong>
${course.number}
</strong></a>
%if coming_soon:
<a
class=
"action action-register is-registered"
href=
"#"
>
Coming Soon
</a>
%else:
%if user.is_authenticated():
%if registered:
<!-- signed in, registered -->
<a
class=
"action action-register is-registered"
href=
"${course_target}"
>
Registered for
<strong>
${course.number}
</strong></a>
%else:
<!-- signed in, not registered -->
<a
href=
""
class=
"action action-register register"
>
Register for ${course.number}
</a>
<div
id=
"register_message"
></div>
%endif
%else:
<!--
signed in, not registered
-->
<a
href=
""
class=
"action action-register register"
>
Register for ${course.number}
</a>
<div
id=
"register_message"
></div
>
<!--
not signed in
-->
<a
class=
"action action-register is-not-signedin"
href=
"${reverse('register_user')}"
>
Register for
<strong>
${course.number}
</strong></a
>
%endif
%else:
<!-- not signed in -->
<a
class=
"action action-register is-not-signedin"
href=
"${reverse('register_user')}"
>
Register for
<strong>
${course.number}
</strong></a>
%endif
%endif
</li>
</ul>
...
...
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