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
40393b21
Commit
40393b21
authored
Aug 23, 2013
by
Diana Huang
Committed by
David Ormsbee
Aug 27, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add in a new HTML class that represents the enrollment mode.
parent
134e09b2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
8 deletions
+6
-8
common/djangoapps/student/views.py
+4
-6
lms/templates/dashboard.html
+2
-2
No files found.
common/djangoapps/student/views.py
View file @
40393b21
import
datetime
import
feedparser
import
json
import
logging
import
random
...
...
@@ -31,7 +30,6 @@ from django.views.decorators.http import require_POST
from
ratelimitbackend.exceptions
import
RateLimitException
from
mitxmako.shortcuts
import
render_to_response
,
render_to_string
from
bs4
import
BeautifulSoup
from
course_modes.models
import
CourseMode
from
student.models
import
(
Registration
,
UserProfile
,
TestCenterUser
,
TestCenterUserForm
,
...
...
@@ -262,7 +260,7 @@ def dashboard(request):
courses
=
[]
for
enrollment
in
CourseEnrollment
.
enrollments_for_user
(
user
):
try
:
courses
.
append
(
course_from_id
(
enrollment
.
course_id
))
courses
.
append
(
(
course_from_id
(
enrollment
.
course_id
),
enrollment
))
except
ItemNotFoundError
:
log
.
error
(
"User {0} enrolled in non-existent course {1}"
.
format
(
user
.
username
,
enrollment
.
course_id
))
...
...
@@ -279,12 +277,12 @@ def dashboard(request):
staff_access
=
True
errored_courses
=
modulestore
()
.
get_errored_courses
()
show_courseware_links_for
=
frozenset
(
course
.
id
for
course
in
courses
show_courseware_links_for
=
frozenset
(
course
.
id
for
course
,
_enrollment
in
courses
if
has_access
(
request
.
user
,
course
,
'load'
))
cert_statuses
=
{
course
.
id
:
cert_info
(
request
.
user
,
course
)
for
course
in
courses
}
cert_statuses
=
{
course
.
id
:
cert_info
(
request
.
user
,
course
)
for
course
,
_enrollment
in
courses
}
exam_registrations
=
{
course
.
id
:
exam_registration_info
(
request
.
user
,
course
)
for
course
in
courses
}
exam_registrations
=
{
course
.
id
:
exam_registration_info
(
request
.
user
,
course
)
for
course
,
_enrollment
in
courses
}
# get info w.r.t ExternalAuthMap
external_auth_map
=
None
...
...
lms/templates/dashboard.html
View file @
40393b21
...
...
@@ -129,9 +129,9 @@
</header>
% if len(courses) > 0:
% for course in courses:
% for course
, enrollment
in courses:
<article
class=
"my-course
"
>
<article
class=
"my-course ${enrollment.mode}
"
>
<
%
course_target =
reverse('info',
args=
[course.id])
%
>
...
...
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