build correct mastery paths url for course home page

closes: CYOE-388

Test plan:
1.  Make the modules page the course home page.
2.  Visit the course home page.  Verify that mastery
    paths links (both inline and in the menu) are
    correct.
3.  Make the assignments page the course home page.
    Verify that mastery paths links are correct
4.  Visit the assignments, modules, quizzes, and
    discussions pages.  Verify that mastery path links
    are correct.

Change-Id: If0623a7e4d324523993f334a854919e43ab40508
Reviewed-on: https://gerrit.instructure.com/95315
Reviewed-by: Christian Prescott <cprescott@instructure.com>
Tested-by: Jenkins
QA-Review: Alex Ortiz-Rosado <aortiz@instructure.com>
Product-Review: Michael Brewer-Davis <mbd@instructure.com>
This commit is contained in:
Michael Brewer-Davis 2016-11-15 16:51:53 -06:00
parent 96d0ab4ea1
commit 3e88f8109d
3 changed files with 5 additions and 3 deletions

View File

@ -67,6 +67,7 @@ class ContextModulesController < ApplicationController
module_file_details = load_module_file_details if @context.grants_right?(@current_user, session, :manage_content)
js_env :course_id => @context.id,
:CONTEXT_URL_ROOT => polymorphic_path([@context]),
:FILES_CONTEXTS => [{asset_string: @context.asset_string}],
:MODULE_FILE_DETAILS => module_file_details,
:MODULE_FILE_PERMISSIONS => {

View File

@ -66,7 +66,7 @@
{{#if canManage}}
<div class="ig-admin">
{{#if cyoe.isTrigger}}
<a href="assignments/{{id}}/edit/?return_to={{return_to}}#mastery-paths-editor" title="{{#t}}Edit Mastery Paths for {{name}}{{/t}}">{{#t}}Mastery Paths{{/t}}</a>
<a href="{{htmlEditUrl}}?return_to={{return_to}}#mastery-paths-editor" title="{{#t}}Edit Mastery Paths for {{name}}{{/t}}">{{#t}}Mastery Paths{{/t}}</a>
{{/if}}
{{#if cyoe.isReleased}}
<span class="pill mastery-path-icon" data-tooltip title="{{#t}}Released by Mastery Path{{/t}}">
@ -121,7 +121,7 @@
{{#if cyoe.isCyoeAble}}
<li>
<a
href="assignments/{{id}}/edit/?return_to={{return_to}}#mastery-paths-editor"
href="{{htmlEditUrl}}?return_to={{return_to}}#mastery-paths-editor"
class="edit_mastery_paths icon-mastery-path"
id="assignment_{{id}}_settings_edit_item_mastery_paths"
aria-label="{{#t}}Edit Assignment {{name}} Mastery Paths{{/t}}"

View File

@ -528,7 +528,8 @@ define([
if (cyoe.isCyoeAble) {
var $mpLink = $('<a class="mastery_paths_link" />')
.attr('href', './modules/items/' +
.attr('href', ENV.CONTEXT_URL_ROOT +
'/modules/items/' +
data.id +
'/edit_mastery_paths?return_to=' +
encodeURIComponent(window.location.pathname))