Add accessibility accomodation request page to studio and link to said page in footer, both behind a Waffle switch. Add tests for the new page.
This commit is contained in:
18
cms/djangoapps/contentstore/config/waffle.py
Normal file
18
cms/djangoapps/contentstore/config/waffle.py
Normal file
@@ -0,0 +1,18 @@
|
||||
"""
|
||||
This module contains various configuration settings via
|
||||
waffle switches for the contentstore app.
|
||||
"""
|
||||
from openedx.core.djangoapps.waffle_utils import WaffleSwitchNamespace
|
||||
|
||||
# Namespace
|
||||
WAFFLE_NAMESPACE = u'accessibility'
|
||||
|
||||
# Switches
|
||||
ENABLE_ACCESSIBILITY_POLICY_PAGE = u'enable_policy_page'
|
||||
|
||||
|
||||
def waffle():
|
||||
"""
|
||||
Returns the namespaced, cached, audited Waffle class for Accessibility Accomodation Request Page.
|
||||
"""
|
||||
return WaffleSwitchNamespace(name=WAFFLE_NAMESPACE, log_prefix=u'Accessibility: ')
|
||||
@@ -23,10 +23,12 @@ from opaque_keys import InvalidKeyError
|
||||
from opaque_keys.edx.keys import CourseKey, UsageKey
|
||||
from opaque_keys.edx.locations import AssetLocation, CourseLocator
|
||||
from path import Path as path
|
||||
from waffle.testutils import override_switch
|
||||
|
||||
from contentstore.tests.utils import AjaxEnabledTestClient, CourseTestCase, get_url, parse_json
|
||||
from contentstore.utils import delete_course, reverse_course_url, reverse_url
|
||||
from contentstore.views.component import ADVANCED_COMPONENT_TYPES
|
||||
from contentstore.config import waffle
|
||||
from course_action_state.managers import CourseActionStateItemNotFoundError
|
||||
from course_action_state.models import CourseRerunState, CourseRerunUIStateManager
|
||||
from django_comment_common.utils import are_permissions_roles_seeded
|
||||
@@ -1054,6 +1056,16 @@ class MiscCourseTests(ContentStoreTestCase):
|
||||
resp = self.client.get_html('/c4x/InvalidOrg/InvalidCourse/asset/invalid.png')
|
||||
self.assertEqual(resp.status_code, 404)
|
||||
|
||||
@override_switch(
|
||||
'{}.{}'.format(waffle.WAFFLE_NAMESPACE, waffle.ENABLE_ACCESSIBILITY_POLICY_PAGE),
|
||||
active=False)
|
||||
def test_disabled_accessibility_page(self):
|
||||
"""
|
||||
Test that accessibility page returns 404 when waffle switch is disabled
|
||||
"""
|
||||
resp = self.client.get_html('/accessibility')
|
||||
self.assertEqual(resp.status_code, 404)
|
||||
|
||||
def test_delete_course(self):
|
||||
"""
|
||||
This test creates a course, makes a draft item, and deletes the course. This will also assert that the
|
||||
@@ -2151,6 +2163,12 @@ class EntryPageTestCase(TestCase):
|
||||
# Logout redirects.
|
||||
self._test_page("/logout", 302)
|
||||
|
||||
@override_switch(
|
||||
'{}.{}'.format(waffle.WAFFLE_NAMESPACE, waffle.ENABLE_ACCESSIBILITY_POLICY_PAGE),
|
||||
active=True)
|
||||
def test_accessibility(self):
|
||||
self._test_page('/accessibility')
|
||||
|
||||
|
||||
class SigninPageTestCase(TestCase):
|
||||
"""
|
||||
|
||||
@@ -11,8 +11,10 @@ from django.views.decorators.csrf import ensure_csrf_cookie
|
||||
from edxmako.shortcuts import render_to_response
|
||||
from openedx.core.djangoapps.external_auth.views import redirect_with_get, ssl_get_cert_from_request, ssl_login_shortcut
|
||||
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
|
||||
from waffle.decorators import waffle_switch
|
||||
from contentstore.config import waffle
|
||||
|
||||
__all__ = ['signup', 'login_page', 'howitworks']
|
||||
__all__ = ['signup', 'login_page', 'howitworks', 'accessibility']
|
||||
|
||||
|
||||
@ensure_csrf_cookie
|
||||
@@ -70,3 +72,12 @@ def howitworks(request):
|
||||
return redirect('/home/')
|
||||
else:
|
||||
return render_to_response('howitworks.html', {})
|
||||
|
||||
|
||||
@waffle_switch('{}.{}'.format(waffle.WAFFLE_NAMESPACE, waffle.ENABLE_ACCESSIBILITY_POLICY_PAGE))
|
||||
def accessibility(_request):
|
||||
"""
|
||||
Display the accessibility accommodation form.
|
||||
"""
|
||||
|
||||
return render_to_response('accessibility.html', {})
|
||||
|
||||
@@ -285,6 +285,10 @@ if FEATURES.get('AUTH_USE_CAS'):
|
||||
FILE_UPLOAD_STORAGE_BUCKET_NAME = ENV_TOKENS.get('FILE_UPLOAD_STORAGE_BUCKET_NAME', FILE_UPLOAD_STORAGE_BUCKET_NAME)
|
||||
FILE_UPLOAD_STORAGE_PREFIX = ENV_TOKENS.get('FILE_UPLOAD_STORAGE_PREFIX', FILE_UPLOAD_STORAGE_PREFIX)
|
||||
|
||||
# Zendesk
|
||||
ZENDESK_URL = ENV_TOKENS.get('ZENDESK_URL', ZENDESK_URL)
|
||||
ZENDESK_CUSTOM_FIELDS = ENV_TOKENS.get('ZENDESK_CUSTOM_FIELDS', ZENDESK_CUSTOM_FIELDS)
|
||||
|
||||
################ SECURE AUTH ITEMS ###############################
|
||||
# Secret things: passwords, access keys, etc.
|
||||
with open(CONFIG_ROOT / CONFIG_PREFIX + "auth.json") as auth_file:
|
||||
@@ -429,6 +433,9 @@ EVENT_TRACKING_BACKENDS['segmentio']['OPTIONS']['processors'][0]['OPTIONS']['whi
|
||||
|
||||
VIRTUAL_UNIVERSITIES = ENV_TOKENS.get('VIRTUAL_UNIVERSITIES', [])
|
||||
|
||||
# Zendesk
|
||||
ZENDESK_OAUTH_ACCESS_TOKEN = AUTH_TOKENS.get("ZENDESK_OAUTH_ACCESS_TOKEN")
|
||||
|
||||
##### ACCOUNT LOCKOUT DEFAULT PARAMETERS #####
|
||||
MAX_FAILED_LOGIN_ATTEMPTS_ALLOWED = ENV_TOKENS.get("MAX_FAILED_LOGIN_ATTEMPTS_ALLOWED", 5)
|
||||
MAX_FAILED_LOGIN_ATTEMPTS_LOCKOUT_PERIOD_SECS = ENV_TOKENS.get("MAX_FAILED_LOGIN_ATTEMPTS_LOCKOUT_PERIOD_SECS", 15 * 60)
|
||||
|
||||
@@ -1459,3 +1459,11 @@ VIDEO_IMAGE_MIN_HEIGHT = 360
|
||||
VIDEO_IMAGE_ASPECT_RATIO = 16 / 9.0
|
||||
VIDEO_IMAGE_ASPECT_RATIO_TEXT = '16:9'
|
||||
VIDEO_IMAGE_ASPECT_RATIO_ERROR_MARGIN = 0.1
|
||||
|
||||
|
||||
###################### ZENDESK ######################
|
||||
ZENDESK_URL = None
|
||||
ZENDESK_USER = None
|
||||
ZENDESK_API_KEY = None
|
||||
ZENDESK_OAUTH_ACCESS_TOKEN = None
|
||||
ZENDESK_CUSTOM_FIELDS = {}
|
||||
|
||||
26
cms/templates/accessibility.html
Normal file
26
cms/templates/accessibility.html
Normal file
@@ -0,0 +1,26 @@
|
||||
<%page expression_filter="h"/>
|
||||
<%inherit file="base.html" />
|
||||
<%def name="online_help_token()"><% return "accessibility" %></%def>
|
||||
<%!
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.utils.translation import ugettext as _
|
||||
from openedx.core.djangolib.markup import HTML, Text
|
||||
from openedx.core.djangolib.js_utils import js_escaped_string, dump_js_escaped_json
|
||||
%>
|
||||
<%block name="title">${_("Studio Accessibility Policy")}</%block>
|
||||
<%block name="bodyclass">is-signedin not-signedin view-accessibility</%block>
|
||||
|
||||
<%namespace name='static' file='static_content.html'/>
|
||||
|
||||
<%block name="content">
|
||||
|
||||
<div class="wrapper-content wrapper">
|
||||
<div class="content">
|
||||
<div class="content-primary">
|
||||
<div id="root"></div>
|
||||
<h1>Accessibility Accommodation Request</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</%block>
|
||||
@@ -4,6 +4,7 @@ from django.core.urlresolvers import reverse
|
||||
from datetime import datetime
|
||||
from django.conf import settings
|
||||
import pytz
|
||||
from cms.djangoapps.contentstore.config.waffle import waffle, ENABLE_ACCESSIBILITY_POLICY_PAGE
|
||||
%>
|
||||
|
||||
<div class="wrapper-footer wrapper">
|
||||
@@ -14,7 +15,7 @@ import pytz
|
||||
<p>© ${datetime.now(pytz.timezone(settings.TIME_ZONE)).year} <a data-rel="edx.org" href="${marketing_link('ROOT')}" rel="external">${settings.PLATFORM_NAME}</a>.</p>
|
||||
</div>
|
||||
|
||||
% if is_any_marketing_link_set(['TOS', 'PRIVACY']):
|
||||
% if is_any_marketing_link_set(['TOS', 'PRIVACY']) or waffle().is_enabled(ENABLE_ACCESSIBILITY_POLICY_PAGE):
|
||||
<nav class="nav-peripheral">
|
||||
<ol>
|
||||
% if is_marketing_link_set('TOS'):
|
||||
@@ -27,6 +28,11 @@ import pytz
|
||||
<a data-rel="edx.org" href="${marketing_link('PRIVACY')}">${_("Privacy Policy")}</a>
|
||||
</li>
|
||||
% endif
|
||||
% if waffle().is_enabled(ENABLE_ACCESSIBILITY_POLICY_PAGE):
|
||||
<li class="nav-item nav-peripheral-aar">
|
||||
<a data-rel="edx.org" href="${reverse('accessibility')}">${_("Accessibility Accommodation Request")}</a>
|
||||
</li>
|
||||
%endif
|
||||
</ol>
|
||||
</nav>
|
||||
% endif
|
||||
|
||||
@@ -152,6 +152,7 @@ urlpatterns = [
|
||||
name='group_configurations_detail_handler'),
|
||||
url(r'^api/val/v0/', include('edxval.urls')),
|
||||
url(r'^api/tasks/v0/', include('user_tasks.urls')),
|
||||
url(r'^accessibility$', contentstore.views.accessibility, name='accessibility')
|
||||
]
|
||||
|
||||
JS_INFO_DICT = {
|
||||
|
||||
Reference in New Issue
Block a user