From e30030c274724df6f5f29215ebcdfa9e607053c5 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Thu, 18 Jul 2024 11:06:00 +0200 Subject: [PATCH] Mobile app: Remove ionic3 template --- classes/output/mobile.php | 3 +- templates/mobile_view_ionic3.mustache | 102 -------------------------- tests/output_mobile_test.php | 10 --- 3 files changed, 1 insertion(+), 114 deletions(-) delete mode 100644 templates/mobile_view_ionic3.mustache diff --git a/classes/output/mobile.php b/classes/output/mobile.php index 350a448..23352bb 100644 --- a/classes/output/mobile.php +++ b/classes/output/mobile.php @@ -48,7 +48,6 @@ public static function main_view($args) { global $OUTPUT, $USER, $DB; $args = (object) $args; - $versionname = $args->appversioncode >= 3950 ? 'latest' : 'ionic3'; $cm = get_coursemodule_from_id('subcourse', $args->cmid); $context = \context_module::instance($cm->id); @@ -99,7 +98,7 @@ public static function main_view($args) { 'templates' => [ [ 'id' => 'main', - 'html' => $OUTPUT->render_from_template("mod_subcourse/mobile_view_$versionname", $data), + 'html' => $OUTPUT->render_from_template('mod_subcourse/mobile_view_latest', $data), ], ], 'javascript' => '', diff --git a/templates/mobile_view_ionic3.mustache b/templates/mobile_view_ionic3.mustache deleted file mode 100644 index 30998bc..0000000 --- a/templates/mobile_view_ionic3.mustache +++ /dev/null @@ -1,102 +0,0 @@ -{{! - This file is part of Moodle - https://moodle.org/ - - Moodle is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - Moodle is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Moodle. If not, see . -}} -{{! - @template mod_subcourse/mobile_view - - Render the main view for the mobile app. - - Classes required for JS: - * none - - Data attributes required for JS: - * none - - Context variables required for this template: - * cmid - [int] Course module identifier. - * subcourse - [object] - * subcourse.id - [int] Subcourse instance ID. - * subcourse.intro - [string] Formatted activity description. - * refcourse - [object] - * refcourse.fullname - [string] Formatted referenced course name. - * refcourse.url - [string] Referenced course view URL. - * hasprogress - [bool] Is the progress value set (not null). - * progress - [float] Percentual value of the progress in the referenced course. - * hasgrade - [bool] Is the currentgrade value set (not null). - * currentgrade - [string] Textual representation of the final grade in the referenced course. - * warning - [string] Warning to be displayed to the user. - - Example context (json): - { - "cmid": 42, - "subcourse": { - "id": 24, - "intro": "

Subcourse activity description

" - }, - "refcourse": { - "fullname": "Subcourse A.100", - "url": "https://my.school.edu/lms/course/view.php?id=43" - }, - "hasprogress": true, - "progress": 100, - "hasgrade": true, - "currentgrade": "80.00", - "warning": "" - } -}} - -{{=<% %>=}} -
- - - - - <%# warning %> - - <% warning %> - - <%/ warning %> - - <%# hasprogress %> - - - - <%/ hasprogress %> - - <%# hasgrade %> - - {{ 'plugin.mod_subcourse.currentgrade' | translate: {$a: '<% currentgrade %>'} }} - - <%/ hasgrade %> - - <%# refcourse %> - - - - <%/ refcourse %> - -
- - - diff --git a/tests/output_mobile_test.php b/tests/output_mobile_test.php index 1ebdb12..fbf113e 100644 --- a/tests/output_mobile_test.php +++ b/tests/output_mobile_test.php @@ -79,15 +79,5 @@ public function test_main_view() { $this->assertEquals('main', $mainview3950['templates'][0]['id']); $this->assertStringContainsString('plugin.mod_subcourse.currentgrade', $mainview3950['templates'][0]['html']); - - // Ionic3 compatible view for the app version 3.9.4. - $mainview3940 = \mod_subcourse\output\mobile::main_view([ - 'cmid' => $subcourse->cmid, - 'courseid' => $metacourse->id, - 'appversioncode' => 3940, - ]); - - $this->assertEquals('main', $mainview3940['templates'][0]['id']); - $this->assertStringContainsString('plugin.mod_subcourse.currentgrade', $mainview3940['templates'][0]['html']); } }