From 1a4eb7d2e8f078dbc5fcb9854644a3d18f99bc2e Mon Sep 17 00:00:00 2001 From: Awais Jibran Date: Thu, 22 Aug 2019 16:37:44 +0500 Subject: [PATCH] Pervent reverse tabnabbing in edx platform --- cms/static/js/base.js | 5 ++++- cms/templates/container.html | 2 +- cms/templates/course-create-rerun.html | 2 +- cms/templates/course_outline.html | 10 +++++----- cms/templates/export.html | 4 ++-- cms/templates/group_configurations.html | 6 +++--- cms/templates/import.html | 4 ++-- cms/templates/index.html | 2 +- ...dd-xblock-component-support-legend.underscore | 2 +- .../js/course-highlights-enable.underscore | 2 +- .../js/highlights-enable-editor.underscore | 2 +- cms/templates/js/license-selector.underscore | 2 +- cms/templates/library.html | 2 +- cms/templates/textbooks.html | 2 +- .../ux/reference/fragments/course-settings.html | 6 +++--- cms/templates/widgets/header.html | 4 ++-- common/lib/xmodule/xmodule/lti_module.py | 2 +- .../tests/views/test_instructor_dashboard.py | 4 ++-- .../instructor/views/instructor_dashboard.py | 4 ++-- lms/static/js/instructor_dashboard/util.js | 2 +- .../components/StudentAccountDeletion.jsx | 8 ++++---- .../components/StudentAccountDeletionModal.jsx | 2 +- .../js/student_account/views/RegisterView.js | 2 +- lms/templates/api_admin/catalogs/edit.html | 2 +- lms/templates/api_admin/catalogs/list.html | 2 +- .../certificates/_accomplishment-banner.html | 6 ++++-- lms/templates/certificates/_badges-modal.html | 4 ++-- lms/templates/courseware/progress.html | 4 ++-- .../credit_eligibility_email.html | 2 +- lms/templates/dashboard.html | 2 +- .../_dashboard_certificate_information.html | 4 ++-- .../dashboard/_dashboard_course_listing.html | 6 ++++-- .../dashboard/_dashboard_credit_info.html | 4 ++-- .../fields/field_order_history.underscore | 2 +- lms/templates/header/header.html | 4 ++-- lms/templates/header/navbar-authenticated.html | 2 +- .../cohort-group-header.underscore | 4 ++-- .../instructor_analytics.html | 2 +- lms/templates/login.html | 2 +- lms/templates/lti.html | 2 +- .../bootstrap/navbar-authenticated.html | 3 ++- .../navigation/navbar-authenticated.html | 1 + lms/templates/navigation/navigation.html | 4 ++-- lms/templates/register-shib.html | 2 +- lms/templates/register.html | 2 +- lms/templates/signup_modal.html | 4 ++-- .../student_account/account_settings.underscore | 2 +- .../student_account/form_field.underscore | 8 ++++---- lms/templates/wiki/delete.html | 2 +- lms/templates/wiki/includes/cheatsheet.html | 6 +++--- openedx/core/djangoapps/api_admin/widgets.py | 4 +++- openedx/core/djangoapps/user_api/api.py | 16 ++++++++++++---- .../core/djangoapps/user_api/tests/test_views.py | 14 +++++++------- .../user_authn/views/tests/test_views.py | 2 +- openedx/core/lib/license/templates/license.html | 2 +- openedx/features/enterprise_support/utils.py | 2 +- .../templates/social_icons.underscore | 2 +- .../learner-achievements-fragment.html | 2 +- themes/edx.org/lms/templates/dashboard.html | 2 +- .../templates/header/navbar-authenticated.html | 6 ++---- .../lms/templates/register-shib.html | 2 +- 61 files changed, 120 insertions(+), 103 deletions(-) diff --git a/cms/static/js/base.js b/cms/static/js/base.js index 0f7fa7f1da..7ef8b9f47c 100644 --- a/cms/static/js/base.js +++ b/cms/static/js/base.js @@ -97,7 +97,10 @@ define([ // general link management - new window/tab $('a[rel="external"]:not([title])') .attr('title', gettext('This link will open in a new browser window/tab')); - $('a[rel="external"]').attr('target', '_blank'); + $('a[rel="external"]').attr({ + rel: 'noopener external', + target: '_blank' + }); // general link management - lean modal window $('a[rel="modal"]').attr('title', gettext('This link will open in a modal window')).leanModal({ diff --git a/cms/templates/container.html b/cms/templates/container.html index ecaa9110e2..6de87b2b28 100644 --- a/cms/templates/container.html +++ b/cms/templates/container.html @@ -144,7 +144,7 @@ from openedx.core.djangolib.markup import HTML, Text

${_("Confirm that you have properly configured content in each of your experiment groups.")}

- ${_("Learn more about component containers")} + ${_("Learn more about component containers")}
% elif is_unit_page:
diff --git a/cms/templates/course-create-rerun.html b/cms/templates/course-create-rerun.html index c8114a56a9..b8cdd06e88 100644 --- a/cms/templates/course-create-rerun.html +++ b/cms/templates/course-create-rerun.html @@ -148,7 +148,7 @@ from openedx.core.djangolib.js_utils import js_escaped_string
- ${_("Learn more about Course Re-runs")} + ${_("Learn more about Course Re-runs")}
diff --git a/cms/templates/course_outline.html b/cms/templates/course_outline.html index 5507ed75fa..44962ae6a6 100644 --- a/cms/templates/course_outline.html +++ b/cms/templates/course_outline.html @@ -164,7 +164,7 @@ from django.core.urlresolvers import reverse
% endif <%static:studiofrontend entry="courseOutlineHealthCheck"> - <% + <% course_key = context_course.id %> { @@ -188,7 +188,7 @@ from django.core.urlresolvers import reverse "settings": ${reverse('settings_handler', kwargs={'course_key_string': unicode(course_key)})| n, dump_js_escaped_json} } } - +
@@ -218,14 +218,14 @@ from django.core.urlresolvers import reverse

${_("Reorganizing your course")}

${_("Drag sections, subsections, and units to new locations in the outline.")}

- ${_("Learn more about the course outline")} + ${_("Learn more about the course outline")}

${_("Setting release dates and grading policies")}

${_("Select the Configure icon for a section or subsection to set its release date. When you configure a subsection, you can also set the grading policy and due date.")}

@@ -234,7 +234,7 @@ from django.core.urlresolvers import reverse

${Text(_("To make a section, subsection, or unit unavailable to learners, select the Configure icon for that level, then select the appropriate {em_start}Hide{em_end} option. Grades for hidden sections, subsections, and units are not included in grade calculations.")).format(em_start=HTML(""), em_end=HTML(""))}

${Text(_("To hide the content of a subsection from learners after the subsection due date has passed, select the Configure icon for a subsection, then select {em_start}Hide content after due date{em_end}. Grades for the subsection remain included in grade calculations.")).format(em_start=HTML(""), em_end=HTML(""))}

diff --git a/cms/templates/export.html b/cms/templates/export.html index d0f546d633..bbc74c2046 100644 --- a/cms/templates/export.html +++ b/cms/templates/export.html @@ -235,7 +235,7 @@ else:

${_("Use an archive program to extract the data from the .tar.gz file. Extracted data includes the library.xml file, as well as subfolders that contain library content.")}

- ${_("Learn more about exporting a library")} + ${_("Learn more about exporting a library")}
%else: @@ -269,7 +269,7 @@ else:

${_("Use an archive program to extract the data from the .tar.gz file. Extracted data includes the course.xml file, as well as subfolders that contain course content.")}

- ${_("Learn more about exporting a course")} + ${_("Learn more about exporting a course")}
%endif diff --git a/cms/templates/group_configurations.html b/cms/templates/group_configurations.html index 37bf796795..0e9708954c 100644 --- a/cms/templates/group_configurations.html +++ b/cms/templates/group_configurations.html @@ -86,7 +86,7 @@ from openedx.core.djangolib.markup import HTML, Text

${_("Enrollment track groups allow you to offer different course content to learners in each enrollment track. Learners enrolled in each enrollment track in your course are automatically included in the corresponding enrollment track group.")}

${_("On unit pages in the course outline, you can restrict access to components to learners based on their enrollment track.")}

${_("You cannot edit enrollment track groups, but you can expand each group to view details of the course content that is designated for learners in the group.")}

-

${_("Learn More")}

+

${_("Learn More")}

% endif @@ -96,7 +96,7 @@ from openedx.core.djangolib.markup import HTML, Text

${_("If you have cohorts enabled in your course, you can use content groups to create cohort-specific courseware. In other words, you can customize the content that particular cohorts see in your course.")}

${_("Each content group that you create can be associated with one or more cohorts. In addition to making course content available to all learners, you can restrict access to some content to learners in specific content groups. Only learners in the cohorts that are associated with the specified content groups see the additional content.")}

${Text(_("Click {em_start}New content group{em_end} to add a new content group. To edit the name of a content group, hover over its box and click {em_start}Edit{em_end}. You can delete a content group only if it is not in use by a unit. To delete a content group, hover over its box and click the delete icon.")).format(em_start=HTML(""), em_end=HTML(""))}

-

${_("Learn More")}

+

${_("Learn More")}

% if should_show_experiment_groups: @@ -105,7 +105,7 @@ from openedx.core.djangolib.markup import HTML, Text

${_("Experiment Group Configurations")}

${_("Use experiment group configurations if you are conducting content experiments, also known as A/B testing, in your course. Experiment group configurations define how many groups of learners are in a content experiment. When you create a content experiment for a course, you select the group configuration to use.")}

${Text(_("Click {em_start}New Group Configuration{em_end} to add a new configuration. To edit a configuration, hover over its box and click {em_start}Edit{em_end}. You can delete a group configuration only if it is not in use in an experiment. To delete a configuration, hover over its box and click the delete icon.")).format(em_start=HTML(""), em_end=HTML(""))}

-

${_("Learn More")}

+

${_("Learn More")}

% endif diff --git a/cms/templates/import.html b/cms/templates/import.html index 38678c0562..d37aa30f88 100644 --- a/cms/templates/import.html +++ b/cms/templates/import.html @@ -213,7 +213,7 @@ else:

${_("If you change and import a library that is referenced by randomized content blocks in one or more courses, those courses do not automatically use the updated content. You must manually refresh the randomized content blocks to bring them up to date with the latest library content.")}

- ${_("Learn more about importing a library")} + ${_("Learn more about importing a library")}
%else: @@ -245,7 +245,7 @@ else:

${_("If you perform an import while your course is running, and you change the URL names (or url_name nodes) of any Problem components, the student data associated with those Problem components may be lost. This data includes students' problem scores.")}

- ${_("Learn more about importing a course")} + ${_("Learn more about importing a course")}
%endif diff --git a/cms/templates/index.html b/cms/templates/index.html index ff2b595167..39b193ead7 100644 --- a/cms/templates/index.html +++ b/cms/templates/index.html @@ -519,7 +519,7 @@ from openedx.core.djangolib.js_utils import (
  1. - ${_("Getting Started with {studio_name}").format(studio_name=settings.STUDIO_NAME)} + ${_("Getting Started with {studio_name}").format(studio_name=settings.STUDIO_NAME)}
diff --git a/cms/templates/js/add-xblock-component-support-legend.underscore b/cms/templates/js/add-xblock-component-support-legend.underscore index e3338da691..483e786581 100644 --- a/cms/templates/js/add-xblock-component-support-legend.underscore +++ b/cms/templates/js/add-xblock-component-support-legend.underscore @@ -1,7 +1,7 @@ <% if (support_legend.show_legend) { %> + href="https://edx.readthedocs.io/projects/edx-partner-course-staff/en/latest/exercises_tools/create_exercises_and_tools.html#levels-of-support-for-tools" rel="noopener" target="_blank"> <%- support_legend.documentation_label %> diff --git a/cms/templates/js/course-highlights-enable.underscore b/cms/templates/js/course-highlights-enable.underscore index 885b64bc5f..2b3ea55d5c 100644 --- a/cms/templates/js/course-highlights-enable.underscore +++ b/cms/templates/js/course-highlights-enable.underscore @@ -8,5 +8,5 @@ <% } else { %> <% } %> -Learn more +Learn more diff --git a/cms/templates/js/highlights-enable-editor.underscore b/cms/templates/js/highlights-enable-editor.underscore index de8ee87989..9541113072 100644 --- a/cms/templates/js/highlights-enable-editor.underscore +++ b/cms/templates/js/highlights-enable-editor.underscore @@ -15,7 +15,7 @@ ), { linkStart: edx.HtmlUtils.interpolateHtml( - edx.HtmlUtils.HTML(''), + edx.HtmlUtils.HTML(''), {highlightsDocUrl: xblockInfo.attributes.highlights_doc_url} ), linkEnd: edx.HtmlUtils.HTML('') diff --git a/cms/templates/js/license-selector.underscore b/cms/templates/js/license-selector.underscore index 2245f7deb0..6bf3c97806 100644 --- a/cms/templates/js/license-selector.underscore +++ b/cms/templates/js/license-selector.underscore @@ -3,7 +3,7 @@ <%- gettext("License Type") %>