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
a745e2f8
Commit
a745e2f8
authored
Jun 29, 2012
by
Matthew Mongeau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display enrollments on dashboard. Add reverse to navigation and footer links.
parent
2926e0d5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
216 additions
and
94 deletions
+216
-94
lms/djangoapps/courseware/views.py
+7
-8
lms/djangoapps/student/migrations/0007_auto__del_courseregistration__add_courseenrollment.py
+0
-0
lms/djangoapps/student/migrations/0008_auto__chg_field_courseenrollment_course_id.py
+128
-0
lms/djangoapps/student/models.py
+2
-2
lms/djangoapps/student/views.py
+18
-3
lms/templates/accordion.html
+1
-3
lms/templates/dashboard.html
+37
-58
lms/templates/footer.html
+4
-3
lms/templates/index.html
+2
-2
lms/templates/navigation.html
+5
-5
lms/templates/portal/course_about.html
+2
-1
lms/urls.py
+10
-9
No files found.
lms/djangoapps/courseware/views.py
View file @
a745e2f8
...
@@ -269,13 +269,13 @@ def index(request, course=None, chapter=None, section=None,
...
@@ -269,13 +269,13 @@ def index(request, course=None, chapter=None, section=None,
{'content': module-error message}
{'content': module-error message}
'''
'''
user
=
request
.
user
user
=
request
.
user
module_xml
=
get_module_xml
(
user
,
course
,
chapter
,
section
)
module_xml
=
get_module_xml
(
user
,
course
,
chapter
,
section
)
if
module_xml
is
None
:
if
module_xml
is
None
:
log
.
exception
(
"couldn't get module_xml: course/chapter/section: '
%
s/
%
s/
%
s'"
,
log
.
exception
(
"couldn't get module_xml: course/chapter/section: '
%
s/
%
s/
%
s'"
,
course
,
chapter
,
section
)
course
,
chapter
,
section
)
return
{
'content'
:
render_to_string
(
"module-error.html"
,
{})}
return
{
'content'
:
render_to_string
(
"module-error.html"
,
{})}
student_module_cache
=
preload_student_modules
(
module_xml
)
student_module_cache
=
preload_student_modules
(
module_xml
)
try
:
try
:
...
@@ -287,7 +287,7 @@ def index(request, course=None, chapter=None, section=None,
...
@@ -287,7 +287,7 @@ def index(request, course=None, chapter=None, section=None,
return
{
'init'
:
module_context
.
get
(
'init_js'
,
''
),
return
{
'init'
:
module_context
.
get
(
'init_js'
,
''
),
'content'
:
module_context
[
'content'
]}
'content'
:
module_context
[
'content'
]}
if
not
settings
.
COURSEWARE_ENABLED
:
if
not
settings
.
COURSEWARE_ENABLED
:
return
redirect
(
'/'
)
return
redirect
(
'/'
)
...
@@ -366,7 +366,7 @@ def jump_to(request, probname=None):
...
@@ -366,7 +366,7 @@ def jump_to(request, probname=None):
return
index
(
request
,
return
index
(
request
,
course
=
coursename
,
chapter
=
chapter
,
course
=
coursename
,
chapter
=
chapter
,
section
=
section
,
position
=
position
)
section
=
section
,
position
=
position
)
@ensure_csrf_cookie
@ensure_csrf_cookie
def
course_info
(
request
):
def
course_info
(
request
):
...
@@ -374,15 +374,14 @@ def course_info(request):
...
@@ -374,15 +374,14 @@ def course_info(request):
# TODO: Couse should be a model
# TODO: Couse should be a model
return
render_to_response
(
'portal/course_info.html'
,
{
'csrf'
:
csrf_token
})
return
render_to_response
(
'portal/course_info.html'
,
{
'csrf'
:
csrf_token
})
@ensure_csrf_cookie
@ensure_csrf_cookie
def
course_info
(
request
,
course_id
):
def
course_info
(
request
,
course_id
):
# This is the advertising page for a student to look at the course before signing up
# This is the advertising page for a student to look at the course before signing up
csrf_token
=
csrf
(
request
)[
'csrf_token'
]
csrf_token
=
csrf
(
request
)[
'csrf_token'
]
try
:
try
:
course
=
settings
.
COURSES_BY_ID
[
course_id
]
course
=
settings
.
COURSES_BY_ID
[
course_id
]
except
KeyError
:
except
KeyError
:
raise
Http404
(
"Course not found"
)
raise
Http404
(
"Course not found"
)
return
render_to_response
(
'portal/course_about.html'
,
{
'csrf'
:
csrf_token
,
'course'
:
course
})
return
render_to_response
(
'portal/course_about.html'
,
{
'csrf'
:
csrf_token
,
'course'
:
course
})
lms/djangoapps/student/migrations/0007_auto__del_courseregistration__add_courseenrollment.py
0 → 100644
View file @
a745e2f8
This diff is collapsed.
Click to expand it.
lms/djangoapps/student/migrations/0008_auto__chg_field_courseenrollment_course_id.py
0 → 100644
View file @
a745e2f8
# -*- coding: utf-8 -*-
import
datetime
from
south.db
import
db
from
south.v2
import
SchemaMigration
from
django.db
import
models
class
Migration
(
SchemaMigration
):
def
forwards
(
self
,
orm
):
# Changing field 'CourseEnrollment.course_id'
db
.
alter_column
(
'student_courseenrollment'
,
'course_id'
,
self
.
gf
(
'django.db.models.fields.CharField'
)(
max_length
=
255
))
def
backwards
(
self
,
orm
):
# Changing field 'CourseEnrollment.course_id'
db
.
alter_column
(
'student_courseenrollment'
,
'course_id'
,
self
.
gf
(
'django.db.models.fields.IntegerField'
)())
models
=
{
'auth.group'
:
{
'Meta'
:
{
'object_name'
:
'Group'
},
'id'
:
(
'django.db.models.fields.AutoField'
,
[],
{
'primary_key'
:
'True'
}),
'name'
:
(
'django.db.models.fields.CharField'
,
[],
{
'unique'
:
'True'
,
'max_length'
:
'80'
}),
'permissions'
:
(
'django.db.models.fields.related.ManyToManyField'
,
[],
{
'to'
:
"orm['auth.Permission']"
,
'symmetrical'
:
'False'
,
'blank'
:
'True'
})
},
'auth.permission'
:
{
'Meta'
:
{
'ordering'
:
"('content_type__app_label', 'content_type__model', 'codename')"
,
'unique_together'
:
"(('content_type', 'codename'),)"
,
'object_name'
:
'Permission'
},
'codename'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'100'
}),
'content_type'
:
(
'django.db.models.fields.related.ForeignKey'
,
[],
{
'to'
:
"orm['contenttypes.ContentType']"
}),
'id'
:
(
'django.db.models.fields.AutoField'
,
[],
{
'primary_key'
:
'True'
}),
'name'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'50'
})
},
'auth.user'
:
{
'Meta'
:
{
'object_name'
:
'User'
},
'about'
:
(
'django.db.models.fields.TextField'
,
[],
{
'blank'
:
'True'
}),
'avatar_type'
:
(
'django.db.models.fields.CharField'
,
[],
{
'default'
:
"'n'"
,
'max_length'
:
'1'
}),
'bronze'
:
(
'django.db.models.fields.SmallIntegerField'
,
[],
{
'default'
:
'0'
}),
'consecutive_days_visit_count'
:
(
'django.db.models.fields.IntegerField'
,
[],
{
'default'
:
'0'
}),
'country'
:
(
'django_countries.fields.CountryField'
,
[],
{
'max_length'
:
'2'
,
'blank'
:
'True'
}),
'date_joined'
:
(
'django.db.models.fields.DateTimeField'
,
[],
{
'default'
:
'datetime.datetime.now'
}),
'date_of_birth'
:
(
'django.db.models.fields.DateField'
,
[],
{
'null'
:
'True'
,
'blank'
:
'True'
}),
'display_tag_filter_strategy'
:
(
'django.db.models.fields.SmallIntegerField'
,
[],
{
'default'
:
'0'
}),
'email'
:
(
'django.db.models.fields.EmailField'
,
[],
{
'max_length'
:
'75'
,
'blank'
:
'True'
}),
'email_isvalid'
:
(
'django.db.models.fields.BooleanField'
,
[],
{
'default'
:
'False'
}),
'email_key'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'32'
,
'null'
:
'True'
}),
'email_tag_filter_strategy'
:
(
'django.db.models.fields.SmallIntegerField'
,
[],
{
'default'
:
'1'
}),
'first_name'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'30'
,
'blank'
:
'True'
}),
'gold'
:
(
'django.db.models.fields.SmallIntegerField'
,
[],
{
'default'
:
'0'
}),
'gravatar'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'32'
}),
'groups'
:
(
'django.db.models.fields.related.ManyToManyField'
,
[],
{
'to'
:
"orm['auth.Group']"
,
'symmetrical'
:
'False'
,
'blank'
:
'True'
}),
'id'
:
(
'django.db.models.fields.AutoField'
,
[],
{
'primary_key'
:
'True'
}),
'ignored_tags'
:
(
'django.db.models.fields.TextField'
,
[],
{
'blank'
:
'True'
}),
'interesting_tags'
:
(
'django.db.models.fields.TextField'
,
[],
{
'blank'
:
'True'
}),
'is_active'
:
(
'django.db.models.fields.BooleanField'
,
[],
{
'default'
:
'True'
}),
'is_staff'
:
(
'django.db.models.fields.BooleanField'
,
[],
{
'default'
:
'False'
}),
'is_superuser'
:
(
'django.db.models.fields.BooleanField'
,
[],
{
'default'
:
'False'
}),
'last_login'
:
(
'django.db.models.fields.DateTimeField'
,
[],
{
'default'
:
'datetime.datetime.now'
}),
'last_name'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'30'
,
'blank'
:
'True'
}),
'last_seen'
:
(
'django.db.models.fields.DateTimeField'
,
[],
{
'default'
:
'datetime.datetime.now'
}),
'location'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'100'
,
'blank'
:
'True'
}),
'new_response_count'
:
(
'django.db.models.fields.IntegerField'
,
[],
{
'default'
:
'0'
}),
'password'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'128'
}),
'questions_per_page'
:
(
'django.db.models.fields.SmallIntegerField'
,
[],
{
'default'
:
'10'
}),
'real_name'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'100'
,
'blank'
:
'True'
}),
'reputation'
:
(
'django.db.models.fields.PositiveIntegerField'
,
[],
{
'default'
:
'1'
}),
'seen_response_count'
:
(
'django.db.models.fields.IntegerField'
,
[],
{
'default'
:
'0'
}),
'show_country'
:
(
'django.db.models.fields.BooleanField'
,
[],
{
'default'
:
'False'
}),
'silver'
:
(
'django.db.models.fields.SmallIntegerField'
,
[],
{
'default'
:
'0'
}),
'status'
:
(
'django.db.models.fields.CharField'
,
[],
{
'default'
:
"'w'"
,
'max_length'
:
'2'
}),
'user_permissions'
:
(
'django.db.models.fields.related.ManyToManyField'
,
[],
{
'to'
:
"orm['auth.Permission']"
,
'symmetrical'
:
'False'
,
'blank'
:
'True'
}),
'username'
:
(
'django.db.models.fields.CharField'
,
[],
{
'unique'
:
'True'
,
'max_length'
:
'30'
}),
'website'
:
(
'django.db.models.fields.URLField'
,
[],
{
'max_length'
:
'200'
,
'blank'
:
'True'
})
},
'contenttypes.contenttype'
:
{
'Meta'
:
{
'ordering'
:
"('name',)"
,
'unique_together'
:
"(('app_label', 'model'),)"
,
'object_name'
:
'ContentType'
,
'db_table'
:
"'django_content_type'"
},
'app_label'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'100'
}),
'id'
:
(
'django.db.models.fields.AutoField'
,
[],
{
'primary_key'
:
'True'
}),
'model'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'100'
}),
'name'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'100'
})
},
'student.courseenrollment'
:
{
'Meta'
:
{
'object_name'
:
'CourseEnrollment'
},
'course_id'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'255'
}),
'id'
:
(
'django.db.models.fields.AutoField'
,
[],
{
'primary_key'
:
'True'
}),
'user'
:
(
'django.db.models.fields.related.OneToOneField'
,
[],
{
'to'
:
"orm['auth.User']"
,
'unique'
:
'True'
})
},
'student.pendingemailchange'
:
{
'Meta'
:
{
'object_name'
:
'PendingEmailChange'
},
'activation_key'
:
(
'django.db.models.fields.CharField'
,
[],
{
'unique'
:
'True'
,
'max_length'
:
'32'
,
'db_index'
:
'True'
}),
'id'
:
(
'django.db.models.fields.AutoField'
,
[],
{
'primary_key'
:
'True'
}),
'new_email'
:
(
'django.db.models.fields.CharField'
,
[],
{
'db_index'
:
'True'
,
'max_length'
:
'255'
,
'blank'
:
'True'
}),
'user'
:
(
'django.db.models.fields.related.OneToOneField'
,
[],
{
'to'
:
"orm['auth.User']"
,
'unique'
:
'True'
})
},
'student.pendingnamechange'
:
{
'Meta'
:
{
'object_name'
:
'PendingNameChange'
},
'id'
:
(
'django.db.models.fields.AutoField'
,
[],
{
'primary_key'
:
'True'
}),
'new_name'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'255'
,
'blank'
:
'True'
}),
'rationale'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'1024'
,
'blank'
:
'True'
}),
'user'
:
(
'django.db.models.fields.related.OneToOneField'
,
[],
{
'to'
:
"orm['auth.User']"
,
'unique'
:
'True'
})
},
'student.registration'
:
{
'Meta'
:
{
'object_name'
:
'Registration'
,
'db_table'
:
"'auth_registration'"
},
'activation_key'
:
(
'django.db.models.fields.CharField'
,
[],
{
'unique'
:
'True'
,
'max_length'
:
'32'
,
'db_index'
:
'True'
}),
'id'
:
(
'django.db.models.fields.AutoField'
,
[],
{
'primary_key'
:
'True'
}),
'user'
:
(
'django.db.models.fields.related.ForeignKey'
,
[],
{
'to'
:
"orm['auth.User']"
,
'unique'
:
'True'
})
},
'student.userprofile'
:
{
'Meta'
:
{
'object_name'
:
'UserProfile'
,
'db_table'
:
"'auth_userprofile'"
},
'courseware'
:
(
'django.db.models.fields.CharField'
,
[],
{
'default'
:
"'course.xml'"
,
'max_length'
:
'255'
,
'blank'
:
'True'
}),
'id'
:
(
'django.db.models.fields.AutoField'
,
[],
{
'primary_key'
:
'True'
}),
'language'
:
(
'django.db.models.fields.CharField'
,
[],
{
'db_index'
:
'True'
,
'max_length'
:
'255'
,
'blank'
:
'True'
}),
'location'
:
(
'django.db.models.fields.CharField'
,
[],
{
'db_index'
:
'True'
,
'max_length'
:
'255'
,
'blank'
:
'True'
}),
'meta'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'255'
,
'blank'
:
'True'
}),
'name'
:
(
'django.db.models.fields.CharField'
,
[],
{
'db_index'
:
'True'
,
'max_length'
:
'255'
,
'blank'
:
'True'
}),
'user'
:
(
'django.db.models.fields.related.OneToOneField'
,
[],
{
'related_name'
:
"'profile'"
,
'unique'
:
'True'
,
'to'
:
"orm['auth.User']"
})
},
'student.usertestgroup'
:
{
'Meta'
:
{
'object_name'
:
'UserTestGroup'
},
'description'
:
(
'django.db.models.fields.TextField'
,
[],
{
'blank'
:
'True'
}),
'id'
:
(
'django.db.models.fields.AutoField'
,
[],
{
'primary_key'
:
'True'
}),
'name'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'32'
,
'db_index'
:
'True'
}),
'users'
:
(
'django.db.models.fields.related.ManyToManyField'
,
[],
{
'to'
:
"orm['auth.User']"
,
'db_index'
:
'True'
,
'symmetrical'
:
'False'
})
}
}
complete_apps
=
[
'student'
]
\ No newline at end of file
lms/djangoapps/student/models.py
View file @
a745e2f8
...
@@ -81,9 +81,9 @@ class PendingEmailChange(models.Model):
...
@@ -81,9 +81,9 @@ class PendingEmailChange(models.Model):
new_email
=
models
.
CharField
(
blank
=
True
,
max_length
=
255
,
db_index
=
True
)
new_email
=
models
.
CharField
(
blank
=
True
,
max_length
=
255
,
db_index
=
True
)
activation_key
=
models
.
CharField
((
'activation key'
),
max_length
=
32
,
unique
=
True
,
db_index
=
True
)
activation_key
=
models
.
CharField
((
'activation key'
),
max_length
=
32
,
unique
=
True
,
db_index
=
True
)
class
Course
Registration
(
models
.
Model
):
class
Course
Enrollment
(
models
.
Model
):
user
=
models
.
OneToOneField
(
User
,
db_index
=
True
)
user
=
models
.
OneToOneField
(
User
,
db_index
=
True
)
course_id
=
models
.
IntegerField
(
)
course_id
=
models
.
CharField
(
max_length
=
255
)
#cache_relation(User.profile)
#cache_relation(User.profile)
...
...
lms/djangoapps/student/views.py
View file @
a745e2f8
...
@@ -18,10 +18,11 @@ from django.db import IntegrityError
...
@@ -18,10 +18,11 @@ from django.db import IntegrityError
from
django.http
import
HttpResponse
,
Http404
from
django.http
import
HttpResponse
,
Http404
from
django.shortcuts
import
redirect
from
django.shortcuts
import
redirect
from
mitxmako.shortcuts
import
render_to_response
,
render_to_string
from
mitxmako.shortcuts
import
render_to_response
,
render_to_string
from
django.core.urlresolvers
import
reverse
from
django_future.csrf
import
ensure_csrf_cookie
from
django_future.csrf
import
ensure_csrf_cookie
from
models
import
Registration
,
UserProfile
,
PendingNameChange
,
PendingEmailChange
from
models
import
Registration
,
UserProfile
,
PendingNameChange
,
PendingEmailChange
,
CourseEnrollment
log
=
logging
.
getLogger
(
"mitx.student"
)
log
=
logging
.
getLogger
(
"mitx.student"
)
...
@@ -47,8 +48,13 @@ def index(request):
...
@@ -47,8 +48,13 @@ def index(request):
@ensure_csrf_cookie
@ensure_csrf_cookie
def
dashboard
(
request
):
def
dashboard
(
request
):
csrf_token
=
csrf
(
request
)[
'csrf_token'
]
csrf_token
=
csrf
(
request
)[
'csrf_token'
]
return
render_to_response
(
'dashboard.html'
,
{
'csrf'
:
csrf_token
})
user
=
request
.
user
enrollments
=
CourseEnrollment
.
objects
.
filter
(
user
=
user
)
courses
=
[
settings
.
COURSES_BY_ID
[
enrollment
.
course_id
]
for
enrollment
in
enrollments
]
context
=
{
'csrf'
:
csrf_token
,
'courses'
:
courses
}
return
render_to_response
(
'dashboard.html'
,
context
)
# Need different levels of logging
# Need different levels of logging
@ensure_csrf_cookie
@ensure_csrf_cookie
...
@@ -477,3 +483,12 @@ def about(request):
...
@@ -477,3 +483,12 @@ def about(request):
def
jobs
(
request
):
def
jobs
(
request
):
return
render_to_response
(
'jobs.html'
,
None
)
return
render_to_response
(
'jobs.html'
,
None
)
@ensure_csrf_cookie
def
enroll
(
request
,
course_id
):
course
=
settings
.
COURSES_BY_ID
[
course_id
]
user
=
request
.
user
enrollment
=
CourseEnrollment
(
user
=
user
,
course_id
=
course_id
)
enrollment
.
save
()
return
redirect
(
reverse
(
'dashboard'
))
lms/templates/accordion.html
View file @
a745e2f8
<
%!
<
%!
from
django
.
core
.
urlresolvers
import
reverse
%
>
from
django
.
core
.
urlresolvers
import
reverse
%
>
<
%
def
name=
"make_chapter(chapter)"
>
<
%
def
name=
"make_chapter(chapter)"
>
<h3><a
href=
"#"
>
${chapter['name']}
</a></h3>
<h3><a
href=
"#"
>
${chapter['name']}
</a></h3>
...
...
lms/templates/dashboard.html
View file @
a745e2f8
<
%!
from
django
.
core
.
urlresolvers
import
reverse
%
>
<
%
inherit
file=
"main.html"
/>
<
%
inherit
file=
"main.html"
/>
<
%
namespace
name=
'static'
file=
'static_content.html'
/>
<
%
namespace
name=
'static'
file=
'static_content.html'
/>
...
@@ -49,65 +50,43 @@
...
@@ -49,65 +50,43 @@
</ol>
</ol>
</nav>
</nav>
<article
class=
"my-course"
>
% if len(courses) > 0:
<a
href=
"/info"
>
% for course in courses:
<div
class=
"cover"
>
<article
class=
"my-course"
>
<div
class=
"shade"
></div>
<a
href=
"/info"
>
<div
class=
"arrow"
></div>
<div
class=
"cover"
>
<img
src=
"${static.url('images/history.png')}"
/>
<div
class=
"shade"
></div>
</div>
<div
class=
"arrow"
></div>
<section
class=
"info"
>
<img
src=
"${static.url('images/history.png')}"
/>
<hgroup>
<h2>
18th Century History
</h2>
<p>
Adam Smith, Harvard University
</p>
</hgroup>
<div
class=
"edit"
>
options
</div>
<section
class=
"meta"
>
<div
class=
"complete"
>
<p>
60% complete
</p>
</div>
<div
class=
"progress"
>
<div
class=
"meter"
>
<div
class=
"meter-fill"
></div>
</div>
</div>
<div
class=
"end-date"
>
<p>
End date:
<time>
6/10/12
</time></p>
</div>
</section>
</section>
</a>
</article>
<article
class=
"my-course"
>
<a
href=
"/info"
>
<div
class=
"cover"
>
<div
class=
"shade"
></div>
<div
class=
"arrow"
></div>
<img
src=
"${static.url('images/math.png')}"
/>
</div>
<section
class=
"info"
>
<hgroup>
<h2>
Linear Algebra
</h2>
<p>
Adam Smith, Harvard University
</p>
</hgroup>
<div
class=
"edit"
>
options
</div>
<section
class=
"meta"
>
<div
class=
"complete"
>
<p>
60% complete
</p>
</div>
</div>
<div
class=
"progress"
>
<section
class=
"info"
>
<div
class=
"meter"
>
<hgroup>
<div
class=
"meter-fill"
></div>
<h2>
${course.title}
</h2>
</div>
% for instructor in course.instructors:
</div>
<p>
${instructor}, ${course.institution}
</p>
<div
class=
"end-date"
>
% endfor
<p>
End date:
<time>
6/10/12
</time></p>
</hgroup>
</div>
<div
class=
"edit"
>
options
</div>
</section>
<section
class=
"meta"
>
</section>
<div
class=
"complete"
>
</a>
<p>
60% complete
</p>
</article>
</div>
<div
class=
"progress"
>
<div
class=
"meter"
>
<div
class=
"meter-fill"
></div>
</div>
</div>
<div
class=
"end-date"
>
<p>
End date:
<time>
6/10/12
</time></p>
</div>
</section>
</section>
</a>
</article>
% endfor
% else:
<p>
You are not enrolled in any courses.
<a
href=
"${reverse('courses')}"
>
Find some here
</a>
.
</p>
% endif
<article
class=
"my-course"
>
<article
class=
"my-course"
>
<a
href=
"/info"
>
<a
href=
"/info"
>
...
...
lms/templates/footer.html
View file @
a745e2f8
<
%!
from
django
.
core
.
urlresolvers
import
reverse
%
>
<
%
namespace
name=
'static'
file=
'static_content.html'
/>
<
%
namespace
name=
'static'
file=
'static_content.html'
/>
<footer>
<footer>
...
@@ -10,16 +11,16 @@
...
@@ -10,16 +11,16 @@
</section>
</section>
<ol>
<ol>
<li>
<li>
<a
href=
"
/courses
"
>
Find Courses
</a>
<a
href=
"
${reverse('courses')}
"
>
Find Courses
</a>
</li>
</li>
<li>
<li>
<a
href=
"
#
"
>
About
</a>
<a
href=
"
${reverse('about_edx')}
"
>
About
</a>
</li>
</li>
<li>
<li>
<a
href=
"#"
>
Blog
</a>
<a
href=
"#"
>
Blog
</a>
</li>
</li>
<li>
<li>
<a
href=
"
#
"
>
Jobs
</a>
<a
href=
"
${reverse('jobs')}
"
>
Jobs
</a>
</li>
</li>
<li
class=
"social"
>
<li
class=
"social"
>
<a
href=
"#"
><img
src=
"${static.url('images/linkedin.png')}"
/></a>
<a
href=
"#"
><img
src=
"${static.url('images/linkedin.png')}"
/></a>
...
...
lms/templates/index.html
View file @
a745e2f8
<
%!
from
django
.
core
.
urlresolvers
import
reverse
%
>
<
%
inherit
file=
"main.html"
/>
<
%
inherit
file=
"main.html"
/>
<
%
namespace
name=
'static'
file=
'static_content.html'
/>
<
%
namespace
name=
'static'
file=
'static_content.html'
/>
<section
class=
"container"
>
<section
class=
"container"
>
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
</div>
</div>
<div
class=
"signup-wrapper"
>
<div
class=
"signup-wrapper"
>
<section
class=
"sign-up"
>
<section
class=
"sign-up"
>
<a
href=
"#
"
class=
"find-courses"
>
Find Courses
</a>
<a
href=
"${reverse('courses')}
"
class=
"find-courses"
>
Find Courses
</a>
</section>
</section>
</div>
</div>
</section>
</section>
...
...
lms/templates/navigation.html
View file @
a745e2f8
...
@@ -12,14 +12,14 @@
...
@@ -12,14 +12,14 @@
<ol>
<ol>
<li
class=
"primary"
>
<li
class=
"primary"
>
<div
class=
"divider"
></div>
<div
class=
"divider"
></div>
<a
href=
"
/courses
"
>
Find Courses
</a>
<a
href=
"
${reverse('courses')}
"
>
Find Courses
</a>
<div
class=
"divider"
></div>
<div
class=
"divider"
></div>
</li>
</li>
%if not user.is_authenticated():
%if not user.is_authenticated():
<li
class=
"secondary"
>
<li
class=
"secondary"
>
<a
href=
"
/about
"
>
About
</a>
<a
href=
"
${reverse('about_edx')}
"
>
About
</a>
<a
href=
"#"
>
Blog
</a>
<a
href=
"#"
>
Blog
</a>
<a
href=
"
/jobs
"
>
Jobs
</a>
<a
href=
"
${reverse('jobs')}
"
>
Jobs
</a>
</li>
</li>
%endif
%endif
</ol>
</ol>
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
<ol>
<ol>
<li
class=
"primary"
>
<li
class=
"primary"
>
<div
class=
"divider"
></div>
<div
class=
"divider"
></div>
<a
href=
"
/dashboard
"
class=
"user-link"
>
<a
href=
"
${reverse('dashboard')}
"
class=
"user-link"
>
<span
class=
"avatar"
><img
src=
"${static.url('images/profile.jpg')}"
/></span>
<span
class=
"avatar"
><img
src=
"${static.url('images/profile.jpg')}"
/></span>
Neil deGrasse Tyson
Neil deGrasse Tyson
</a>
</a>
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
<ol
class=
"user-options"
>
<ol
class=
"user-options"
>
<li><a
href=
"#"
>
Account Settings
</a></li>
<li><a
href=
"#"
>
Account Settings
</a></li>
<li><a
href=
"#"
>
Help
</a></li>
<li><a
href=
"#"
>
Help
</a></li>
<li><a
href=
"
/logout
"
>
Log Out
</a></li>
<li><a
href=
"
${reverse('logout')}
"
>
Log Out
</a></li>
</ol>
</ol>
</li>
</li>
</ol>
</ol>
...
...
lms/templates/portal/course_about.html
View file @
a745e2f8
<
%!
from
django
.
core
.
urlresolvers
import
reverse
%
>
<
%
namespace
name=
'static'
file=
'../static_content.html'
/>
<
%
namespace
name=
'static'
file=
'../static_content.html'
/>
<
%
block
name=
"js_extra"
>
<
%
block
name=
"js_extra"
>
<script
src=
"${static.url('js/course_info.js')}"
></script>
<script
src=
"${static.url('js/course_info.js')}"
></script>
...
@@ -14,7 +15,7 @@
...
@@ -14,7 +15,7 @@
<div
class=
"course-abstract"
>
<div
class=
"course-abstract"
>
<p>
${course.get_about_section("short_description")}
</p>
<p>
${course.get_about_section("short_description")}
</p>
</div>
</div>
<a
class=
"button sign-up"
href=
"
#
"
>
Sign up
</a>
<a
class=
"button sign-up"
href=
"
${reverse('enroll', args=[course.id])}
"
>
Sign up
</a>
</header>
</header>
<section
class=
"sidebar"
>
<section
class=
"sidebar"
>
...
...
lms/urls.py
View file @
a745e2f8
...
@@ -12,9 +12,9 @@ if settings.DEBUG:
...
@@ -12,9 +12,9 @@ if settings.DEBUG:
urlpatterns
=
(
''
,
urlpatterns
=
(
''
,
url
(
r'^$'
,
'student.views.index'
,
name
=
"root"
),
# Main marketing page, or redirect to courseware
url
(
r'^$'
,
'student.views.index'
,
name
=
"root"
),
# Main marketing page, or redirect to courseware
url
(
r'^about$'
,
'student.views.about'
,
name
=
"about"
),
url
(
r'^about$'
,
'student.views.about'
,
name
=
"about
_edx
"
),
url
(
r'^jobs$'
,
'student.views.jobs'
,
name
=
"jobs"
),
url
(
r'^jobs$'
,
'student.views.jobs'
,
name
=
"jobs"
),
url
(
r'^dashboard$'
,
'student.views.dashboard'
),
url
(
r'^dashboard$'
,
'student.views.dashboard'
,
name
=
"dashboard"
),
url
(
r'^change_email$'
,
'student.views.change_email_request'
),
url
(
r'^change_email$'
,
'student.views.change_email_request'
),
url
(
r'^email_confirm/(?P<key>[^/]*)$'
,
'student.views.confirm_email_change'
),
url
(
r'^email_confirm/(?P<key>[^/]*)$'
,
'student.views.confirm_email_change'
),
url
(
r'^change_name$'
,
'student.views.change_name_request'
),
url
(
r'^change_name$'
,
'student.views.change_name_request'
),
...
@@ -26,7 +26,7 @@ urlpatterns = ('',
...
@@ -26,7 +26,7 @@ urlpatterns = ('',
url
(
r'^t/(?P<template>[^/]*)$'
,
'static_template_view.views.index'
),
url
(
r'^t/(?P<template>[^/]*)$'
,
'static_template_view.views.index'
),
url
(
r'^login$'
,
'student.views.login_user'
),
url
(
r'^login$'
,
'student.views.login_user'
),
url
(
r'^login/(?P<error>[^/]*)$'
,
'student.views.login_user'
),
url
(
r'^login/(?P<error>[^/]*)$'
,
'student.views.login_user'
),
url
(
r'^logout$'
,
'student.views.logout_user'
),
url
(
r'^logout$'
,
'student.views.logout_user'
,
name
=
'logout'
),
url
(
r'^create_account$'
,
'student.views.create_account'
),
url
(
r'^create_account$'
,
'student.views.create_account'
),
url
(
r'^activate/(?P<key>[^/]*)$'
,
'student.views.activate_account'
),
url
(
r'^activate/(?P<key>[^/]*)$'
,
'student.views.activate_account'
),
# url(r'^reactivate/(?P<key>[^/]*)$', 'student.views.reactivation_email'),
# url(r'^reactivate/(?P<key>[^/]*)$', 'student.views.reactivation_email'),
...
@@ -61,9 +61,9 @@ if settings.COURSEWARE_ENABLED:
...
@@ -61,9 +61,9 @@ if settings.COURSEWARE_ENABLED:
url
(
r'^modx/(?P<module>[^/]*)/(?P<id>[^/]*)/(?P<dispatch>[^/]*)$'
,
'courseware.module_render.modx_dispatch'
),
#reset_problem'),
url
(
r'^modx/(?P<module>[^/]*)/(?P<id>[^/]*)/(?P<dispatch>[^/]*)$'
,
'courseware.module_render.modx_dispatch'
),
#reset_problem'),
url
(
r'^change_setting$'
,
'student.views.change_setting'
),
url
(
r'^change_setting$'
,
'student.views.change_setting'
),
url
(
r'^s/(?P<template>[^/]*)$'
,
'static_template_view.views.auth_index'
),
url
(
r'^s/(?P<template>[^/]*)$'
,
'static_template_view.views.auth_index'
),
url
(
r'^book/(?P<page>[^/]*)$'
,
'staticbook.views.index'
),
url
(
r'^book/(?P<page>[^/]*)$'
,
'staticbook.views.index'
),
url
(
r'^book-shifted/(?P<page>[^/]*)$'
,
'staticbook.views.index_shifted'
),
url
(
r'^book-shifted/(?P<page>[^/]*)$'
,
'staticbook.views.index_shifted'
),
url
(
r'^book*$'
,
'staticbook.views.index'
),
url
(
r'^book*$'
,
'staticbook.views.index'
),
# url(r'^course_info/$', 'student.views.courseinfo'),
# url(r'^course_info/$', 'student.views.courseinfo'),
# url(r'^show_circuit/(?P<circuit>[^/]*)$', 'circuit.views.show_circuit'),
# url(r'^show_circuit/(?P<circuit>[^/]*)$', 'circuit.views.show_circuit'),
url
(
r'^edit_circuit/(?P<circuit>[^/]*)$'
,
'circuit.views.edit_circuit'
),
url
(
r'^edit_circuit/(?P<circuit>[^/]*)$'
,
'circuit.views.edit_circuit'
),
...
@@ -72,14 +72,15 @@ if settings.COURSEWARE_ENABLED:
...
@@ -72,14 +72,15 @@ if settings.COURSEWARE_ENABLED:
url
(
r'^heartbeat$'
,
include
(
'heartbeat.urls'
)),
url
(
r'^heartbeat$'
,
include
(
'heartbeat.urls'
)),
# Multicourse related:
# Multicourse related:
url
(
r'^courses$'
,
'courseware.views.courses'
),
url
(
r'^courses$'
,
'courseware.views.courses'
,
name
=
"courses"
),
url
(
r'^courses/(?P<course_id>[^/]*)/info$'
,
'util.views.info'
,
name
=
"info"
),
url
(
r'^courses/(?P<course_id>[^/]*)/info$'
,
'util.views.info'
,
name
=
"info"
),
url
(
r'^courses/(?P<course_id>[^/]*)/book$'
,
'staticbook.views.index'
,
name
=
"book"
),
url
(
r'^courses/(?P<course_id>[^/]*)/book$'
,
'staticbook.views.index'
,
name
=
"book"
),
url
(
r'^courses/(?P<course_id>[^/]*)/enroll$'
,
'student.views.enroll'
,
name
=
"enroll"
),
url
(
r'^courses/(?P<course_id>[^/]*)/courseware/?$'
,
'courseware.views.index'
,
name
=
"courseware"
),
url
(
r'^courses/(?P<course_id>[^/]*)/courseware/?$'
,
'courseware.views.index'
,
name
=
"courseware"
),
url
(
r'^courses/(?P<course_id>[^/]*)/courseware/(?P<chapter>[^/]*)/(?P<section>[^/]*)/$'
,
'courseware.views.index'
,
name
=
"courseware_section"
),
url
(
r'^courses/(?P<course_id>[^/]*)/courseware/(?P<chapter>[^/]*)/(?P<section>[^/]*)/$'
,
'courseware.views.index'
,
name
=
"courseware_section"
),
url
(
r'^courses/(?P<course_id>[^/]*)/profile$'
,
'courseware.views.profile'
,
name
=
"profile"
),
url
(
r'^courses/(?P<course_id>[^/]*)/profile$'
,
'courseware.views.profile'
,
name
=
"profile"
),
url
(
r'^courses/(?P<course_id>[^/]*)/profile/(?P<student_id>[^/]*)/$'
,
'courseware.views.profile'
),
url
(
r'^courses/(?P<course_id>[^/]*)/profile/(?P<student_id>[^/]*)/$'
,
'courseware.views.profile'
),
url
(
r'^courses/(?P<course_id>[^/]*)/about$'
,
'courseware.views.course_info'
,
name
=
"about_course"
),
url
(
r'^courses/(?P<course_id>[^/]*)/about$'
,
'courseware.views.course_info'
,
name
=
"about_course"
),
)
)
...
...
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