mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 17:36:38 +02:00
MDL-84208 course: update default completion form template
This commit is contained in:
parent
cfa13aa912
commit
61ec2a5c68
3 changed files with 22 additions and 34 deletions
|
@ -62,6 +62,7 @@ class core_course_bulk_activity_completion_renderer extends plugin_renderer_base
|
||||||
if ($module->canmanage) {
|
if ($module->canmanage) {
|
||||||
// Only create the form if it's different from the one that has been sent.
|
// Only create the form if it's different from the one that has been sent.
|
||||||
$modform = $form;
|
$modform = $form;
|
||||||
|
$module->open = true;
|
||||||
if (empty($form) || !in_array($module->id, array_keys($modules))) {
|
if (empty($form) || !in_array($module->id, array_keys($modules))) {
|
||||||
$modform = new \core_completion_defaultedit_form(
|
$modform = new \core_completion_defaultedit_form(
|
||||||
null,
|
null,
|
||||||
|
@ -74,7 +75,7 @@ class core_course_bulk_activity_completion_renderer extends plugin_renderer_base
|
||||||
'forceuniqueid' => true,
|
'forceuniqueid' => true,
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
$module->modulecollapsed = true;
|
$module->open = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$moduleform = manager::get_module_form($module->name, $course);
|
$moduleform = manager::get_module_form($module->name, $course);
|
||||||
|
|
|
@ -70,6 +70,7 @@ class completion_action_bar implements templatable, renderable {
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'navigation' => $selectmenu->export_for_template($output),
|
'navigation' => $selectmenu->export_for_template($output),
|
||||||
|
'headinglevel' => 2,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,46 +42,32 @@
|
||||||
{{#issite}}{{#str}}defaultactivitycompletionsite, core_completion{{/str}}{{/issite}}
|
{{#issite}}{{#str}}defaultactivitycompletionsite, core_completion{{/str}}{{/issite}}
|
||||||
{{^issite}}{{#str}}defaultactivitycompletioncourse, core_completion{{/str}}{{/issite}}
|
{{^issite}}{{#str}}defaultactivitycompletioncourse, core_completion{{/str}}{{/issite}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="modules pt-3">
|
<div class="modules pt-3">
|
||||||
{{#modules}}
|
{{#modules}}
|
||||||
{{#canmanage}}
|
{{#canmanage}}
|
||||||
<div class="defaultactivitycompletion-item d-flex"
|
{{<core/local/collapsable_section}}
|
||||||
id="activitycompletion-{{id}}"
|
{{$titlecontent}}
|
||||||
>
|
<img class="activityicon ms-2" src="{{icon}}" alt="" aria-hidden="true">
|
||||||
<a data-toggle="collapse"
|
<span class="activityname ms-3 mb-0">{{{formattedname}}}</span>
|
||||||
href="#activitycompletioncollapse-{{id}}"
|
{{/titlecontent}}
|
||||||
class="icons-collapse-expand {{#modulecollapsed}}collapsed{{/modulecollapsed}}"
|
{{$elementid}}activitycompletioncollapse-{{id}}{{/elementid}}
|
||||||
aria-expanded="{{^modulecollapsed}}true{{/modulecollapsed}}{{#modulecollapsed}}false{{/modulecollapsed}}"
|
{{$extraclasses}}defaultactivitycompletion-item{{/extraclasses}}
|
||||||
role="button"
|
{{$expandlabel}}
|
||||||
>
|
{{#str}} expandcategory, core, {{formattedname}} {{/str}}
|
||||||
<span class="collapsed-icon icon-no-margin me-1"
|
{{/expandlabel}}
|
||||||
title="{{#str}} expandcategory, core, {{formattedname}} {{/str}}">
|
{{$collapselabel}}
|
||||||
<span class="dir-rtl-hide">{{#pix}} t/collapsedchevron, core {{/pix}}</span>
|
{{#str}} collapsecategory, core, {{formattedname}} {{/str}}
|
||||||
<span class="dir-ltr-hide">{{#pix}} t/collapsedchevron_rtl, core {{/pix}}</span>
|
{{/collapselabel}}
|
||||||
<span class="visually-hidden">{{#str}} expandcategory, core, {{formattedname}} {{/str}}</span>
|
{{$extras}}
|
||||||
</span>
|
|
||||||
<span class="expanded-icon icon-no-margin me-1"
|
|
||||||
title="{{#str}} collapsecategory, core, {{formattedname}} {{/str}}">
|
|
||||||
{{#pix}} t/expandedchevron, core {{/pix}}
|
|
||||||
<span class="visually-hidden">{{#str}} collapsecategory, core, {{formatedname}} {{/str}}</span>
|
|
||||||
</span>
|
|
||||||
<img class="activityicon ms-4" src="{{icon}}" alt="" aria-hidden="true">
|
|
||||||
<h2 class="activityname ms-3 mb-0">{{{formattedname}}}</h2>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<div id="activitycompletioncollapse-{{id}}"
|
|
||||||
class="defaultactivitycompletion-item-content collapse multi-collapse {{^modulecollapsed}}show{{/modulecollapsed}}"
|
|
||||||
aria-labelledby="activitycompletion-{{id}}" role="group"
|
|
||||||
data-region="activitycompletion-{{name}}"
|
data-region="activitycompletion-{{name}}"
|
||||||
>
|
{{/extras}}
|
||||||
|
{{$sectioncontent}}
|
||||||
<hr class="row">
|
<hr class="row">
|
||||||
<div class="py-3">{{{formhtml}}}</div>
|
<div class="py-3">{{{formhtml}}}</div>
|
||||||
</div>
|
{{/sectioncontent}}
|
||||||
|
{{/core/local/collapsable_section}}
|
||||||
<hr class="row">
|
<hr class="row">
|
||||||
{{/canmanage}}
|
{{/canmanage}}
|
||||||
{{/modules}}
|
{{/modules}}
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue