mirror of
https://github.com/moodle/moodle.git
synced 2025-08-09 19:06:41 +02:00
Merge branch 'MDL-79987-master' of https://github.com/sarjona/moodle
This commit is contained in:
commit
105ae8942a
11 changed files with 113 additions and 73 deletions
File diff suppressed because one or more lines are too long
|
@ -70,15 +70,13 @@ class cmsummary implements named_templatable, renderable {
|
||||||
|
|
||||||
list($mods, $complete, $total, $showcompletion) = $this->calculate_section_stats();
|
list($mods, $complete, $total, $showcompletion) = $this->calculate_section_stats();
|
||||||
|
|
||||||
if (empty($mods)) {
|
$totalactivities = array_reduce($mods, fn($carry, $item) => $carry + ($item["count"] ?? 0), 0);
|
||||||
return new stdClass();
|
|
||||||
}
|
|
||||||
|
|
||||||
$data = (object)[
|
$data = (object)[
|
||||||
'showcompletion' => $showcompletion,
|
'showcompletion' => $showcompletion,
|
||||||
'total' => $total,
|
'total' => $total,
|
||||||
'complete' => $complete,
|
'complete' => $complete,
|
||||||
'mods' => array_values($mods),
|
'mods' => array_values($mods),
|
||||||
|
'totalactivities' => $totalactivities,
|
||||||
];
|
];
|
||||||
|
|
||||||
$data->modprogress = get_string('progresstotal', 'completion', $data);
|
$data->modprogress = get_string('progresstotal', 'completion', $data);
|
||||||
|
|
|
@ -32,16 +32,17 @@
|
||||||
"count": "2"
|
"count": "2"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"modprogress": "Total 5"
|
"modprogress": "Progress: 1 / 5",
|
||||||
|
"totalactivities": "5"
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
<div class="section-summary-activities pr-2 mdl-right">
|
<div class="section-summary-activities d-flex">
|
||||||
{{#mods}}
|
<div class="d-flex align-items-center">
|
||||||
<span class="activity-count">{{name}}: {{count}}</span>
|
{{#pix}}i/activities, moodle{{/pix}}{{#str}} totalactivities, course, {{totalactivities}} {{/str}}
|
||||||
{{/mods}}
|
</div>
|
||||||
</div>
|
{{#showcompletion}}
|
||||||
{{#showcompletion}}
|
<div class="d-flex ml-auto align-items-center">
|
||||||
<div class="section-summary-activities pr-2 mdl-right">
|
{{#pix}}i/stats, moodle{{/pix}}{{modprogress}}
|
||||||
<span class="activity-count">{{modprogress}}</span>
|
</div>
|
||||||
|
{{/showcompletion}}
|
||||||
</div>
|
</div>
|
||||||
{{/showcompletion}}
|
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
"hasname": "true"
|
"hasname": "true"
|
||||||
},
|
},
|
||||||
"id": 3,
|
"id": 3,
|
||||||
|
"cmid": 3,
|
||||||
"module": "forum",
|
"module": "forum",
|
||||||
"anchor": "activity-3",
|
"anchor": "activity-3",
|
||||||
"extraclasses": "newmessages"
|
"extraclasses": "newmessages"
|
||||||
|
@ -51,6 +52,7 @@
|
||||||
"hasname": "true"
|
"hasname": "true"
|
||||||
},
|
},
|
||||||
"id": 4,
|
"id": 4,
|
||||||
|
"cmid": 4,
|
||||||
"anchor": "activity-4",
|
"anchor": "activity-4",
|
||||||
"module": "assign",
|
"module": "assign",
|
||||||
"extraclasses": ""
|
"extraclasses": ""
|
||||||
|
@ -123,11 +125,30 @@
|
||||||
{{> core_courseformat/local/content/section/controlmenu }}
|
{{> core_courseformat/local/content/section/controlmenu }}
|
||||||
{{/ core_courseformat/local/content/section/controlmenu }}
|
{{/ core_courseformat/local/content/section/controlmenu }}
|
||||||
{{/controlmenu}}
|
{{/controlmenu}}
|
||||||
|
{{#header}}
|
||||||
|
{{#headerdisplaymultipage}}
|
||||||
|
{{^controlmenu}}
|
||||||
|
<div class="section_goto bulk-hidden ml-auto" data-sectionid="{{id}}">
|
||||||
|
<a href="{{{url}}}"
|
||||||
|
class="btn btn-icon d-flex align-items-center justify-content-center icon-no-margin"
|
||||||
|
title="{{#str}}gotosection, course, {{name}}{{/str}}">
|
||||||
|
<span class="dir-rtl-hide">
|
||||||
|
{{#pix}}t/right, moodle{{/pix}}
|
||||||
|
</span>
|
||||||
|
<span class="dir-ltr-hide">
|
||||||
|
{{#pix}}t/left, moodle, {{#str}}gotosection, course, {{name}}{{/str}}{{/pix}}
|
||||||
|
</span>
|
||||||
|
<span class="sr-only">
|
||||||
|
{{#str}}gotosection, course, {{name}}{{/str}}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
{{/controlmenu}}
|
||||||
|
{{/headerdisplaymultipage}}
|
||||||
|
{{/header}}
|
||||||
</div>
|
</div>
|
||||||
<div id="coursecontentcollapse{{num}}"
|
<div id="coursecontentcollapse{{num}}"
|
||||||
class="content {{^iscoursedisplaymultipage}}
|
class="content {{^iscoursedisplaymultipage}}{{^sitehome}}course-content-item-content collapse {{^contentcollapsed}}show{{/contentcollapsed}}{{/sitehome}}{{/iscoursedisplaymultipage}}">
|
||||||
{{^sitehome}}course-content-item-content collapse {{^contentcollapsed}}show{{/contentcollapsed}}{{/sitehome}}
|
|
||||||
{{/iscoursedisplaymultipage}}">
|
|
||||||
<div class="{{#hasavailability}}description{{/hasavailability}} my-3" data-for="sectioninfo">
|
<div class="{{#hasavailability}}description{{/hasavailability}} my-3" data-for="sectioninfo">
|
||||||
{{#summary}}
|
{{#summary}}
|
||||||
{{$ core_courseformat/local/content/section/summary }}
|
{{$ core_courseformat/local/content/section/summary }}
|
||||||
|
|
|
@ -13,7 +13,7 @@ Feature: Course paged mode information
|
||||||
| activity | course | name | section | completion |
|
| activity | course | name | section | completion |
|
||||||
| chat | C1 | Chat room | 1 | <completion> |
|
| chat | C1 | Chat room | 1 | <completion> |
|
||||||
| data | C1 | Database | 1 | <completion> |
|
| data | C1 | Database | 1 | <completion> |
|
||||||
| forum | C1 | First forum | 2 | <completion> |
|
| forum | C1 | First forum | 1 | <completion> |
|
||||||
| forum | C1 | Second forum | 2 | <completion> |
|
| forum | C1 | Second forum | 2 | <completion> |
|
||||||
And the following "users" exist:
|
And the following "users" exist:
|
||||||
| username | firstname | lastname | email |
|
| username | firstname | lastname | email |
|
||||||
|
@ -23,13 +23,13 @@ Feature: Course paged mode information
|
||||||
| user | course | role |
|
| user | course | role |
|
||||||
| student1 | C1 | student |
|
| student1 | C1 | student |
|
||||||
| teacher1 | C1 | editingteacher |
|
| teacher1 | C1 | editingteacher |
|
||||||
When I log in as "<user>"
|
When I am on the "Course 1" "Course" page logged in as "<user>"
|
||||||
And I am on "Course 1" course homepage
|
Then I should see "Activities: 3" in the "#section-1" "css_element"
|
||||||
Then I should see "Chat: 1" in the "#section-1" "css_element"
|
|
||||||
And I should see "Database: 1" in the "#section-1" "css_element"
|
|
||||||
And I should <show> "Progress:" in the "#section-1" "css_element"
|
And I should <show> "Progress:" in the "#section-1" "css_element"
|
||||||
And I should see "Forums: 2" in the "#section-2" "css_element"
|
And I should see "Activities: 1" in the "#section-2" "css_element"
|
||||||
And I should <show> "Progress:" in the "#section-2" "css_element"
|
And I should <show> "Progress:" in the "#section-2" "css_element"
|
||||||
|
And I should see "Activities: 0" in the "#section-3" "css_element"
|
||||||
|
And I should not see "Progress:" in the "#section-3" "css_element"
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
| user | courseformat | completion | show |
|
| user | courseformat | completion | show |
|
||||||
|
@ -51,18 +51,17 @@ Feature: Course paged mode information
|
||||||
| activity | course | name | section | completion |
|
| activity | course | name | section | completion |
|
||||||
| chat | C1 | Chat room | 1 | <completion> |
|
| chat | C1 | Chat room | 1 | <completion> |
|
||||||
| data | C1 | Database | 1 | <completion> |
|
| data | C1 | Database | 1 | <completion> |
|
||||||
| forum | C1 | First forum | 2 | <completion> |
|
| forum | C1 | First forum | 1 | <completion> |
|
||||||
| forum | C1 | Second forum | 2 | <completion> |
|
| forum | C1 | Second forum | 2 | <completion> |
|
||||||
And I am on the "Course 1" "enrolment methods" page logged in as admin
|
And I am on the "Course 1" "enrolment methods" page logged in as admin
|
||||||
And I click on "Enable" "link" in the "Guest access" "table_row"
|
And I click on "Enable" "link" in the "Guest access" "table_row"
|
||||||
And I log out
|
When I am on the "Course 1" "Course" page logged in as "guest"
|
||||||
When I log in as "guest"
|
Then I should see "Activities: 3" in the "#section-1" "css_element"
|
||||||
And I am on "Course 1" course homepage
|
|
||||||
Then I should see "Chat: 1" in the "#section-1" "css_element"
|
|
||||||
And I should see "Database: 1" in the "#section-1" "css_element"
|
|
||||||
And I should not see "Progress:" in the "#section-1" "css_element"
|
And I should not see "Progress:" in the "#section-1" "css_element"
|
||||||
And I should see "Forums: 2" in the "#section-2" "css_element"
|
And I should see "Activities: 1" in the "#section-2" "css_element"
|
||||||
And I should not see "Progress:" in the "#section-2" "css_element"
|
And I should not see "Progress:" in the "#section-2" "css_element"
|
||||||
|
And I should see "Activities: 0" in the "#section-3" "css_element"
|
||||||
|
And I should not see "Progress:" in the "#section-3" "css_element"
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
| courseformat | completion |
|
| courseformat | completion |
|
||||||
|
|
|
@ -162,6 +162,8 @@ $string['targetlabelstudentgradetopassno'] = 'Student who is likely to meet the
|
||||||
$string['targetlabelstudentgradetopassyes'] = 'Student at risk of not meeting the minimum grade to pass the course.';
|
$string['targetlabelstudentgradetopassyes'] = 'Student at risk of not meeting the minimum grade to pass the course.';
|
||||||
$string['targetlabelteachingyes'] = 'Users with teaching capabilities who have access to the course';
|
$string['targetlabelteachingyes'] = 'Users with teaching capabilities who have access to the course';
|
||||||
$string['targetlabelteachingno'] = 'Courses at risk of not starting';
|
$string['targetlabelteachingno'] = 'Courses at risk of not starting';
|
||||||
|
$string['totalactivities'] = 'Activities: {$a}';
|
||||||
|
$string['gotosection'] = 'Go to section {$a}';
|
||||||
|
|
||||||
// Deprecated since Moodle 4.3.
|
// Deprecated since Moodle 4.3.
|
||||||
$string['aria:courseimage'] = 'Course image';
|
$string['aria:courseimage'] = 'Course image';
|
||||||
|
|
|
@ -193,6 +193,7 @@ class icon_system_fontawesome extends icon_system_font {
|
||||||
'theme:fp/view_icon_active' => 'fa-th',
|
'theme:fp/view_icon_active' => 'fa-th',
|
||||||
'theme:fp/view_list_active' => 'fa-list',
|
'theme:fp/view_list_active' => 'fa-list',
|
||||||
'theme:fp/view_tree_active' => 'fa-folder',
|
'theme:fp/view_tree_active' => 'fa-folder',
|
||||||
|
'core:i/activities' => 'fa-file-pen',
|
||||||
'core:i/addblock' => 'fa-plus-square',
|
'core:i/addblock' => 'fa-plus-square',
|
||||||
'core:i/assignroles' => 'fa-user-plus',
|
'core:i/assignroles' => 'fa-user-plus',
|
||||||
'core:i/asterisk' => 'fa-asterisk',
|
'core:i/asterisk' => 'fa-asterisk',
|
||||||
|
|
1
pix/i/activities.svg
Normal file
1
pix/i/activities.svg
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 576 512"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M0 64C0 28.7 28.7 0 64 0H224V128c0 17.7 14.3 32 32 32H384V285.7l-86.8 86.8c-10.3 10.3-17.5 23.1-21 37.2l-18.7 74.9c-2.3 9.2-1.8 18.8 1.3 27.5H64c-35.3 0-64-28.7-64-64V64zm384 64H256V0L384 128zM549.8 235.7l14.4 14.4c15.6 15.6 15.6 40.9 0 56.6l-29.4 29.4-71-71 29.4-29.4c15.6-15.6 40.9-15.6 56.6 0zM311.9 417L441.1 287.8l71 71L382.9 487.9c-4.1 4.1-9.2 7-14.9 8.4l-60.1 15c-5.5 1.4-11.2-.2-15.2-4.2s-5.6-9.7-4.2-15.2l15-60.1c1.4-5.6 4.3-10.8 8.4-14.9z"/></svg>
|
After Width: | Height: | Size: 711 B |
|
@ -375,14 +375,6 @@ body:not(.editing) .sitetopic ul.section {
|
||||||
margin: 2px 5px 2px 5px;
|
margin: 2px 5px 2px 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.course-content .section-summary .section-summary-activities .activity-count {
|
|
||||||
color: $text-muted;
|
|
||||||
font-size: $font-size-sm;
|
|
||||||
margin: 3px;
|
|
||||||
white-space: nowrap;
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.course-content .section-summary .summary {
|
.course-content .section-summary .summary {
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
}
|
}
|
||||||
|
@ -1350,6 +1342,13 @@ $activity-add-hover: theme-color-level('primary', -10) !default;
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
border-bottom: $border-width solid $border-color;
|
border-bottom: $border-width solid $border-color;
|
||||||
|
|
||||||
|
.sectionname > a {
|
||||||
|
color: $gray-900;
|
||||||
|
&:hover {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&:last-child:not(.section-summary) {
|
&:last-child:not(.section-summary) {
|
||||||
border-bottom: 0;
|
border-bottom: 0;
|
||||||
}
|
}
|
||||||
|
@ -1407,12 +1406,22 @@ $activity-add-hover: theme-color-level('primary', -10) !default;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.section-summary-activities .activity-count {
|
.section-summary-activities {
|
||||||
color: $text-muted;
|
.icon {
|
||||||
font-size: $font-size-sm;
|
width: inherit;
|
||||||
margin: 3px;
|
color: $primary;
|
||||||
white-space: nowrap;
|
}
|
||||||
display: inline-block;
|
}
|
||||||
|
|
||||||
|
.section-summary-activities + .section {
|
||||||
|
border-top: $border-width solid $border-color;
|
||||||
|
margin-top: map-get($spacers, 3) !important; // stylelint-disable-line declaration-no-important
|
||||||
|
padding-top: map-get($spacers, 3) !important; // stylelint-disable-line declaration-no-important
|
||||||
|
}
|
||||||
|
|
||||||
|
.section_goto .icon {
|
||||||
|
font-size: $font-size-lg;
|
||||||
|
color: $primary;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Legacy dndupload classes. Can be removed in 4.4 as part of MDL-77124.
|
// Legacy dndupload classes. Can be removed in 4.4 as part of MDL-77124.
|
||||||
|
|
|
@ -28256,14 +28256,6 @@ body:not(.editing) .sitetopic ul.section .label .mod-indent-outer {
|
||||||
margin: 2px 5px 2px 5px;
|
margin: 2px 5px 2px 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.course-content .section-summary .section-summary-activities .activity-count {
|
|
||||||
color: #6a737b;
|
|
||||||
font-size: 0.8203125rem;
|
|
||||||
margin: 3px;
|
|
||||||
white-space: nowrap;
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.course-content .section-summary .summary {
|
.course-content .section-summary .summary {
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
}
|
}
|
||||||
|
@ -29128,6 +29120,12 @@ span.editinstructions .alert-link {
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
border-bottom: 1px solid #dee2e6;
|
border-bottom: 1px solid #dee2e6;
|
||||||
}
|
}
|
||||||
|
.course-section .sectionname > a {
|
||||||
|
color: #1d2125;
|
||||||
|
}
|
||||||
|
.course-section .sectionname > a:hover {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
.course-section:last-child:not(.section-summary) {
|
.course-section:last-child:not(.section-summary) {
|
||||||
border-bottom: 0;
|
border-bottom: 0;
|
||||||
}
|
}
|
||||||
|
@ -29168,12 +29166,18 @@ span.editinstructions .alert-link {
|
||||||
margin-top: 0.5rem;
|
margin-top: 0.5rem;
|
||||||
border-radius: 0.5rem;
|
border-radius: 0.5rem;
|
||||||
}
|
}
|
||||||
.course-section .section-summary-activities .activity-count {
|
.course-section .section-summary-activities .icon {
|
||||||
color: #6a737b;
|
width: inherit;
|
||||||
font-size: 0.8203125rem;
|
color: #0f6cbf;
|
||||||
margin: 3px;
|
}
|
||||||
white-space: nowrap;
|
.course-section .section-summary-activities + .section {
|
||||||
display: inline-block;
|
border-top: 1px solid #dee2e6;
|
||||||
|
margin-top: 1rem !important;
|
||||||
|
padding-top: 1rem !important;
|
||||||
|
}
|
||||||
|
.course-section .section_goto .icon {
|
||||||
|
font-size: 1.171875rem;
|
||||||
|
color: #0f6cbf;
|
||||||
}
|
}
|
||||||
.course-section.dndupload-dropzone {
|
.course-section.dndupload-dropzone {
|
||||||
border: 2px dashed #0f6cbf;
|
border: 2px dashed #0f6cbf;
|
||||||
|
|
|
@ -28256,14 +28256,6 @@ body:not(.editing) .sitetopic ul.section .label .mod-indent-outer {
|
||||||
margin: 2px 5px 2px 5px;
|
margin: 2px 5px 2px 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.course-content .section-summary .section-summary-activities .activity-count {
|
|
||||||
color: #6a737b;
|
|
||||||
font-size: 0.8203125rem;
|
|
||||||
margin: 3px;
|
|
||||||
white-space: nowrap;
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.course-content .section-summary .summary {
|
.course-content .section-summary .summary {
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
}
|
}
|
||||||
|
@ -29128,6 +29120,12 @@ span.editinstructions .alert-link {
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
border-bottom: 1px solid #dee2e6;
|
border-bottom: 1px solid #dee2e6;
|
||||||
}
|
}
|
||||||
|
.course-section .sectionname > a {
|
||||||
|
color: #1d2125;
|
||||||
|
}
|
||||||
|
.course-section .sectionname > a:hover {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
.course-section:last-child:not(.section-summary) {
|
.course-section:last-child:not(.section-summary) {
|
||||||
border-bottom: 0;
|
border-bottom: 0;
|
||||||
}
|
}
|
||||||
|
@ -29168,12 +29166,18 @@ span.editinstructions .alert-link {
|
||||||
margin-top: 0.5rem;
|
margin-top: 0.5rem;
|
||||||
border-radius: 0.25rem;
|
border-radius: 0.25rem;
|
||||||
}
|
}
|
||||||
.course-section .section-summary-activities .activity-count {
|
.course-section .section-summary-activities .icon {
|
||||||
color: #6a737b;
|
width: inherit;
|
||||||
font-size: 0.8203125rem;
|
color: #0f6cbf;
|
||||||
margin: 3px;
|
}
|
||||||
white-space: nowrap;
|
.course-section .section-summary-activities + .section {
|
||||||
display: inline-block;
|
border-top: 1px solid #dee2e6;
|
||||||
|
margin-top: 1rem !important;
|
||||||
|
padding-top: 1rem !important;
|
||||||
|
}
|
||||||
|
.course-section .section_goto .icon {
|
||||||
|
font-size: 1.171875rem;
|
||||||
|
color: #0f6cbf;
|
||||||
}
|
}
|
||||||
.course-section.dndupload-dropzone {
|
.course-section.dndupload-dropzone {
|
||||||
border: 2px dashed #0f6cbf;
|
border: 2px dashed #0f6cbf;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue