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
f68e10a6
Commit
f68e10a6
authored
Sep 05, 2012
by
Calen Pennington
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #624 from MITx/rocha/master
Cleanup of 'About Course' page link to its Courseware
parents
2a8e47c3
f6153387
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
13 deletions
+12
-13
lms/djangoapps/courseware/views.py
+10
-1
lms/templates/portal/course_about.html
+2
-12
No files found.
lms/djangoapps/courseware/views.py
View file @
f68e10a6
...
...
@@ -264,10 +264,19 @@ def registered_for_course(course, user):
def
course_about
(
request
,
course_id
):
course
=
get_course_with_access
(
request
.
user
,
course_id
,
'see_exists'
)
registered
=
registered_for_course
(
course
,
request
.
user
)
show_courseware_link
=
has_access
(
request
.
user
,
course
,
'load'
)
if
has_access
(
request
.
user
,
course
,
'load'
):
course_target
=
reverse
(
'info'
,
args
=
[
course
.
id
])
else
:
course_target
=
reverse
(
'about_course'
,
args
=
[
course
.
id
])
show_courseware_link
=
(
has_access
(
request
.
user
,
course
,
'load'
)
or
settings
.
MITX_FEATURES
.
get
(
'ENABLE_LMS_MIGRATION'
))
return
render_to_response
(
'portal/course_about.html'
,
{
'course'
:
course
,
'registered'
:
registered
,
'course_target'
:
course_target
,
'show_courseware_link'
:
show_courseware_link
})
...
...
lms/templates/portal/course_about.html
View file @
f68e10a6
...
...
@@ -63,22 +63,12 @@
<div
class=
"main-cta"
>
%if user.is_authenticated():
%if registered:
<
%
##
TODO:
move
this
logic
into
a
view
if
has_access
(
user
,
course
,
'
load
')
:
course_target =
reverse('info',
args=
[course.id])
else:
course_target =
reverse('about_course',
args=
[course.id])
show_link =
settings.MITX_FEATURES.get('ENABLE_LMS_MIGRATION')
%
>
%if show_link or show_courseware_link:
%if show_courseware_link:
<a
href=
"${course_target}"
>
%endif
<span
class=
"register disabled"
>
You are registered for this course (${course.number})
</span>
%
if show_courseware_link:
%if show_courseware_link:
<strong>
View Courseware
</strong>
% endif
%if show_link or show_courseware_link:
</a>
%endif
%else:
...
...
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