From 46908347e3e6fee6337622e3ede4c5100472b188 Mon Sep 17 00:00:00 2001 From: Amir Qayyum khan Date: Fri, 17 Apr 2015 15:29:09 +0500 Subject: [PATCH] fix accessibility issues in code --- edx_sga/static/js/src/edx_sga.js | 10 +++- .../staff_graded_assignment/edit.html | 21 +++++---- .../staff_graded_assignment/show.html | 47 ++++++++++--------- 3 files changed, 43 insertions(+), 35 deletions(-) diff --git a/edx_sga/static/js/src/edx_sga.js b/edx_sga/static/js/src/edx_sga.js index 38db877b..fd01a5ff 100644 --- a/edx_sga/static/js/src/edx_sga.js +++ b/edx_sga/static/js/src/edx_sga.js @@ -48,13 +48,19 @@ function StaffGradedAssignmentXBlock(runtime, element) { return; } } + var uploadElement = $(content).find(".upload"); + uploadElement.attr("role", "progressbar"); + uploadElement.attr("aria-valuemax", "100"); + uploadElement.attr("aria-valuemin", "0"); data.submit(); }); }, progressall: function(e, data) { var percent = parseInt(data.loaded / data.total * 100, 10); - $(content).find('.upload').text( - 'Uploading... ' + percent + '%'); + var uploadElement = $(content).find(".upload"); + uploadElement.text("Uploading... " + percent + "%"); + uploadElement.attr("aria-valuenow" , percent); + uploadElement.attr("aria-valuetext" , "Uploading... " + percent + "%"); }, fail: function(e, data) { /** diff --git a/edx_sga/templates/staff_graded_assignment/edit.html b/edx_sga/templates/staff_graded_assignment/edit.html index 4ef3d34a..876b6908 100644 --- a/edx_sga/templates/staff_graded_assignment/edit.html +++ b/edx_sga/templates/staff_graded_assignment/edit.html @@ -1,22 +1,23 @@ {% load i18n %} -
- +
diff --git a/edx_sga/templates/staff_graded_assignment/show.html b/edx_sga/templates/staff_graded_assignment/show.html index 7eac9d9e..cedb78df 100644 --- a/edx_sga/templates/staff_graded_assignment/show.html +++ b/edx_sga/templates/staff_graded_assignment/show.html @@ -1,14 +1,15 @@ {% load i18n %}
+ data-staff="{{ is_course_staff }}" role="article" aria-describedby="title"> -