mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 20:42:22 +02:00
Merge branch 'MDL-72463-master' of git://github.com/ferranrecio/moodle
This commit is contained in:
commit
b7687bfef8
@ -1,2 +1,2 @@
|
||||
define ("core_courseformat/local/courseeditor/exporter",["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;function b(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);if(b)d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable});c.push.apply(c,d)}return c}function c(a){for(var c=1,e;c<arguments.length;c++){e=null!=arguments[c]?arguments[c]:{};if(c%2){b(Object(e),!0).forEach(function(b){d(a,b,e[b])})}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(a,Object.getOwnPropertyDescriptors(e))}else{b(Object(e)).forEach(function(b){Object.defineProperty(a,b,Object.getOwnPropertyDescriptor(e,b))})}}return a}function d(a,b,c){if(b in a){Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0})}else{a[b]=c}return a}function e(a,b){if(!(a instanceof b)){throw new TypeError("Cannot call a class as a function")}}function f(a,b){for(var c=0,d;c<b.length;c++){d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;if("value"in d)d.writable=!0;Object.defineProperty(a,d.key,d)}}function g(a,b,c){if(b)f(a.prototype,b);if(c)f(a,c);return a}var h=function(){function a(b){e(this,a);this.reactive=b}g(a,[{key:"course",value:function course(a){var b,c=this,d={sections:[],editmode:this.reactive.isEditing},e=null!==(b=a.course.sectionlist)&&void 0!==b?b:[];e.forEach(function(b){var e,f=null!==(e=a.section.get(b))&&void 0!==e?e:{},g=c.section(a,f);d.sections.push(g)});d.hassections=0!=d.sections.length;return d}},{key:"section",value:function(a,b){var d,e=this,f=c({},b,{cms:[],isactive:!0}),g=null!==(d=b.cmlist)&&void 0!==d?d:[];g.forEach(function(b){var c=a.cm.get(b),d=e.cm(a,c);f.cms.push(d)});f.hascms=0!=f.cms.length;return f}},{key:"cm",value:function(a,b){var d=c({},b,{isactive:!1});return d}},{key:"cmDraggableData",value:function cmDraggableData(a,b){var c=a.cm.get(b);if(!c){return null}var d,e=a.section.get(c.sectionid),f=null===e||void 0===e?void 0:e.cmlist.indexOf(c.id);if(f!==void 0){d=null===e||void 0===e?void 0:e.cmlist[f+1]}return{type:"cm",id:c.id,name:c.name,nextcmid:d}}},{key:"sectionDraggableData",value:function sectionDraggableData(a,b){var c=a.section.get(b);if(!c){return null}return{type:"section",id:c.id,name:c.name,number:c.number}}}]);return a}();a.default=h;return a.default});
|
||||
define ("core_courseformat/local/courseeditor/exporter",["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;function b(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);if(b)d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable});c.push.apply(c,d)}return c}function c(a){for(var c=1,e;c<arguments.length;c++){e=null!=arguments[c]?arguments[c]:{};if(c%2){b(Object(e),!0).forEach(function(b){d(a,b,e[b])})}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(a,Object.getOwnPropertyDescriptors(e))}else{b(Object(e)).forEach(function(b){Object.defineProperty(a,b,Object.getOwnPropertyDescriptor(e,b))})}}return a}function d(a,b,c){if(b in a){Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0})}else{a[b]=c}return a}function e(a,b){if(!(a instanceof b)){throw new TypeError("Cannot call a class as a function")}}function f(a,b){for(var c=0,d;c<b.length;c++){d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;if("value"in d)d.writable=!0;Object.defineProperty(a,d.key,d)}}function g(a,b,c){if(b)f(a.prototype,b);if(c)f(a,c);return a}var h=function(){function a(b){e(this,a);this.reactive=b}g(a,[{key:"course",value:function course(a){var b,c,d=this,e={sections:[],editmode:this.reactive.isEditing,highlighted:null!==(b=a.course.highlighted)&&void 0!==b?b:""},f=null!==(c=a.course.sectionlist)&&void 0!==c?c:[];f.forEach(function(b){var c,f=null!==(c=a.section.get(b))&&void 0!==c?c:{},g=d.section(a,f);e.sections.push(g)});e.hassections=0!=e.sections.length;return e}},{key:"section",value:function(a,b){var d,e=this,f=c({},b,{cms:[],isactive:!0}),g=null!==(d=b.cmlist)&&void 0!==d?d:[];g.forEach(function(b){var c=a.cm.get(b),d=e.cm(a,c);f.cms.push(d)});f.hascms=0!=f.cms.length;return f}},{key:"cm",value:function(a,b){var d=c({},b,{isactive:!1});return d}},{key:"cmDraggableData",value:function cmDraggableData(a,b){var c=a.cm.get(b);if(!c){return null}var d,e=a.section.get(c.sectionid),f=null===e||void 0===e?void 0:e.cmlist.indexOf(c.id);if(f!==void 0){d=null===e||void 0===e?void 0:e.cmlist[f+1]}return{type:"cm",id:c.id,name:c.name,nextcmid:d}}},{key:"sectionDraggableData",value:function sectionDraggableData(a,b){var c=a.section.get(b);if(!c){return null}return{type:"section",id:c.id,name:c.name,number:c.number}}}]);return a}();a.default=h;return a.default});
|
||||
//# sourceMappingURL=exporter.min.js.map
|
||||
|
File diff suppressed because one or more lines are too long
@ -44,6 +44,7 @@ export default class {
|
||||
const data = {
|
||||
sections: [],
|
||||
editmode: this.reactive.isEditing,
|
||||
highlighted: state.course.highlighted ?? '',
|
||||
};
|
||||
const sectionlist = state.course.sectionlist ?? [];
|
||||
sectionlist.forEach(sectionid => {
|
||||
|
@ -454,6 +454,15 @@ abstract class base {
|
||||
return self::get_section_name($section);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the name for the highlighted section.
|
||||
*
|
||||
* @return string The name for the highlighted section based on the given course format.
|
||||
*/
|
||||
public function get_section_highlighted_name(): string {
|
||||
return get_string('highlighted');
|
||||
}
|
||||
|
||||
/**
|
||||
* Set if the current format instance will show multiple sections or an individual one.
|
||||
*
|
||||
|
@ -57,6 +57,7 @@ class course implements renderable {
|
||||
'numsections' => $format->get_last_section_number(),
|
||||
'sectionlist' => [],
|
||||
'editmode' => $format->show_editor(),
|
||||
'highlighted' => $format->get_section_highlighted_name(),
|
||||
];
|
||||
|
||||
$sections = $modinfo->get_section_info_all();
|
||||
|
@ -89,6 +89,9 @@
|
||||
>
|
||||
{{{title}}}
|
||||
</a>
|
||||
<span class="current-badge badge badge-primary ml-2 px-2">
|
||||
{{highlighted}}
|
||||
</span>
|
||||
<span class="dragicon ml-auto">{{#pix}}i/dragdrop{{/pix}}</span>
|
||||
</div>
|
||||
<div id="courseindexcollapse{{number}}"
|
||||
|
@ -101,12 +101,16 @@ Feature: Course index depending on role
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I click on "Side panel" "button"
|
||||
And I turn section "2" highlighting on
|
||||
# Current section is only marked visually in the course index.
|
||||
And the "class" attribute of "#courseindex-content [data-for='section'][data-number='2']" "css_element" should contain "current"
|
||||
When I turn section "1" highlighting on
|
||||
And I click on "Open course index drawer" "button"
|
||||
# Current section is only marked visually in the course index.
|
||||
And the "class" attribute of "#courseindex-content [data-for='section'][data-number='2']" "css_element" should contain "current"
|
||||
And I should not see "Highlighted" in the "#courseindex-content [data-for='section'][data-number='1']" "css_element"
|
||||
And I should see "Highlighted" in the "#courseindex-content [data-for='section'][data-number='2']" "css_element"
|
||||
When I turn section "1" highlighting on
|
||||
# Current section is only marked visually in the course index.
|
||||
Then the "class" attribute of "#courseindex-content [data-for='section'][data-number='1']" "css_element" should contain "current"
|
||||
And I should see "Highlighted" in the "#courseindex-content [data-for='section'][data-number='1']" "css_element"
|
||||
And I should not see "Highlighted" in the "#courseindex-content [data-for='section'][data-number='2']" "css_element"
|
||||
|
||||
@javascript
|
||||
Scenario: Course index toggling
|
||||
|
@ -99,6 +99,10 @@ class format_weeks extends core_courseformat\base {
|
||||
}
|
||||
}
|
||||
|
||||
public function get_section_highlighted_name(): string {
|
||||
return get_string('currentsection', 'format_weeks');
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL to use for the specified course (with section)
|
||||
*
|
||||
|
@ -1004,6 +1004,7 @@ $string['hidesettings'] = 'Hide settings';
|
||||
$string['hideshowblocks'] = 'Hide or show blocks';
|
||||
$string['hidepopoverwindow'] = 'Hide popover window';
|
||||
$string['highlight'] = 'Highlight';
|
||||
$string['highlighted'] = 'Highlighted';
|
||||
$string['highlightoff'] = 'Remove highlight';
|
||||
$string['hits'] = 'Hits';
|
||||
$string['hitsoncourse'] = 'Hits on {$a->coursename} by {$a->username}';
|
||||
|
@ -57,8 +57,18 @@ $courseindex-item-current: $primary !default;
|
||||
}
|
||||
|
||||
.courseindex-section {
|
||||
|
||||
.current-badge {
|
||||
line-height: $line-height-base;
|
||||
display: none;
|
||||
}
|
||||
|
||||
&.current {
|
||||
border-left: solid 3px $courseindex-item-current;
|
||||
|
||||
.current-badge {
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
|
||||
&.dropready .courseindex-item-content {
|
||||
|
@ -20431,8 +20431,14 @@ div.editor_atto_toolbar button .icon {
|
||||
.courseindex .courseindex-sectioncontent .courseindex-item {
|
||||
padding-left: calc(1rem * 2 + 0.5rem); }
|
||||
|
||||
.courseindex .courseindex-section .current-badge {
|
||||
line-height: 1.5;
|
||||
display: none; }
|
||||
|
||||
.courseindex .courseindex-section.current {
|
||||
border-left: solid 3px #0f6fc5; }
|
||||
.courseindex .courseindex-section.current .current-badge {
|
||||
display: inline-block; }
|
||||
|
||||
.courseindex .courseindex-section.dropready .courseindex-item-content {
|
||||
/* Extra dropzone space */
|
||||
|
@ -20377,8 +20377,14 @@ div.editor_atto_toolbar button .icon {
|
||||
.courseindex .courseindex-sectioncontent .courseindex-item {
|
||||
padding-left: calc(1rem * 2 + 0.5rem); }
|
||||
|
||||
.courseindex .courseindex-section .current-badge {
|
||||
line-height: 1.5;
|
||||
display: none; }
|
||||
|
||||
.courseindex .courseindex-section.current {
|
||||
border-left: solid 3px #0f6fc5; }
|
||||
.courseindex .courseindex-section.current .current-badge {
|
||||
display: inline-block; }
|
||||
|
||||
.courseindex .courseindex-section.dropready .courseindex-item-content {
|
||||
/* Extra dropzone space */
|
||||
|
Loading…
x
Reference in New Issue
Block a user