diff --git a/src/addons/mod/assign/components/index/addon-mod-assign-index.html b/src/addons/mod/assign/components/index/addon-mod-assign-index.html index 1efbaa292..fd835cefd 100644 --- a/src/addons/mod/assign/components/index/addon-mod-assign-index.html +++ b/src/addons/mod/assign/components/index/addon-mod-assign-index.html @@ -31,23 +31,13 @@ + [component]="component" [componentId]="componentId" [courseId]="courseId" [hasDataToSync]="hasOffline"> - - - - - - - {{ 'core.hasdatatosync' | translate: {$a: moduleName} }} - - - diff --git a/src/addons/mod/choice/components/index/addon-mod-choice-index.html b/src/addons/mod/choice/components/index/addon-mod-choice-index.html index f0e2aa0f5..a767fe487 100644 --- a/src/addons/mod/choice/components/index/addon-mod-choice-index.html +++ b/src/addons/mod/choice/components/index/addon-mod-choice-index.html @@ -30,7 +30,7 @@ + [component]="component" [componentId]="componentId" [courseId]="courseId" [hasDataToSync]="hasOffline"> @@ -58,14 +58,6 @@ - - - - - {{ 'core.hasdatatosync' | translate:{$a: moduleName} }} - - - diff --git a/src/addons/mod/data/components/index/addon-mod-data-index.html b/src/addons/mod/data/components/index/addon-mod-data-index.html index f8a993361..8a1f45d10 100644 --- a/src/addons/mod/data/components/index/addon-mod-data-index.html +++ b/src/addons/mod/data/components/index/addon-mod-data-index.html @@ -40,17 +40,9 @@ + [component]="component" [componentId]="componentId" [courseId]="courseId" [hasDataToSync]="hasOffline || hasOfflineRatings"> - - - - - {{ 'core.hasdatatosync' | translate: {$a: moduleName} }} - - - {{'core.groupsseparate' | translate }} diff --git a/src/addons/mod/feedback/components/index/addon-mod-feedback-index.html b/src/addons/mod/feedback/components/index/addon-mod-feedback-index.html index b6852c689..aacd8344e 100644 --- a/src/addons/mod/feedback/components/index/addon-mod-feedback-index.html +++ b/src/addons/mod/feedback/components/index/addon-mod-feedback-index.html @@ -30,7 +30,7 @@ + [component]="component" [componentId]="componentId" [courseId]="courseId" [hasDataToSync]="hasOffline"> @@ -106,14 +106,6 @@ - - - - - {{ 'core.hasdatatosync' | translate:{$a: moduleName} }} - - - diff --git a/src/addons/mod/forum/components/index/index.html b/src/addons/mod/forum/components/index/index.html index 642a96d2f..e61fce1ef 100644 --- a/src/addons/mod/forum/components/index/index.html +++ b/src/addons/mod/forum/components/index/index.html @@ -39,8 +39,8 @@ + [description]="forum && forum.type != 'single' && description" [component]="component" [componentId]="componentId" + [courseId]="courseId" [hasDataToSync]="hasOffline || hasOfflineRatings"> {{descriptionNote}} @@ -48,14 +48,6 @@ - - - - - {{ 'core.hasdatatosync' | translate:{$a: moduleName} }} - - - diff --git a/src/addons/mod/glossary/components/index/addon-mod-glossary-index.html b/src/addons/mod/glossary/components/index/addon-mod-glossary-index.html index 61cee7db8..b0095c394 100644 --- a/src/addons/mod/glossary/components/index/addon-mod-glossary-index.html +++ b/src/addons/mod/glossary/components/index/addon-mod-glossary-index.html @@ -51,17 +51,9 @@ + [component]="component" [componentId]="componentId" [courseId]="courseId" [hasDataToSync]="hasOffline || hasOfflineRatings"> - - - - - {{ 'core.hasdatatosync' | translate:{$a: moduleName} }} - - - diff --git a/src/addons/mod/h5pactivity/components/index/addon-mod-h5pactivity-index.html b/src/addons/mod/h5pactivity/components/index/addon-mod-h5pactivity-index.html index 1811b5b44..4c7b7cd88 100644 --- a/src/addons/mod/h5pactivity/components/index/addon-mod-h5pactivity-index.html +++ b/src/addons/mod/h5pactivity/components/index/addon-mod-h5pactivity-index.html @@ -37,17 +37,9 @@ + [component]="component" [componentId]="componentId" [courseId]="courseId" [hasDataToSync]="hasOffline"> - - - - - {{ 'core.hasdatatosync' | translate: {$a: moduleName} }} - - - diff --git a/src/addons/mod/lesson/components/index/addon-mod-lesson-index.html b/src/addons/mod/lesson/components/index/addon-mod-lesson-index.html index aa28071e4..a9eeb2a60 100644 --- a/src/addons/mod/lesson/components/index/addon-mod-lesson-index.html +++ b/src/addons/mod/lesson/components/index/addon-mod-lesson-index.html @@ -34,7 +34,7 @@ + [component]="component" [componentId]="componentId" [courseId]="courseId" [hasDataToSync]="hasOffline"> @@ -45,14 +45,6 @@ - - - - - {{ 'core.hasdatatosync' | translate: {$a: moduleName} }} - - -
diff --git a/src/addons/mod/quiz/components/index/addon-mod-quiz-index.html b/src/addons/mod/quiz/components/index/addon-mod-quiz-index.html index 519746fe0..cf49f5b7b 100644 --- a/src/addons/mod/quiz/components/index/addon-mod-quiz-index.html +++ b/src/addons/mod/quiz/components/index/addon-mod-quiz-index.html @@ -30,7 +30,8 @@ + [component]="component" [componentId]="componentId" [courseId]="courseId" + [hasDataToSync]="buttonText && hasOffline && !showStatusSpinner"> @@ -194,14 +195,6 @@ - - - - - {{ 'core.hasdatatosync' | translate: {$a: moduleName} }} - - - diff --git a/src/addons/mod/scorm/components/index/addon-mod-scorm-index.html b/src/addons/mod/scorm/components/index/addon-mod-scorm-index.html index 58f417175..f184db40a 100644 --- a/src/addons/mod/scorm/components/index/addon-mod-scorm-index.html +++ b/src/addons/mod/scorm/components/index/addon-mod-scorm-index.html @@ -30,7 +30,7 @@ + [component]="component" [componentId]="componentId" [courseId]="courseId" [hasDataToSync]="!errorMessage && hasOffline"> @@ -113,14 +113,6 @@ - - - - - {{ 'core.hasdatatosync' | translate: {$a: moduleName} }} - - - diff --git a/src/addons/mod/survey/components/index/addon-mod-survey-index.html b/src/addons/mod/survey/components/index/addon-mod-survey-index.html index 16ebaa871..b5042fbf5 100644 --- a/src/addons/mod/survey/components/index/addon-mod-survey-index.html +++ b/src/addons/mod/survey/components/index/addon-mod-survey-index.html @@ -31,8 +31,8 @@ + [description]="survey && !survey.surveydone && !hasOffline && description" [component]="component" [componentId]="componentId" + [courseId]="courseId" [hasDataToSync]="hasOffline"> @@ -44,14 +44,6 @@ - - - - - {{ 'core.hasdatatosync' | translate: {$a: moduleName} }} - - - diff --git a/src/addons/mod/workshop/components/index/addon-mod-workshop-index.html b/src/addons/mod/workshop/components/index/addon-mod-workshop-index.html index 4004119c0..1aedc639d 100644 --- a/src/addons/mod/workshop/components/index/addon-mod-workshop-index.html +++ b/src/addons/mod/workshop/components/index/addon-mod-workshop-index.html @@ -30,7 +30,7 @@ - + @@ -60,14 +60,6 @@ - - - - - {{ 'core.hasdatatosync' | translate: {$a: moduleName} }} - - - diff --git a/src/core/features/course/components/module-info/core-course-module-info.html b/src/core/features/course/components/module-info/core-course-module-info.html index 8aac777b4..a169e3604 100644 --- a/src/core/features/course/components/module-info/core-course-module-info.html +++ b/src/core/features/course/components/module-info/core-course-module-info.html @@ -35,3 +35,11 @@ + + + + + + {{ 'core.hasdatatosync' | translate: {$a: moduleNameTranslated} }} + + diff --git a/src/core/features/course/components/module-info/course-module-info.scss b/src/core/features/course/components/module-info/course-module-info.scss index a4d1bf7e1..0a0b5bce7 100644 --- a/src/core/features/course/components/module-info/course-module-info.scss +++ b/src/core/features/course/components/module-info/course-module-info.scss @@ -4,6 +4,7 @@ display: block; box-shadow: 0px 3px 3px rgba(var(--drop-shadow)); margin-bottom: 8px; + padding-bottom: 1px; // To allow margins inside. background-color: var(--contrast-background); @include padding-horizontal(var(--ion-safe-area-left), var(--ion-safe-area-right)); diff --git a/src/core/features/course/components/module-info/module-info.ts b/src/core/features/course/components/module-info/module-info.ts index 13cbd4e40..063ebc88f 100644 --- a/src/core/features/course/components/module-info/module-info.ts +++ b/src/core/features/course/components/module-info/module-info.ts @@ -13,6 +13,7 @@ // limitations under the License. import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; +import { CoreCourse } from '@features/course/services/course'; import { CoreCourseModule, CoreCourseModuleCompletionData } from '@features/course/services/course-helper'; import { CoreCourseModuleDelegate } from '@features/course/services/module-delegate'; import { CoreSites } from '@services/sites'; @@ -42,10 +43,13 @@ export class CoreCourseModuleInfoComponent implements OnInit { @Input() description?: string | false; // The description to display. If false, no description will be shown. + @Input() hasDataToSync = false; // If the activity has any data to be synced. + @Output() completionChanged = new EventEmitter(); // Notify when completion changes. modicon = ''; showCompletion = false; // Whether to show completion. + moduleNameTranslated = ''; /** * @inheritdoc @@ -53,6 +57,8 @@ export class CoreCourseModuleInfoComponent implements OnInit { async ngOnInit(): Promise { this.modicon = await CoreCourseModuleDelegate.getModuleIconSrc(this.module.modname, this.module.modicon, this.module); + this.moduleNameTranslated = CoreCourse.translateModuleName(this.module.modname || ''); + this.showCompletion = CoreSites.getRequiredCurrentSite().isVersionGreaterEqualThan('3.11'); } diff --git a/src/core/features/courses/pages/dashboard/dashboard.ts b/src/core/features/courses/pages/dashboard/dashboard.ts index 2b7448a0b..e86d2d72a 100644 --- a/src/core/features/courses/pages/dashboard/dashboard.ts +++ b/src/core/features/courses/pages/dashboard/dashboard.ts @@ -109,7 +109,6 @@ export class CoreCoursesDashboardPage implements OnInit, OnDestroy { this.blocks = []; } - // this.dashboardEnabled = this.blockDelegate.hasSupportedBlock(this.blocks); this.loaded = true; }