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:
parent
96d0ab4ea1
commit
3e88f8109d
|
@ -67,6 +67,7 @@ class ContextModulesController < ApplicationController
|
||||||
|
|
||||||
module_file_details = load_module_file_details if @context.grants_right?(@current_user, session, :manage_content)
|
module_file_details = load_module_file_details if @context.grants_right?(@current_user, session, :manage_content)
|
||||||
js_env :course_id => @context.id,
|
js_env :course_id => @context.id,
|
||||||
|
:CONTEXT_URL_ROOT => polymorphic_path([@context]),
|
||||||
:FILES_CONTEXTS => [{asset_string: @context.asset_string}],
|
:FILES_CONTEXTS => [{asset_string: @context.asset_string}],
|
||||||
:MODULE_FILE_DETAILS => module_file_details,
|
:MODULE_FILE_DETAILS => module_file_details,
|
||||||
:MODULE_FILE_PERMISSIONS => {
|
:MODULE_FILE_PERMISSIONS => {
|
||||||
|
|
|
@ -66,7 +66,7 @@
|
||||||
{{#if canManage}}
|
{{#if canManage}}
|
||||||
<div class="ig-admin">
|
<div class="ig-admin">
|
||||||
{{#if cyoe.isTrigger}}
|
{{#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}}
|
||||||
{{#if cyoe.isReleased}}
|
{{#if cyoe.isReleased}}
|
||||||
<span class="pill mastery-path-icon" data-tooltip title="{{#t}}Released by Mastery Path{{/t}}">
|
<span class="pill mastery-path-icon" data-tooltip title="{{#t}}Released by Mastery Path{{/t}}">
|
||||||
|
@ -121,7 +121,7 @@
|
||||||
{{#if cyoe.isCyoeAble}}
|
{{#if cyoe.isCyoeAble}}
|
||||||
<li>
|
<li>
|
||||||
<a
|
<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"
|
class="edit_mastery_paths icon-mastery-path"
|
||||||
id="assignment_{{id}}_settings_edit_item_mastery_paths"
|
id="assignment_{{id}}_settings_edit_item_mastery_paths"
|
||||||
aria-label="{{#t}}Edit Assignment {{name}} Mastery Paths{{/t}}"
|
aria-label="{{#t}}Edit Assignment {{name}} Mastery Paths{{/t}}"
|
||||||
|
|
|
@ -528,7 +528,8 @@ define([
|
||||||
|
|
||||||
if (cyoe.isCyoeAble) {
|
if (cyoe.isCyoeAble) {
|
||||||
var $mpLink = $('<a class="mastery_paths_link" />')
|
var $mpLink = $('<a class="mastery_paths_link" />')
|
||||||
.attr('href', './modules/items/' +
|
.attr('href', ENV.CONTEXT_URL_ROOT +
|
||||||
|
'/modules/items/' +
|
||||||
data.id +
|
data.id +
|
||||||
'/edit_mastery_paths?return_to=' +
|
'/edit_mastery_paths?return_to=' +
|
||||||
encodeURIComponent(window.location.pathname))
|
encodeURIComponent(window.location.pathname))
|
||||||
|
|
Loading…
Reference in New Issue