From 23c561f554ccbdf1f153be19a3263288e1981143 Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Tue, 19 Nov 2024 14:11:30 +1300 Subject: [PATCH] Fix #700 mobile app. display warning when no students are available to take attendance. --- db/mobile.php | 1 + lang/en/attendance.php | 1 + templates/mobile_teacher_form_ionic5.mustache | 74 ++++++++++--------- templates/mobile_teacher_form_latest.mustache | 69 +++++++++-------- 4 files changed, 78 insertions(+), 67 deletions(-) diff --git a/db/mobile.php b/db/mobile.php index 74136ef4ea7..ebc62acf3d0 100644 --- a/db/mobile.php +++ b/db/mobile.php @@ -65,6 +65,7 @@ ['incorrectpasswordshort', 'attendance'], ['attendancesuccess', 'attendance'], ['setallstatuses', 'attendance'], + ['nousers', 'attendance'], ], ], ]; diff --git a/lang/en/attendance.php b/lang/en/attendance.php index 69573557707..9512d5e68ac 100644 --- a/lang/en/attendance.php +++ b/lang/en/attendance.php @@ -681,3 +681,4 @@ $string['weekcommencing'] = 'Week commencing'; $string['weeks'] = 'Weeks'; $string['youcantdo'] = 'You can\'t do anything'; +$string['nousers'] = 'No enrolled users found to take attendance for.'; diff --git a/templates/mobile_teacher_form_ionic5.mustache b/templates/mobile_teacher_form_ionic5.mustache index 4beb511592e..5121663d42d 100644 --- a/templates/mobile_teacher_form_ionic5.mustache +++ b/templates/mobile_teacher_form_ionic5.mustache @@ -58,47 +58,51 @@ <%/messages%> <%/showmessage%> - - - {{ 'plugin.mod_attendance.setallstatuses' | translate }} - - - <%#statuses%> + <%#users.0%> + + + {{ 'plugin.mod_attendance.setallstatuses' | translate }} + + + <%#statuses%> - + + + <% acronym %> + + + + <%/statuses%> + + + <%#users%> + + + + + + + +

<% fullname %>

+
+
+ + <%#statuses%> + <% acronym %> - <%/statuses%> + <%/statuses%> -
- <%#users%> - - - - - - - -

<% fullname %>

-
-
- - <%#statuses%> - - - <% acronym %> - - - <%/statuses%> - -
- <%/users%> - - {{ 'plugin.mod_attendance.submitattendance' | translate }} - - + <%/users%> + + {{ 'plugin.mod_attendance.submitattendance' | translate }} + + <%/users.0%> + <%^users.0%> + {{ 'plugin.mod_attendance.nousers' | translate }} + <%/users.0%> \ No newline at end of file diff --git a/templates/mobile_teacher_form_latest.mustache b/templates/mobile_teacher_form_latest.mustache index cb9e2cc4d25..110e540dc64 100644 --- a/templates/mobile_teacher_form_latest.mustache +++ b/templates/mobile_teacher_form_latest.mustache @@ -66,45 +66,50 @@
<%/messages%> <%/showmessage%> - - - {{ 'plugin.mod_attendance.setallstatuses' | translate }} - - - <%#statuses%> + <%#users.0%> + + + {{ 'plugin.mod_attendance.setallstatuses' | translate }} + + + <%#statuses%> + + + <% acronym %> + + + <%/statuses%> + + + <%#users%> + + + + + + + +

<% fullname %>

+
+
+ + <%#statuses%> <% acronym %> - <%/statuses%> + <%/statuses%> -
- <%#users%> - - - - - - - -

<% fullname %>

-
-
- - <%#statuses%> - - - <% acronym %> - - <%/statuses%> - -
- <%/users%> - - {{ 'plugin.mod_attendance.submitattendance' | translate }} - + <%/users%> + + {{ 'plugin.mod_attendance.submitattendance' | translate }} + + <%/users.0%> + <%^users.0%> + {{ 'plugin.mod_attendance.nousers' | translate }} + <%/users.0%>