moodle-mod-customcert/templates/mobile_view_activity_page.mustache

98 lines
3.4 KiB
Text
Raw Normal View History

{{!
This file is part of Moodle - http://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 <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_customcert/mobile_view_activity_page
The main page to view the custom certificate activity
Classes required for JS:
* None
Data attibutes required for JS:
* All data attributes are required
2018-06-07 11:29:34 +00:00
Context variables required for this template:
* certificate
* cmid
* hasissues
* issues
* candownload
* fileurl
* showreport
* numissuesinreport
* currenttimestamp
Example context (json):
{
"certificate": {
"id": "1",
"course": "2",
"name": "A rad certificate name!",
"intro": "A certificate",
"requiredtime": "60"
},
"cmid": "25",
"hasissues": "true",
"issues": [
{
"timecreated": "1528370177"
}
],
"candownload": "true",
"fileurl": "http://yoursite.com/mod/customcert/mobile/pluginfile.php?id=4",
"showreport": "true",
"numissuesinreport": "5",
"currenttimestamp": "1528370177"
}
}}
{{=<% %>=}}
<div>
<core-course-module-description description="<% certificate.intro %>" component="mod_customcert" componentId="<% cmid %>"></core-course-module-description>
<%#showreport%>
<a ion-item class="text-right" core-site-plugins-new-content component="mod_customcert" method="mobile_view_report" [args]="{cmid: <% cmid %>}">
{{ 'plugin.mod_customcert.viewcustomcertissues' | translate: {$a: <% numissuesinreport %>} }}
</a>
<%/showreport%>
<%#hasissues%>
<%^canmanage%>
<ion-list>
<ion-list-header class="text-center">
{{ 'plugin.mod_customcert.receiveddate' | translate }}
</ion-list-header>
<%#issues%>
<ion-item class="text-center">
{{ <% timecreated %> | coreToLocaleString }}
</ion-item>
<%/issues%>
</ion-list>
<%/canmanage%>
<%/hasissues%>
<%#candownload%>
<ion-item>
<button ion-button block core-course-download-module-main-file moduleId="<% cmid %>" courseId="<% certificate.course %>" component="mod_customcert" [files]="[{fileurl: '<% fileurl %>', timemodified: '<% currenttimestamp %>'}]">
<ion-icon name="download" item-start></ion-icon>
{{ 'plugin.mod_customcert.getcustomcert' | translate }}
</button>
</ion-item>
<%/candownload%>
<%^candownload%>
<ion-item>
<p>{{ 'plugin.mod_customcert.requiredtimenotmet' | translate: {$a: { requiredtime: <% certificate.requiredtime %>} } }}</p>
</ion-item>
<%/candownload%>
</div>