Commit 648e8a20 by David Baumgold Committed by Sarina Canelake

Creative Commons: Accessibility improvements

parent 37ab2fc1
<div class="license-wrapper"> <div class="license-wrapper">
<label class="label setting-label" for="list-license-types"> <h3 class="label setting-label">
<%= gettext("License Type") %> <%= gettext("License Type") %>
</label> </h3>
<ul class="license-types" id="list-license-types"> <ul class="license-types">
<% var link_start_tpl = '<a href="{url}" target="_blank">'; %> <% var link_start_tpl = '<a href="{url}" target="_blank">'; %>
<% _.each(licenseInfo, function(license, licenseType) { %> <% _.each(licenseInfo, function(license, licenseType) { %>
<li data-license="<%- licenseType %>"> <li data-license="<%- licenseType %>">
...@@ -29,14 +29,14 @@ ...@@ -29,14 +29,14 @@
<% var license = licenseInfo[model.type]; %> <% var license = licenseInfo[model.type]; %>
<% if(license && !_.isEmpty(license.options)) { %> <% if(license && !_.isEmpty(license.options)) { %>
<div class="wrapper-license-options"> <div class="wrapper-license-options">
<label class="label setting-label" for="list-license-options"> <h4 class="label setting-label">
<%- gettext("Options for {license_name}").replace("{license_name}", license.name) %> <%- gettext("Options for {license_name}").replace("{license_name}", license.name) %>
</label> </h4>
<p class='tip tip-inline'> <p class='tip tip-inline'>
<%- gettext("The following options are available for the {license_name} license.") <%- gettext("The following options are available for the {license_name} license.")
.replace("{license_name}", license.name) %> .replace("{license_name}", license.name) %>
</p> </p>
<ul class="license-options" id="list-license-options"> <ul class="license-options">
<% _.each(license.option_order, function(optionKey) { %> <% _.each(license.option_order, function(optionKey) { %>
<% var optionInfo = license.options[optionKey]; %> <% var optionInfo = license.options[optionKey]; %>
<% if (optionInfo.type == "boolean") { %> <% if (optionInfo.type == "boolean") { %>
...@@ -49,11 +49,26 @@ ...@@ -49,11 +49,26 @@
<% if (optionSelected) { print("is-selected"); } %> <% if (optionSelected) { print("is-selected"); } %>
<% if (optionDisabled) { print("is-disabled"); } else { print("is-clickable"); } %>" <% if (optionDisabled) { print("is-disabled"); } else { print("is-clickable"); } %>"
> >
<i class="fa fa-fw <i aria-hidden="true"
class="fa fa-fw
<% if(optionSelected) { print("fa-check-square-o"); } else { print("fa-square-o"); } %> <% if(optionSelected) { print("fa-check-square-o"); } else { print("fa-square-o"); } %>
<% if(optionDisabled) { print("is-disabled"); } %> <% if(optionDisabled) { print("is-disabled"); } %>
"></i> "></i>
<h4 class="option-name"><%- optionInfo.name %></h4> <h4 class="option-name">
<%- optionInfo.name %>
<%
var states = [];
if (optionSelected) {
states.push(gettext("selected"));
}
if (optionDisabled) {
states.push(gettext("disabled"));
}
if (states) {
%>
<span class="sr">, <%- states.join(", ") %></span>
<% } %>
</h4>
<div class="explanation"><%- optionInfo.help %></div> <div class="explanation"><%- optionInfo.help %></div>
</li> </li>
<% } // could implement other types here %> <% } // could implement other types here %>
...@@ -64,13 +79,13 @@ ...@@ -64,13 +79,13 @@
<% if (showPreview) { %> <% if (showPreview) { %>
<div class="license-preview-wrapper"> <div class="license-preview-wrapper">
<label class="label setting-label" for="license-preview"> <h4 class="label setting-label">
<%= gettext("License Display") %> <%= gettext("License Display") %>
</label> </h4>
<p class="tip"> <p class="tip">
<%= gettext("The following message will be displayed at the bottom of the courseware pages within your course.") %> <%= gettext("The following message will be displayed at the bottom of the courseware pages within your course.") %>
</p> </p>
<div id="license-preview"> <div class="license-preview">
<% // keep this synchronized with the contents of common/templates/license.html %> <% // keep this synchronized with the contents of common/templates/license.html %>
<% if (model.type === "all-rights-reserved") { %> <% if (model.type === "all-rights-reserved") { %>
© <span class="license-text"><%= gettext("All Rights Reserved") %></span> © <span class="license-text"><%= gettext("All Rights Reserved") %></span>
...@@ -91,9 +106,9 @@ ...@@ -91,9 +106,9 @@
alt="<%- typeof licenseString == "string" ? licenseString : "" %>" alt="<%- typeof licenseString == "string" ? licenseString : "" %>"
/> />
<% } else { %> <% } else { %>
<i class="icon-cc"></i> <i aria-hidden="true" class="icon-cc"></i>
<% _.each(enabled, function(option) { %> <% _.each(enabled, function(option) { %>
<i class="icon-cc-<%- option %>"></i> <i aria-hidden="true" class="icon-cc-<%- option %>"></i>
<% }); %> <% }); %>
<span class="license-text"><%= gettext("Some Rights Reserved") %></span> <span class="license-text"><%= gettext("Some Rights Reserved") %></span>
<% } %> <% } %>
......
...@@ -43,9 +43,9 @@ def parse_license(lic): ...@@ -43,9 +43,9 @@ def parse_license(lic):
/> />
</a> </a>
% else: % else:
<i class="icon-cc"></i> <i aria-hidden="true" class="icon-cc"></i>
% for option in enabled: % for option in enabled:
<i class="icon-cc-${option}"></i> <i aria-hidden="true" class="icon-cc-${option}"></i>
% endfor % endfor
<span class="license-text">${_("Some Rights Reserved")}</span> <span class="license-text">${_("Some Rights Reserved")}</span>
% endif % endif
......
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