MDL-68030 core_course: Relocate chooser templates
authorMathew May <mathewm@hotmail.co.nz>
Thu, 12 Mar 2020 04:05:20 +0000 (12:05 +0800)
committerMathew May <mathewm@hotmail.co.nz>
Thu, 12 Mar 2020 04:05:20 +0000 (12:05 +0800)
12 files changed:
course/amd/build/activitychooser.min.js
course/amd/build/activitychooser.min.js.map
course/amd/build/local/activitychooser/dialogue.min.js
course/amd/build/local/activitychooser/dialogue.min.js.map
course/amd/src/activitychooser.js
course/amd/src/local/activitychooser/dialogue.js
course/templates/activitychooser.mustache [moved from course/templates/chooser.mustache with 95% similarity]
course/templates/local/activitychooser/favourites.mustache [moved from course/templates/chooser_favourites.mustache with 95% similarity]
course/templates/local/activitychooser/help.mustache [moved from course/templates/chooser_help.mustache with 100% similarity]
course/templates/local/activitychooser/item.mustache [moved from course/templates/chooser_item.mustache with 100% similarity]
course/templates/local/activitychooser/search.mustache [moved from course/templates/chooser_search.mustache with 100% similarity]
course/templates/local/activitychooser/search_results.mustache [moved from course/templates/chooser_search_results.mustache with 96% similarity]

index 114a575..56f6374 100644 (file)
Binary files a/course/amd/build/activitychooser.min.js and b/course/amd/build/activitychooser.min.js differ
index 8e0e90b..9201790 100644 (file)
Binary files a/course/amd/build/activitychooser.min.js.map and b/course/amd/build/activitychooser.min.js.map differ
index 1e13f0a..65c611f 100644 (file)
Binary files a/course/amd/build/local/activitychooser/dialogue.min.js and b/course/amd/build/local/activitychooser/dialogue.min.js differ
index fbcda72..8ea4836 100644 (file)
Binary files a/course/amd/build/local/activitychooser/dialogue.min.js.map and b/course/amd/build/local/activitychooser/dialogue.min.js.map differ
index c3e5566..cb58e9f 100644 (file)
@@ -159,7 +159,7 @@ const buildModal = data => {
     return ModalFactory.create({
         type: ModalFactory.types.DEFAULT,
         title: getString('addresourceoractivity'),
-        body: Templates.render('core_course/chooser', data),
+        body: Templates.render('core_course/activitychooser', data),
         large: true,
         templateContext: {
             classes: 'modchooser'
@@ -230,7 +230,8 @@ const partiallyAppliedFavouriteManager = (moduleData, sectionId) => {
 
                 const builtFaves = sectionIdMapper(newFaves, sectionId);
 
-                const {html, js} = await Templates.renderForPromise('core_course/chooser_favourites', {favourites: builtFaves});
+                const {html, js} = await Templates.renderForPromise('core_course/local/activitychooser/favourites',
+                    {favourites: builtFaves});
 
                 await Templates.replaceNodeContents(favouriteArea, html, js);
 
index acee873..9f803c3 100644 (file)
@@ -53,7 +53,7 @@ const showModuleHelp = (carousel, moduleData) => {
     });
 
     // Build up the html & js ready to place into the help section.
-    const contentPromise = Templates.renderForPromise('core_course/chooser_help', moduleData);
+    const contentPromise = Templates.renderForPromise('core_course/local/activitychooser/help', moduleData);
 
     // Wait for the content to be ready, and for the transition to be complet.
     Promise.all([contentPromise, spinnerPromise, transitionPromise])
@@ -402,7 +402,7 @@ const renderSearchResults = async(searchResultsContainer, searchResultsData) =>
         'searchresults': searchResultsData
     };
     // Build up the html & js ready to place into the help section.
-    const {html, js} = await Templates.renderForPromise('core_course/chooser_search_results', templateData);
+    const {html, js} = await Templates.renderForPromise('core_course/local/activitychooser/search_results', templateData);
     await Templates.replaceNodeContents(searchResultsContainer, html, js);
 };
 
similarity index 95%
rename from course/templates/chooser.mustache
rename to course/templates/activitychooser.mustache
index 6e3c96b..7bd4b3d 100644 (file)
@@ -38,7 +38,7 @@
         <div class="carousel-item px-4 py-3 active" data-region="modules">
             <div class="modchoosercontainer" aria-label="{{#str}} activitymodules, core {{/str}}">
                 <div class="searchcontainer mb-3">
-                    {{>core_course/chooser_search}}
+                    {{>core_course/local/activitychooser/search}}
                 </div>
                 <div data-region="chooser-container">
                     <ul class="nav nav-tabs mb-3" id="activities-{{uniqid}}" role="tablist">
                     <div class="tab-content" id="tabbed-activities-{{uniqid}}">
                         <div class="tab-pane {{#favouritesFirst}}active{{/favouritesFirst}}" id="starred-{{uniqid}}" data-region="favourites" role="tabpanel" aria-labelledby="starred-tab-{{uniqid}}">
                             <div class="optionscontainer d-flex flex-wrap p-1 mw-100 position-relative" role="menubar" data-region="chooser-options-container" data-render="favourites-area">
-                                {{>core_course/chooser_favourites}}
+                                {{>core_course/local/activitychooser/favourites}}
                             </div>
                         </div>
                         <div class="tab-pane {{#recommendedFirst}}active{{/recommendedFirst}}" id="recommended-{{uniqid}}" data-region="recommended" role="tabpanel" aria-labelledby="recommended-tab-{{uniqid}}">
                             <div class="optionscontainer d-flex flex-wrap p-1 mw-100 position-relative" role="menubar" data-region="chooser-options-container">
                                 {{#recommended}}
-                                    {{>core_course/chooser_item}}
+                                    {{>core_course/local/activitychooser/item}}
                                 {{/recommended}}
                             </div>
                         </div>
                         <div class="tab-pane {{#fallback}}active{{/fallback}}" id="all-{{uniqid}}" data-region="default" role="tabpanel" aria-labelledby="all-tab-{{uniqid}}">
                             <div class="optionscontainer d-flex flex-wrap p-1 mw-100 position-relative" role="menubar" data-region="chooser-options-container">
                                 {{#default}}
-                                    {{>core_course/chooser_item}}
+                                    {{>core_course/local/activitychooser/item}}
                                 {{/default}}
                             </div>
                         </div>
@@ -32,5 +32,5 @@
     }
 }}
 {{#favourites}}
-    {{>core_course/chooser_item}}
+    {{>core_course/local/activitychooser/item}}
 {{/favourites}}
@@ -35,6 +35,6 @@
 <p class="mt-4 px-3 pb-1">{{#str}} resultsfound, core, {{searchresultsnumber}} {{/str}}</p>
 <div class="searchresultitemscontainer d-flex flex-wrap mw-100 position-relative p-1 mt-4" role="menubar" data-region="search-result-items-container">
     {{#searchresults}}
-        {{>core_course/chooser_item}}
+        {{>core_course/local/activitychooser/item}}
     {{/searchresults}}
 </div>