Commit c17ba15f by Jonathan Piacenti Committed by E. Kolpakov

Made empty course url the 'home' url instead.

parent 4d825106
"""
Views related to operations on course objects
"""
from django.shortcuts import redirect
import json
import random
import string # pylint: disable=deprecated-module
......@@ -71,7 +72,8 @@ from microsite_configuration import microsite
from xmodule.course_module import CourseFields
__all__ = ['course_info_handler', 'course_handler', 'course_info_update_handler',
__all__ = ['course_info_handler', 'course_handler', 'course_listing',
'course_info_update_handler',
'course_rerun_handler',
'settings_handler',
'grading_handler',
......@@ -230,7 +232,7 @@ def course_handler(request, course_key_string=None):
return HttpResponseBadRequest()
elif request.method == 'GET': # assume html
if course_key_string is None:
return course_listing(request)
return redirect(reverse("home"))
else:
return course_index(request, CourseKey.from_string(course_key_string))
else:
......
......@@ -14,7 +14,7 @@
<%block name="content">
<div class="wrapper-mast wrapper">
<header class="mast has-actions">
<h1 class="page-header">${_("My Courses")}</h1>
<h1 class="page-header">${_("Studio Home")}</h1>
% if user.is_active:
<nav class="nav-actions">
......@@ -43,33 +43,6 @@
<section class="content">
<article class="content-primary" role="main">
<div class="introduction">
<h2 class="title">${_("Welcome, {0}!").format(user.username)}</h2>
%if len(courses) > 0 or len(libraries) > 0:
<div class="copy">
<p>
%if libraries_enabled:
${_("Here are all of the courses and librariess you currently have access to in {studio_name}:").format(studio_name=settings.STUDIO_SHORT_NAME)}
%else:
${_("Here are all of the courses you currently have access to in {studio_name}:").format(studio_name=settings.STUDIO_SHORT_NAME)}
%endif
</p>
</div>
%else:
<div class="copy">
<p>
%if libraries_enabled:
${_("You currently aren't associated with any {studio_name} Courses and Libraries").format(studio_name=settings.STUDIO_SHORT_NAME)}
%else:
${_("You currently aren't associated with any {studio_name} Courses.").format(studio_name=settings.STUDIO_SHORT_NAME)}
%endif
</p>
</div>
%endif
</div>
% if course_creator_status=='granted':
<div class="wrapper-create-element wrapper-create-course">
<form class="form-create create-course course-info" id="create-course-form" name="create-course-form">
......
......@@ -77,6 +77,7 @@ urlpatterns += patterns(
r'^course_info_update/{}/(?P<provided_id>\d+)?$'.format(settings.COURSE_KEY_PATTERN),
'course_info_update_handler'
),
url(r'^home/$', 'course_listing', name='home'),
url(r'^course/{}?$'.format(settings.COURSE_KEY_PATTERN), 'course_handler', name='course_handler'),
url(r'^course_notifications/{}/(?P<action_state_id>\d+)?$'.format(settings.COURSE_KEY_PATTERN), 'course_notifications_handler'),
url(r'^course_rerun/{}$'.format(settings.COURSE_KEY_PATTERN), 'course_rerun_handler', name='course_rerun_handler'),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment