+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ 'addon.mod_resource.openthefile' | translate }}
+
+
+
+
diff --git a/src/addons/mod/resource/components/index/index.ts b/src/addons/mod/resource/components/index/index.ts
new file mode 100644
index 000000000..4b1c9b8cf
--- /dev/null
+++ b/src/addons/mod/resource/components/index/index.ts
@@ -0,0 +1,177 @@
+// (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 { Component, OnInit, Optional } from '@angular/core';
+import { CoreError } from '@classes/errors/error';
+import {
+ CoreCourseModuleMainResourceComponent,
+} from '@features/course/classes/main-resource-component';
+import { CoreCourseContentsPage } from '@features/course/pages/contents/contents';
+import { CoreCourse, CoreCourseWSModule } from '@features/course/services/course';
+import { CoreCourseModulePrefetchDelegate } from '@features/course/services/module-prefetch-delegate';
+import { CoreSites } from '@services/sites';
+import { CoreTextUtils } from '@services/utils/text';
+import { CoreUtils } from '@services/utils/utils';
+import { Translate } from '@singletons';
+import {
+ AddonModResource,
+ AddonModResourceCustomData,
+ AddonModResourceProvider,
+ AddonModResourceResource,
+} from '../../services/resource';
+import { AddonModResourceHelper } from '../../services/resource-helper';
+
+/**
+ * Component that displays a resource.
+ */
+@Component({
+ selector: 'addon-mod-resource-index',
+ templateUrl: 'addon-mod-resource-index.html',
+})
+export class AddonModResourceIndexComponent extends CoreCourseModuleMainResourceComponent implements OnInit {
+
+ component = AddonModResourceProvider.COMPONENT;
+
+ canGetResource = false;
+ mode = '';
+ src = '';
+ contentText = '';
+ displayDescription = true;
+ warning = '';
+
+ constructor(@Optional() courseContentsPage?: CoreCourseContentsPage) {
+ super('AddonModResourceIndexComponent', courseContentsPage);
+ }
+
+ /**
+ * Component being initialized.
+ */
+ async ngOnInit(): Promise