Browse Source

Fix example template.

MOODLE_35_STABLE
Dan Marsden 6 years ago
parent
commit
1906820255
  1. 4
      classes/output/mobile.php
  2. 40
      templates/mobile_teacher_form.mustache

4
classes/output/mobile.php

@ -362,7 +362,7 @@ class mobile {
$data['messages'] = array(); $data['messages'] = array();
$data['showmessage'] = false; $data['showmessage'] = false;
$data['statuses'] = array(); $data['statuses'] = array();
$data['args'] = ''; // Stores list of userid status args that should be added to form post. $data['btnargs'] = ''; // Stores list of userid status args that should be added to form post.
$statuses = $att->get_statuses(); $statuses = $att->get_statuses();
$otherdata = array(); $otherdata = array();
@ -384,7 +384,7 @@ class mobile {
foreach ($users as $user) { foreach ($users as $user) {
$data['users'][] = array('userid' => $user->id, 'fullname' => $user->fullname); $data['users'][] = array('userid' => $user->id, 'fullname' => $user->fullname);
// Generate args to use in submission button here. // Generate args to use in submission button here.
$data['args'] .= ', status'. $user->id. ': CONTENT_OTHERDATA.status'. $user->id; $data['btnargs'] .= ', status'. $user->id. ': CONTENT_OTHERDATA.status'. $user->id;
} }
if (!empty($data['messages'])) { if (!empty($data['messages'])) {

40
templates/mobile_teacher_form.mustache

@ -40,8 +40,8 @@
}, },
"cmid": "25", "cmid": "25",
"courseid": "4", "courseid": "4",
"sessid": "43" "sessid": "43",
"args" : ", status4: CONTENT_OTHERDATA.status4" "btnargs" : ""
} }
}} }}
{{=<% %>=}} {{=<% %>=}}
@ -59,25 +59,27 @@
<%/messages%> <%/messages%>
<%/showmessage%> <%/showmessage%>
<%#users%> <%#users%>
<ion-item>
<span class="studentname">
<h2><% fullname %></h2>
</span>
</ion-item>
<ion-list radio-group [(ngModel)]="CONTENT_OTHERDATA.status<% userid %>">
<%#statuses%>
<span class="radiolabel">
<ion-item> <ion-item>
<ion-label><% acronym %></ion-label> <span class="studentname">
<ion-radio value="<% stid %>"></ion-radio> <h2><% fullname %></h2>
</span>
</ion-item> </ion-item>
</span>
<%/statuses%> <ion-list radio-group [(ngModel)]="CONTENT_OTHERDATA.status<% userid %>">
</ion-list> <%#statuses%>
<span class="radiolabel">
<ion-item>
<ion-label><% acronym %></ion-label>
<ion-radio value="<% stid %>"></ion-radio>
</ion-item>
</span>
<%/statuses%>
</ion-list>
<%/users%> <%/users%>
<button ion-button core-site-plugins-new-content component="mod_attendance" method="mobile_view_activity" [args]="{cmid: <% cmid %>, courseid: <% courseid %>, sessid: <% sessid %><% args %>}"> <ion-item>
{{ 'plugin.mod_attendance.submitattendance' | translate }} <button ion-button core-site-plugins-new-content component="mod_attendance" method="mobile_view_activity" [args]="{cmid: <% cmid %>, courseid: <% courseid %>, sessid: <% sessid %><% btnargs %>}">
</button> {{ 'plugin.mod_attendance.submitattendance' | translate }}
</button>
</ion-item>
</div> </div>
Loading…
Cancel
Save