mirror of
https://github.com/moodle/moodle.git
synced 2025-04-20 07:56:06 +02:00
Merge branch 'MDL-82407-main' of https://github.com/laurentdavid/moodle
This commit is contained in:
commit
d0f79969d1
@ -8,6 +8,6 @@ define("core_courseformat/local/courseeditor/exporter",["exports"],(function(_ex
|
||||
* @copyright 2021 Ferran Recio <ferran@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class{constructor(reactive){this.reactive=reactive,this.COMPLETIONS=["incomplete","complete","complete","fail"]}course(state){var _state$course$highlig;const data={sections:[],editmode:this.reactive.isEditing,highlighted:null!==(_state$course$highlig=state.course.highlighted)&&void 0!==_state$course$highlig?_state$course$highlig:""};return this.listedSectionIds(state).forEach((sectionid=>{var _state$section$get;const sectioninfo=null!==(_state$section$get=state.section.get(sectionid))&&void 0!==_state$section$get?_state$section$get:{},section=this.section(state,sectioninfo);data.sections.push(section)})),data.hassections=0!=data.sections.length,data}listedSectionIds(state){var _state$course$section;return(null!==(_state$course$section=state.course.sectionlist)&&void 0!==_state$course$section?_state$course$section:[]).filter((sectionid=>{var _state$section$get2;return null===(null!==(_state$section$get2=state.section.get(sectionid))&&void 0!==_state$section$get2?_state$section$get2:{}).component}))}section(state,sectioninfo){var _state$course$highlig2,_sectioninfo$cmlist;const section={...sectioninfo,highlighted:null!==(_state$course$highlig2=state.course.highlighted)&&void 0!==_state$course$highlig2?_state$course$highlig2:"",cms:[]};return(null!==(_sectioninfo$cmlist=sectioninfo.cmlist)&&void 0!==_sectioninfo$cmlist?_sectioninfo$cmlist:[]).forEach((cmid=>{const cminfo=state.cm.get(cmid),cm=this.cm(state,cminfo);section.cms.push(cm)})),section.hascms=0!=section.cms.length,section}cm(state,cminfo){const cm={...cminfo,isactive:!1,sectioninfo:!1};if(cminfo.hasdelegatedsection){const sectioninfo=state.section.get(cminfo.delegatesectionid);cm.sectioninfo=this.section(state,sectioninfo)}return cm}cmDraggableData(state,cmid){const cminfo=state.cm.get(cmid);if(!cminfo)return null;let nextcmid;const section=state.section.get(cminfo.sectionid),currentindex=null==section?void 0:section.cmlist.indexOf(cminfo.id);return void 0!==currentindex&&(nextcmid=null==section?void 0:section.cmlist[currentindex+1]),{type:"cm",id:cminfo.id,name:cminfo.name,sectionid:cminfo.sectionid,hasdelegatedsection:cminfo.hasdelegatedsection,nextcmid:nextcmid}}sectionDraggableData(state,sectionid){const sectioninfo=state.section.get(sectionid);return sectioninfo?{type:"section",id:sectioninfo.id,name:sectioninfo.name,number:sectioninfo.number}:null}fileDraggableData(state,dataTransfer){var _dataTransfer$files;const files=[];return(null===(_dataTransfer$files=dataTransfer.files)||void 0===_dataTransfer$files?void 0:_dataTransfer$files.length)>0&&dataTransfer.files.forEach((file=>{files.push(file)})),{type:"files",files:files}}cmCompletion(state,cminfo){const data={statename:"",state:"NaN"};if(void 0!==cminfo.completionstate){var _this$COMPLETIONS$cmi;data.state=cminfo.completionstate,data.hasstate=!0;let statename=null!==(_this$COMPLETIONS$cmi=this.COMPLETIONS[cminfo.completionstate])&&void 0!==_this$COMPLETIONS$cmi?_this$COMPLETIONS$cmi:"NaN";void 0!==cminfo.isoverallcomplete&&!0===cminfo.isoverallcomplete&&(statename="complete"),data["is".concat(statename)]=!0}return data}allItemsArray(state){var _state$course$section2;const items=[];return(null!==(_state$course$section2=state.course.sectionlist)&&void 0!==_state$course$section2?_state$course$section2:[]).forEach((sectionid=>{var _sectioninfo$cmlist2;const sectioninfo=state.section.get(sectionid);items.push({type:"section",id:sectioninfo.id,url:sectioninfo.sectionurl});(null!==(_sectioninfo$cmlist2=sectioninfo.cmlist)&&void 0!==_sectioninfo$cmlist2?_sectioninfo$cmlist2:[]).forEach((cmid=>{const cminfo=state.cm.get(cmid);items.push({type:"cm",id:cminfo.id,url:cminfo.url})}))})),items}canUseStealth(state,cmIds){return cmIds.some((cmId=>{var _cminfo$allowstealth;const cminfo=state.cm.get(cmId);return null!==(_cminfo$allowstealth=null==cminfo?void 0:cminfo.allowstealth)&&void 0!==_cminfo$allowstealth&&_cminfo$allowstealth}))}},_exports.default}));
|
||||
class{constructor(reactive){this.reactive=reactive,this.COMPLETIONS=["incomplete","complete","complete","fail"]}course(state){var _state$course$highlig;const data={sections:[],editmode:this.reactive.isEditing,highlighted:null!==(_state$course$highlig=state.course.highlighted)&&void 0!==_state$course$highlig?_state$course$highlig:""};return this.listedSectionIds(state).forEach((sectionid=>{var _state$section$get;const sectioninfo=null!==(_state$section$get=state.section.get(sectionid))&&void 0!==_state$section$get?_state$section$get:{},section=this.section(state,sectioninfo);data.sections.push(section)})),data.hassections=0!=data.sections.length,data}listedSectionIds(state){var _state$course$section;return(null!==(_state$course$section=state.course.sectionlist)&&void 0!==_state$course$section?_state$course$section:[]).filter((sectionid=>{var _state$section$get2;return null===(null!==(_state$section$get2=state.section.get(sectionid))&&void 0!==_state$section$get2?_state$section$get2:{}).component}))}section(state,sectioninfo){var _state$course$highlig2,_sectioninfo$cmlist;const section={...sectioninfo,highlighted:null!==(_state$course$highlig2=state.course.highlighted)&&void 0!==_state$course$highlig2?_state$course$highlig2:"",cms:[]};return(null!==(_sectioninfo$cmlist=sectioninfo.cmlist)&&void 0!==_sectioninfo$cmlist?_sectioninfo$cmlist:[]).forEach((cmid=>{const cminfo=state.cm.get(cmid),cm=this.cm(state,cminfo);section.cms.push(cm)})),section.hascms=0!=section.cms.length,section}cm(state,cminfo){const cm={...cminfo,isactive:!1,sectioninfo:!1};if(cminfo.hasdelegatedsection){const sectioninfo=state.section.get(cminfo.delegatesectionid);cm.sectioninfo=this.section(state,sectioninfo)}return cm}cmDraggableData(state,cmid){const cminfo=state.cm.get(cmid);if(!cminfo)return null;let nextcmid;const section=state.section.get(cminfo.sectionid),currentindex=null==section?void 0:section.cmlist.indexOf(cminfo.id);return void 0!==currentindex&&(nextcmid=null==section?void 0:section.cmlist[currentindex+1]),{type:"cm",id:cminfo.id,name:cminfo.name,sectionid:cminfo.sectionid,hasdelegatedsection:cminfo.hasdelegatedsection,nextcmid:nextcmid}}sectionDraggableData(state,sectionid){const sectioninfo=state.section.get(sectionid);return sectioninfo?{type:"section",id:sectioninfo.id,name:sectioninfo.name,number:sectioninfo.number}:null}fileDraggableData(state,dataTransfer){var _dataTransfer$files;const files=[];return(null===(_dataTransfer$files=dataTransfer.files)||void 0===_dataTransfer$files?void 0:_dataTransfer$files.length)>0&&dataTransfer.files.forEach((file=>{files.push(file)})),{type:"files",files:files}}cmCompletion(state,cminfo){const data={statename:"",state:"NaN"};if(void 0!==cminfo.completionstate){var _this$COMPLETIONS$cmi;data.state=cminfo.completionstate,data.hasstate=!0;let statename=null!==(_this$COMPLETIONS$cmi=this.COMPLETIONS[cminfo.completionstate])&&void 0!==_this$COMPLETIONS$cmi?_this$COMPLETIONS$cmi:"NaN";void 0!==cminfo.isoverallcomplete&&!0===cminfo.isoverallcomplete&&(statename="complete"),data["is".concat(statename)]=!0}return data}allItemsArray(state){var _state$course$section2;const items=[];return(null!==(_state$course$section2=state.course.sectionlist)&&void 0!==_state$course$section2?_state$course$section2:[]).forEach((sectionid=>{var _sectioninfo$cmlist2;const sectioninfo=state.section.get(sectionid);if(null!==sectioninfo.component)return;items.push({type:"section",id:sectioninfo.id,url:sectioninfo.sectionurl});(null!==(_sectioninfo$cmlist2=sectioninfo.cmlist)&&void 0!==_sectioninfo$cmlist2?_sectioninfo$cmlist2:[]).forEach((cmid=>{const cmInfo=state.cm.get(cmid);items.push(...this.cmItemsArray(state,cmInfo))}))})),items}cmItemsArray(state,cmInfo){if(cmInfo.hasdelegatedsection){var _delegatedsection$cml;const items=[],delegatedsection=state.section.get(cmInfo.delegatesectionid);items.push({type:"section",id:delegatedsection.id,url:delegatedsection.sectionurl});return(null!==(_delegatedsection$cml=delegatedsection.cmlist)&&void 0!==_delegatedsection$cml?_delegatedsection$cml:[]).forEach((cmid=>{const cmInfo=state.cm.get(cmid);items.push({type:"cm",id:cmInfo.id,url:cmInfo.url})})),items}return[{type:"cm",id:cmInfo.id,url:cmInfo.url}]}canUseStealth(state,cmIds){return cmIds.some((cmId=>{var _cminfo$allowstealth;const cminfo=state.cm.get(cmId);return null!==(_cminfo$allowstealth=null==cminfo?void 0:cminfo.allowstealth)&&void 0!==_cminfo$allowstealth&&_cminfo$allowstealth}))}},_exports.default}));
|
||||
|
||||
//# sourceMappingURL=exporter.min.js.map
|
File diff suppressed because one or more lines are too long
@ -13,6 +13,16 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* A configuration to provide to the modal.
|
||||
*
|
||||
* @typedef {Object} courseItem
|
||||
*
|
||||
* @property {String} type The type of element (section, cm).
|
||||
* @property {Number} id Element ID.
|
||||
* @property {String} url Element URL.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Module to export parts of the state and transform them to be used in templates
|
||||
* and as draggable data.
|
||||
@ -228,7 +238,7 @@ export default class {
|
||||
* Return a sorted list of all sections and cms items in the state.
|
||||
*
|
||||
* @param {Object} state the current state.
|
||||
* @returns {Array} all sections and cms items in the state.
|
||||
* @returns {courseItem[]} all sections and cms items in the state.
|
||||
*/
|
||||
allItemsArray(state) {
|
||||
const items = [];
|
||||
@ -236,17 +246,61 @@ export default class {
|
||||
// Add sections.
|
||||
sectionlist.forEach(sectionid => {
|
||||
const sectioninfo = state.section.get(sectionid);
|
||||
items.push({type: 'section', id: sectioninfo.id, url: sectioninfo.sectionurl});
|
||||
// Skip delegated sections because components are responsible for them.
|
||||
if (sectioninfo.component !== null) {
|
||||
return;
|
||||
}
|
||||
|
||||
items.push({
|
||||
type: 'section',
|
||||
id: sectioninfo.id,
|
||||
url: sectioninfo.sectionurl
|
||||
});
|
||||
// Add cms.
|
||||
const cmlist = sectioninfo.cmlist ?? [];
|
||||
cmlist.forEach(cmid => {
|
||||
const cminfo = state.cm.get(cmid);
|
||||
items.push({type: 'cm', id: cminfo.id, url: cminfo.url});
|
||||
const cmInfo = state.cm.get(cmid);
|
||||
items.push(...this.cmItemsArray(state, cmInfo));
|
||||
});
|
||||
});
|
||||
return items;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a list of all items associated with an activity.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} state the full current state.
|
||||
* @param {Object} cmInfo the course module state data.
|
||||
* @return {courseItem[]} the items array associated with that cm.
|
||||
*/
|
||||
cmItemsArray(state, cmInfo) {
|
||||
// Activities with delegated sections are exported as sections.
|
||||
if (cmInfo.hasdelegatedsection) {
|
||||
const items = [];
|
||||
const delegatedsection = state.section.get(cmInfo.delegatesectionid);
|
||||
items.push({
|
||||
type: 'section',
|
||||
id: delegatedsection.id,
|
||||
url: delegatedsection.sectionurl
|
||||
});
|
||||
const delegatedCmlist = delegatedsection.cmlist ?? [];
|
||||
delegatedCmlist.forEach(cmid => {
|
||||
const cmInfo = state.cm.get(cmid);
|
||||
items.push({
|
||||
type: 'cm',
|
||||
id: cmInfo.id,
|
||||
url: cmInfo.url
|
||||
});
|
||||
});
|
||||
return items;
|
||||
}
|
||||
|
||||
return [
|
||||
{type: 'cm', id: cmInfo.id, url: cmInfo.url},
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Check is some activities of a list can be stealth.
|
||||
*
|
||||
|
@ -1303,7 +1303,6 @@ $divider-hover-color: $primary !default;
|
||||
|
||||
.activity {
|
||||
list-style: none;
|
||||
position: relative;
|
||||
padding-top: map-get($spacers, 1);
|
||||
margin-top: map-get($spacers, 1);
|
||||
border-top: $border-width solid $border-color;
|
||||
@ -1318,7 +1317,6 @@ $divider-hover-color: $primary !default;
|
||||
}
|
||||
|
||||
.activity-item {
|
||||
position: relative;
|
||||
padding: $activity-item-padding;
|
||||
@include border-radius($activity-border-radius);
|
||||
&.activityinline {
|
||||
@ -1695,8 +1693,8 @@ $divider-hover-color: $primary !default;
|
||||
}
|
||||
.activity-item {
|
||||
.bulkselect {
|
||||
position: absolute;
|
||||
left: -2rem;
|
||||
float: left;
|
||||
margin-left: -2rem;
|
||||
}
|
||||
// Delegated sections are not available for bulk editing.
|
||||
&:has(.delegated-section):hover {
|
||||
|
@ -33,6 +33,18 @@ $courseindex-item-current: $primary !default;
|
||||
&.draggable {
|
||||
cursor: move;
|
||||
}
|
||||
&.pageitem,
|
||||
.pageitem {
|
||||
background-color: darken($courseindex-item-page-bg, 7.5%);
|
||||
color: darken($courseindex-link-color-selected, 10%);
|
||||
.courseindex-link,
|
||||
.courseindex-chevron {
|
||||
color: darken($courseindex-link-color-selected, 10%);
|
||||
a {
|
||||
color: darken($courseindex-link-color-selected, 10%);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -114,15 +126,6 @@ $courseindex-item-current: $primary !default;
|
||||
a {
|
||||
color: $courseindex-link-color-selected;
|
||||
}
|
||||
&:hover,
|
||||
&:focus {
|
||||
background-color: darken($courseindex-item-page-bg, 7.5%);
|
||||
color: darken($courseindex-link-color-selected, 10%);
|
||||
.courseindex-link,
|
||||
.courseindex-chevron {
|
||||
color: darken($courseindex-link-color-selected, 10%);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Completion.
|
||||
|
@ -29198,7 +29198,6 @@ span.editinstructions .alert-link {
|
||||
/* Activity cards */
|
||||
.activity {
|
||||
list-style: none;
|
||||
position: relative;
|
||||
padding-top: 0.25rem;
|
||||
margin-top: 0.25rem;
|
||||
border-top: 1px solid #dee2e6;
|
||||
@ -29210,7 +29209,6 @@ span.editinstructions .alert-link {
|
||||
}
|
||||
|
||||
.activity-item {
|
||||
position: relative;
|
||||
padding: 0.75rem;
|
||||
border-radius: 1rem;
|
||||
}
|
||||
@ -29937,8 +29935,8 @@ span.editinstructions .alert-link {
|
||||
margin-top: 1.5rem;
|
||||
}
|
||||
.bulkenabled .activity-item .bulkselect {
|
||||
position: absolute;
|
||||
left: -2rem;
|
||||
float: left;
|
||||
margin-left: -2rem;
|
||||
}
|
||||
.bulkenabled .activity-item:has(.delegated-section):hover {
|
||||
outline: none !important;
|
||||
@ -38661,6 +38659,30 @@ div.editor_atto_toolbar button .icon {
|
||||
.courseindex .courseindex-item:hover.draggable, .courseindex .courseindex-item:focus.draggable {
|
||||
cursor: move;
|
||||
}
|
||||
.courseindex .courseindex-item:hover.pageitem,
|
||||
.courseindex .courseindex-item:hover .pageitem, .courseindex .courseindex-item:focus.pageitem,
|
||||
.courseindex .courseindex-item:focus .pageitem {
|
||||
background-color: #0c589c;
|
||||
color: #e6e6e6;
|
||||
}
|
||||
.courseindex .courseindex-item:hover.pageitem .courseindex-link,
|
||||
.courseindex .courseindex-item:hover.pageitem .courseindex-chevron,
|
||||
.courseindex .courseindex-item:hover .pageitem .courseindex-link,
|
||||
.courseindex .courseindex-item:hover .pageitem .courseindex-chevron, .courseindex .courseindex-item:focus.pageitem .courseindex-link,
|
||||
.courseindex .courseindex-item:focus.pageitem .courseindex-chevron,
|
||||
.courseindex .courseindex-item:focus .pageitem .courseindex-link,
|
||||
.courseindex .courseindex-item:focus .pageitem .courseindex-chevron {
|
||||
color: #e6e6e6;
|
||||
}
|
||||
.courseindex .courseindex-item:hover.pageitem .courseindex-link a,
|
||||
.courseindex .courseindex-item:hover.pageitem .courseindex-chevron a,
|
||||
.courseindex .courseindex-item:hover .pageitem .courseindex-link a,
|
||||
.courseindex .courseindex-item:hover .pageitem .courseindex-chevron a, .courseindex .courseindex-item:focus.pageitem .courseindex-link a,
|
||||
.courseindex .courseindex-item:focus.pageitem .courseindex-chevron a,
|
||||
.courseindex .courseindex-item:focus .pageitem .courseindex-link a,
|
||||
.courseindex .courseindex-item:focus .pageitem .courseindex-chevron a {
|
||||
color: #e6e6e6;
|
||||
}
|
||||
.courseindex .courseindex-item.dragging {
|
||||
border: 1px solid #b3d9e0;
|
||||
background-color: #e6f2f5;
|
||||
@ -38696,15 +38718,6 @@ div.editor_atto_toolbar button .icon {
|
||||
.courseindex .courseindex-item.pageitem a {
|
||||
color: #fff;
|
||||
}
|
||||
.courseindex .courseindex-item.pageitem:hover, .courseindex .courseindex-item.pageitem:focus {
|
||||
background-color: #0c589c;
|
||||
color: #e6e6e6;
|
||||
}
|
||||
.courseindex .courseindex-item.pageitem:hover .courseindex-link,
|
||||
.courseindex .courseindex-item.pageitem:hover .courseindex-chevron, .courseindex .courseindex-item.pageitem:focus .courseindex-link,
|
||||
.courseindex .courseindex-item.pageitem:focus .courseindex-chevron {
|
||||
color: #e6e6e6;
|
||||
}
|
||||
.courseindex .courseindex-item .completioninfo {
|
||||
min-width: 24px;
|
||||
}
|
||||
|
@ -29198,7 +29198,6 @@ span.editinstructions .alert-link {
|
||||
/* Activity cards */
|
||||
.activity {
|
||||
list-style: none;
|
||||
position: relative;
|
||||
padding-top: 0.25rem;
|
||||
margin-top: 0.25rem;
|
||||
border-top: 1px solid #dee2e6;
|
||||
@ -29210,7 +29209,6 @@ span.editinstructions .alert-link {
|
||||
}
|
||||
|
||||
.activity-item {
|
||||
position: relative;
|
||||
padding: 0.75rem;
|
||||
border-radius: 1rem;
|
||||
}
|
||||
@ -29937,8 +29935,8 @@ span.editinstructions .alert-link {
|
||||
margin-top: 1.5rem;
|
||||
}
|
||||
.bulkenabled .activity-item .bulkselect {
|
||||
position: absolute;
|
||||
left: -2rem;
|
||||
float: left;
|
||||
margin-left: -2rem;
|
||||
}
|
||||
.bulkenabled .activity-item:has(.delegated-section):hover {
|
||||
outline: none !important;
|
||||
@ -38595,6 +38593,30 @@ div.editor_atto_toolbar button .icon {
|
||||
.courseindex .courseindex-item:hover.draggable, .courseindex .courseindex-item:focus.draggable {
|
||||
cursor: move;
|
||||
}
|
||||
.courseindex .courseindex-item:hover.pageitem,
|
||||
.courseindex .courseindex-item:hover .pageitem, .courseindex .courseindex-item:focus.pageitem,
|
||||
.courseindex .courseindex-item:focus .pageitem {
|
||||
background-color: #0c589c;
|
||||
color: #e6e6e6;
|
||||
}
|
||||
.courseindex .courseindex-item:hover.pageitem .courseindex-link,
|
||||
.courseindex .courseindex-item:hover.pageitem .courseindex-chevron,
|
||||
.courseindex .courseindex-item:hover .pageitem .courseindex-link,
|
||||
.courseindex .courseindex-item:hover .pageitem .courseindex-chevron, .courseindex .courseindex-item:focus.pageitem .courseindex-link,
|
||||
.courseindex .courseindex-item:focus.pageitem .courseindex-chevron,
|
||||
.courseindex .courseindex-item:focus .pageitem .courseindex-link,
|
||||
.courseindex .courseindex-item:focus .pageitem .courseindex-chevron {
|
||||
color: #e6e6e6;
|
||||
}
|
||||
.courseindex .courseindex-item:hover.pageitem .courseindex-link a,
|
||||
.courseindex .courseindex-item:hover.pageitem .courseindex-chevron a,
|
||||
.courseindex .courseindex-item:hover .pageitem .courseindex-link a,
|
||||
.courseindex .courseindex-item:hover .pageitem .courseindex-chevron a, .courseindex .courseindex-item:focus.pageitem .courseindex-link a,
|
||||
.courseindex .courseindex-item:focus.pageitem .courseindex-chevron a,
|
||||
.courseindex .courseindex-item:focus .pageitem .courseindex-link a,
|
||||
.courseindex .courseindex-item:focus .pageitem .courseindex-chevron a {
|
||||
color: #e6e6e6;
|
||||
}
|
||||
.courseindex .courseindex-item.dragging {
|
||||
border: 1px solid #b3d9e0;
|
||||
background-color: #e6f2f5;
|
||||
@ -38630,15 +38652,6 @@ div.editor_atto_toolbar button .icon {
|
||||
.courseindex .courseindex-item.pageitem a {
|
||||
color: #fff;
|
||||
}
|
||||
.courseindex .courseindex-item.pageitem:hover, .courseindex .courseindex-item.pageitem:focus {
|
||||
background-color: #0c589c;
|
||||
color: #e6e6e6;
|
||||
}
|
||||
.courseindex .courseindex-item.pageitem:hover .courseindex-link,
|
||||
.courseindex .courseindex-item.pageitem:hover .courseindex-chevron, .courseindex .courseindex-item.pageitem:focus .courseindex-link,
|
||||
.courseindex .courseindex-item.pageitem:focus .courseindex-chevron {
|
||||
color: #e6e6e6;
|
||||
}
|
||||
.courseindex .courseindex-item .completioninfo {
|
||||
min-width: 24px;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user