Skip to content

Commit

Permalink
MDL-78284 theme: Add new interactive content and update styles
Browse files Browse the repository at this point in the history
  • Loading branch information
sarjona committed Feb 15, 2024
1 parent 76474b6 commit 8cdd62c
Show file tree
Hide file tree
Showing 44 changed files with 225 additions and 223 deletions.
5 changes: 3 additions & 2 deletions blocks/recentlyaccesseditems/templates/view-cards.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"name": "Forum",
"timeaccess": 1539848498,
"userid": 2,
"viewurl": "http://moodlesite/mod/forum?id=64"
"viewurl": "http://moodlesite/mod/forum?id=64",
"purpose": "assessment"
}
]
}
Expand All @@ -45,7 +46,7 @@
<a class="card dashboard-card mb-1" href="{{{viewurl}}}" title="{{{name}}}" role="listitem">
<div class="card-body p-2 m-1">
<div class="d-flex text-truncate">
<div class="d-flex align-self-center activityiconcontainer {{purpose}}">
<div class="d-flex align-self-center activityiconcontainer">
{{{icon}}}
</div>
<div class="w-100 line-height-3 text-truncate ml-2">
Expand Down
2 changes: 1 addition & 1 deletion blocks/timeline/templates/event-list-item.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<small class="text-right text-nowrap align-self-center ml-1">
{{#userdate}} {{timesort}}, {{#str}} strftimetime24, core_langconfig {{/str}} {{/userdate}}
</small>
<div class="activityiconcontainer small {{purpose}} courseicon align-self-top align-self-center mx-3 mb-1 mb-sm-0 text-nowrap">
<div class="activityiconcontainer small courseicon align-self-top align-self-center mx-3 mb-1 mb-sm-0 text-nowrap">
{{#icon}}
{{#iconurl}}
<img alt="{{alttext}}" title="{{alttext}}" src="{{{ iconurl }}}" class="icon {{iconclass}}">
Expand Down
2 changes: 1 addition & 1 deletion calendar/templates/upcoming_mini.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
}} data-eventtype-{{normalisedeventtype}}="1"{{!
}} data-region="event-item"{{!
}}>
<div class="activityiconcontainer small {{{purpose}}} courseicon mr-3">
<div class="activityiconcontainer small courseicon mr-3">
{{#icon}}
{{#iconurl}}
<img alt="{{alttext}}" title="{{alttext}}" src="{{{ iconurl }}}" class="icon {{iconclass}}">
Expand Down
6 changes: 3 additions & 3 deletions course/format/templates/local/content/cm/cmicon.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@
{{#url}}
{{#uservisible}}
<a href="{{url}}"
class="activity-icon activityiconcontainer smaller {{^branded}}{{purpose}}{{/branded}} btn btn-link courseicon align-self-start mr-2"
{{#showtooltip}}data-toggle="tooltip" title="{{{pluginname}}}" data-placement="top"{{/showtooltip}} {{branded}}
class="activity-icon activityiconcontainer smaller {{purpose}} {{#branded}}isbranded{{/branded}} btn btn-link courseicon align-self-start mr-2"
{{#showtooltip}}data-toggle="tooltip" title="{{{pluginname}}}" data-placement="top"{{/showtooltip}}
>
<img src="{{{icon}}}" class="activityicon {{iconclass}}"
alt="{{#cleanstr}} activityicon, moodle, {{{pluginname}}} {{/cleanstr}}"
>
</a>
{{/uservisible}}
{{^uservisible}}
<div class="activity-icon activityiconcontainer smaller {{^branded}}{{purpose}}{{/branded}} courseicon align-self-start mr-2">
<div class="activity-icon activityiconcontainer smaller {{purpose}} {{#branded}}isbranded{{/branded}} courseicon align-self-start mr-2">
<img src="{{{icon}}}" class="activityicon {{iconclass}}"
alt="{{#cleanstr}} activityicon, moodle, {{{pluginname}}} {{/cleanstr}}"
>
Expand Down
2 changes: 1 addition & 1 deletion course/modedit.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@
$PAGE->activityheader->disable();

echo $OUTPUT->header();
echo $OUTPUT->heading_with_help($pageheading, '', $module->name, 'monologo');
echo $OUTPUT->heading_with_help($pageheading, '', $module->name);

$mform->display();

Expand Down
2 changes: 1 addition & 1 deletion course/templates/activityinstance.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"activities": [{
"cmid": "4",
"modname": "Test activity",
"icon": "https://raw.githubusercontent.com/moodle/moodle/master/mod/feedback/pix/monologo.png",
"icon": "https://raw.githubusercontent.com/moodle/moodle/master/mod/feedback/pix/monologo.svg",
"completionstatus": {
"string": "Manual",
"icon": "https://raw.githubusercontent.com/moodle/moodle/master/pix/i/completion-manual-enabled.png"
Expand Down
2 changes: 1 addition & 1 deletion course/templates/bulkactivitycompletion.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"activities": [{
"cmid": "4",
"modname": "Test activity",
"icon": "https://raw.githubusercontent.com/moodle/moodle/master/mod/feedback/pix/monologo.png",
"icon": "https://raw.githubusercontent.com/moodle/moodle/master/mod/feedback/pix/monologo.svg",
"completionstatus": {
"string": "Manual",
"icon": "https://raw.githubusercontent.com/moodle/moodle/master/pix/i/completion-manual-enabled.png"
Expand Down
2 changes: 1 addition & 1 deletion course/templates/defaultactivitycompletion.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"id": "10",
"formattedname": "Assignment",
"canmanage": true,
"icon": "https://raw.githubusercontent.com/moodle/moodle/master/mod/assign/pix/monologo.png",
"icon": "https://raw.githubusercontent.com/moodle/moodle/master/mod/assign/pix/monologo.svg",
"completionstatus": {
"string": "Manual",
"icon": "https://raw.githubusercontent.com/moodle/moodle/master/pix/i/completion-manual-enabled.png"
Expand Down
2 changes: 1 addition & 1 deletion course/templates/editbulkactivitycompletion.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"activities": [{
"cmid": "4",
"modname": "Test activity",
"icon": "https://raw.githubusercontent.com/moodle/moodle/master/mod/feedback/pix/monologo.png"
"icon": "https://raw.githubusercontent.com/moodle/moodle/master/mod/feedback/pix/monologo.svg"
}]
}
}}
Expand Down
2 changes: 1 addition & 1 deletion course/templates/editdefaultcompletion.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"modules": [{
"id": "10",
"formattedname": "Assignment",
"icon": "https://raw.githubusercontent.com/moodle/moodle/master/mod/assign/pix/monologo.png"
"icon": "https://raw.githubusercontent.com/moodle/moodle/master/mod/assign/pix/monologo.svg"
}]
}
}}
Expand Down
2 changes: 1 addition & 1 deletion course/templates/local/activitychooser/item.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<div class="optioninfo card-body d-flex flex-column text-center p-1" data-region="chooser-option-info-container">
<a class="d-flex flex-column justify-content-between flex-fill" href="{{link}}" title="{{#str}} addnew, moodle, {{title}} {{/str}}" tabindex="-1" data-action="add-chooser-option">
<div class="optionicon mt-2 mb-1 mx-auto icon-no-margin modicon_{{name}} activityiconcontainer smaller
{{^branded}} {{purpose}}{{/branded}}">
{{purpose}} {{#branded}}isbranded{{/branded}}">
{{{icon}}}
</div>
<div class="optionname clamp-2">{{title}}</div>
Expand Down
6 changes: 6 additions & 0 deletions course/upgrade.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ information provided here is intended especially for developers.
* New format actions classes. Those classes will eventually replace all course/lib.php content editing functions.
All new methods are distributed in three classes formats can extend. Method can be accessed using static
methods (see doc block of core_courseformat\formatactions for more information).
* The monologo activity icons have been improved and .png files have been removed (although the API still supports them).
The background for these icons has been removed and the color is used now for outlining their shapes.
About the categories supported by the FEATURE_MOD_PURPOSE:
* A new category has been added: MOD_PURPOSE_INTERACTIVECONTENT.
* The MOD_PURPOSE_INTERFACE category has been deprecated. The styles associated with this category have been removed.
The colors for all these purposes and the filters applied to outline them are defined in theme/boost/scss/moodle/variables.scss

=== 4.3 ===
* The `core_course_renderer::course_section_cm_completion` method has been removed, and can no longer be used
Expand Down
6 changes: 4 additions & 2 deletions grade/report/grader/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@

.path-grade-report-grader .grade_icons .icon {
margin-right: 1rem;
font-size: 14px;
width: 24px;
}

.path-grade-report-grader .grade_icons .icon:last-child {
Expand Down Expand Up @@ -90,8 +92,8 @@
}

.path-grade-report-grader .heading .gradeitemheader {
text-indent: -1.5rem;
padding-left: 1.5rem;
text-indent: -2rem;
padding-left: 2rem;
padding-top: 6px;
}

Expand Down
7 changes: 0 additions & 7 deletions grade/report/user/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,6 @@
padding-left: 0;
}

.path-grade-report-user .user-grade .column-itemname .itemicon,
.grade-report-user .user-grade .column-itemname .itemicon {
font-size: 18px;
width: 18px;
height: 18px;
}

.path-grade-report-user .user-grade .baggt,
.path-grade-report-user .user-grade .baggb,
.grade-report-user .user-grade .baggt,
Expand Down
17 changes: 11 additions & 6 deletions grade/tests/behat/grade_aggregation.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,18 @@ Feature: We can use calculated grade totals
| fullname | shortname | category | groupmode |
| Course 1 | C1 | 0 | 1 |
And the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | teacher1@example.com | t1 |
| student1 | Student | 1 | student1@example.com | s1 |
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | teacher1@example.com | t1 |
| student1 | Student | 1 | student1@example.com | s1 |
# Additional students must be enrolled in the course to ensure that the action menu for hiding grades is displayed correctly.
| student2 | Student | 2 | student2@example.com | s2 |
| student3 | Student | 3 | student3@example.com | s3 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
| student3 | C1 | student |
And the following "grade categories" exist:
| fullname | course |
| Sub category 1 | C1 |
Expand Down
10 changes: 8 additions & 2 deletions lib/moodlelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -487,10 +487,16 @@
define('MOD_PURPOSE_COMMUNICATION', 'communication');
/** Module purpose content */
define('MOD_PURPOSE_CONTENT', 'content');
/** Module purpose interface */
define('MOD_PURPOSE_INTERFACE', 'interface');
/** Module purpose interactive content */
define('MOD_PURPOSE_INTERACTIVECONTENT', 'interactivecontent');
/** Module purpose other */
define('MOD_PURPOSE_OTHER', 'other');
/**
* Module purpose interface
* @deprecated since Moodle 4.4
* @todo MDL-80701 Remove in Moodle 4.8
*/
define('MOD_PURPOSE_INTERFACE', 'interface');

/**
* Security token used for allowing access
Expand Down
2 changes: 1 addition & 1 deletion mod/bigbluebuttonbn/db/mobile.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
'coursebigbluebuttonbn' => [ // Handler unique name (can be anything).
'displaydata' => [
'title' => 'pluginname',
'icon' => $CFG->wwwroot . '/mod/bigbluebuttonbn/pix/monologo.png',
'icon' => $CFG->wwwroot . '/mod/bigbluebuttonbn/pix/monologo.svg',
'class' => '',
],
'delegate' => 'CoreCourseModuleDelegate', // Delegate (where to display the link to the add-on).
Expand Down
12 changes: 6 additions & 6 deletions mod/data/tests/entries_export_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,13 @@ public function test_export_csv(): void {
$ziparchive = new \zip_archive();
$ziparchive->open($tmpdir . '/testexportarchive.zip');
$expectedfilecontents = [
// The test generator for mod_data uses a copy of pix/monologo.png as sample file content for the file stored in a
// file and picture field.
// So we expect that this file has to have the same content as monologo.png.
// The test generator for mod_data uses a copy of field/picture/pix/sample.png as sample file content for the
// file stored in a file and picture field.
// So we expect that this file has to have the same content as sample.png.
// Also, the default value for the subdirectory in the zip archive containing the files is 'files/'.
'files/samplefile.png' => 'mod/data/pix/monologo.png',
'files/samplefile_1.png' => 'mod/data/pix/monologo.png',
'files/picturefile.png' => 'mod/data/pix/monologo.png',
'files/samplefile.png' => 'mod/data/field/picture/pix/sample.png',
'files/samplefile_1.png' => 'mod/data/field/picture/pix/sample.png',
'files/picturefile.png' => 'mod/data/field/picture/pix/sample.png',
// By checking that the content of the exported csv is identical to the fixture file it is verified
// that the filenames in the csv file correspond to the names of the exported file.
// It also verifies that files with identical file names in different fields (or records) will be numbered
Expand Down
2 changes: 1 addition & 1 deletion mod/data/tests/generator/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ public function create_entry($data, array $contents, $groupid = 0, $tags = [], a
get_file_storage()->create_file_from_string(['component' => 'user', 'filearea' => 'draft',
'contextid' => $usercontext->id, 'itemid' => $itemid, 'filepath' => '/',
'filename' => $filename],
file_get_contents($CFG->dirroot.'/mod/data/pix/monologo.png'));
file_get_contents($CFG->dirroot.'/mod/data/field/picture/pix/sample.png'));
}

$fieldname = 'field_' . $fieldid . '_file';
Expand Down
2 changes: 1 addition & 1 deletion mod/h5pactivity/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function h5pactivity_supports(string $feature) {
case FEATURE_BACKUP_MOODLE2:
return true;
case FEATURE_MOD_PURPOSE:
return MOD_PURPOSE_CONTENT;
return MOD_PURPOSE_INTERACTIVECONTENT;
default:
return null;
}
Expand Down
3 changes: 2 additions & 1 deletion mod/imscp/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ function imscp_supports($feature) {
case FEATURE_GRADE_OUTCOMES: return false;
case FEATURE_BACKUP_MOODLE2: return true;
case FEATURE_SHOW_DESCRIPTION: return true;
case FEATURE_MOD_PURPOSE: return MOD_PURPOSE_CONTENT;
case FEATURE_MOD_PURPOSE:
return MOD_PURPOSE_INTERACTIVECONTENT;

default: return null;
}
Expand Down
2 changes: 1 addition & 1 deletion mod/lesson/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,7 @@ function lesson_supports($feature) {
case FEATURE_SHOW_DESCRIPTION:
return true;
case FEATURE_MOD_PURPOSE:
return MOD_PURPOSE_CONTENT;
return MOD_PURPOSE_INTERACTIVECONTENT;
default:
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ protected function get_all_columns(): array {

$iconurl = $data->icon ?: $OUTPUT->image_url('monologo', 'lti')->out();
$iconclass = $data->icon ? ' nofilter' : '';
$iconcontainerclass = 'activityiconcontainer smaller content';
$iconcontainerclass = 'activityiconcontainer smaller';
$name = $data->name;
$img = \html_writer::img($iconurl, get_string('courseexternaltooliconalt', 'mod_lti', $name),
['class' => 'activityicon' . $iconclass]);
Expand Down
2 changes: 1 addition & 1 deletion mod/lti/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function lti_supports($feature) {
case FEATURE_SHOW_DESCRIPTION:
return true;
case FEATURE_MOD_PURPOSE:
return MOD_PURPOSE_CONTENT;
return MOD_PURPOSE_OTHER;

default:
return null;
Expand Down
3 changes: 2 additions & 1 deletion mod/scorm/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1042,7 +1042,8 @@ function scorm_supports($feature) {
case FEATURE_GRADE_OUTCOMES: return true;
case FEATURE_BACKUP_MOODLE2: return true;
case FEATURE_SHOW_DESCRIPTION: return true;
case FEATURE_MOD_PURPOSE: return MOD_PURPOSE_CONTENT;
case FEATURE_MOD_PURPOSE:
return MOD_PURPOSE_INTERACTIVECONTENT;

default: return null;
}
Expand Down
2 changes: 1 addition & 1 deletion pix/i/completion-auto-enabled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion pix/i/completion-auto-fail.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion pix/i/completion-auto-n-override.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion pix/i/completion-auto-n.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 8cdd62c

Please sign in to comment.