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
e47c97b4
Commit
e47c97b4
authored
Jun 07, 2015
by
Chris Dodge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make courses.html also honor the ENABLE_COURSE_DISCOVERY feature flag
parent
53e2f2ee
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
115 additions
and
21 deletions
+115
-21
lms/djangoapps/branding/tests/test_page.py
+46
-0
lms/envs/bok_choy.env.json
+2
-1
lms/envs/bok_choy.py
+3
-0
lms/static/sass/multicourse/_courses.scss
+58
-18
lms/templates/courseware/courses.html
+6
-2
No files found.
lms/djangoapps/branding/tests/test_page.py
View file @
e47c97b4
...
...
@@ -201,6 +201,52 @@ class IndexPageCourseCardsSortingTests(ModuleStoreTestCase):
@patch
(
'student.views.render_to_response'
,
RENDER_MOCK
)
@patch
(
'courseware.views.render_to_response'
,
RENDER_MOCK
)
@patch.dict
(
'django.conf.settings.FEATURES'
,
{
'ENABLE_COURSE_DISCOVERY'
:
False
})
def
test_course_discovery_off
(
self
):
"""
Asserts that the Course Discovery UI elements follow the
feature flag settings
"""
response
=
self
.
client
.
get
(
'/'
)
self
.
assertEqual
(
response
.
status_code
,
200
)
# assert that the course discovery UI is not present
self
.
assertNotIn
(
'Search for a course'
,
response
.
content
)
# check the /courses view
response
=
self
.
client
.
get
(
reverse
(
'branding.views.courses'
))
self
.
assertEqual
(
response
.
status_code
,
200
)
# assert that the course discovery UI is not present
self
.
assertNotIn
(
'Search for a course'
,
response
.
content
)
self
.
assertNotIn
(
'<aside aria-label="Refine your search" class="search-facets phone-menu">'
,
response
.
content
)
# make sure we have the special css class on the section
self
.
assertIn
(
'<section class="courses no-course-discovery">'
,
response
.
content
)
@patch
(
'student.views.render_to_response'
,
RENDER_MOCK
)
@patch
(
'courseware.views.render_to_response'
,
RENDER_MOCK
)
@patch.dict
(
'django.conf.settings.FEATURES'
,
{
'ENABLE_COURSE_DISCOVERY'
:
True
})
def
test_course_discovery_on
(
self
):
"""
Asserts that the Course Discovery UI elements follow the
feature flag settings
"""
response
=
self
.
client
.
get
(
'/'
)
self
.
assertEqual
(
response
.
status_code
,
200
)
# assert that the course discovery UI is not present
self
.
assertIn
(
'Search for a course'
,
response
.
content
)
# check the /courses view
response
=
self
.
client
.
get
(
reverse
(
'branding.views.courses'
))
self
.
assertEqual
(
response
.
status_code
,
200
)
# assert that the course discovery UI is not present
self
.
assertIn
(
'Search for a course'
,
response
.
content
)
self
.
assertIn
(
'<aside aria-label="Refine your search" class="search-facets phone-menu">'
,
response
.
content
)
self
.
assertIn
(
'<section class="courses">'
,
response
.
content
)
@patch
(
'student.views.render_to_response'
,
RENDER_MOCK
)
@patch
(
'courseware.views.render_to_response'
,
RENDER_MOCK
)
@patch.dict
(
'django.conf.settings.FEATURES'
,
{
'ENABLE_COURSE_DISCOVERY'
:
False
})
def
test_course_cards_sorted_by_default_sorting
(
self
):
response
=
self
.
client
.
get
(
'/'
)
self
.
assertEqual
(
response
.
status_code
,
200
)
...
...
lms/envs/bok_choy.env.json
View file @
e47c97b4
...
...
@@ -86,7 +86,8 @@
"ALLOW_AUTOMATED_SIGNUPS"
:
true
,
"AUTOMATIC_AUTH_FOR_TESTING"
:
true
,
"MODE_CREATION_FOR_TESTING"
:
true
,
"AUTOMATIC_VERIFY_STUDENT_IDENTITY_FOR_TESTING"
:
true
"AUTOMATIC_VERIFY_STUDENT_IDENTITY_FOR_TESTING"
:
true
,
"ENABLE_COURSE_DISCOVERY"
:
true
},
"FEEDBACK_SUBMISSION_EMAIL"
:
""
,
"GITHUB_REPO_ROOT"
:
"** OVERRIDDEN **"
,
...
...
lms/envs/bok_choy.py
View file @
e47c97b4
...
...
@@ -94,6 +94,9 @@ FEATURES['MILESTONES_APP'] = True
# Enable pre-requisite course
FEATURES
[
'ENABLE_PREREQUISITE_COURSES'
]
=
True
# Enable Course Discovery
FEATURES
[
'ENABLE_COURSE_DISCOVERY'
]
=
True
# Enable student notes
FEATURES
[
'ENABLE_EDXNOTES'
]
=
True
...
...
lms/static/sass/multicourse/_courses.scss
View file @
e47c97b4
...
...
@@ -41,38 +41,78 @@ $facet-background-color: #007db8;
.courses
{
@include
rtl
()
{
$layout-direction
:
"RTL"
;
}
@include
span-columns
(
9
);
@include
media
(
$bp-medium
)
{
@include
span-columns
(
4
);
}
@include
media
(
$bp-large
)
{
@include
span-columns
(
8
);
.courses-listing
.courses-listing-item
{
@include
fill-parent
();
margin
:
(
$baseline
*
0
.75
)
0
(
$baseline
*
1
.5
)
0
;
max-height
:
$course-card-height
;
}
@include
media
(
$bp-huge
)
{
/* Style grid settings if course discovery turned on */
&
:not
(
.no-course-discovery
)
{
@include
span-columns
(
9
);
@include
media
(
$bp-medium
)
{
@include
span-columns
(
4
);
}
@include
media
(
$bp-large
)
{
@include
span-columns
(
8
);
}
@include
media
(
$bp-huge
)
{
@include
span-columns
(
9
);
}
.courses-listing
.courses-listing-item
{
@include
media
(
$bp-medium
)
{
@include
span-columns
(
8
);
// 4 of 8
@include
omega
(
1n
);
}
@include
media
(
$bp-large
)
{
@include
span-columns
(
6
);
// 6 of 12
@include
omega
(
2n
);
}
@include
media
(
$bp-huge
)
{
@include
span-columns
(
4
);
// 4 of 12
@include
omega
(
3n
);
}
}
}
.courses-listing
.courses-listing-item
{
@include
fill-parent
();
margin
:
(
$baseline
*
0
.75
)
0
(
$baseline
*
1
.5
)
0
;
max-height
:
$course-card-height
;
/* Style grid settings if course discovery turned off */
&
.no-course-discovery
{
@include
span-columns
(
12
);
@include
media
(
$bp-medium
)
{
@include
span-columns
(
8
);
// 4 of 8
@include
omega
(
1n
);
@include
span-columns
(
8
);
}
@include
media
(
$bp-large
)
{
@include
span-columns
(
6
);
// 6 of 12
@include
omega
(
2n
);
@include
span-columns
(
12
);
}
@include
media
(
$bp-huge
)
{
@include
span-columns
(
4
);
// 4 of 12
@include
omega
(
3n
);
@include
span-columns
(
12
);
}
.courses-listing
.courses-listing-item
{
@include
media
(
$bp-medium
)
{
@include
span-columns
(
4
);
// 4 of 8
@include
omega
(
2n
);
}
@include
media
(
$bp-large
)
{
@include
span-columns
(
4
);
// 4 of 12
@include
omega
(
3n
);
}
@include
media
(
$bp-huge
)
{
@include
span-columns
(
3
);
// 3 of 12
@include
omega
(
4n
);
}
}
}
}
...
...
lms/templates/courseware/courses.html
View file @
e47c97b4
...
...
@@ -29,7 +29,7 @@
<
%
block
name=
"pagetitle"
>
${_("Courses")}
</
%
block>
<
%
platform_name =
microsite.get_value('platform_name',
settings
.
PLATFORM_NAME
)
course_discovery_enabled =
settings.FEATURES.get('ENABLE_COURSE_DISCOVERY')
if
self
.
stanford_theme_enabled
()
:
course_index_overlay_text =
_("Explore
free
courses
from
{
university_name
}.").
format
(
university_name=
"Stanford University"
)
logo_file =
static.url('themes/stanford/images/seal.png')
...
...
@@ -66,6 +66,7 @@
<section
class=
"courses-container"
>
% if course_discovery_enabled:
<div
id=
"discovery-form"
role=
"search"
aria-label=
"course"
>
<form>
<input
class=
"discovery-input"
placeholder=
"${_('Search for a course')}"
type=
"text"
/>
<!-- removes spacing
...
...
@@ -83,8 +84,9 @@
<div
id=
"filter-bar"
class=
"filters hide-phone"
>
</div>
% endif
<section
class=
"courses"
>
<section
class=
"courses
${'' if course_discovery_enabled else ' no-course-discovery'}
"
>
<ul
class=
"courses-listing"
>
%for course in courses:
<li
class=
"courses-listing-item"
>
...
...
@@ -95,8 +97,10 @@
</section>
% if course_discovery_enabled:
<aside
aria-label=
"${_('Refine your search')}"
class=
"search-facets phone-menu"
>
</aside>
% endif
</section>
</section>
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