Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
52e8db34
Commit
52e8db34
authored
9 years ago
by
Ben Weeks
Browse files
Options
Downloads
Patches
Plain Diff
course id/org/name -> display_stuff_with_default
parent
84773d2f
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lms/djangoapps/courseware/tests/test_course_info.py
+39
-0
39 additions, 0 deletions
lms/djangoapps/courseware/tests/test_course_info.py
lms/templates/courseware/info.html
+6
-6
6 additions, 6 deletions
lms/templates/courseware/info.html
with
45 additions
and
6 deletions
lms/djangoapps/courseware/tests/test_course_info.py
+
39
−
0
View file @
52e8db34
...
...
@@ -127,6 +127,45 @@ class CourseInfoTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
content
=
pq
(
info_page_response
.
content
)
self
.
assertEqual
(
content
(
'
.page-header-secondary .last-accessed-link
'
).
attr
(
'
href
'
),
section_url
)
def
test_info_title
(
self
):
"""
Test the info page on a course without any display_* settings against
one that does.
"""
url
=
reverse
(
'
info
'
,
args
=
(
unicode
(
self
.
course
.
id
),))
response
=
self
.
client
.
get
(
url
)
content
=
pq
(
response
.
content
)
expected_title
=
"
Welcome to {org}
'
s {course_name}!
"
.
format
(
org
=
self
.
course
.
display_org_with_default
,
course_name
=
self
.
course
.
display_number_with_default
)
display_course
=
CourseFactory
.
create
(
org
=
"
HogwartZ
"
,
number
=
"
Potions_3
"
,
display_organization
=
"
HogwartsX
"
,
display_coursenumber
=
"
Potions
"
,
display_name
=
"
Introduction_to_Potions
"
)
display_url
=
reverse
(
'
info
'
,
args
=
(
unicode
(
display_course
.
id
),))
display_response
=
self
.
client
.
get
(
display_url
)
display_content
=
pq
(
display_response
.
content
)
expected_display_title
=
"
Welcome to {org}
'
s {course_name}!
"
.
format
(
org
=
display_course
.
display_org_with_default
,
course_name
=
display_course
.
display_number_with_default
)
self
.
assertIn
(
expected_title
,
content
(
'
h1.page-title
'
).
contents
()
)
self
.
assertIn
(
expected_display_title
,
display_content
(
'
h1.page-title
'
).
contents
()
)
self
.
assertIn
(
display_course
.
display_name_with_default
,
display_content
(
'
h2.page-subtitle
'
).
contents
()
)
class
CourseInfoTestCaseCCX
(
SharedModuleStoreTestCase
,
LoginEnrollmentTestCase
):
"""
...
...
This diff is collapsed.
Click to expand it.
lms/templates/courseware/info.html
+
6
−
6
View file @
52e8db34
<
%
inherit
file=
"../main.html"
/>
<
%
namespace
name=
'static'
file=
'../static_content.html'
/>
<
%!
from
django.utils.translation
import
ugettext
as
_
from
courseware.courses
import
get_course_info_section
,
get_course_date_summary
from
openedx.core.djangoapps.self_paced.models
import
SelfPacedConfiguration
from
openedx.core.djangolib.markup
import
HTML
,
ugettext
as
_
%
>
<
%
block
name=
"pagetitle"
>
${_("{course_number} Course Info").format(course_number=course.display_number_with_default)}
</
%
block>
...
...
@@ -21,9 +21,9 @@ from openedx.core.djangoapps.self_paced.models import SelfPacedConfiguration
<h2
class=
"title"
>
${_("You are not enrolled yet")}
</h2>
<div
class=
"copy"
>
<p
class=
'enroll-message'
>
${_(
u
"You are not currently enrolled in this course. {link_start}Sign up now!{link_end}").format(
link_start=
u
"
<a
href=
{}
>
".format(url_to_enroll),
link_end=
u
"
</a>
"
${_("You are not currently enrolled in this course. {link_start}Sign up now!{link_end}").format(
link_start=
HTML(
"
<a
href=
{}
>
"
)
.format(url_to_enroll),
link_end=
HTML(
"
</a>
"
)
)}
</p>
</div>
...
...
@@ -54,8 +54,8 @@ from openedx.core.djangoapps.self_paced.models import SelfPacedConfiguration
<section
class=
"container"
>
<div
class=
"home"
>
<div
class=
"page-header-main"
>
<h1
class=
"page-title"
>
${_("Welcome to {org}'s {course_name}!").format(org=course.
id.org, course_name=course.id.course
) | h}
</h1>
<h2
class=
"page-subtitle"
>
${course.display_name | h}
</h2>
<h1
class=
"page-title"
>
${_("Welcome to {org}'s {course_name}!").format(org=course.
display_org_with_default, course_name=course.display_number_with_default
) | h}
</h1>
<h2
class=
"page-subtitle"
>
${course.display_name
_with_default
| h}
</h2>
</div>
% if last_accessed_courseware_url:
<div
class=
"page-header-secondary"
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment