Commit d556cdd5 by Brian Talbot Committed by Andy Armstrong

syncing icon class syntax + semantically hiding changed icons from assistive tech

TNL-1137
parent f58e96a2
...@@ -79,7 +79,7 @@ var visibleToStaffOnly = visibilityState === 'staff_only'; ...@@ -79,7 +79,7 @@ var visibleToStaffOnly = visibilityState === 'staff_only';
<% } %> <% } %>
<% if (hasContentGroupComponents) { %> <% if (hasContentGroupComponents) { %>
<p class="note-visibility"> <p class="note-visibility">
<i class="icon icon-eye-open"></i> <i class="icon fa fa-eye" aria-hidden="true"></i>
<span class="note-copy"><%= gettext("Some content in this unit is only visible to particular groups") %></span> <span class="note-copy"><%= gettext("Some content in this unit is only visible to particular groups") %></span>
</p> </p>
<% } %> <% } %>
...@@ -87,9 +87,9 @@ var visibleToStaffOnly = visibilityState === 'staff_only'; ...@@ -87,9 +87,9 @@ var visibleToStaffOnly = visibilityState === 'staff_only';
<li class="action-inline"> <li class="action-inline">
<a href="" class="action-staff-lock" role="button" aria-pressed="<%= hasExplicitStaffLock %>"> <a href="" class="action-staff-lock" role="button" aria-pressed="<%= hasExplicitStaffLock %>">
<% if (hasExplicitStaffLock) { %> <% if (hasExplicitStaffLock) { %>
<i class="icon fa fa-check-square-o"></i> <i class="icon fa fa-check-square-o" aria-hidden="true"></i>
<% } else { %> <% } else { %>
<i class="icon fa fa-square-o"></i> <i class="icon fa fa-square-o" aria-hidden="true"></i>
<% } %> <% } %>
<%= gettext('Hide from students') %> <%= gettext('Hide from students') %>
</a> </a>
......
...@@ -83,7 +83,7 @@ messages = json.dumps(xblock.validate().to_json()) ...@@ -83,7 +83,7 @@ messages = json.dumps(xblock.validate().to_json())
</li> </li>
<li class="action-item action-visibility"> <li class="action-item action-visibility">
<a href="#" data-tooltip="${_("Visibility Settings")}" class="visibility-button action-button"> <a href="#" data-tooltip="${_("Visibility Settings")}" class="visibility-button action-button">
<i class="icon-eye-open"></i> <i class="icon fa fa-eye" aria-hidden="true"></i>
<span class="sr">${_("Visibility")}</span> <span class="sr">${_("Visibility")}</span>
</a> </a>
</li> </li>
......
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
<div class="modal-section visibility-summary"> <div class="modal-section visibility-summary">
<div class="summary-message summary-message-warning visibility-summary-message"> <div class="summary-message summary-message-warning visibility-summary-message">
<i class="icon icon-warning-sign"></i> <i class="icon fa fa-exclamation-triangle" aria-hidden="true"></i>
<p class="copy">This component is contained in a unit that is hidden from students. Component visibility settings are overridden by the unit visibility settings.</p> <p class="copy"><span class="sr">Warning: </span>This component is contained in a unit that is hidden from students. Component visibility settings are overridden by the unit visibility settings.</p>
</div> </div>
<!-- NOTE: use when no group configuration has been set --> <!-- NOTE: use when no group configuration has been set -->
......
...@@ -27,8 +27,17 @@ is_staff_locked = ancestor_has_staff_lock(xblock) ...@@ -27,8 +27,17 @@ is_staff_locked = ancestor_has_staff_lock(xblock)
</div> </div>
% elif is_staff_locked: % elif is_staff_locked:
<div class="summary-message summary-message-warning visibility-summary-message"> <div class="summary-message summary-message-warning visibility-summary-message">
<i class="icon icon-warning-sign"></i> <i class="icon fa fa-exclamation-triangle" aria-hidden="true"></i>
<p class="copy">${_('The Unit this component is contained in is hidden from students. Visibility settings here will be trumped by this.')}</p> <p class="copy">
## 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='<span class="sr">',
screen_reader_end='</span>',
)
}
</p>
</div> </div>
% endif % endif
</div> </div>
......
...@@ -112,7 +112,8 @@ class CohortConfigurationTest(UniqueCourseTest, CohortTestMixin): ...@@ -112,7 +112,8 @@ class CohortConfigurationTest(UniqueCourseTest, CohortTestMixin):
self.cohort_management_page.select_cohort(self.manual_cohort_name) self.cohort_management_page.select_cohort(self.manual_cohort_name)
self.assertIsNone(self.cohort_management_page.get_cohort_associated_content_group()) self.assertIsNone(self.cohort_management_page.get_cohort_associated_content_group())
self.assertEqual( 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.cohort_management_page.get_cohort_related_content_group_message()
) )
self.assertFalse(self.cohort_management_page.select_content_group_radio_button()) self.assertFalse(self.cohort_management_page.select_content_group_radio_button())
...@@ -616,7 +617,7 @@ class CohortContentGroupAssociationTest(UniqueCourseTest, CohortTestMixin): ...@@ -616,7 +617,7 @@ class CohortContentGroupAssociationTest(UniqueCourseTest, CohortTestMixin):
self.cohort_management_page.get_all_content_groups() self.cohort_management_page.get_all_content_groups()
) )
self.assertEqual( 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.get_cohort_related_content_group_message()
) )
self.cohort_management_page.set_cohort_associated_content_group("Pears") self.cohort_management_page.set_cohort_associated_content_group("Pears")
......
...@@ -646,7 +646,7 @@ define(['backbone', 'jquery', 'js/common_helpers/ajax_helpers', 'js/common_helpe ...@@ -646,7 +646,7 @@ define(['backbone', 'jquery', 'js/common_helpers/ajax_helpers', 'js/common_helpe
cohortsView.$('.tab-settings a').click(); cohortsView.$('.tab-settings a').click();
expect(cohortsView.$('option.option-unavailable').text().trim()).toBe('Deleted Content Group'); expect(cohortsView.$('option.option-unavailable').text().trim()).toBe('Deleted Content Group');
expect(cohortsView.$('.copy-error').text().trim()).toBe( 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 ...@@ -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 () { it("shows an error message when no content groups are specified", function () {
var message;
createCohortsView(this, {selectCohort: 1, contentGroups: []}); createCohortsView(this, {selectCohort: 1, contentGroups: []});
cohortsView.$('.tab-settings a').click(); cohortsView.$('.tab-settings a').click();
expect(cohortsView.$('.radio-yes').prop('disabled')).toBeTruthy(); expect(cohortsView.$('.radio-yes').prop('disabled')).toBeTruthy();
expect(cohortsView.$('.msg-inline').text().trim()).toBe( message = cohortsView.$('.msg-inline').text().trim();
'No content groups exist. Create a content group to associate with cohort groups. ' + expect(message).toContain('Warning: No content groups exist.');
'Create a content group' expect(message).toContain('Create a content group to associate with cohort groups.');
); expect(message).toContain('Create a content group');
expect( expect(
cohortsView.$('.msg-inline a').attr('href'), cohortsView.$('.msg-inline a').attr('href'),
MOCK_STUDIO_GROUP_CONFIGURATIONS_URL MOCK_STUDIO_GROUP_CONFIGURATIONS_URL
......
define(['backbone', 'jquery', 'js/instructor_dashboard/ecommerce', 'js/common_helpers/template_helpers'], define(['backbone', 'jquery', 'js/instructor_dashboard/ecommerce'],
function (Backbone, $, ExpiryCouponView, TemplateHelpers) { function (Backbone, $, ExpiryCouponView) {
'use strict'; 'use strict';
var expiryCouponView, createExpiryCoupon; var expiryCouponView;
describe("edx.instructor_dashboard.ecommerce.ExpiryCouponView", function() { describe("edx.instructor_dashboard.ecommerce.ExpiryCouponView", function() {
beforeEach(function() { beforeEach(function() {
setFixtures('<li class="field full-width" id="add-coupon-modal-field-expiry"><input id="expiry-check" type="checkbox"/><label for="expiry-check"></label><input type="text" id="coupon_expiration_date" class="field" name="expiration_date" aria-required="true"/></li>') setFixtures('<li class="field full-width" id="add-coupon-modal-field-expiry"><input id="expiry-check" type="checkbox"/><label for="expiry-check"></label><input type="text" id="coupon_expiration_date" class="field" name="expiration_date" aria-required="true"/></li>');
expiryCouponView = new ExpiryCouponView(); expiryCouponView = new ExpiryCouponView();
}); });
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
<div class="form-actions"> <div class="form-actions">
<button class="form-submit button action-primary action-view"> <button class="form-submit button action-primary action-view">
<i class="button-icon icon fa fa-plus"></i> <%- gettext('Add Students') %> <i class="button-icon icon fa fa-plus" aria-hidden="true"></i> <%- gettext('Add Students') %>
</button> </button>
</div> </div>
</form> </form>
......
...@@ -71,14 +71,41 @@ ...@@ -71,14 +71,41 @@
<% if (hasSelectedContentGroup && !foundSelected) { %> <% if (hasSelectedContentGroup && !foundSelected) { %>
<div class="msg-inline"> <div class="msg-inline">
<p class="copy-error"><i class="icon icon-warning-sign"></i><%- gettext("The previously selected content group was deleted. Select another content group.") %></p> <p class="copy-error">
<i class="icon fa fa-exclamation-triangle" aria-hidden="true"></i>
<%=
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: '<span class="sr">',
screen_reader_end: '</span>'
},
true
)
%>
</p>
</div> </div>
<% } %> <% } %>
</div> </div>
<% } else { // no content groups available %> <% } else { // no content groups available %>
<div class="input-group-other"> <div class="input-group-other">
<div class="msg-inline"> <div class="msg-inline">
<p class="copy-error"><i class="icon icon-warning-sign"></i><%- gettext("No content groups exist. Create a content group to associate with cohort groups.") %> <a class="link-to-group-settings" href="<%- studioGroupConfigurationsUrl %>"><%- gettext("Create a content group") %></a></p> <p class="copy-error">
<i class="icon fa fa-exclamation-triangle" aria-hidden="true"></i>
<%=
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: '<span class="sr">',
screen_reader_end: '</span>'
},
true
)
%>
<a class="link-to-group-settings" href="<%- studioGroupConfigurationsUrl %>"><%- gettext("Create a content group") %></a>
</p>
</div> </div>
</div> </div>
<% } %> <% } %>
...@@ -89,7 +116,7 @@ ...@@ -89,7 +116,7 @@
<div class="form-actions"> <div class="form-actions">
<button class="form-submit button action-primary action-save"> <button class="form-submit button action-primary action-save">
<i class="icon fa fa-plus"></i> <i class="icon fa fa-plus" aria-hidden="true"></i>
<%- gettext('Save') %> <%- gettext('Save') %>
</button> </button>
<% if (isNewCohort) { %> <% if (isNewCohort) { %>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment