From d556cdd586f829aad9e67050200217125951bbf2 Mon Sep 17 00:00:00 2001 From: Brian Talbot Date: Fri, 9 Jan 2015 11:41:16 -0500 Subject: [PATCH] syncing icon class syntax + semantically hiding changed icons from assistive tech TNL-1137 --- cms/templates/js/publish-xblock.underscore | 6 ++-- cms/templates/studio_xblock_wrapper.html | 2 +- .../ux/reference/modal_access-component.html | 4 +-- cms/templates/visibility_editor.html | 13 ++++++-- .../discussion/test_cohort_management.py | 5 +-- .../js/spec/groups/views/cohorts_spec.js | 11 ++++--- .../instructor_dashboard/ecommerce_spec.js | 8 ++--- .../cohort-editor.underscore | 2 +- .../cohort-form.underscore | 33 +++++++++++++++++-- 9 files changed, 61 insertions(+), 23 deletions(-) diff --git a/cms/templates/js/publish-xblock.underscore b/cms/templates/js/publish-xblock.underscore index 3af6f4c258..521cfc31a2 100644 --- a/cms/templates/js/publish-xblock.underscore +++ b/cms/templates/js/publish-xblock.underscore @@ -79,7 +79,7 @@ var visibleToStaffOnly = visibilityState === 'staff_only'; <% } %> <% if (hasContentGroupComponents) { %>

- + <%= gettext("Some content in this unit is only visible to particular groups") %>

<% } %> @@ -87,9 +87,9 @@ var visibleToStaffOnly = visibilityState === 'staff_only';
  • <% if (hasExplicitStaffLock) { %> - + <% } else { %> - + <% } %> <%= gettext('Hide from students') %> diff --git a/cms/templates/studio_xblock_wrapper.html b/cms/templates/studio_xblock_wrapper.html index 3c0b34288e..11beba2c9a 100644 --- a/cms/templates/studio_xblock_wrapper.html +++ b/cms/templates/studio_xblock_wrapper.html @@ -83,7 +83,7 @@ messages = json.dumps(xblock.validate().to_json())
  • - + ${_("Visibility")}
  • diff --git a/cms/templates/ux/reference/modal_access-component.html b/cms/templates/ux/reference/modal_access-component.html index 321cc4d83a..4d5ea570c6 100644 --- a/cms/templates/ux/reference/modal_access-component.html +++ b/cms/templates/ux/reference/modal_access-component.html @@ -13,8 +13,8 @@ % elif is_staff_locked:
    - -

    ${_('The Unit this component is contained in is hidden from students. Visibility settings here will be trumped by this.')}

    + +

    + ## Translators: Any text between {screen_reader_start} and {screen_reader_end} is only read by screen readers and never shown in the browser. + ${_( + "{screen_reader_start}Warning:{screen_reader_end} The Unit this component is contained in is hidden from students. Visibility settings here will be trumped by this." + ).format( + screen_reader_start='', + screen_reader_end='', + ) + } +

    % endif diff --git a/common/test/acceptance/tests/discussion/test_cohort_management.py b/common/test/acceptance/tests/discussion/test_cohort_management.py index 7c12492e94..5390bac698 100644 --- a/common/test/acceptance/tests/discussion/test_cohort_management.py +++ b/common/test/acceptance/tests/discussion/test_cohort_management.py @@ -112,7 +112,8 @@ class CohortConfigurationTest(UniqueCourseTest, CohortTestMixin): self.cohort_management_page.select_cohort(self.manual_cohort_name) self.assertIsNone(self.cohort_management_page.get_cohort_associated_content_group()) self.assertEqual( - "No content groups exist. Create a content group to associate with cohort groups. Create a content group", + "Warning:\nNo content groups exist. " + "Create a content group to associate with cohort groups. Create a content group", self.cohort_management_page.get_cohort_related_content_group_message() ) self.assertFalse(self.cohort_management_page.select_content_group_radio_button()) @@ -616,7 +617,7 @@ class CohortContentGroupAssociationTest(UniqueCourseTest, CohortTestMixin): self.cohort_management_page.get_all_content_groups() ) self.assertEqual( - "The previously selected content group was deleted. Select another content group.", + "Warning:\nThe previously selected content group was deleted. Select another content group.", self.cohort_management_page.get_cohort_related_content_group_message() ) self.cohort_management_page.set_cohort_associated_content_group("Pears") diff --git a/lms/static/js/spec/groups/views/cohorts_spec.js b/lms/static/js/spec/groups/views/cohorts_spec.js index b9987099a2..652c42316e 100644 --- a/lms/static/js/spec/groups/views/cohorts_spec.js +++ b/lms/static/js/spec/groups/views/cohorts_spec.js @@ -646,7 +646,7 @@ define(['backbone', 'jquery', 'js/common_helpers/ajax_helpers', 'js/common_helpe cohortsView.$('.tab-settings a').click(); expect(cohortsView.$('option.option-unavailable').text().trim()).toBe('Deleted Content Group'); expect(cohortsView.$('.copy-error').text().trim()).toBe( - 'The previously selected content group was deleted. Select another content group.' + 'Warning: The previously selected content group was deleted. Select another content group.' ); }); @@ -687,13 +687,14 @@ define(['backbone', 'jquery', 'js/common_helpers/ajax_helpers', 'js/common_helpe }); it("shows an error message when no content groups are specified", function () { + var message; createCohortsView(this, {selectCohort: 1, contentGroups: []}); cohortsView.$('.tab-settings a').click(); expect(cohortsView.$('.radio-yes').prop('disabled')).toBeTruthy(); - expect(cohortsView.$('.msg-inline').text().trim()).toBe( - 'No content groups exist. Create a content group to associate with cohort groups. ' + - 'Create a content group' - ); + message = cohortsView.$('.msg-inline').text().trim(); + expect(message).toContain('Warning: No content groups exist.'); + expect(message).toContain('Create a content group to associate with cohort groups.'); + expect(message).toContain('Create a content group'); expect( cohortsView.$('.msg-inline a').attr('href'), MOCK_STUDIO_GROUP_CONFIGURATIONS_URL diff --git a/lms/static/js/spec/instructor_dashboard/ecommerce_spec.js b/lms/static/js/spec/instructor_dashboard/ecommerce_spec.js index 38c1163b6f..273fbd6f53 100644 --- a/lms/static/js/spec/instructor_dashboard/ecommerce_spec.js +++ b/lms/static/js/spec/instructor_dashboard/ecommerce_spec.js @@ -1,10 +1,10 @@ -define(['backbone', 'jquery', 'js/instructor_dashboard/ecommerce', 'js/common_helpers/template_helpers'], - function (Backbone, $, ExpiryCouponView, TemplateHelpers) { +define(['backbone', 'jquery', 'js/instructor_dashboard/ecommerce'], + function (Backbone, $, ExpiryCouponView) { 'use strict'; - var expiryCouponView, createExpiryCoupon; + var expiryCouponView; describe("edx.instructor_dashboard.ecommerce.ExpiryCouponView", function() { beforeEach(function() { - setFixtures('
  • ') + setFixtures('
  • '); expiryCouponView = new ExpiryCouponView(); }); diff --git a/lms/templates/instructor/instructor_dashboard_2/cohort-editor.underscore b/lms/templates/instructor/instructor_dashboard_2/cohort-editor.underscore index 65f2a68a66..0090a87f79 100644 --- a/lms/templates/instructor/instructor_dashboard_2/cohort-editor.underscore +++ b/lms/templates/instructor/instructor_dashboard_2/cohort-editor.underscore @@ -61,7 +61,7 @@
    diff --git a/lms/templates/instructor/instructor_dashboard_2/cohort-form.underscore b/lms/templates/instructor/instructor_dashboard_2/cohort-form.underscore index edfe6622c1..960def3ac2 100644 --- a/lms/templates/instructor/instructor_dashboard_2/cohort-form.underscore +++ b/lms/templates/instructor/instructor_dashboard_2/cohort-form.underscore @@ -71,14 +71,41 @@ <% if (hasSelectedContentGroup && !foundSelected) { %>
    -

    <%- gettext("The previously selected content group was deleted. Select another content group.") %>

    +

    + + <%= + interpolate( + // Translators: Any text between %(screen_reader_start)s and %(screen_reader_end)s is only read by screen readers and never shown in the browser. + '%(screen_reader_start)sWarning:%(screen_reader_end)s The previously selected content group was deleted. Select another content group.', + { + screen_reader_start: '', + screen_reader_end: '' + }, + true + ) + %> +

    <% } %> <% } else { // no content groups available %>
    -

    <%- gettext("No content groups exist. Create a content group to associate with cohort groups.") %> <%- gettext("Create a content group") %>

    +

    + + <%= + interpolate( + // Translators: Any text between %(screen_reader_start)s and %(screen_reader_end)s is only read by screen readers and never shown in the browser. + '%(screen_reader_start)sWarning:%(screen_reader_end)s No content groups exist. Create a content group to associate with cohort groups.', + { + screen_reader_start: '', + screen_reader_end: '' + }, + true + ) + %> + <%- gettext("Create a content group") %> +

    <% } %> @@ -89,7 +116,7 @@
    <% if (isNewCohort) { %>