Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cms/djangoapps/contentstore/features/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def log_into_studio(
world.log_in(username=uname, password=password, email=email, name=name)
# Navigate to the studio dashboard
world.visit('/')
assert_in(uname, world.css_text('h2.title', timeout=10))
assert_in(uname, world.css_text('span.account-username', timeout=10))


def add_course_author(user, course):
Expand Down
8 changes: 4 additions & 4 deletions cms/djangoapps/contentstore/features/courses.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ def i_create_a_course(step):
create_a_course()


@step('I click the course link in My Courses$')
def i_click_the_course_link_in_my_courses(step):
@step('I click the course link in Studio Home$')
def i_click_the_course_link_in_studio_home(step):
course_css = 'a.course-link'
world.css_click(course_css)

Expand All @@ -52,8 +52,8 @@ def courseware_page_has_loaded_in_studio(step):
assert world.is_css_present(course_title_css)


@step('I see the course listed in My Courses$')
def i_see_the_course_in_my_courses(step):
@step('I see the course listed in Studio Home$')
def i_see_the_course_in_studio_home(step):
course_css = 'h3.class-title'
assert world.css_has_text(course_css, world.scenario_dict['COURSE'].display_name)

Expand Down
2 changes: 1 addition & 1 deletion cms/djangoapps/contentstore/features/help.feature
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Feature: CMS.Help
Scenario: Users can access online help within a course
Given I have opened a new course in Studio

And I click the course link in My Courses
And I click the course link in Studio Home
Then I should see online help for "outline"

And I go to the course updates page
Expand Down
2 changes: 1 addition & 1 deletion cms/djangoapps/contentstore/features/signup.feature
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ Feature: CMS.Sign in
And I visit the url "/signin?next=http://www.google.com/"
When I fill in and submit the signin form
And I wait for "2" seconds
Then I should see that the path is "/course/"
Then I should see that the path is "/home/"
2 changes: 1 addition & 1 deletion cms/djangoapps/contentstore/features/signup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def i_press_the_button_on_the_registration_form(step):

@step('I should see an email verification prompt')
def i_should_see_an_email_verification_prompt(step):
world.css_has_text('h1.page-header', u'My Courses')
world.css_has_text('h1.page-header', u'Studio Home')
world.css_has_text('div.msg h3.title', u'We need to verify your email address')


Expand Down
11 changes: 5 additions & 6 deletions cms/djangoapps/contentstore/tests/test_contentstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -1166,11 +1166,10 @@ def assert_course_permission_denied(self):

def test_course_index_view_with_no_courses(self):
"""Test viewing the index page with no courses"""
# Create a course so there is something to view
resp = self.client.get_html('/course/')
resp = self.client.get_html('/home/')
self.assertContains(
resp,
'<h1 class="page-header">My Courses</h1>',
'<h1 class="page-header">Studio Home</h1>',
status_code=200,
html=True
)
Expand All @@ -1189,7 +1188,7 @@ def test_item_factory(self):
def test_course_index_view_with_course(self):
"""Test viewing the index page with an existing course"""
CourseFactory.create(display_name='Robot Super Educational Course')
resp = self.client.get_html('/course/')
resp = self.client.get_html('/home/')
self.assertContains(
resp,
'<h3 class="course-title">Robot Super Educational Course</h3>',
Expand Down Expand Up @@ -1604,7 +1603,7 @@ def assertInCourseListing(self, course_key):
Asserts that the given course key is in the accessible course listing section of the html
and NOT in the unsucceeded course action section of the html.
"""
course_listing = lxml.html.fromstring(self.client.get_html('/course/').content)
course_listing = lxml.html.fromstring(self.client.get_html('/home/').content)
self.assertEqual(len(self.get_course_listing_elements(course_listing, course_key)), 1)
self.assertEqual(len(self.get_unsucceeded_course_action_elements(course_listing, course_key)), 0)

Expand All @@ -1613,7 +1612,7 @@ def assertInUnsucceededCourseActions(self, course_key):
Asserts that the given course key is in the unsucceeded course action section of the html
and NOT in the accessible course listing section of the html.
"""
course_listing = lxml.html.fromstring(self.client.get_html('/course/').content)
course_listing = lxml.html.fromstring(self.client.get_html('/home/').content)
self.assertEqual(len(self.get_course_listing_elements(course_listing, course_key)), 0)
self.assertEqual(len(self.get_unsucceeded_course_action_elements(course_listing, course_key)), 1)

Expand Down
10 changes: 5 additions & 5 deletions cms/djangoapps/contentstore/tests/test_i18n.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ def test_course_plain_english(self):
self.client = AjaxEnabledTestClient()
self.client.login(username=self.uname, password=self.password)

resp = self.client.get_html('/course/')
resp = self.client.get_html('/home/')
self.assertContains(resp,
'<h1 class="page-header">My Courses</h1>',
'<h1 class="page-header">Studio Home</h1>',
status_code=200,
html=True)

Expand All @@ -56,13 +56,13 @@ def test_course_explicit_english(self):
self.client.login(username=self.uname, password=self.password)

resp = self.client.get_html(
'/course/',
'/home/',
{},
HTTP_ACCEPT_LANGUAGE='en',
)

self.assertContains(resp,
'<h1 class="page-header">My Courses</h1>',
'<h1 class="page-header">Studio Home</h1>',
status_code=200,
html=True)

Expand All @@ -81,7 +81,7 @@ def test_course_with_accents(self):
self.client.login(username=self.uname, password=self.password)

resp = self.client.get_html(
'/course/',
'/home/',
{},
HTTP_ACCEPT_LANGUAGE='eo'
)
Expand Down
10 changes: 5 additions & 5 deletions cms/djangoapps/contentstore/tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,13 +234,13 @@ def test_login_link_on_activation_age(self):
def test_private_pages_auth(self):
"""Make sure pages that do require login work."""
auth_pages = (
'/course/',
'/home/',
)

# These are pages that should just load when the user is logged in
# (no data needed)
simple_auth_pages = (
'/course/',
'/home/',
)

# need an activated user
Expand All @@ -266,7 +266,7 @@ def test_private_pages_auth(self):
def test_index_auth(self):

# not logged in. Should return a redirect.
resp = self.client.get_html('/course/')
resp = self.client.get_html('/home/')
self.assertEqual(resp.status_code, 302)

# Logged in should work.
Expand All @@ -283,7 +283,7 @@ def test_inactive_session_timeout(self):
self.login(self.email, self.pw)

# make sure we can access courseware immediately
course_url = '/course/'
course_url = '/home/'
resp = self.client.get_html(course_url)
self.assertEquals(resp.status_code, 200)

Expand All @@ -293,7 +293,7 @@ def test_inactive_session_timeout(self):
resp = self.client.get_html(course_url)

# re-request, and we should get a redirect to login page
self.assertRedirects(resp, settings.LOGIN_REDIRECT_URL + '?next=/course/')
self.assertRedirects(resp, settings.LOGIN_REDIRECT_URL + '?next=/home/')


class ForumTestCase(CourseTestCase):
Expand Down
6 changes: 4 additions & 2 deletions cms/djangoapps/contentstore/views/course.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Views related to operations on course objects
"""
from django.shortcuts import redirect
import json
import random
import string # pylint: disable=deprecated-module
Expand Down Expand Up @@ -71,7 +72,8 @@
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',
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion cms/djangoapps/contentstore/views/public.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@ def login_page(request):
def howitworks(request):
"Proxy view"
if request.user.is_authenticated():
return redirect('/course/')
return redirect('/home/')
else:
return render_to_response('howitworks.html', {})
4 changes: 2 additions & 2 deletions cms/djangoapps/contentstore/views/tests/test_course_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def check_index_and_outline(self, authed_client):
"""
Test getting the list of courses and then pulling up their outlines
"""
index_url = '/course/'
index_url = '/home/'
index_response = authed_client.get(index_url, {}, HTTP_ACCEPT='text/html')
parsed_html = lxml.html.fromstring(index_response.content)
course_link_eles = parsed_html.find_class('course-link')
Expand All @@ -68,7 +68,7 @@ def test_libraries_on_course_index(self):
# Add a library:
lib1 = LibraryFactory.create()

index_url = '/course/'
index_url = '/home/'
index_response = self.client.get(index_url, {}, HTTP_ACCEPT='text/html')
parsed_html = lxml.html.fromstring(index_response.content)
library_link_elements = parsed_html.find_class('library-link')
Expand Down
12 changes: 7 additions & 5 deletions cms/static/sass/views/_dashboard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -299,19 +299,21 @@
line-height: $baseline*2;
margin: 0 10px;

&.active, &:hover {
&.active {
border-bottom: 4px solid $blue;
}

&.active, &:hover {
a {
color: $gray-d2;
}
}

a {
color: $blue;
cursor: pointer;
display: inline-block;
}

&.active a {
color: $gray-d2;
}
}
}

Expand Down
41 changes: 7 additions & 34 deletions cms/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<%inherit file="base.html" />
<%def name="online_help_token()"><% return "home" %></%def>
<%block name="title">${_("My Courses")}</%block>
<%block name="title">${_("Studio Home")}</%block>
<%block name="bodyclass">is-signedin index view-dashboard</%block>

<%block name="requirejs">
Expand All @@ -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">
Expand Down Expand Up @@ -42,33 +42,7 @@ <h3 class="sr">${_("Page Actions")}</h3>
% if user.is_active:
<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:")}
%else:
${_("Here are all of the courses you currently have access to in Studio:")}
%endif
</p>
</div>

%else:
<div class="copy">
<p>
%if libraries_enabled:
${_("You currently aren't associated with any Studio Courses and Libraries")}
%else:
${_("You currently aren't associated with any Studio Courses")}
%endif
</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">
Expand Down Expand Up @@ -155,15 +129,14 @@ <h3 class="title">${_("Create a New Library")}</h3>
<li class="field text required" id="field-organization">
<label for="new-library-org">${_("Organization")}</label>
<input class="new-library-org" id="new-library-org" type="text" name="new-library-org" aria-required="true" placeholder="${_('e.g. UniversityX or OrganizationX')}" />
<span class="tip">${_("The name of the organization sponsoring the library.")} <strong>${_("Note: This is part of your library URL, so no spaces or special characters are allowed.")}</strong> ${_("This cannot be changed.")}</span>
<span class="tip">${_("The public organization name for your library.")} ${_("This cannot be changed.")}</span>
<span class="tip tip-error is-hiding"></span>
</li>

<li class="field text required" id="field-library-number">
<label for="new-library-number">${_("Library Code/Number")}</label>
## Translators: This is an example for the "number" used to identify a library, seen when filling out the form to create a new library. This example is short for "Computer Science Problems". The example number may contain letters but must not contain spaces.
<input class="new-library-number" id="new-library-number" type="text" name="new-library-number" aria-required="true" placeholder="${_('e.g. CSPROB')}" />
<span class="tip">${_("The unique code that identifies this library.")} <strong>${_("Note: This is part of your library URL, so no spaces or special characters are allowed.")}</strong> ${_("This cannot be changed.")}</span>
<label for="new-library-number">${_("Major Version Number")}</label>
<input class="new-library-number" id="new-library-number" type="text" name="new-library-number" aria-required="true" value="1" />
<span class="tip">${_("The {em_start}major version number{em_end} of your library. Minor revisions are tracked as edits happen within a library.").format(em_start='<strong>', em_end='</strong>')}</span>
<span class="tip tip-error is-hiding"></span>
</li>
</ol>
Expand Down
17 changes: 5 additions & 12 deletions cms/templates/js/mock/mock-index-page.underscore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="wrapper-mast wrapper">
<header class="mast has-actions">
<h1 class="page-header">My Courses</h1>
<h1 class="page-header">Studio Home</h1>
<nav class="nav-actions">
<h3 class="sr">Page Actions</h3>
<ul>
Expand All @@ -21,13 +21,6 @@
<section class="content">
<article class="content-primary" role="main">

<div class="introduction">
<h2 class="title">Welcome, user!</h2>
<div class="copy">
<p>Here are all of the courses you currently have access to in Studio:</p>
</div>
</div>

<div class="wrapper-create-element wrapper-create-course">
<form class="form-create create-course course-info" id="create-course-form" name="create-course-form">
<div class="wrap-error">
Expand Down Expand Up @@ -106,14 +99,14 @@
<li class="field text required" id="field-organization">
<label for="new-library-org">Organization</label>
<input class="new-library-org" id="new-library-org" type="text" name="new-library-org" aria-required="true" placeholder="e.g. UniversityX or OrganizationX" />
<span class="tip">The name of the organization sponsoring the library. <strong>Note: This is part of your library URL, so no spaces or special characters are allowed.</strong> This cannot be changed.</span>
<span class="tip">The public organization name for your library. This cannot be changed.</span>
<span class="tip tip-error is-hiding"></span>
</li>

<li class="field text required" id="field-library-number">
<label for="new-library-number">Library Code/Number</label>
<input class="new-library-number" id="new-library-number" type="text" name="new-library-number" aria-required="true" placeholder="e.g. CSPROB" />
<span class="tip">The unique code that identifies this library. <strong>Note: This is part of your library URL, so no spaces or special characters are allowed and it cannot be changed.</strong></span>
<label for="new-library-number">Major Version Number</label>
<input class="new-library-number" id="new-library-number" type="text" name="new-library-number" aria-required="true" value="1" />
<span class="tip">The <strong>major version number</strong> of your library. Minor revisions are tracked as edits happen within a library.</span>
<span class="tip tip-error is-hiding"></span>
</li>
</ol>
Expand Down
5 changes: 4 additions & 1 deletion cms/templates/library.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@
<div class="wrapper-mast wrapper">
<header class="mast has-actions has-navigation has-subtitle">
<div class="page-header">
<h1 class="page-header-title"><span class="title-value">${context_library.display_name_with_default | h}</span></h1>
<small class="subtitle">${_("Content Library")}</small>
<div class="wrapper-xblock-field incontext-editor is-editable"
data-field="display_name" data-field-display-name="${_("Display Name")}">
<h1 class="page-header-title xblock-field-value incontext-editor-value"><span class="title-value">${context_library.display_name_with_default | h}</span></h1>
</div>
</header>
</div>
Expand Down
2 changes: 1 addition & 1 deletion cms/templates/widgets/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ <h3 class="title"><span class="label"><span class="label-prefix sr">${_("Current
<div class="nav-sub">
<ul>
<li class="nav-item nav-account-dashboard">
<a href="/">${_("My Courses")}</a>
<a href="/">${_("Studio Home")}</a>
</li>
<li class="nav-item nav-account-signout">
<a class="action action-signout" href="${reverse('logout')}">${_("Sign Out")}</a>
Expand Down
1 change: 1 addition & 0 deletions cms/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
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'),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Kelketek there's a way to do a redirect in urls.py: http://stackoverflow.com/questions/15706489/redirect-to-named-url-pattern-directly-from-urls-py-in-django

So it might make sense to add a route like /course/?$ that only perform redirect, than get rid of that if-else block in course.py

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'),
Expand Down
Loading