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
5600d135
Commit
5600d135
authored
Oct 13, 2014
by
Omar Al-Ithawi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
All courses page
parent
72881001
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
1 deletions
+34
-1
lms/djangoapps/edraak_misc/urls.py
+1
-0
lms/djangoapps/edraak_misc/views.py
+31
-1
lms/templates/all_courses.html
+2
-0
No files found.
lms/djangoapps/edraak_misc/urls.py
View file @
5600d135
...
...
@@ -18,4 +18,5 @@ def i18n_patterns(prefix, *args):
urlpatterns
=
patterns
(
''
,
url
(
r'^setlang/$'
,
'edraak_misc.views.set_language'
,
name
=
'edraak_setlang'
),
url
(
r'^check_student_grades/$'
,
'edraak_misc.views.check_student_grades'
,
name
=
'edraak_check_student_grades'
),
url
(
r'^all_courses/$'
,
'edraak_misc.views.all_courses'
,
name
=
'edraak_all_courses'
),
)
lms/djangoapps/edraak_misc/views.py
View file @
5600d135
from
django.views.i18n
import
set_language
as
django_set_language
from
django.views.decorators.csrf
import
csrf_exempt
from
django.views.decorators.csrf
import
csrf_exempt
,
ensure_csrf_cookie
from
xmodule.modulestore.django
import
modulestore
from
courseware.access
import
has_access
from
util.json_request
import
JsonResponse
from
courseware.grades
import
grade
from
opaque_keys.edx
import
locator
from
util.cache
import
cache_if_anonymous
from
django.conf
import
settings
from
courseware.courses
import
get_courses
,
sort_by_announcement
from
edxmako.shortcuts
import
render_to_response
from
django.contrib.auth.models
import
AnonymousUser
@csrf_exempt
def
set_language
(
request
):
...
...
@@ -30,3 +35,28 @@ def check_student_grades(request):
return
JsonResponse
({
'success'
:
False
,
'error'
:
False
})
except
:
return
JsonResponse
({
'success'
:
False
,
'error'
:
True
})
@ensure_csrf_cookie
@cache_if_anonymous
def
all_courses
(
request
,
extra_context
=
{},
user
=
AnonymousUser
()):
"""
Render the edX main page.
extra_context is used to allow immediate display of certain modal windows, eg signup,
as used by external_auth.
"""
# The course selection work is done in courseware.courses.
domain
=
settings
.
FEATURES
.
get
(
'FORCE_UNIVERSITY_DOMAIN'
)
# normally False
# do explicit check, because domain=None is valid
if
domain
is
False
:
domain
=
request
.
META
.
get
(
'HTTP_HOST'
)
courses
=
get_courses
(
user
,
domain
=
domain
)
courses
=
sort_by_announcement
(
courses
)
context
=
{
'courses'
:
courses
}
context
.
update
(
extra_context
)
return
render_to_response
(
'all_courses.html'
,
context
)
lms/templates/all_courses.html
0 → 100644
View file @
5600d135
## Just an empty placeholder
## Actual implementation is available in Edraak theme
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