MDL-74272 theme_boost: Remove plugin name on course page

In 4.0, the plugin name was added above their name. Based on the community
feedback and the research done by the UX team, this needs to be removed.
This commit removes the activity name when edit mode is disabled.
This commit is contained in:
Sara Arjona 2023-01-31 16:17:05 +01:00
parent 0780e87f06
commit 5d7d947553
4 changed files with 10 additions and 3 deletions

View File

@ -106,12 +106,15 @@ class cmname implements named_templatable, renderable {
'url' => $mod->url,
'icon' => $mod->get_icon_url(),
'modname' => $mod->modname,
'pluginname' => get_string('pluginname', 'mod_' . $mod->modname),
'textclasses' => $displayoptions['textclasses'] ?? '',
'purpose' => plugin_supports('mod', $mod->modname, FEATURE_MOD_PURPOSE, MOD_PURPOSE_OTHER),
'activityname' => $this->get_title_data($output),
];
if ($this->format->show_editor()) {
$data['pluginname'] = get_string('pluginname', 'mod_' . $mod->modname);
}
return $data;
}

View File

@ -70,7 +70,7 @@
{{/ core_courseformat/local/content/cm/cmname }}
{{/cmname}}
{{#afterlink}}
<div class="afterlink">
<div class="afterlink d-flex align-items-center ml-3">
{{{afterlink}}}
</div>
{{/afterlink}}

View File

@ -50,9 +50,11 @@
<img src="{{{icon}}}" class="activityicon " alt="{{{modname}}} icon">
</div>
<div class="media-body align-self-center">
{{#pluginname}}
<div class="text-uppercase small">
{{{pluginname}}}
</div>
{{/pluginname}}
<div class="activityname">
{{#activityname}}
{{$ core/inplace_editable }}

View File

@ -167,7 +167,9 @@ class core_renderer extends \core_renderer {
$purposeclass .= ' activityiconcontainer';
$purposeclass .= ' modicon_' . $this->page->activityname;
$imagedata = html_writer::tag('div', $imagedata, ['class' => $purposeclass]);
$prefix = get_string('modulename', $this->page->activityname);
if (!empty($USER->editing)) {
$prefix = get_string('modulename', $this->page->activityname);
}
}
}