diff --git a/src/addons/block/activitymodules/components/activitymodules/activitymodules.scss b/src/addons/block/activitymodules/components/activitymodules/activitymodules.scss new file mode 100644 index 000000000..21ce02313 --- /dev/null +++ b/src/addons/block/activitymodules/components/activitymodules/activitymodules.scss @@ -0,0 +1,13 @@ +:host { + --mod-icon-filter: brightness(0); + + core-mod-icon { + background: transparent; + margin: 0; + --filter: var(--mod-icon-filter); + } +} + +:host-context(body.dark) { + --mod-icon-filter: brightness(0) invert(1); +} diff --git a/src/addons/block/activitymodules/components/activitymodules/activitymodules.ts b/src/addons/block/activitymodules/components/activitymodules/activitymodules.ts index 60db4a0c0..129c1ca6d 100644 --- a/src/addons/block/activitymodules/components/activitymodules/activitymodules.ts +++ b/src/addons/block/activitymodules/components/activitymodules/activitymodules.ts @@ -28,6 +28,7 @@ import { CoreNavigator } from '@services/navigator'; @Component({ selector: 'addon-block-activitymodules', templateUrl: 'addon-block-activitymodules.html', + styleUrls: ['activitymodules.scss'], }) export class AddonBlockActivityModulesComponent extends CoreBlockBaseComponent implements OnInit { @@ -96,16 +97,13 @@ export class AddonBlockActivityModulesComponent extends CoreBlockBaseComponent i // Sort the modnames alphabetically. modFullNames = CoreUtils.sortValues(modFullNames); for (const modName in modFullNames) { - let icon: string; + const iconModName = modName === 'resources' ? 'page' : modName; - if (modName === 'resources') { - icon = await CoreCourse.getModuleIconSrc('page', modIcons['page']); - } else { - icon = await CoreCourseModuleDelegate.getModuleIconSrc(modName, modIcons[modName]); - } + const icon = await CoreCourseModuleDelegate.getModuleIconSrc(iconModName, modIcons[iconModName]); this.entries.push({ - icon: icon, + icon, + iconModName, name: modFullNames[modName], modName, }); @@ -145,4 +143,5 @@ type AddonBlockActivityModuleEntry = { icon: string; name: string; modName: string; + iconModName: string; }; diff --git a/src/addons/block/activitymodules/components/activitymodules/addon-block-activitymodules.html b/src/addons/block/activitymodules/components/activitymodules/addon-block-activitymodules.html index 44810d334..a22f3d549 100644 --- a/src/addons/block/activitymodules/components/activitymodules/addon-block-activitymodules.html +++ b/src/addons/block/activitymodules/components/activitymodules/addon-block-activitymodules.html @@ -5,7 +5,7 @@ - + {{ entry.name }} diff --git a/src/addons/mod/forum/services/handlers/module.ts b/src/addons/mod/forum/services/handlers/module.ts index a750b83b6..780f432b1 100644 --- a/src/addons/mod/forum/services/handlers/module.ts +++ b/src/addons/mod/forum/services/handlers/module.ts @@ -23,6 +23,7 @@ import { CoreConstants, ModPurpose } from '@/core/constants'; import { AddonModForumIndexComponent } from '../../components/index'; import { CoreModuleHandlerBase } from '@features/course/classes/module-base-handler'; import { CoreCourseModuleData } from '@features/course/services/course-helper'; +import { CoreIonicColorNames } from '@singletons/colors'; /** * Handler to support forum modules. @@ -58,7 +59,7 @@ export class AddonModForumModuleHandlerService extends CoreModuleHandlerBase imp const data = await super.getData(module, courseId); if ('afterlink' in module && !!module.afterlink) { - data.extraBadgeColor = ''; + data.extraBadgeColor = undefined; const match = />(\d+)[^<]+/.exec(module.afterlink); data.extraBadge = match ? Translate.instant('addon.mod_forum.unreadpostsnumber', { $a : match[1] }) : ''; } else { @@ -112,7 +113,7 @@ export class AddonModForumModuleHandlerService extends CoreModuleHandlerBase imp } data.extraBadge = Translate.instant('core.loading'); - data.extraBadgeColor = 'light'; + data.extraBadgeColor = CoreIonicColorNames.DARK; await CoreUtils.ignoreErrors(AddonModForum.invalidateForumData(courseId)); @@ -120,7 +121,7 @@ export class AddonModForumModuleHandlerService extends CoreModuleHandlerBase imp // Handle unread posts. const forum = await AddonModForum.getForum(courseId, moduleId, { siteId }); - data.extraBadgeColor = ''; + data.extraBadgeColor = undefined; data.extraBadge = forum.unreadpostscount ? Translate.instant( 'addon.mod_forum.unreadpostsnumber', @@ -129,7 +130,7 @@ export class AddonModForumModuleHandlerService extends CoreModuleHandlerBase imp : ''; } catch { // Ignore errors. - data.extraBadgeColor = ''; + data.extraBadgeColor = undefined; data.extraBadge = ''; } } diff --git a/src/addons/mod/h5pactivity/pages/attempt-results/attempt-results.html b/src/addons/mod/h5pactivity/pages/attempt-results/attempt-results.html index 00a903743..718811590 100644 --- a/src/addons/mod/h5pactivity/pages/attempt-results/attempt-results.html +++ b/src/addons/mod/h5pactivity/pages/attempt-results/attempt-results.html @@ -109,7 +109,7 @@ - {{ result.optionslabel }} + {{ result.optionslabel }} {{ result.correctlabel }} {{ result.answerlabel }} @@ -118,7 +118,7 @@ - + diff --git a/src/addons/mod/resource/services/handlers/module.ts b/src/addons/mod/resource/services/handlers/module.ts index 0eaab6861..3304a1b8c 100644 --- a/src/addons/mod/resource/services/handlers/module.ts +++ b/src/addons/mod/resource/services/handlers/module.ts @@ -20,6 +20,7 @@ import { CoreCourseModuleData } from '@features/course/services/course-helper'; import { CoreCourseModuleHandler, CoreCourseModuleHandlerData } from '@features/course/services/module-delegate'; import { CoreCourseModulePrefetchDelegate } from '@features/course/services/module-prefetch-delegate'; import { CoreFileHelper } from '@services/file-helper'; +import { CoreSites } from '@services/sites'; import { CoreMimetypeUtils } from '@services/utils/mimetype'; import { CoreTextUtils } from '@services/utils/text'; import { CoreTimeUtils } from '@services/utils/time'; @@ -95,7 +96,14 @@ export class AddonModResourceModuleHandlerService extends CoreModuleHandlerBase this.getResourceData(module, courseId, handlerData).then((extra) => { handlerData.extraBadge = extra; - handlerData.extraBadgeColor = ''; + + return; + }).catch(() => { + // Ignore errors. + }); + + this.getIconSrc(module).then((icon) => { + handlerData.icon = icon; return; }).catch(() => { @@ -214,6 +222,36 @@ export class AddonModResourceModuleHandlerService extends CoreModuleHandlerBase return extra.join(' '); } + /** + * @inheritdoc + */ + async getIconSrc(module?: CoreCourseModuleData): Promise { + if (!module) { + return; + } + + if (CoreSites.getCurrentSite()?.isVersionGreaterEqualThan('4.0')) { + return await CoreCourse.getModuleIconSrc(module.modname, module.modicon); + } + let mimetypeIcon = ''; + + if (module.contentsinfo) { + // No need to use the list of files. + const mimetype = module.contentsinfo.mimetypes[0]; + if (mimetype) { + mimetypeIcon = CoreMimetypeUtils.getMimetypeIcon(mimetype); + } + + } else if (module.contents && module.contents[0]) { + const files = module.contents; + const file = files[0]; + + mimetypeIcon = CoreMimetypeUtils.getFileIcon(file.filename || ''); + } + + return await CoreCourse.getModuleIconSrc(module.modname, module.modicon, mimetypeIcon); + } + /** * @inheritdoc */ diff --git a/src/addons/storagemanager/pages/course-storage/course-storage.scss b/src/addons/storagemanager/pages/course-storage/course-storage.scss index 29bc1c7d8..87de86c13 100644 --- a/src/addons/storagemanager/pages/course-storage/course-storage.scss +++ b/src/addons/storagemanager/pages/course-storage/course-storage.scss @@ -1,7 +1,6 @@ @import "~theme/globals"; :host { - --core-format-text-background-gradient-rgb: var(--background-rgb, #{$ion-item-background-rgb}); --course-storage-max-activity-height: 120px; ion-card.section ion-card-header { @@ -23,8 +22,8 @@ min-height: var(--course-storage-max-activity-height); position: absolute; @include position(0, 0, null, 0); - background: -webkit-linear-gradient(top, rgba(var(--core-format-text-background-gradient-rgb), 0) calc(100% - 30px), rgba(var(--core-format-text-background-gradient-rgb), 1) calc(100% - 20px)); - background: linear-gradient(to bottom, rgba(var(--core-format-text-background-gradient-rgb), 0) calc(100% - 30px), rgba(var(--core-format-text-background-gradient-rgb), 1) calc(100% - 20px)); + background: -webkit-linear-gradient(top, rgba(var(--background-gradient-rgb), 0) calc(100% - 30px), rgba(var(--background-gradient-rgb), 1) calc(100% - 20px)); + background: linear-gradient(to bottom, rgba(var(--background-gradient-rgb), 0) calc(100% - 30px), rgba(var(--background-gradient-rgb), 1) calc(100% - 20px)); z-index: 6; pointer-events: none; } diff --git a/src/addons/storagemanager/services/handlers/course-menu.ts b/src/addons/storagemanager/services/handlers/course-menu.ts deleted file mode 100644 index 74dc8f409..000000000 --- a/src/addons/storagemanager/services/handlers/course-menu.ts +++ /dev/null @@ -1,62 +0,0 @@ -// (C) Copyright 2015 Moodle Pty Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import { Injectable } from '@angular/core'; -import { CoreCourseOptionsMenuHandler, CoreCourseOptionsMenuHandlerData } from '@features/course/services/course-options-delegate'; -import { CoreCourseAnyCourseDataWithOptions } from '@features/courses/services/courses'; -import { makeSingleton } from '@singletons'; - -/** - * Handler to inject an option into course menu so that user can get to the manage storage page. - */ -@Injectable( { providedIn: 'root' }) -export class AddonStorageManagerCourseMenuHandlerService implements CoreCourseOptionsMenuHandler { - - name = 'AddonStorageManager'; - priority = 500; - isMenuHandler = true; - - /** - * @inheritdoc - */ - async isEnabledForCourse(): Promise { - return true; - } - - /** - * @inheritdoc - */ - async isEnabled(): Promise { - return true; - } - - /** - * @inheritdoc - */ - getMenuDisplayData( - course: CoreCourseAnyCourseDataWithOptions, - ): CoreCourseOptionsMenuHandlerData { - return { - icon: 'fas-cloud-download-alt', - title: 'addon.storagemanager.coursedownloads', - page: 'storage/' + course.id, - pageParams: { - title: course.displayname ?? course.fullname, - }, - class: 'addon-storagemanager-coursemenu-handler', - }; - } - -} -export const AddonStorageManagerCourseMenuHandler = makeSingleton(AddonStorageManagerCourseMenuHandlerService); diff --git a/src/addons/storagemanager/storagemanager.module.ts b/src/addons/storagemanager/storagemanager.module.ts index 187d66cdd..fbf97bdaf 100644 --- a/src/addons/storagemanager/storagemanager.module.ts +++ b/src/addons/storagemanager/storagemanager.module.ts @@ -14,12 +14,10 @@ import { NgModule, APP_INITIALIZER } from '@angular/core'; import { Routes } from '@angular/router'; -import { CoreCourseOptionsDelegate } from '@features/course/services/course-options-delegate'; import { CoreMainMenuRoutingModule } from '@features/mainmenu/mainmenu-routing.module'; import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module'; import { CoreSitePreferencesRoutingModule } from '@features/settings/pages/site/site-routing'; import { CoreSettingsDelegate } from '@features/settings/services/settings-delegate'; -import { AddonStorageManagerCourseMenuHandler } from './services/handlers/course-menu'; import { AddonStorageManagerSettingsHandler } from './services/handlers/settings'; const routes: Routes = [ @@ -41,7 +39,6 @@ const routes: Routes = [ provide: APP_INITIALIZER, multi: true, useValue: () => { - CoreCourseOptionsDelegate.registerHandler(AddonStorageManagerCourseMenuHandler.instance); CoreSettingsDelegate.registerHandler(AddonStorageManagerSettingsHandler.instance); }, }, diff --git a/src/core/components/iframe/core-iframe.html b/src/core/components/iframe/core-iframe.html index 776cfbbee..78c405420 100644 --- a/src/core/components/iframe/core-iframe.html +++ b/src/core/components/iframe/core-iframe.html @@ -1,6 +1,6 @@
- + diff --git a/src/core/directives/collapsible-item.ts b/src/core/directives/collapsible-item.ts index c7f069354..d572a0586 100644 --- a/src/core/directives/collapsible-item.ts +++ b/src/core/directives/collapsible-item.ts @@ -64,8 +64,8 @@ export class CoreCollapsibleItemDirective implements OnInit { } this.maxHeight = this.maxHeight < defaultMaxHeight ? defaultMaxHeight : this.maxHeight; - if (!this.maxHeight || (window.innerWidth > 576 && window.innerHeight > 576)) { - // Do not collapse on big screens. + if (!this.maxHeight) { + // Do not collapse. return; } @@ -91,9 +91,6 @@ export class CoreCollapsibleItemDirective implements OnInit { */ protected calculateHeight(): void { // @todo: Work on calculate this height better. - if (!this.maxHeight) { - return; - } // Remove max-height (if any) to calculate the real height. const initialMaxHeight = this.element.style.maxHeight; @@ -117,7 +114,11 @@ export class CoreCollapsibleItemDirective implements OnInit { this.toggleExpandEnabled = enable; this.element.classList.toggle('collapsible-enabled', enable); - if (!enable || this.element.querySelector('ion-button.collapsible-toggle')) { + if (!enable || this.element.querySelector('ion-button.collapsible-toggle')) { + this.element.style.maxHeight = !enable || this.expanded + ? '' + : this.maxHeight + 'px'; + return; } @@ -128,6 +129,7 @@ export class CoreCollapsibleItemDirective implements OnInit { const toggleText = document.createElement('span'); toggleText.classList.add('collapsible-toggle-text'); + toggleText.classList.add('sr-only'); toggleButton.appendChild(toggleText); const expandArrow = document.createElement('span'); diff --git a/src/core/directives/format-text.ts b/src/core/directives/format-text.ts index b87e1fbe0..cf080adea 100644 --- a/src/core/directives/format-text.ts +++ b/src/core/directives/format-text.ts @@ -279,23 +279,28 @@ export class CoreFormatTextDirective implements OnChanges { */ protected setExpandButtonEnabled(enable: boolean): void { this.toggleExpandEnabled = enable; - this.element.classList.toggle('core-text-formatted', enable); + this.element.classList.toggle('collapsible-enabled', enable); + + if (!enable || this.element.querySelector('ion-button.collapsible-toggle')) { + this.element.style.maxHeight = !enable || this.expanded + ? '' + : this.maxHeight + 'px'; - if (!enable || this.element.querySelector('ion-button.core-format-text-toggle')) { return; } // Add expand/collapse buttons const toggleButton = document.createElement('ion-button'); - toggleButton.classList.add('core-format-text-toggle'); + toggleButton.classList.add('collapsible-toggle'); toggleButton.setAttribute('fill', 'clear'); const toggleText = document.createElement('span'); - toggleText.classList.add('core-format-text-toggle-text'); + toggleText.classList.add('collapsible-toggle-text'); + toggleText.classList.add('sr-only'); toggleButton.appendChild(toggleText); const expandArrow = document.createElement('span'); - expandArrow.classList.add('core-format-text-arrow'); + expandArrow.classList.add('collapsible-toggle-arrow'); toggleButton.appendChild(expandArrow); this.element.appendChild(toggleButton); @@ -313,12 +318,12 @@ export class CoreFormatTextDirective implements OnChanges { expand = !this.expanded; } this.expanded = expand; - this.element.classList.toggle('core-text-format-expanded', expand); - this.element.classList.toggle('core-text-format-collapsed', !expand); + this.element.classList.toggle('collapsible-expanded', expand); + this.element.classList.toggle('collapsible-collapsed', !expand); this.element.style.maxHeight = expand ? '' : this.maxHeight + 'px'; - const toggleButton = this.element.querySelector('ion-button.core-format-text-toggle'); - const toggleText = toggleButton?.querySelector('.core-format-text-toggle-text'); + const toggleButton = this.element.querySelector('ion-button.collapsible-toggle'); + const toggleText = toggleButton?.querySelector('.collapsible-toggle-text'); if (!toggleButton || !toggleText) { return; } @@ -396,8 +401,7 @@ export class CoreFormatTextDirective implements OnChanges { this.element.classList.add('core-disable-media-adapt'); this.contentSpan.innerHTML = ''; // Remove current contents. - if (this.maxHeight && result.div.innerHTML != '' && - (window.innerWidth < 576 || window.innerHeight < 576)) { // Don't collapse in big screens. + if (this.maxHeight && result.div.innerHTML != '') { // Move the children to the current element to be able to calculate the height. CoreDomUtils.moveChildren(result.div, this.contentSpan); diff --git a/src/core/features/course/components/course-index/course-index.scss b/src/core/features/course/components/course-index/course-index.scss index 169950d9d..854d9c3a3 100644 --- a/src/core/features/course/components/course-index/course-index.scss +++ b/src/core/features/course/components/course-index/course-index.scss @@ -33,16 +33,35 @@ ion-item.item.item-current { --background: var(--primary); --color: var(--primary-contrast); border: 0; - - ion-badge { - border: 1px solid var(--primary-contrast); - } - - ::ng-deep ion-icon { - color: var(--primary-contrast); - } } ion-icon.restricted { font-size: 14px; } + +ion-item.item.divider.section { + --padding-start: 0px; + + &.item-current { + ion-badge { + border: 1px solid var(--primary-contrast); + } + + ion-icon.expandable-status-icon { + color: var(--primary-contrast); + + &:hover { + background: var(--primary-shade); + } + } + } + + ion-icon.expandable-status-icon { + padding: 13px; + margin: 3px; + border-radius: 50%; + &:hover { + background: var(--gray-300); + } + } +} diff --git a/src/core/features/course/components/module-completion/core-course-module-completion.html b/src/core/features/course/components/module-completion/core-course-module-completion.html index d449ff532..969b358d7 100644 --- a/src/core/features/course/components/module-completion/core-course-module-completion.html +++ b/src/core/features/course/components/module-completion/core-course-module-completion.html @@ -5,21 +5,24 @@ - + {{ rule.rulevalue.description }} - + {{ rule.rulevalue.description }} - + {{ rule.rulevalue.description }} @@ -29,7 +32,7 @@ - + {{ rule.rulevalue.description }} diff --git a/src/core/features/course/components/module-completion/module-completion.scss b/src/core/features/course/components/module-completion/module-completion.scss deleted file mode 100644 index 946eac3bd..000000000 --- a/src/core/features/course/components/module-completion/module-completion.scss +++ /dev/null @@ -1,12 +0,0 @@ -:host { - .core-module-automatic-completion-conditions { - ion-badge { - font-weight: normal; - margin-right: 5px; - - &[color="medium"] { - color: black; - } - } - } -} diff --git a/src/core/features/course/components/module-completion/module-completion.ts b/src/core/features/course/components/module-completion/module-completion.ts index 060cdd7dd..5a6d5b986 100644 --- a/src/core/features/course/components/module-completion/module-completion.ts +++ b/src/core/features/course/components/module-completion/module-completion.ts @@ -36,7 +36,6 @@ import { Translate } from '@singletons'; @Component({ selector: 'core-course-module-completion', templateUrl: 'core-course-module-completion.html', - styleUrls: ['module-completion.scss'], }) export class CoreCourseModuleCompletionComponent extends CoreCourseModuleCompletionBaseComponent { diff --git a/src/core/features/course/components/module-summary/module-summary.html b/src/core/features/course/components/module-summary/module-summary.html index 6c60ba185..09a0e3354 100644 --- a/src/core/features/course/components/module-summary/module-summary.html +++ b/src/core/features/course/components/module-summary/module-summary.html @@ -37,7 +37,7 @@ {{ 'core.course' | translate}}

- +

@@ -58,7 +58,7 @@

- + {{ 'addon.storagemanager.downloads' | translate }}

@@ -81,7 +81,7 @@
- + {{ 'core.download' | translate }} diff --git a/src/core/features/course/components/module-summary/module-summary.ts b/src/core/features/course/components/module-summary/module-summary.ts index a82c4801c..f480c8469 100644 --- a/src/core/features/course/components/module-summary/module-summary.ts +++ b/src/core/features/course/components/module-summary/module-summary.ts @@ -249,7 +249,13 @@ export class CoreCourseModuleSummaryComponent implements OnInit, OnDestroy { * Fetch course. */ protected async fetchCourse(): Promise { - this.course = await CoreCourses.getUserCourse(this.courseId, true); + // Fix that. + try { + this.course = await CoreCourses.getUserCourse(this.courseId, true); + } catch { + // The user is not enrolled in the course. Use getCourses to see if it's an admin/manager and can see the course. + this.course = await CoreCourses.getCourse(this.courseId); + } } /** diff --git a/src/core/features/course/components/module/core-course-module.html b/src/core/features/course/components/module/core-course-module.html index 579f101e5..86afecafe 100644 --- a/src/core/features/course/components/module/core-course-module.html +++ b/src/core/features/course/components/module/core-course-module.html @@ -71,7 +71,7 @@ - diff --git a/src/core/features/course/components/module/module.scss b/src/core/features/course/components/module/module.scss index c4fd942bd..4c06e9ca0 100644 --- a/src/core/features/course/components/module/module.scss +++ b/src/core/features/course/components/module/module.scss @@ -2,10 +2,14 @@ :host { --horizontal-margin: 10px; + --vertical-margin: 10px; ion-card { - margin-left: var(--horizontal-margin); - margin-right: var(--horizontal-margin); + margin: var(--vertical-margin) var(--horizontal-margin); + } + + ion-item { + --padding-start: 12px; } ion-item.core-module-main-item { @@ -84,4 +88,7 @@ @include margin-horizontal(null, 8px); } + .core-course-module-info ::ng-deep core-course-module-completion .core-module-automatic-completion-conditions .completioninfo.completion_complete { + display: none; + } } diff --git a/src/core/features/course/components/module/module.ts b/src/core/features/course/components/module/module.ts index 478dc0b62..2ea4748e8 100644 --- a/src/core/features/course/components/module/module.ts +++ b/src/core/features/course/components/module/module.ts @@ -20,7 +20,7 @@ import { CoreCourseModuleCompletionData, CoreCourseSection, } from '@features/course/services/course-helper'; -import { CoreCourse } from '@features/course/services/course'; +import { CoreCourse, CoreCourseModuleCompletionStatus, CoreCourseModuleCompletionTracking } from '@features/course/services/course'; import { CoreCourseModuleDelegate, CoreCourseModuleHandlerButton } from '@features/course/services/module-delegate'; import { CoreCourseModulePrefetchDelegate, @@ -55,6 +55,8 @@ export class CoreCourseModuleComponent implements OnInit, OnDestroy { showManualCompletion = false; // Whether to show manual completion when completion conditions are disabled. prefetchStatusIcon = ''; // Module prefetch status icon. prefetchStatusText = ''; // Module prefetch status text. + autoCompletionTodo = false; + protected prefetchHandler?: CoreCourseModulePrefetchHandler; protected moduleStatusObserver?: CoreEventObserver; @@ -73,10 +75,18 @@ export class CoreCourseModuleComponent implements OnInit, OnDestroy { this.module.handlerData.a11yTitle = this.module.handlerData.a11yTitle ?? this.module.handlerData.title; + const completionStatus = this.showCompletionConditions && this.module.completiondata?.isautomatic && + this.module.completiondata.tracking == CoreCourseModuleCompletionTracking.COMPLETION_TRACKING_AUTOMATIC + ? this.module.completiondata.state + : undefined; + + this.autoCompletionTodo = completionStatus == CoreCourseModuleCompletionStatus.COMPLETION_INCOMPLETE || + completionStatus == CoreCourseModuleCompletionStatus.COMPLETION_COMPLETE_FAIL; + this.hasInfo = !!( this.module.description || (this.showActivityDates && this.module.dates && this.module.dates.length) || - (this.module.completiondata && this.showCompletionConditions && this.module.completiondata.isautomatic) || + (this.autoCompletionTodo) || (this.module.visible === 0 && (!this.section || this.section.visible)) || (this.module.visible !== 0 && this.module.isStealth) || (this.module.availabilityinfo) diff --git a/src/core/features/course/pages/contents/contents.html b/src/core/features/course/pages/contents/contents.html index 64ff48a05..bc3f404f8 100644 --- a/src/core/features/course/pages/contents/contents.html +++ b/src/core/features/course/pages/contents/contents.html @@ -1,4 +1,7 @@ - + + + + diff --git a/src/core/features/course/pages/contents/contents.ts b/src/core/features/course/pages/contents/contents.ts index 85d7bfce1..81953a209 100644 --- a/src/core/features/course/pages/contents/contents.ts +++ b/src/core/features/course/pages/contents/contents.ts @@ -29,7 +29,6 @@ import { } from '@features/course/services/course-helper'; import { CoreCourseFormatDelegate } from '@features/course/services/format-delegate'; import { CoreCourseModulePrefetchDelegate } from '@features/course/services/module-prefetch-delegate'; -import { CoreCourseOptionsMenuHandlerToDisplay } from '@features/course/services/course-options-delegate'; import { CoreCourseSync, CoreCourseSyncProvider } from '@features/course/services/sync'; import { CoreCourseFormatComponent } from '../../components/course-format/course-format'; import { @@ -54,7 +53,6 @@ export class CoreCourseContentsPage implements OnInit, OnDestroy { sections?: CoreCourseSection[]; sectionId?: number; sectionNumber?: number; - courseMenuHandlers: CoreCourseOptionsMenuHandlerToDisplay[] = []; dataLoaded = false; downloadCourseEnabled = false; moduleId?: number; @@ -368,8 +366,16 @@ export class CoreCourseContentsPage implements OnInit, OnDestroy { } } + gotoCourseDownloads(): void { + CoreNavigator.navigateToSitePath( + `storage/${this.course.id}`, + { params: { title: this.course.fullname } }, + ); + + } + /** - * Page destroyed. + * @inheritdoc */ ngOnDestroy(): void { this.isDestroyed = true; diff --git a/src/core/features/course/pages/course-summary/course-summary.html b/src/core/features/course/pages/course-summary/course-summary.html index 56baec734..46926639f 100644 --- a/src/core/features/course/pages/course-summary/course-summary.html +++ b/src/core/features/course/pages/course-summary/course-summary.html @@ -26,14 +26,23 @@ -

- +

+

+ {{ 'core.courses.aria:coursename' | translate }}

+ + {{ 'core.courses.aria:coursecategory' | translate }} + + + + +
diff --git a/src/core/features/course/pages/index/index.html b/src/core/features/course/pages/index/index.html index 0187dc8e4..2a234b5d5 100644 --- a/src/core/features/course/pages/index/index.html +++ b/src/core/features/course/pages/index/index.html @@ -21,10 +21,6 @@ -

- - -

{{ title }}

diff --git a/src/core/features/course/pages/index/index.ts b/src/core/features/course/pages/index/index.ts index 56e10b136..c6b24df14 100644 --- a/src/core/features/course/pages/index/index.ts +++ b/src/core/features/course/pages/index/index.ts @@ -238,7 +238,6 @@ export class CoreCourseIndexPage implements OnInit, OnDestroy { // Get the title to display initially. this.title = CoreCourseFormatDelegate.getCourseTitle(this.course); - this.category = 'categoryname' in this.course ? this.course.categoryname : ''; if ('overviewfiles' in this.course) { this.imageThumb = this.course.overviewfiles?.[0]?.fileurl; diff --git a/src/core/features/course/services/module-delegate.ts b/src/core/features/course/services/module-delegate.ts index 6c9a73055..ba49c4c72 100644 --- a/src/core/features/course/services/module-delegate.ts +++ b/src/core/features/course/services/module-delegate.ts @@ -25,6 +25,7 @@ import { CoreSites } from '@services/sites'; import { makeSingleton } from '@singletons'; import { CoreCourseModuleData } from './course-helper'; import { CoreNavigationOptions } from '@services/navigator'; +import { CoreIonicColorNames } from '@singletons/colors'; /** * Interface that all course module handlers must implement. @@ -146,7 +147,7 @@ export interface CoreCourseModuleHandlerData { /** * The color of the extra badge. Default: primary. */ - extraBadgeColor?: string; + extraBadgeColor?: CoreIonicColorNames; /** * Whether to display a button to download/refresh the module if it's downloadable. diff --git a/src/core/features/courses/components/course-list-item/core-courses-course-list-item.html b/src/core/features/courses/components/course-list-item/core-courses-course-list-item.html index 39bf2b5e2..fd2a803bc 100644 --- a/src/core/features/courses/components/course-list-item/core-courses-course-list-item.html +++ b/src/core/features/courses/components/course-list-item/core-courses-course-list-item.html @@ -70,7 +70,8 @@ class="core-course-category core-course-additional-info ion-text-nowrap"> {{ 'core.courses.aria:coursecategory' | translate }} - + +
diff --git a/src/core/features/login/login.scss b/src/core/features/login/login.scss index 6aeb84b40..165ba96e3 100644 --- a/src/core/features/login/login.scss +++ b/src/core/features/login/login.scss @@ -34,6 +34,10 @@ margin-bottom: 16px; } + form .core-username.ios { + --inner-border-width: 0 0 1px 0; + } + form .item, form .item ion-label { --background: var(--core-login-input-background); diff --git a/src/core/features/user/pages/about/about.html b/src/core/features/user/pages/about/about.html index c539e7b3c..d31800b14 100644 --- a/src/core/features/user/pages/about/about.html +++ b/src/core/features/user/pages/about/about.html @@ -15,7 +15,7 @@